streamlit-nightly 1.38.1.dev20240910__py2.py3-none-any.whl → 1.38.1.dev20240912__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 (32) hide show
  1. streamlit/dataframe_util.py +1 -1
  2. streamlit/elements/doc_string.py +1 -9
  3. streamlit/elements/lib/policies.py +0 -5
  4. streamlit/elements/vega_charts.py +8 -3
  5. streamlit/runtime/caching/cache_utils.py +5 -1
  6. streamlit/runtime/credentials.py +2 -2
  7. streamlit/runtime/scriptrunner/magic.py +2 -20
  8. streamlit/static/asset-manifest.json +8 -8
  9. streamlit/static/index.html +1 -1
  10. streamlit/static/static/js/1086.b7ec1344.chunk.js +5 -0
  11. streamlit/static/static/js/1260.eaaa4e75.chunk.js +5 -0
  12. streamlit/static/static/js/5618.f7838309.chunk.js +5 -0
  13. streamlit/static/static/js/{5711.2f36e813.chunk.js → 5711.229cb7d0.chunk.js} +1 -1
  14. streamlit/static/static/js/7612.39e7938b.chunk.js +2 -0
  15. streamlit/static/static/js/954.88cae675.chunk.js +5 -0
  16. streamlit/static/static/js/{main.7b7fe9ac.js → main.536604a4.js} +2 -2
  17. streamlit/watcher/event_based_path_watcher.py +11 -2
  18. streamlit/watcher/folder_black_list.py +1 -0
  19. streamlit/watcher/path_watcher.py +5 -0
  20. {streamlit_nightly-1.38.1.dev20240910.dist-info → streamlit_nightly-1.38.1.dev20240912.dist-info}/METADATA +1 -1
  21. {streamlit_nightly-1.38.1.dev20240910.dist-info → streamlit_nightly-1.38.1.dev20240912.dist-info}/RECORD +27 -27
  22. streamlit/static/static/js/1086.1bb52316.chunk.js +0 -5
  23. streamlit/static/static/js/1260.4017a70f.chunk.js +0 -5
  24. streamlit/static/static/js/2266.48d2ebd0.chunk.js +0 -2
  25. streamlit/static/static/js/5618.08be9e66.chunk.js +0 -5
  26. streamlit/static/static/js/954.3cc76210.chunk.js +0 -5
  27. /streamlit/static/static/js/{2266.48d2ebd0.chunk.js.LICENSE.txt → 7612.39e7938b.chunk.js.LICENSE.txt} +0 -0
  28. /streamlit/static/static/js/{main.7b7fe9ac.js.LICENSE.txt → main.536604a4.js.LICENSE.txt} +0 -0
  29. {streamlit_nightly-1.38.1.dev20240910.data → streamlit_nightly-1.38.1.dev20240912.data}/scripts/streamlit.cmd +0 -0
  30. {streamlit_nightly-1.38.1.dev20240910.dist-info → streamlit_nightly-1.38.1.dev20240912.dist-info}/WHEEL +0 -0
  31. {streamlit_nightly-1.38.1.dev20240910.dist-info → streamlit_nightly-1.38.1.dev20240912.dist-info}/entry_points.txt +0 -0
  32. {streamlit_nightly-1.38.1.dev20240910.dist-info → streamlit_nightly-1.38.1.dev20240912.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 2266.48d2ebd0.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[2266],{8481:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,i;try{t=Map}catch(s){t=function(){}}try{n=Set}catch(s){n=function(){}}try{i=Promise}catch(s){i=function(){}}function r(o,s,l,c,u){"object"===typeof s&&(l=s.depth,c=s.prototype,u=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return"undefined"==typeof s&&(s=!0),"undefined"==typeof l&&(l=1/0),function o(l,p){if(null===l)return null;if(0===p)return l;var g,m;if("object"!=typeof l)return l;if(e(l,t))g=new t;else if(e(l,n))g=new n;else if(e(l,i))g=new i((function(e,t){l.then((function(t){e(o(t,p-1))}),(function(e){t(o(e,p-1))}))}));else if(r.__isArray(l))g=[];else if(r.__isRegExp(l))g=new RegExp(l.source,a(l)),l.lastIndex&&(g.lastIndex=l.lastIndex);else if(r.__isDate(l))g=new Date(l.getTime());else{if(h&&Buffer.isBuffer(l))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(l.length):new Buffer(l.length),l.copy(g),g;e(l,Error)?g=Object.create(l):"undefined"==typeof c?(m=Object.getPrototypeOf(l),g=Object.create(m)):(g=Object.create(c),m=c)}if(s){var y=f.indexOf(l);if(-1!=y)return d[y];f.push(l),d.push(g)}for(var v in e(l,t)&&l.forEach((function(e,t){var n=o(t,p-1),i=o(e,p-1);g.set(n,i)})),e(l,n)&&l.forEach((function(e){var t=o(e,p-1);g.add(t)})),l){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(l[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(l);for(v=0;v<x.length;v++){var _=x[v];(!(k=Object.getOwnPropertyDescriptor(l,_))||k.enumerable||u)&&(g[_]=o(l[_],p-1),k.enumerable||Object.defineProperty(g,_,{enumerable:!1}))}}if(u){var w=Object.getOwnPropertyNames(l);for(v=0;v<w.length;v++){var k,$=w[v];(k=Object.getOwnPropertyDescriptor(l,$))&&k.enumerable||(g[$]=o(l[$],p-1),Object.defineProperty(g,$,{enumerable:!1}))}}return g}(o,l)}function o(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return r.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},r.__objToStr=o,r.__isDate=function(e){return"object"===typeof e&&"[object Date]"===o(e)},r.__isArray=function(e){return"object"===typeof e&&"[object Array]"===o(e)},r.__isRegExp=function(e){return"object"===typeof e&&"[object RegExp]"===o(e)},r.__getRegExpFlags=a,r}();e.exports&&(e.exports=t)},41515:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!==r--;){var a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}},94526:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var n,i="boolean"===typeof t.cycles&&t.cycles,r=t.cmp&&(n=t.cmp,function(e){return function(t,i){var r={key:t,value:e[t]},o={key:i,value:e[i]};return n(r,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"===typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!==typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n<t.length;n++)n&&(a+=","),a+=e(t[n])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,l=Object.keys(t).sort(r&&r(t));for(a="",n=0;n<l.length;n++){var c=l[n],u=e(t[c]);u&&(a&&(a+=","),a+=JSON.stringify(c)+":"+u)}return o.splice(s,1),"{"+a+"}"}}(e)}},42274:(e,t,n)=>{var i=n(51596),r=n(44777)((function(e,t,n,r){i(e,t,n,r)}));e.exports=r},77099:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>uv});var i={};n.r(i),n.d(i,{JsonPatchError:()=>v,_areEquals:()=>D,applyOperation:()=>k,applyPatch:()=>$,applyReducer:()=>E,deepClone:()=>b,getValueByPointer:()=>w,validate:()=>S,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:()=>Te,accessPathWithDatum:()=>Se,compile:()=>kg,contains:()=>se,deepEqual:()=>Z,deleteNestedProperty:()=>Ee,duplicate:()=>ee,entries:()=>_e,every:()=>ce,fieldIntersection:()=>ye,flatAccessWithDatum:()=>De,getFirstDefined:()=>ze,hasIntersection:()=>ge,hash:()=>oe,internalField:()=>Pe,isBoolean:()=>we,isEmpty:()=>ve,isEqual:()=>he,isInternalField:()=>Le,isNullOrFalse:()=>ae,isNumeric:()=>je,keys:()=>be,logicalExpr:()=>$e,mergeDeep:()=>ue,never:()=>te,normalize:()=>Pc,normalizeAngle:()=>Ie,omit:()=>ie,pick:()=>ne,prefixGenerator:()=>me,removePathFromField:()=>Oe,replaceAll:()=>Fe,replacePathInField:()=>Me,resetIdCounter:()=>Be,setEqual:()=>pe,some:()=>le,stringify:()=>re,titleCase:()=>Ae,unique:()=>de,uniqueId:()=>Re,vals:()=>xe,varName:()=>ke,version:()=>$g});var a={};n.r(a),n.d(a,{carbong10:()=>$m,carbong100:()=>Am,carbong90:()=>Em,carbonwhite:()=>km,dark:()=>Cg,excel:()=>Fg,fivethirtyeight:()=>Rg,ggplot2:()=>Pg,googlecharts:()=>om,latimes:()=>Gg,powerbi:()=>vm,quartz:()=>Hg,urbaninstitute:()=>tm,version:()=>Sm,vox:()=>Vg});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 c(e,t){return l.call(e,t)}function u(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)c(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 g(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(g(e[t]))return!0}else if("object"===typeof e)for(var i=u(e),r=i.length,o=0;o<r;o++)if(g(e[i[o]]))return!0;return!1}function m(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,m(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=m(t,{name:n,index:i,operation:r,tree:o}),s}return s(t,e),t}(Error),v=y,b=f,x={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:D(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:x.move,copy:x.copy,test:x.test,_get:x._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=D(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,c=1,u=s.length,h=void 0,g=void 0,m=void 0;for(m="function"==typeof n?n:A;;){if((g=s[c])&&-1!=g.indexOf("~")&&(g=p(g)),r&&("__proto__"==g||"prototype"==g&&c>0&&"constructor"==s[c-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[g]?h=s.slice(0,c).join("/"):c==u-1&&(h=t.path),void 0!==h&&m(t,0,e,h)),c++,Array.isArray(l)){if("-"===g)g=l.length;else{if(n&&!d(g))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(g)&&(g=~~g)}if(c>=u){if(n&&"add"===t.op&&g>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,g,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(c>=u){if(!1===(a=x[t.op].call(t,l,g,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(l=l[g],n&&c<u&&(!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(!x[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)&&g(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=S([{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 S(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 D(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(!D(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(!D(e[r=s[n]],t[r]))return!1;return!0}return e!==e&&t!==t}var C=new WeakMap,M=function(e){this.observers=new Map,this.obj=e},F=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 M(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 F(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=u(t),a=u(e),s=!1,l=a.length-1;l>=0;l--){var d=e[g=a[l]];if(!c(t,g)||void 0===t[g]&&void 0!==d&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+h(g),value:f(d)}),n.push({op:"remove",path:i+"/"+h(g)}),s=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}),!0);else{var p=t[g];"object"==typeof d&&null!=d&&"object"==typeof p&&null!=p&&Array.isArray(d)===Array.isArray(p)?N(d,p,n,i+"/"+h(g),r):d!==p&&(r&&n.push({op:"test",path:i+"/"+h(g),value:f(d)}),n.push({op:"replace",path:i+"/"+h(g),value:f(p)}))}}if(s||o.length!=a.length)for(l=0;l<o.length;l++){var g;c(e,g=o[l])||void 0===t[g]||n.push({op:"add",path:i+"/"+h(g),value:f(t[g])})}}}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 B=n(93811),P=n.n(B),L=n(88478),I=n(28430);var j=n(518),U=n(8481),q=n.n(U),G=n(41515),W=n.n(G),Y=n(94526),H=n.n(Y);function X(e){return!!e.or}function V(e){return!!e.and}function K(e){return!!e.not}function Q(e,t){if(K(e))Q(e.not,t);else if(V(e))for(const n of e.and)Q(n,t);else if(X(e))for(const n of e.or)Q(n,t);else t(e)}function J(e,t){return K(e)?{not:J(e.not,t)}:V(e)?{and:e.and.map((e=>J(e,t)))}:X(e)?{or:e.or.map((e=>J(e,t)))}:t(e)}const Z=W(),ee=q();function te(e){throw new Error(e)}function ne(e,t){const n={};for(const i of t)(0,j.mQ)(e,i)&&(n[i]=e[i]);return n}function ie(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>H()(e))).join(",")})`};const re=H();function oe(e){if((0,j.Et)(e))return e;const t=(0,j.Kg)(e)?e:H()(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 ae(e){return!1===e||null===e}function se(e,t){return e.includes(t)}function le(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function ce(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function ue(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)fe(e,r??{});return e}function fe(e,t){for(const n of be(t))(0,j.AU)(e,n,t[n],!0)}function de(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 he(e,t){const n=be(e),i=be(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function pe(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ge(e,t){for(const n of e)if(t.has(n))return!0;return!1}function me(e){const t=new Set;for(const n of e){const e=(0,j.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 ye(e,t){return void 0===e||void 0===t||ge(me(e),me(t))}function ve(e){return 0===be(e).length}const be=Object.keys,xe=Object.values,_e=Object.entries;function we(e){return!0===e||!1===e}function ke(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function $e(e,t){return K(e)?`!(${$e(e.not,t)})`:V(e)?`(${e.and.map((e=>$e(e,t))).join(") && (")})`:X(e)?`(${e.or.map((e=>$e(e,t))).join(") || (")})`:t(e)}function Ee(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&Ee(e[n],t)&&delete e[n],ve(e)}function Ae(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Se(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";const n=(0,j.iv)(e),i=[];for(let r=1;r<=n.length;r++){const e=`[${n.slice(0,r).map(j.r$).join("][")}]`;i.push(`${t}${e}`)}return i.join(" && ")}function De(e){return`${arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum"}[${(0,j.r$)((0,j.iv)(e).join("."))}]`}function Ce(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Me(e){return`${(0,j.iv)(e).map(Ce).join("\\.")}`}function Fe(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Oe(e){return`${(0,j.iv)(e).join(".")}`}function Te(e){return e?(0,j.iv)(e).length:0}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(const i of t)if(void 0!==i)return i}let Ne=42;function Re(e){const t=++Ne;return e?String(e)+t:t}function Be(){Ne=42}function Pe(e){return Le(e)?e:`__${e}`}function Le(e){return e.startsWith("__")}function Ie(e){if(void 0!==e)return(e%360+360)%360}function je(e){return!!(0,j.Et)(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Ue="row",qe="column",Ge="facet",We="x",Ye="y",He="x2",Xe="y2",Ve="xOffset",Ke="yOffset",Qe="radius",Je="radius2",Ze="theta",et="theta2",tt="latitude",nt="longitude",it="latitude2",rt="longitude2",ot="color",at="fill",st="stroke",lt="shape",ct="size",ut="angle",ft="opacity",dt="fillOpacity",ht="strokeOpacity",pt="strokeWidth",gt="strokeDash",mt="text",yt="order",vt="detail",bt="key",xt="tooltip",_t="href",wt="url",kt="description",$t={theta:1,theta2:1,radius:1,radius2:1};function Et(e){return e in $t}const At={longitude:1,longitude2:1,latitude:1,latitude2:1};function St(e){switch(e){case tt:return"y";case it:return"y2";case nt:return"x";case rt:return"x2"}}function Dt(e){return e in At}const Ct=be(At),Mt={x:1,y:1,x2:1,y2:1,...$t,...At,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 Ft(e){return e===ot||e===at||e===st}const Ot={row:1,column:1,facet:1},Tt=be(Ot),zt={...Mt,...Ot},Nt=be(zt),{order:Rt,detail:Bt,tooltip:Pt,...Lt}=zt,{row:It,column:jt,facet:Ut,...qt}=Lt;be(Lt),be(qt);function Gt(e){return!!zt[e]}const Wt=[He,Xe,it,rt,et,Je];function Yt(e){return Ht(e)!==e}function Ht(e){switch(e){case He:return We;case Xe:return Ye;case it:return tt;case rt:return nt;case et:return Ze;case Je:return Qe}return e}function Xt(e){if(Et(e))switch(e){case Ze:return"startAngle";case et:return"endAngle";case Qe:return"outerRadius";case Je:return"innerRadius"}return e}function Vt(e){switch(e){case We:return He;case Ye:return Xe;case tt:return it;case nt:return rt;case Ze:return et;case Qe:return Je}}function Kt(e){switch(e){case We:case He:return"width";case Ye:case Xe:return"height"}}function Qt(e){switch(e){case We:return"xOffset";case Ye:return"yOffset";case He:return"x2Offset";case Xe:return"y2Offset";case Ze:return"thetaOffset";case Qe:return"radiusOffset";case et:return"theta2Offset";case Je:return"radius2Offset"}}function Jt(e){switch(e){case We:return"xOffset";case Ye:return"yOffset"}}function Zt(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const en=be(Mt),{x:tn,y:nn,x2:rn,y2:on,xOffset:an,yOffset:sn,latitude:ln,longitude:cn,latitude2:un,longitude2:fn,theta:dn,theta2:hn,radius:pn,radius2:gn,...mn}=Mt,yn=be(mn),vn={x:1,y:1},bn=be(vn);function xn(e){return e in vn}const _n={theta:1,radius:1},wn=be(_n);function kn(e){return"width"===e?We:Ye}const $n={xOffset:1,yOffset:1};be($n);function En(e){return e in $n}const{text:An,tooltip:Sn,href:Dn,url:Cn,description:Mn,detail:Fn,key:On,order:Tn,...zn}=mn,Nn=be(zn);const Rn={...vn,..._n,...$n,...zn},Bn=be(Rn);function Pn(e){return!!Rn[e]}function Ln(e,t){return function(e){switch(e){case ot:case at:case st:case kt:case vt:case bt:case xt:case _t:case yt:case ft:case dt:case ht:case pt:case Ge:case Ue:case qe:return In;case We:case Ye:case Ve:case Ke:case tt:case nt:return Un;case He:case Xe:case it:case rt:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ct:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case gt:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case lt:return{point:"always",geoshape:"always"};case mt:return{text:"always"};case ut:return{point:"always",square:"always",text:"always"};case wt:return{image:"always"};case Ze:case Qe:return{text:"always",arc:"always"};case et:case Je:return{arc:"always"}}}(e)[t]}const In={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:jn,...Un}=In;function qn(e){switch(e){case We:case Ye:case Ze:case Qe:case Ve:case Ke:case ct:case ut:case pt:case ft:case dt:case ht:case He:case Xe:case et:case Je:return;case Ge:case Ue:case qe:case lt:case gt:case mt:case xt:case _t:case wt:case kt:return"discrete";case ot:case at:case st:return"flexible";case tt:case nt:case it:case rt:case vt:case bt:case yt:return}}const Gn={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Wn={count:1,min:1,max:1};function Yn(e){return!!e&&!!e.argmin}function Hn(e){return!!e&&!!e.argmax}function Xn(e){return(0,j.Kg)(e)&&!!Gn[e]}const Vn=new Set(["count","valid","missing","distinct"]);function Kn(e){return(0,j.Kg)(e)&&Vn.has(e)}const Qn=new Set(["count","sum","distinct","valid","missing"]),Jn=new Set(["mean","average","median","q1","q3","min","max"]);function Zn(e){return(0,j.Lm)(e)&&(e=ds(e,void 0)),"bin"+be(e).map((t=>ii(e[t])?ke(`_${t}_${_e(e[t])}`):ke(`_${t}_${e[t]}`))).join("")}function ei(e){return!0===e||ni(e)&&!e.binned}function ti(e){return"binned"===e||ni(e)&&!0===e.binned}function ni(e){return(0,j.Gv)(e)}function ii(e){return e?.param}function ri(e){switch(e){case Ue:case qe:case ct:case ot:case at:case st:case pt:case ft:case dt:case ht:case lt:return 6;case gt:return 4;default:return 10}}function oi(e){return!!e?.expr}function ai(e){const t=be(e||{}),n={};for(const i of t)n[i]=mi(e[i]);return n}function si(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:a,color:s,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...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}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...g,...s?{fill:s}:{}},subtitleMarkConfig:ne(e,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:m,subtitle:y}}function li(e){return(0,j.Kg)(e)||(0,j.cy)(e)&&(0,j.Kg)(e[0])}function ci(e){return!!e?.signal}function ui(e){return!!e.step}function fi(e){return!(0,j.cy)(e)&&("field"in e&&"data"in e)}const di=be({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),hi={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},pi=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function gi(e){const t=(0,j.cy)(e.condition)?e.condition.map(yi):yi(e.condition);return{...mi(e),condition:t}}function mi(e){if(oi(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function yi(e){if(oi(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function vi(e){if(oi(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ci(e)?e:void 0!==e?{value:e}:void 0}function bi(e){return ci(e)?e.signal:(0,j.r$)(e.value)}function xi(e){return ci(e)?e.signal:null==e?null:(0,j.r$)(e)}function _i(e,t,n){for(const i of n){const n=$i(i,t.markDef,t.config);void 0!==n&&(e[i]=vi(n))}return e}function wi(e){return[].concat(e.type,e.style??[])}function ki(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{vgChannel:r,ignoreVgConfig:o}=i;return r&&void 0!==t[r]?t[r]:void 0!==t[e]?t[e]:!o||r&&r!==e?$i(e,t,n,i):void 0}function $i(e,t,n){let{vgChannel:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return ze(i?Ei(e,t,n.style):void 0,Ei(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Ei(e,t,n){return Ai(e,wi(t),n)}function Ai(e,t,n){let i;t=(0,j.YO)(t);for(const r of t){const t=n[r];t&&void 0!==t[e]&&(i=t[e])}return i}function Si(e,t){return(0,j.YO)(e).reduce(((e,n)=>(e.field.push(Ja(n,t)),e.order.push(n.sort??"ascending"),e)),{field:[],order:[]})}function Di(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(Z(t,e))return;n.push(e)})),n}function Ci(e,t){return Z(e,t)||!t?e:e?[...(0,j.YO)(e),...(0,j.YO)(t)].join(", "):t}function Mi(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if((li(n)||ci(n))&&(li(i)||ci(i)))return{explicit:e.explicit,value:Ci(n,i)};if(li(n)||ci(n))return{explicit:e.explicit,value:n};if(li(i)||ci(i))return{explicit:e.explicit,value:i};if(!li(n)&&!ci(n)&&!li(i)&&!ci(i))return{explicit:e.explicit,value:Di(n,i)};throw new Error("It should never reach here")}function Fi(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 Oi='Autosize "fit" only works for single views and layered views.';function Ti(e){return`${"width"==e?"Width":"Height"} "container" only works for single views and layered views.`}function zi(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function Ni(e){return e?`Dropping "fit-${e}" because spec has discrete ${Kt(e)}.`:'Dropping "fit" because spec has discrete size.'}function Ri(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Bi(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Pi(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Li(e){return`Selection not supported for ${e} yet.`}const Ii="The same selection must be used to override scale domains in a layered view.";function ji(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function Ui(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function qi(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Gi(e){return`${e}Offset dropped because ${e} is continuous`}function Wi(e){return`There is no ${e} encoding. Replacing ${e}Offset encoding as ${e}.`}function Yi(e){return`Invalid field type "${e}".`}function Hi(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 Xi(e,t){return`Dropping ${re(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function Vi(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Ki(e){return`${e} encoding has no scale, so specified scale is ignored.`}function Qi(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Ji(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Zi(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function er(e){return`Using unaggregated domain with raw field has no effect (${re(e)}).`}function tr(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function nr(e){return`Unaggregated domain is currently unsupported for log scale (${re(e)}).`}function ir(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function rr(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const or="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ar(e,t){return`Invalid ${e}: ${re(t)}.`}function sr(e){return`1D error band does not support ${e}.`}function lr(e){return`Channel ${e} is required for "binned" bin.`}const cr=(0,j.vF)(j.P$);let ur=cr;function fr(){return ur=cr,ur}function dr(){ur.warn(...arguments)}function hr(e){if(e&&(0,j.Gv)(e))for(const t of _r)if(t in e)return!0;return!1}new WeakMap;const pr=["january","february","march","april","may","june","july","august","september","october","november","december"],gr=pr.map((e=>e.substr(0,3))),mr=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],yr=mr.map((e=>e.substr(0,3)));function vr(e,t){const n=[];if(t&&void 0!==e.day&&be(e).length>1&&(dr(function(e){return`Dropping day from datetime ${re(e)} as day cannot be combined with other units.`}(e)),delete(e=ee(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const i=t?function(e){if(je(e)&&(e=+e),(0,j.Et)(e))return e-1;{const t=e.toLowerCase(),n=pr.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=gr.indexOf(i);if(-1!==r)return r;throw new Error(ar("month",e))}}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){const i=t?function(e){if(je(e)&&(e=+e),(0,j.Et)(e))return e>4&&dr(ar("quarter",e)),e-1;throw new Error(ar("quarter",e))}(e.quarter):e.quarter;n.push((0,j.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(je(e)&&(e=+e),(0,j.Et)(e))return e%7;{const t=e.toLowerCase(),n=mr.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=yr.indexOf(i);if(-1!==r)return r;throw new Error(ar("day",e))}}(e.day):e.day;n.push((0,j.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 br(e){const t=vr(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}const xr={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},_r=be(xr);function wr(e){return(0,j.Gv)(e)?e.binned:kr(e)}function kr(e){return e&&e.startsWith("binned")}function $r(e){return e.startsWith("utc")}const Er={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Ar(e){return _r.filter((t=>Dr(e,t)))}function Sr(e){const t=Ar(e);return t[t.length-1]}function Dr(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 Cr(e,t){let{end:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1};const i=Se(t),r=$r(e)?"utc":"";let o;const a={};for(const l of _r)Dr(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=vr(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function Mr(e){if(!e)return;const t=Ar(e);return`timeUnitSpecifier(${re(t)}, ${re(Er)})`}function Fr(e){if(!e)return;let t;return(0,j.Kg)(e)?t=kr(e)?{unit:e.substring(6),binned:!0}:{unit:e}:(0,j.Gv)(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),$r(t.unit)&&(t.utc=!0,t.unit=function(e){return e.substring(3)}(t.unit)),t}function Or(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const n=Fr(e),i=Sr(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}=zr(i,n.step);return`${t(br({...e,[o]:+e[o]+r}))} - ${t(br(e))}`}}const Tr={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function zr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(function(e){return!!Tr[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 Nr(e){return!!e?.field&&void 0!==e.equal}function Rr(e){return!!e?.field&&void 0!==e.lt}function Br(e){return!!e?.field&&void 0!==e.lte}function Pr(e){return!!e?.field&&void 0!==e.gt}function Lr(e){return!!e?.field&&void 0!==e.gte}function Ir(e){if(e?.field){if((0,j.cy)(e.range)&&2===e.range.length)return!0;if(ci(e.range))return!0}return!1}function jr(e){return!!e?.field&&((0,j.cy)(e.oneOf)||(0,j.cy)(e.in))}function Ur(e){return jr(e)||Nr(e)||Ir(e)||Rr(e)||Pr(e)||Br(e)||Lr(e)}function qr(e,t){return gs(e,{timeUnit:t,wrapTime:!0})}function Gr(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{field:n}=e,i=Fr(e.timeUnit),{unit:r,binned:o}=i||{},a=Ja(e,{expr:"datum"}),s=r?`time(${o?a:Cr(r,n)})`:a;if(Nr(e))return`${s}===${qr(e.equal,r)}`;if(Rr(e)){return`${s}<${qr(e.lt,r)}`}if(Pr(e)){return`${s}>${qr(e.gt,r)}`}if(Br(e)){return`${s}<=${qr(e.lte,r)}`}if(Lr(e)){return`${s}>=${qr(e.gte,r)}`}if(jr(e))return`indexof([${function(e,t){return e.map((e=>qr(e,t)))}(e.oneOf,r).join(",")}], ${s}) !== -1`;if(function(e){return!!e?.field&&void 0!==e.valid}(e))return Wr(s,e.valid);if(Ir(e)){const{range:n}=e,i=ci(n)?{signal:`${n.signal}[0]`}:n[0],o=ci(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==i&&null!==o&&t)return"inrange("+s+", ["+qr(i,r)+", "+qr(o,r)+"])";const a=[];return null!==i&&a.push(`${s} >= ${qr(i,r)}`),null!==o&&a.push(`${s} <= ${qr(o,r)}`),a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${re(e)}`)}function Wr(e){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Yr(e){return Ur(e)&&e.timeUnit?{...e,timeUnit:Fr(e.timeUnit)}:e}const Hr={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Xr(e){return"quantitative"===e||"temporal"===e}function Vr(e){return"ordinal"===e||"nominal"===e}const Kr=Hr.quantitative,Qr=Hr.ordinal,Jr=Hr.temporal,Zr=Hr.nominal,eo=Hr.geojson;be(Hr);const to={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"},no={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"};be(no);function io(e,t){const n=no[e],i=no[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const ro={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 oo(e){return ro[e]}const ao=new Set(["linear","log","pow","sqrt","symlog"]),so=new Set([...ao,"time","utc"]);function lo(e){return ao.has(e)}const co=new Set(["quantile","quantize","threshold"]),uo=new Set([...so,...co,"sequential","identity"]),fo=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function ho(e){return fo.has(e)}function po(e){return uo.has(e)}function go(e){return so.has(e)}function mo(e){return co.has(e)}function yo(e){return e?.param}const vo={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:bo,domain:xo,range:_o,rangeMax:wo,rangeMin:ko,scheme:$o,...Eo}=(be(vo),vo),Ao=be(Eo);function So(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 go(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return go(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 go(e);case"nice":return go(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return po(e)&&!se(["log","time","utc","threshold","quantile"],e)}}function Do(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Ft(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 Co={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"},Mo=Co.arc,Fo=Co.area,Oo=Co.bar,To=Co.image,zo=Co.line,No=Co.point,Ro=Co.rect,Bo=Co.rule,Po=Co.text,Lo=Co.tick,Io=Co.trail,jo=Co.circle,Uo=Co.square,qo=Co.geoshape;function Go(e){return["line","area","trail"].includes(e)}function Wo(e){return["rect","bar","image","arc"].includes(e)}const Yo=new Set(be(Co));function Ho(e){return e.type}const Xo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Vo=be({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Ko=be({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 Qo(e){return e&&void 0!=e.band}const Jo={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Zo={binSpacing:1,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},ea={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5};function ta(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:o}=e,a=aa(e);return Pa(n)&&!Kn(n.aggregate)&&r&&go(r.get("type"))?function(e){let{fieldDef:t,channel:n,markDef:i,ref:r,config:o}=e;if(Go(i.type))return r;const a=ki("invalid",i,o);if(null===a)return[na(t,n),r];return r}({fieldDef:n,channel:t,markDef:i,ref:a,config:o}):a}function na(e,t){return{test:ia(e,!0),..."y"===Ht(t)?{field:{group:"height"}}:{value:0}}}function ia(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Wr((0,j.Kg)(e)?e:Ja(e,{expr:"datum"}),!t)}function ra(e,t,n,i){const r={};if(t&&(r.scale=t),Ia(e)){const{datum:t}=e;hr(t)?r.signal=br(t):ci(t)?r.signal=t.signal:oi(t)?r.signal=t.expr:r.value=t}else r.field=Ja(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,bandPosition:a=.5}=e;const s=0<a&&a<1?"datum":void 0,l=Ja(n,{expr:s,suffix:o}),c=void 0!==i?Ja(i,{expr:s}):Ja(n,{suffix:"end",expr:s}),u={};if(0===a||1===a){u.scale=t;const e=0===a?l:c;u.field=e}else{const e=ci(a)?`${a.signal} * ${l} + (1-${a.signal}) * ${c}`:`${a} * ${l} + ${1-a} * ${c}`;u.signal=`scale("${t}", ${e})`}return r&&(u.offset=r),u}function aa(e){let{channel:t,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:l,offset:c,defaultRef:u,bandPosition:f}=e;if(n){if(Ga(n)){const e=s?.get("type");if(Wa(n)){f??(f=Fa({fieldDef:n,fieldDef2:i,markDef:r,config:o}));const{bin:s,timeUnit:u,type:d}=n;if(ei(s)||f&&u&&d===Jr)return l?.impute?ra(n,a,{binSuffix:"mid"},{offset:c}):f&&!ho(e)?oa({scaleName:a,fieldOrDatumDef:n,bandPosition:f,offset:c}):ra(n,a,ys(n,t)?{binSuffix:"range"}:{},{offset:c});if(ti(s)){if(Pa(i))return oa({scaleName:a,fieldOrDatumDef:n,fieldOrDatumDef2:i,bandPosition:f,offset:c});dr(lr(t===We?He:Xe))}}return ra(n,a,ho(e)?{binSuffix:"range"}:{},{offset:c,band:"band"===e?f??n.bandPosition??.5:void 0})}if(Ya(n)){const e=c?{offset:c}:{};return{...sa(t,n.value),...e}}}return(0,j.Tn)(u)&&(u=u()),u?{...u,...c?{offset:c}:{}}:u}function sa(e,t){return se(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:se(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:vi(t)}function la(e){return e&&"number"!==e&&"time"!==e}function ca(e,t,n){return`${e}(${t}${n?`, ${re(n)}`:""})`}const ua=" \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=La(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(ps(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,j.Kg)(i)?i:o,`${a?"utc":"time"}Format(${t}, '${i}')`):function(e,t,n){if(!e)return;const i=Mr(e);return`${n||$r(e)?"utc":"time"}Format(${t}, ${i})`}(n,t,a)}({field:s,timeUnit:Pa(t)?Fr(t.timeUnit)?.unit:void 0,format:n,formatType:a.timeFormatType,rawTimeFormat:a.timeFormat,isUTCScale:Ha(t)&&t.scale?.type===to.UTC});return e?{signal:e}:void 0}if(n=ma({type:l,specifiedFormat:n,config:a,normalizeStack:o}),Pa(t)&&ei(t.bin)){return{signal:ba(s,Ja(t,{expr:r,binSuffix:"end"}),n,i,a)}}return n||"quantitative"===La(t)?{signal:`${ya(s,n)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function da(e,t,n){return Pa(e)?n?`${Ja(e,{expr:t,suffix:"end"})}-${Ja(e,{expr:t,suffix:"start"})}`:Ja(e,{expr:t}):function(e){const{datum:t}=e;return hr(t)?br(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)&&ei(t.bin)){return{signal:ba(s,Ja(t,{expr:r,binSuffix:"end"}),n,i,a)}}return{signal:ca(i,s,n)}}function pa(e,t,n,i,r,o){if(!(0,j.Kg)(i)||!la(i)){if(void 0===n&&void 0===i&&r.customFormatTypes&&"quantitative"===La(e)){if(r.normalizedNumberFormatType&&Xa(e)&&"normalize"===e.stack)return;if(r.numberFormatType)return}if(Xa(e)&&"normalize"===e.stack&&r.normalizedNumberFormat)return ma({type:"quantitative",config:r,normalizeStack:!0});if(ps(e)){const t=Pa(e)?Fr(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:Mr(n)};return r?void 0:i.timeFormat}({specifiedFormat:n,timeUnit:t,config:r,omitTimeFormatConfig:o})}return ma({type:t,specifiedFormat:n,config:r})}}function ga(e,t,n){return e&&(ci(e)||"number"===e||"time"===e)?e:ps(t)&&"time"!==n&&"utc"!==n?Pa(t)&&Fr(t?.timeUnit)?.utc?"utc":"time":void 0}function ma(e){let{type:t,specifiedFormat:n,config:i,normalizeStack:r}=e;return(0,j.Kg)(n)?n:t===Kr?r?i.normalizedNumberFormat:i.numberFormat:void 0}function ya(e,t){return`format(${e}, "${t||""}")`}function va(e,t,n,i){return la(n)?ca(n,e,t):ya(e,((0,j.Kg)(t)?t:void 0)??i.numberFormat)}function ba(e,t,n,i,r){if(void 0===n&&void 0===i&&r.customFormatTypes&&r.numberFormatType)return ba(e,t,r.numberFormat,r.numberFormatType,r);const o=va(e,n,i,r),a=va(t,n,i,r);return`${Wr(e,!1)} ? "null" : ${o} + "${ua}" + ${a}`}const xa="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 e in _a}function ka(e){return!!e?.encoding}function $a(e){return e&&("count"===e.op||!!e.field)}function Ea(e){return e&&(0,j.cy)(e)}function Aa(e){return"row"in e||"column"in e}function Sa(e){return!!e&&"header"in e}function Da(e){return"facet"in e}function Ca(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Ma(e){return"sort"in e}function Fa(e){let{fieldDef:t,fieldDef2:n,markDef:i,config:r}=e;if(Ga(t)&&void 0!==t.bandPosition)return t.bandPosition;if(Pa(t)){const{timeUnit:e,bin:o}=t;if(e&&!n)return Wo(i.type)?0:$i("timeUnitBandPosition",i,r);if(ei(o))return.5}}function Oa(e){let{channel:t,fieldDef:n,fieldDef2:i,markDef:r,config:o,scaleType:a,useVlSizeChannel:s}=e;const l=Kt(t),c=ki(s?"size":l,r,o,{vgChannel:l});if(void 0!==c)return c;if(Pa(n)){const{timeUnit:e,bin:t}=n;if(e&&!i)return{band:$i("timeUnitBandSize",r,o)};if(ei(t)&&!ho(a))return{band:1}}return Wo(r.type)?a?ho(a)?o[r.type]?.discreteBandSize||{band:1}:o[r.type]?.continuousBandSize:o[r.type]?.discreteBandSize:void 0}function Ta(e,t,n,i){return!!(ei(e.bin)||e.timeUnit&&Wa(e)&&"temporal"===e.type)&&void 0!==Fa({fieldDef:e,fieldDef2:t,markDef:n,config:i})}function za(e){return e&&!!e.sort&&!e.field}function Na(e){return e&&"condition"in e}function Ra(e){const t=e?.condition;return!!t&&!(0,j.cy)(t)&&Pa(t)}function Ba(e){const t=e?.condition;return!!t&&!(0,j.cy)(t)&&Ga(t)}function Pa(e){return e&&(!!e.field||"count"===e.aggregate)}function La(e){return e?.type}function Ia(e){return e&&"datum"in e}function ja(e){return Wa(e)&&!Za(e)||qa(e)}function Ua(e){return Wa(e)&&"quantitative"===e.type&&!e.bin||qa(e)}function qa(e){return Ia(e)&&(0,j.Et)(e.datum)}function Ga(e){return Pa(e)||Ia(e)}function Wa(e){return e&&("field"in e||"count"===e.aggregate)&&"type"in e}function Ya(e){return e&&"value"in e&&"value"in e}function Ha(e){return e&&("scale"in e||"sort"in e)}function Xa(e){return e&&("axis"in e||"stack"in e||"impute"in e)}function Va(e){return e&&"legend"in e}function Ka(e){return e&&("format"in e||"formatType"in e)}function Qa(e){return ie(e,["legend","axis","header","scale"])}function Ja(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=Pe("count");else{let i;if(!t.nofn)if(function(e){return"op"in e}(e))i=e.op;else{const{bin:a,aggregate:s,timeUnit:l}=e;ei(a)?(i=Zn(a),r=(t.binSuffix??"")+(t.suffix??"")):s?Hn(s)?(o=`["${n}"]`,n=`argmax_${s.argmax}`):Yn(s)?(o=`["${n}"]`,n=`argmin_${s.argmin}`):i=String(s):l&&!wr(l)&&(i=function(e){const{utc:t,...n}=Fr(e);return n.unit?(t?"utc":"")+be(n).map((e=>ke(`${"unit"===e?"":`_${e}_`}${n[e]}`))).join(""):(t?"utc":"")+"timeunit"+be(n).map((e=>ke(`_${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?Oe(n):t.expr?De(n,t.expr)+o:Me(n)+o}function Za(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(Yi(e.type))}const es=(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(Hn(t))return`${r} for argmax(${t.argmax})`;if(Yn(t))return`${r} for argmin(${t.argmin})`;const o=i&&!wr(i)?Fr(i):void 0,a=t||o?.unit||o?.maxbins&&"timeunit"||ei(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(ei(i))return`${n} (binned)`;if(r&&!wr(r)){const e=Fr(r)?.unit;if(e)return`${n} (${Ar(e).join("-")})`}else if(o)return Hn(o)?`${n} for max ${o.argmax}`:Yn(o)?`${n} for min ${o.argmin}`:`${Ae(o)} of ${n}`;return n}(e,t)}};let ts=es;function ns(e){ts=e}function is(e,t,n){let{allowDisabling:i,includeDefault:r=!0}=n;const o=rs(e)?.title;if(!Pa(e))return o??e.title;const a=e,s=r?os(a,t):void 0;return i?ze(o,a.title,s):o??a.title??s}function rs(e){return Xa(e)&&e.axis?e.axis:Va(e)&&e.legend?e.legend:Sa(e)&&e.header?e.header:void 0}function os(e,t){return ts(e,t)}function as(e){if(Ka(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const t=rs(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function ss(e){return Pa(e)?e:Ra(e)?e.condition:void 0}function ls(e){return Ga(e)?e:Ba(e)?e.condition:void 0}function cs(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,j.Kg)(e)||(0,j.Et)(e)||(0,j.Lm)(e)){return dr(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${re(n)}}.`}(t,(0,j.Kg)(e)?"string":(0,j.Et)(e)?"number":"boolean",e)),{value:e}}return Ga(e)?us(e,t,n,i):Ba(e)?{...e,condition:us(e.condition,t,n,i)}:e}function us(e,t,n,i){if(Ka(e)){const{format:r,formatType:o,...a}=e;if(la(o)&&!n.customFormatTypes)return dr(qi(t)),us(a,t,n,i)}else{const r=Xa(e)?"axis":Va(e)?"legend":Sa(e)?"header":null;if(r&&e[r]){const{format:o,formatType:a,...s}=e[r];if(la(a)&&!n.customFormatTypes)return dr(qi(t)),us({...e,[r]:s},t,n,i)}}return Pa(e)?fs(e,t,i):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=(0,j.Et)(n)?"quantitative":(0,j.Kg)(n)?"nominal":hr(n)?"temporal":void 0,{...e,type:t}}(e)}function fs(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||Xn(i)||Hn(i)||Yn(i)||(dr(function(e){return`Invalid aggregation operator "${e}".`}(i)),delete s.aggregate),r&&(s.timeUnit=Fr(r)),a&&(s.field=`${a}`),ei(o)&&(s.bin=ds(o,t)),ti(o)&&!xn(t)&&dr(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 Kr:return"quantitative";case"t":case Jr:return"temporal";case"o":case Qr:return"ordinal";case"n":case Zr:return"nominal";case eo:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&Kn(i)&&(dr(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,i)),s.type="quantitative")}else if(!Yt(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(Ma(e)&&(0,j.cy)(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Hn(n)&&!Yn(n))return"quantitative";if(Ha(e)&&e.scale?.type)switch(no[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 Ue:case qe:case Ge:return Za(e)?hs:{compatible:!1,warning:Qi(t)};case We:case Ye:case Ve:case Ke:case ot:case at:case st:case mt:case vt:case bt:case xt:case _t:case wt:case ut:case Ze:case Qe:case kt:return hs;case nt:case rt:case tt:case it:return n!==Kr?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:hs;case ft:case dt:case ht:case pt:case ct:case et:case Je:case He:case Xe:return"nominal"!==n||e.sort?hs:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case lt:case gt:return Za(e)||Ha(i=e)&&mo(i.scale?.type)?hs:{compatible:!1,warning:Ji(t)};case yt:return"nominal"!==e.type||"sort"in e?hs:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}var i}(s,t)||{};!1===e&&dr(n)}if(Ma(s)&&(0,j.Kg)(s.sort)){const{sort:e}=s;if(wa(e))return{...s,sort:{encoding:e}};const t=e.substr(1);if("-"===e.charAt(0)&&wa(t))return{...s,sort:{encoding:t,order:"descending"}}}if(Sa(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 ds(e,t){return(0,j.Lm)(e)?{maxbins:ri(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:ri(t)}}const hs={compatible:!0};function ps(e){const{formatType:t}=as(e);return"time"===t||!t&&((n=e)&&("temporal"===n.type||Pa(n)&&!!n.timeUnit));var n}function gs(e,t){let{timeUnit:n,type:i,wrapTime:r,undefinedIfExprNotRequired:o}=t;const a=n&&Fr(n)?.unit;let s,l=a||"temporal"===i;return oi(e)?s=e.expr:ci(e)?s=e.signal:hr(e)?(l=!0,s=br(e)):((0,j.Kg)(e)||(0,j.Et)(e))&&l&&(s=`datetime(${re(e)})`,function(e){return!!xr[e]}(a)&&((0,j.Et)(e)&&e<1e4||(0,j.Kg)(e)&&isNaN(Date.parse(e)))&&(s=br({[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=gs(t,{timeUnit:Pa(e)&&!wr(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:t}))}function ys(e,t){return ei(e.bin)?Pn(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const vs={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 bs(e){return e?.condition}const xs=["domain","grid","labels","ticks","title"],_s={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"},ws={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},ks={...ws,style:1,labelExpr:1,encoding:1};function $s(e){return!!ks[e]}be(ks);const Es=be({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 As(e){return"mark"in e}class Ss{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!As(e)&&(Ho(t=e.mark)?t.type:t)===this.name;var t}}function Ds(e,t){const n=e&&e[t];return!!n&&((0,j.cy)(n)?le(n,(e=>!!e.field)):Pa(n)||Ra(n))}function Cs(e,t){const n=e&&e[t];return!!n&&((0,j.cy)(n)?le(n,(e=>!!e.field)):Pa(n)||Ia(n)||Ba(n))}function Ms(e,t){if(xn(t)){const n=e[t];if((Pa(n)||Ia(n))&&(Vr(n.type)||Pa(n)&&n.timeUnit)){return Cs(e,Jt(t))}}return!1}function Fs(e){return le(Nt,(t=>{if(Ds(e,t)){const n=e[t];if((0,j.cy)(n))return le(n,(e=>!!e.aggregate));{const e=ss(n);return e&&!!e.aggregate}}return!1}))}function Os(e,t){const n=[],i=[],r=[],o=[],a={};return Ns(e,((s,l)=>{if(Pa(s)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=s;if(u||d||f){const e=rs(s),p=e?.title;let g=Ja(s,{forAs:!0});const m={...p?[]:{title:is(s,t,{allowDisabling:!0})},...h,field:g};if(u){let e;if(Hn(u)?(e="argmax",g=Ja({op:"argmax",field:u.argmax},{forAs:!0}),m.field=`${g}.${c}`):Yn(u)?(e="argmin",g=Ja({op:"argmin",field:u.argmin},{forAs:!0}),m.field=`${g}.${c}`):"boxplot"!==u&&"errorbar"!==u&&"errorband"!==u&&(e=u),e){const t={op:e,as:g};c&&(t.field=c),o.push(t)}}else if(n.push(g),Wa(s)&&ei(f)){if(i.push({bin:f,field:c,as:g}),n.push(Ja(s,{binSuffix:"end"})),ys(s,l)&&n.push(Ja(s,{binSuffix:"range"})),xn(l)){const e={field:`${g}_end`};a[`${l}2`]=e}m.bin="binned",Yt(l)||(m.type=Kr)}else if(d&&!wr(d)){r.push({timeUnit:d,field:c,as:g});const e=Wa(s)&&s.type!==Jr&&"time";e&&(l===mt||l===xt?m.formatType=e:!function(e){return!!mn[e]}(l)?xn(l)&&(m.axis={formatType:e,...m.axis}):m.legend={formatType:e,...m.legend})}a[l]=m}else n.push(c),a[l]=e[l]}else a[l]=e[l]})),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:a}}function Ts(e,t,n){const i=Ln(t,n);if(!i)return!1;if("binned"===i){const n=e[t===He?We:Ye];return!!(Pa(n)&&Pa(e[t])&&ti(n.bin))}return!0}function zs(e,t){const n={};for(const i of be(e)){const r=cs(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Ns(e,t,n){if(e)for(const i of be(e)){const r=e[i];if((0,j.cy)(r))for(const e of r)t.call(n,e,i);else t.call(n,r,i)}}function Rs(e,t){return be(t).reduce(((n,i)=>{switch(i){case We:case Ye:case _t:case kt:case wt:case He:case Xe:case Ve:case Ke:case Ze:case et:case Qe:case Je:case tt:case nt:case it:case rt:case mt:case lt:case ut:case xt:return n;case yt:if("line"===e||"trail"===e)return n;case vt:case bt:{const e=t[i];if((0,j.cy)(e)||Pa(e))for(const t of(0,j.YO)(e))t.aggregate||n.push(Ja(t,{}));return n}case ct:if("trail"===e)return n;case ot:case at:case st:case ft:case dt:case ht:case gt:case pt:{const e=ss(t[i]);return e&&!e.aggregate&&n.push(Ja(e,{})),n}}}),[])}function Bs(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:ci(r)?{signal:`${r}"${escape(o)}"`}:r+o}})),...de(function(e){const t=[];for(const n of be(e))if(Ds(e,n)){const i=e[n],r=(0,j.YO)(i);for(const e of r)Pa(e)?t.push(e):Ra(e)&&t.push(e.condition)}return t}(n).map(Qa),oe)]}}function Ps(e){const{title:t,field:n}=e;return ze(t,n)}function Ls(e,t,n,i,r){const{scale:o,axis:a}=n;return s=>{let{partName:l,mark:c,positionPrefix:u,endPositionPrefix:f,extraEncoding:d={}}=s;const h=Ps(n);return Is(e,l,r,{mark:c,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...void 0!==h?{title:h}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...(0,j.Kg)(f)?{[`${t}2`]:{field:`${f}_${n.field}`}}:{},...i,...d}})}}function Is(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}:{},...Ho(i.mark)?i.mark:{type:i.mark},style:`${s}-${String(t)}`,...(0,j.Lm)(e[t])?{}:e[t]}}]:[]}function js(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&&dr(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),i}return e}function qs(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(Ho(n)&&n.orient)return n.orient;if(ja(r)){if(ja(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 ps(o)&&!ps(r)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(ja(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}const Gs="boxplot",Ws=new Ss(Gs,Hs);function Ys(e){return(0,j.Et)(e)?"tukey":e}function Hs(e,t){let{config:n}=t;e={...e,encoding:zs(e.encoding,n)};const{mark:i,encoding:r,params:o,projection:a,...s}=e,l=Ho(i)?i:{type:i};o&&dr(Li("boxplot"));const c=l.extent??n.boxplot.extent,u=ki("size",l,n),f=l.invalid,d=Ys(c),{bins:h,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:y,groupby:v,aggregate:b,encodingWithoutContinuousAxis:x,ticksOrient:_,boxOrient:w,customTooltipWithoutAggregatedField:k}=function(e,t,n){const i=qs(e,Gs),{continuousAxisChannelDef:r,continuousAxis:o}=js(e,i,Gs),a=r.field,s=Ys(t),l=[...Xs(a),{op:"median",field:a,as:`mid_box_${a}`},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],c="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:u,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=function(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if((0,j.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,j.cy)(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:v}=Os(h,n),b="vertical"===i?"horizontal":"vertical",x=i,_=[...p,...g,{aggregate:[...m,...l],groupby:y},...c];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:d}}(e,c,n),{color:$,size:E,...A}=x,S=e=>Ls(l,y,m,e,n.boxplot),D=S(A),C=S(x),M=S({...A,...E?{size:E}:{}}),F=Bs([{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"}],m,x),O={type:"tick",color:"black",opacity:1,orient:_,invalid:f,aria:!1},T="min-max"===d?F:Bs([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),z=[...D({partName:"rule",mark:{type:"rule",invalid:f,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:T}),...D({partName:"rule",mark:{type:"rule",invalid:f,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:T}),...D({partName:"ticks",mark:O,positionPrefix:"lower_whisker",extraEncoding:T}),...D({partName:"ticks",mark:O,positionPrefix:"upper_whisker",extraEncoding:T})],N=[..."tukey"!==d?z:[],...C({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:w,invalid:f,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:F}),...M({partName:"median",mark:{type:"tick",invalid:f,...(0,j.Gv)(n.boxplot.median)&&n.boxplot.median.color?{color:n.boxplot.median.color}:{},...u?{size:u}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:F})];if("min-max"===d)return{...s,transform:(s.transform??[]).concat(g),layer:N};const R=`datum["lower_box_${m.field}"]`,B=`datum["upper_box_${m.field}"]`,P=`(${B} - ${R})`,L=`${R} - ${c} * ${P}`,I=`${B} + ${c} * ${P}`,U=`datum["${m.field}"]`,q={joinaggregate:Xs(m.field),groupby:v},G={transform:[{filter:`(${L} <= ${U}) && (${U} <= ${I})`},{aggregate:[{op:"min",field:m.field,as:`lower_whisker_${m.field}`},{op:"max",field:m.field,as:`upper_whisker_${m.field}`},{op:"min",field:`lower_box_${m.field}`,as:`lower_box_${m.field}`},{op:"max",field:`upper_box_${m.field}`,as:`upper_box_${m.field}`},...b],groupby:v}],layer:z},{tooltip:W,...Y}=A,{scale:H,axis:X}=m,V=Ps(m),K=ie(X,["title"]),Q=Is(l,"outliers",n.boxplot,{transform:[{filter:`(${U} < ${L}) || (${U} > ${I})`}],mark:"point",encoding:{[y]:{field:m.field,type:m.type,...void 0!==V?{title:V}:{},...void 0!==H?{scale:H}:{},...ve(K)?{}:{axis:K}},...Y,...$?{color:$}:{},...k?{tooltip:k}:{}}})[0];let J;const Z=[...h,...p,q];return Q?J={transform:Z,layer:[Q,G]}:(J=G,J.transform.unshift(...Z)),{...s,layer:[J,{transform:g,layer:N}]}}function Xs(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}const Vs="errorbar",Ks=new Ss(Vs,Qs);function Qs(e,t){let{config:n}=t;e={...e,encoding:zs(e.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,ticksOrient:s,markDef:l,outerSpec:c,tooltipEncoding:u}=Zs(e,Vs,n);delete a.size;const f=Ls(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}:{}},g=[...f({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...f({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...f({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==d?{size:d}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...c,transform:i,...g.length>1?{layer:g}:{...g[0]}}}function Js(e,t){const{encoding:n}=e;if(function(e){return(Ga(e.x)||Ga(e.y))&&!Ga(e.x2)&&!Ga(e.y2)&&!Ga(e.xError)&&!Ga(e.xError2)&&!Ga(e.yError)&&!Ga(e.yError2)}(n))return{orient:qs(e,t),inputType:"raw"};const i=function(e){return Ga(e.x2)||Ga(e.y2)}(n),r=function(e){return Ga(e.xError)||Ga(e.xError2)||Ga(e.yError)||Ga(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(Ga(e)&&Ga(i))throw new Error(`${t} cannot have both x2 and y2`);if(Ga(e)){if(ja(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(Ga(i)){if(ja(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(Ga(i)&&!Ga(e))throw new Error(`${t} cannot have xError2 without xError`);if(Ga(s)&&!Ga(r))throw new Error(`${t} cannot have yError2 without yError`);if(Ga(e)&&Ga(r))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Ga(e)){if(ja(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Ga(r)){if(ja(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 Zs(e,t,n){const{mark:i,encoding:r,params:o,projection:a,...s}=e,l=Ho(i)?i:{type:i};o&&dr(Li(t));const{orient:c,inputType:u}=Js(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=js(e,c,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=function(e,t,n,i,r,o,a,s){let l=[],c=[];const u=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)&&dr(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:u,as:`extent_${u}`},{op:t,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:Ae(t)},{fieldPrefix:"upper_",titlePrefix:el(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:el(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:u,as:`lower_${u}`},{op:i,field:u,as:`upper_${u}`},{op:e,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:is({field:u,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:is({field:u,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:is({field:u,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&dr((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=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${i.field}"]`,as:`upper_${u}`}],r?c.push({calculate:`datum["${u}"] + datum["${r.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${i.field}"]`,as:`lower_${u}`}));for(const e of c)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:Fe(Fe(e.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,f,d,h,p,u,t,n),{[g]:x,["x"===g?"x2":"y2"]:_,["x"===g?"xError":"yError"]:w,["x"===g?"xError2":"yError2"]:k,...$}=r,{bins:E,timeUnits:A,aggregate:S,groupby:D,encoding:C}=Os($,n),M=[...S,...m],F="raw"!==u?[]:D,O=Bs(v,f,C,b);return{transform:[...s.transform??[],...E,...A,...0===M.length?[]:[{aggregate:M,groupby:F}],...y],groupby:F,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:C,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:s,tooltipEncoding:O}}function el(e,t,n){return`${Ae(e)} ${n} ${t}`}const tl="errorband",nl=new Ss(tl,il);function il(e,t){let{config:n}=t;e={...e,encoding:zs(e.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,markDef:s,outerSpec:l,tooltipEncoding:c}=Zs(e,tl,n),u=s,f=Ls(u,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 g={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return d?(h={...h,...g,ariaRoleDescription:"errorband"},p={...p,...g,aria:!1}):u.interpolate?dr(sr("interpolate")):u.tension&&dr(sr("tension")),{...l,transform:i,layer:[...f({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...f({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...f({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const rl={};function ol(e,t,n){const i=new Ss(e,t);rl[e]={normalizer:i,parts:n}}ol(Gs,Hs,["box","median","outliers","rule","ticks"]),ol(Vs,Qs,["ticks","rule"]),ol(tl,il,["band","borders"]);const al=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],sl={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"},ll={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"},cl=be(sl),ul=be(ll),fl=be({header:1,headerRow:1,headerColumn:1,headerFacet:1}),dl=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],hl={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},pl=(be(hl),"_vgsid_"),gl={point:{on:"click",fields:[pl],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function ml(e){return"legend"===e||!!e?.legend}function yl(e){return ml(e)&&(0,j.Gv)(e)}function vl(e){return!!e?.select}function bl(e){const t=[];for(const n of e||[]){if(vl(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"concat"in e}function _l(e){return"vconcat"in e}function wl(e){return"hconcat"in e}function kl(e){let{step:t,offsetIsDiscrete:n}=e;return n?t.for??"offset":"position"}function $l(e){return(0,j.Gv)(e)&&void 0!==e.step}function El(e){return e.view||e.width||e.height}const Al=be({align:1,bounds:1,center:1,columns:1,spacing:1});function Sl(e,t){return e[t]??e["width"===t?"continuousWidth":"continuousHeight"]}function Dl(e,t){const n=Cl(e,t);return $l(n)?n.step:Ml}function Cl(e,t){return ze(e[t]??e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const Ml=20;const Fl={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Ml},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:Zo,circle:{},geoshape:{},image:{},line:{},point:{},rect:ea,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:gl,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Ol=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Tl={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},zl={blue:Ol[0],orange:Ol[1],red:Ol[2],teal:Ol[3],green:Ol[4],yellow:Ol[5],purple:Ol[6],pink:Ol[7],brown:Ol[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 Nl(e){const t=be(e||{}),n={};for(const i of t){const t=e[i];n[i]=bs(t)?gi(t):mi(t)}return n}const Rl=[...Ko,...Es,...fl,"background","padding","legend","lineBreak","scale","style","title","view"];function Bl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:t,font:n,fontSize:i,selection:r,...o}=e,a=(0,j.io)({},ee(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,j.Gv)(e)?{...zl,...e}:zl}],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,j.Gv)(e)?{...Tl,...e}:Tl}],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,L.writeConfig)(a,"selection",r,!0);const s=ie(a,Rl);for(const l of["background","lineBreak","padding"])a[l]&&(s[l]=mi(a[l]));for(const l of Ko)a[l]&&(s[l]=ai(a[l]));for(const l of Es)a[l]&&(s[l]=Nl(a[l]));for(const l of fl)a[l]&&(s[l]=ai(a[l]));return a.legend&&(s.legend=ai(a.legend)),a.scale&&(s.scale=ai(a.scale)),a.style&&(s.style=function(e){const t=be(e),n={};for(const i of t)n[i]=Nl(e[i]);return n}(a.style)),a.title&&(s.title=ai(a.title)),a.view&&(s.view=ai(a.view)),s}const Pl=new Set(["view",...Yo]),Ll=["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"],Il={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]};function jl(e){e=ee(e);for(const t of Ll)delete e[t];if(e.axis)for(const t in e.axis)bs(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of al)delete e.legend[t];if(e.mark){for(const t of Vo)delete e.mark[t];e.mark.tooltip&&(0,j.Gv)(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(bl(e.params)),delete e.params);for(const t of Pl){for(const i of Vo)delete e[t][i];const n=Il[t];if(n)for(const i of n)delete e[t][i];Ul(e,t)}for(const t of be(rl))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=si(e.title);ve(t)||(e.style["group-title"]={...e.style["group-title"],...t});ve(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n});ve(i)?delete e.title:e.title=i}(e);for(const t in e)(0,j.Gv)(e[t])&&ve(e[t])&&delete e[t];return ve(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]};ve(r)||(e.style[n??t]=r),i||delete e[t]}function ql(e){return"layer"in e}class Gl{map(e,t){return Da(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):wl(e)?this.mapHConcat(e,t):_l(e)?this.mapVConcat(e,t):xl(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(ql(e))return this.mapLayer(e,t);if(As(e))return this.mapUnit(e,t);throw new Error(Fi(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 Yl=new Set([Mo,Oo,Fo,Bo,No,jo,Uo,zo,Po,Lo]),Hl=new Set([Oo,Fo,Mo]);function Xl(e){return Pa(e)&&"quantitative"===La(e)&&!e.bin}function Vl(e,t,n){let{orient:i,type:r}=n;const o="x"===t?"y":"radius",a="x"===t,s=e[t],l=e[o];if(Pa(s)&&Pa(l))if(Xl(s)&&Xl(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&&"bar"===r){if("vertical"===i)return o;if("horizontal"===i)return t}}else{if(Xl(s))return t;if(Xl(l))return o}else{if(Xl(s))return t;if(Xl(l))return o}}function Kl(e,t){const n=Ho(e)?e:{type:e},i=n.type;if(!Yl.has(i))return null;const r=Vl(t,"x",n)||Vl(t,"theta",n);if(!r)return null;const o=t[r],a=Pa(o)?Ja(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=[],c=new Set;if(t[s]){const e=t[s],n=Pa(e)?Ja(e,{}):void 0;n&&n!==a&&(l.push(s),c.add(n));const i="x"===s?"xOffset":"yOffset",r=t[i],o=Pa(r)?Ja(r,{}):void 0;o&&o!==a&&(l.push(i),c.add(o))}const u=yn.reduce(((e,n)=>{if("tooltip"!==n&&Ds(t,n)){const i=t[n];for(const t of(0,j.YO)(i)){const i=ss(t);if(i.aggregate)continue;const r=Ja(i,{});r&&c.has(r)||e.push({channel:n,fieldDef:i})}}return e}),[]);let f;return void 0!==o.stack?f=(0,j.Lm)(o.stack)?o.stack?"zero":null:o.stack:Hl.has(i)&&(f="zero"),f&&f in Wl?Fs(t)&&0===u.length?null:o?.scale?.type&&o?.scale?.type!==to.LINEAR?(o?.stack&&dr(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type)),null):Ga(t[Vt(r)])?(void 0!==o.stack&&dr(`Cannot stack "${d=r}" if there is already "${d}2".`),null):(Pa(o)&&o.aggregate&&!Qn.has(o.aggregate)&&dr(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannels:l,groupbyFields:c,fieldChannel:r,impute:null!==o.impute&&Go(i),stackBy:u,offset:f}):null;var d}function Ql(e){const{point:t,line:n,...i}=e;return be(i).length>1?i:i.type}function Jl(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:ie(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,j.Gv)(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?(0,j.Gv)(t.point)?t.point:{}:void 0}function ec(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 tc{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(As(e)){const{mark:n,encoding:i}=e,r=Ho(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)||!!ec(r,t[r.type])}}return!1}run(e,t,n){const{config:i}=t,{params:r,projection:o,mark:a,name:s,encoding:l,...c}=e,u=zs(l,i),f=Ho(a)?a:{type:a},d=Zl(f,i[f.type],u),h="area"===f.type&&ec(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:ie(u,["shape"])}],g=Kl(f,u);let m=u;if(g){const{fieldChannel:e,offset:t}=g;m={...u,[e]:{...u[e],...t?{stack:t}:{}}}}return m=ie(m,["y2","x2"]),h&&p.push({...o?{projection:o}:{},mark:{type:"line",...ne(f,["clip","interpolate","tension","tooltip"]),...h},encoding:m}),d&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...ne(f,["clip","tooltip"]),...d},encoding:m}),n({...c,layer:p},{...t,config:Jl(i)})}}function nc(e,t){return t?Aa(e)?lc(e,t):oc(e,t):e}function ic(e,t){return t?lc(e,t):e}function rc(e,t,n){const i=t[e];return(r=i)&&!(0,j.Kg)(r)&&"repeat"in r?i.repeat in n?{...t,[e]:n[i.repeat]}:void dr(function(e){return`Unknown repeated value "${e}".`}(i.repeat)):t;var r}function oc(e,t){if(void 0!==(e=rc("field",e,t))){if(null===e)return null;if(Ma(e)&&$a(e.sort)){const n=rc("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function ac(e,t){if(Pa(e))return oc(e,t);{const n=rc("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function sc(e,t){if(!Ga(e)){if(Ba(e)){const n=ac(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=ac(e,t);if(n)return n;if(Na(e))return{condition:e.condition}}}function lc(e,t){const n={};for(const i in e)if((0,j.mQ)(e,i)){const r=e[i];if((0,j.cy)(r))n[i]=r.map((e=>sc(e,t))).filter((e=>e));else{const e=sc(r,t);void 0!==e&&(n[i]=e)}}return n}class cc{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(As(e)){const{encoding:t,mark:n}=e;if("line"===n||Ho(n)&&"line"===n.type)for(const e of Wt){const n=t[Ht(e)];if(t[e]&&(Pa(n)&&!ti(n.bin)||Ia(n)))return!0}}return!1}run(e,t,n){const{encoding:i,mark:r}=e;var o,a;return dr((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,j.Gv)(r)?{...r,type:"rule"}:"rule"},t)}}function uc(e){let{parentEncoding:t,encoding:n={},layer:i}=e,r={};if(t){const e=new Set([...be(t),...be(n)]);for(const o of e){const e=n[o],a=t[o];if(Ga(e)){const t={...a,...e};r[o]=t}else Ba(e)?r[o]={...e,condition:{...a,...e.condition}}:e||null===e?r[o]=e:(i||Ya(a)||ci(a)||Ga(a)||(0,j.cy)(a))&&(r[o]=a)}}else r=n;return!r||ve(r)?void 0:r}function fc(e){const{parentProjection:t,projection:n}=e;return t&&n&&dr(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 dc(e){return"filter"in e}function hc(e){return void 0!==e?.stop}function pc(e){return"lookup"in e}function gc(e){return"pivot"in e}function mc(e){return"density"in e}function yc(e){return"quantile"in e}function vc(e){return"regression"in e}function bc(e){return"loess"in e}function xc(e){return"sample"in e}function _c(e){return"window"in e}function wc(e){return"joinaggregate"in e}function kc(e){return"flatten"in e}function $c(e){return"calculate"in e}function Ec(e){return"bin"in e}function Ac(e){return"impute"in e}function Sc(e){return"timeUnit"in e}function Dc(e){return"aggregate"in e}function Cc(e){return"stack"in e}function Mc(e){return"fold"in e}function Fc(e){return"extent"in e&&!("density"in e)}function Oc(e,t){const{transform:n,...i}=e;if(n){const e=n.map((e=>{if(dc(e))return{filter:Nc(e,t)};if(Ec(e)&&ni(e.bin))return{...e,bin:zc(e.bin)};if(pc(e)){const{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e}));return{...i,transform:e}}return e}function Tc(e,t){const n=ee(e);if(Pa(n)&&ni(n.bin)&&(n.bin=zc(n.bin)),Ha(n)&&n.scale?.domain?.selection){const{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if(Na(n))if((0,L.isArray)(n.condition))n.condition=n.condition.map((e=>{const{selection:n,param:i,test:r,...o}=e;return i?e:{...o,test:Nc(e,t)}}));else{const{selection:e,param:i,test:r,...o}=Tc(n.condition,t);n.condition=i?n.condition:{...o,test:Nc(n.condition,t)}}return n}function zc(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Nc(e,t){const n=e=>J(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):J(e.test||e.filter,(e=>e.selection?n(e.selection):e))}class Rc extends Gl{map(e,t){const n=t.selections??[];if(e.params&&!As(e)){const t=[];for(const i of e.params)vl(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,L.isString)(t)&&(t===e.name||i.includes(t))||(0,L.isArray)(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 hv of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=Rc.prototype[hv];Rc.prototype[hv]=function(t,n){return e.call(this,t,Bc(t,n))}}function Bc(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Pc(e,t){void 0===t&&(t=Bl(e.config));const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={config:t};return jc.map(Lc.map(Ic.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=As(e)||ql(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&&(dr(Ti("width")),i=void 0),"container"==r&&(dr(Ti("height")),r=void 0));const s={type:"pad",...a,...n?Uc(n.autosize):{},...Uc(e.autosize)};"fit"!==s.type||o||(dr(Oi),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&dr(zi("width"));"container"==r&&"fit"!=s.type&&"fit-y"!=s.type&&dr(zi("height"));if(Z(s,{type:"pad"}))return;return s}(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Lc=new class extends Gl{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Ws,Ks,nl,new tc,new cc]}map(e,t){if(As(e)){const n=Ds(e.encoding,Ue),i=Ds(e.encoding,qe),r=Ds(e.encoding,Ge);if(n||i||r)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t,r=ic(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,j.cy)(e.repeat)&&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:c=""}=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}_`:"")+c}child__layer_${ke(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,j.cy)(n)&&e.columns&&(e=ie(e,["columns"]),dr(ji("repeat")));const a=[],{repeater:s={},repeaterPrefix:l=""}=t,c=!(0,j.cy)(n)&&n.row||[s?s.row:null],u=!(0,j.cy)(n)&&n.column||[s?s.column:null],f=(0,j.cy)(n)&&n||[s?s.repeat:null];for(const h of f)for(const e of c)for(const r of u){const o={repeat:h,row:e,column:r,layer:s.layer},c=(i.name?`${i.name}_`:"")+l+"child__"+((0,j.cy)(n)?`${ke(h)}`:(n.row?`row_${ke(e)}`:"")+(n.column?`column_${ke(r)}`:"")),u=this.map(i,{...t,repeater:o,repeaterPrefix:c});u.name=c,a.push(ie(u,["data"]))}const d=(0,j.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 Aa(n)&&e.columns&&(e=ie(e,["columns"]),dr(ji("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:r,parentProjection:o,config:a}=t,s=fc({parentProjection:o,projection:i}),l=uc({parentEncoding:r,encoding:ic(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:c,view:u,params:f,encoding:d,...h}=e,{facetMapping:p,layout:g}=this.getFacetMappingAndLayout({row:n,column:i,facet:r},t),m=ic(o,t.repeater);return this.mapFacet({...h,...g,facet:p,spec:{...s?{width:s}:{},...c?{height:c}:{},...u?{view:u}:{},...l?{projection:l}:{},mark:a,encoding:m,...f?{params:f}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:i,facet:r}=e;if(n||i){r&&dr(`Facet encoding dropped as ${(o=[...n?[Ue]:[],...i?[qe]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const t={},a={};for(const n of[Ue,qe]){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:nc(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:uc({parentEncoding:n,encoding:o,layer:!0}),parentProjection:fc({parentProjection:i,projection:a})};return super.mapLayer({...s,...e.name?{name:[l.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{}},l)}},Ic=new class extends Gl{map(e,t){return t.emptySelections??(t.emptySelections={}),t.selectionPredicates??(t.selectionPredicates={}),e=Oc(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if((e=Oc(e,t)).encoding){const n={};for(const[i,r]of _e(e.encoding))n[i]=Tc(r,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:n,...i}=e;return n?{...i,params:_e(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 xe(t.selectionPredicates[n]??{}))l.empty="none"!==a;return{name:n,value:r,select:s,bind:o}}))}:e}},jc=new Rc;function Uc(e){return(0,j.Kg)(e)?{type:e}:e??{}}const qc=["background","padding"];function Gc(e,t){const n={};for(const i of qc)e&&void 0!==e[i]&&(n[i]=mi(e[i]));return t&&(n.params=e.params),n}class Wc{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 Wc(ee(this.explicit),ee(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return ze(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 be(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Yc(e){return{explicit:!0,value:e}}function Hc(e){return{explicit:!1,value:e}}function Xc(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Vc(t,n,i,r)}}function Vc(e,t,n,i){return e.explicit&&t.explicit&&dr(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 Kc(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Vc;return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Z(e.value,t.value)?e:r(e,t,n,i)}class Qc extends Wc{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 Jc(e){return"url"in e}function Zc(e){return"values"in e}function eu(e){return"name"in e&&!Jc(e)&&!Zc(e)&&!tu(e)}function tu(e){return e&&(nu(e)||iu(e)||ru(e))}function nu(e){return"sequence"in e}function iu(e){return"sphere"in e}function ru(e){return"graticule"in e}var ou;!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"}(ou||(ou={}));var au=n(60646);function su(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=Me(r.field),r}function lu(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j.D_;if((0,j.cy)(e)){const i=e.map((e=>lu(e,t,n)));return t?`[${i.join(", ")}]`:i}return hr(e)?n(t?br(e):function(e){const t=vr(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(re(e)):e}function cu(e,t){for(const n of xe(e.component.selection??{})){const i=n.name;let r=`${i}${Mf}, ${"global"===n.resolve?"true":`{unit: ${zf(e)}}`}`;for(const o of Tf)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+Ff,on:[{events:{signal:n.name+Mf},update:`modify(${(0,j.r$)(n.name+Cf)}, ${r})`}]})}return du(t)}function uu(e,t){if(e.component.selection&&be(e.component.selection).length){const n=(0,j.r$)(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:(0,au.P)("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return du(t)}function fu(e,t){for(const n of xe(e.component.selection??{}))for(const i of Tf)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function du(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}class hu{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)?dr("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 pu extends hu{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 ${Re()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function gu(e){return void 0!==e.as}function mu(e){return`${e}_end`}class yu extends hu{clone(){return new yu(null,ee(this.formula))}constructor(e,t){super(e),this.formula=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n)=>{const{field:i,timeUnit:r}=n;if(r){let o;if(wr(r)){if(bp(t)){const{mark:e}=t;(Wo(e)||n.bandPosition)&&(o={timeUnit:Fr(r),field:i})}}else o={as:Ja(n,{forAs:!0}),field:i,timeUnit:r};o&&(e[oe(o)]=o)}return e}),{});return ve(n)?null:new yu(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...i}={...t},r={...i,timeUnit:Fr(n)};return new yu(e,{[oe(r)]:r})}merge(e){this.formula={...this.formula};for(const t in e.formula)this.formula[t]||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,i]of _e(this.formula)){const r=gu(i)?i.as:`${i.field}_end`;e.has(r)||(t[n]=i)}this.formula=t}producedFields(){return new Set(xe(this.formula).map((e=>gu(e)?e.as:mu(e.field))))}dependentFields(){return new Set(xe(this.formula).map((e=>e.field)))}hash(){return`TimeUnit ${oe(this.formula)}`}assemble(){const e=[];for(const t of xe(this.formula))if(gu(t)){const{field:n,as:i,timeUnit:r}=t,{unit:o,utc:a,...s}=Fr(r);e.push({field:Me(n),type:"timeunit",...o?{units:Ar(o)}:{},...a?{timezone:"utc"}:{},...s,as:[i,`${i}_end`]})}else if(t){const{field:n,timeUnit:i}=t,r=Sr(i?.unit),{part:o,step:a}=zr(r,i.step);e.push({type:"formula",expr:`timeOffset('${o}', datum['${n}'], ${a})`,as:mu(n)})}return e}}const vu="_tuple_fields";class bu{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 xu={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new bu),o={},a={},s=new Set,l=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=ke(`${i}_${n}`);for(let o=1;s.has(r);o++)r=ke(`${i}_${n}_${o}`);return s.add(r),{[t]:r}},c=t.type,u=e.config.selection[c],f=void 0!==n.value?(0,j.YO)(n.value):null;let{fields:d,encodings:h}=(0,j.Gv)(n.select)?n.select:{};if(!d&&!h&&f)for(const p of f)if((0,j.Gv)(p))for(const e of be(p))qt[e]?(h||(h=[])).push(e):"interval"===c?(dr('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),h=u.encodings):(d??(d=[])).push(e);d||h||(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const t=e.fieldDef(p);if(t){let n=t.field;if(t.aggregate){dr(Pi(p,t.aggregate));continue}if(!n){dr(Bi(p));continue}if(t.timeUnit&&!wr(t.timeUnit)){n=e.vgField(p);const i={timeUnit:t.timeUnit,as:n,field:t.field};a[oe(i)]=i}if(!o[n]){const i={field:n,channel:p,type:"interval"===c&&Pn(p)&&po(e.getScaleComponent(p).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===pl,Dt(p)?(i.geoChannel=p,i.channel=St(p),r.hasChannel[i.channel]=o[n]):r.hasChannel[p]=o[n]}}else dr(Bi(p))}for(const p of d??[]){if(r.hasField[p])continue;const e={type:"E",field:p,index:r.items.length};e.signals={...l(e,"data")},r.items.push(e),r.hasField[p]=e,r.hasSelectionId=r.hasSelectionId||p===pl}f&&(t.init=f.map((e=>r.items.map((t=>(0,j.Gv)(e)?void 0!==e[t.geoChannel||t.channel]?e[t.geoChannel||t.channel]:e[t.field]:e))))),ve(a)||(r.timeUnit=new yu(null,a))},signals:(e,t,n)=>{const i=t.name+vu;return n.filter((e=>e.name===i)).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(su)})}},_u=xu,wu={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(!Pn(r))continue;const o=e.getScaleComponent(r),a=o?o.get("type"):void 0;o&&po(a)?(o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)):dr("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||Eu(e)||0===i.length)return n;const r=n.filter((e=>e.name===t.name))[0];let o=r.update;if(o.indexOf(Of)>=0)r.update=`{${i.map((e=>`${(0,j.r$)(Me(e.field))}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of i){const t=`${(0,j.r$)(Me(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&&!Eu(e))for(const i of t.scales){const e=n.filter((e=>e.name===i.signals.data))[0];e.push="outer",delete e.value,delete e.update}return n}},ku=wu;function $u(e,t){return`domain(${(0,j.r$)(e.scaleName(t))})`}function Eu(e){return e.parent&&wp(e.parent)&&(!e.parent.parent??Eu(e.parent.parent))}const Au="_brush",Su="_scale_trigger",Du="geo_interval_init_tick",Cu="_init",Mu={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=[pl],e.encodings||(e.encodings=n.value?be(n.value):[nt,tt]),n.select={type:"interval",...e}}if(t.translate&&!ku.defined(t)){const e=`!event.item || event.item.mark.name !== ${(0,j.r$)(t.name+Au)}`;for(const n of t.events){if(!n.between){dr(`${n} is not an ordered event stream for interval selections.`);continue}const t=(0,j.YO)((i=n.between[0]).filter??(i.filter=[]));t.indexOf(e)<0&&t.push(e)}}},signals:(e,t,n)=>{const i=t.name,r=i+Mf,o=xe(t.project.hasChannel).filter((e=>e.channel===We||e.channel===Ye)),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,j.r$)(r?e.scaleName(o):e.projectionName()),l=e=>`scale(${s}, ${e})`,c=e.getSizeSignalRef(o===We?"width":"height").signal,u=`${o}(unit)`,f=t.events.reduce(((e,t)=>[...e,{events:t.between[0],update:`[${u}, ${u}]`},{events:t,update:`[${a}[0], clamp(${u}, 0, ${c})]`}]),[]);if(r){const r=n.signals.data,c=ku.defined(t),u=e.getScaleComponent(o),d=u?u.get("type"):void 0,h=i?{init:lu(i,!0,l)}:{value:[]};return f.push({events:{signal:t.name+Su},update:po(d)?`[${l(`${r}[0]`)}, ${l(`${r}[1]`)}]`:"[0, 0]"}),c?[{name:r,on:[]}]:[{name:a,...h,on:f},{name:r,...i?{init:lu(i)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${s}, ${a})`}]}]}{const e=o===We?0:1,n=t.name+Cu;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,j.r$)(e.projectionName()),l=e.projectionName()+"_center",{x:c,y:u}=t.project.hasChannel,f=c&&c.signals.visual,d=u&&u.signals.visual,h=c?a&&a[c.index]:`${l}[0]`,p=u?a&&a[u.index]:`${l}[1]`,g=t=>e.getSizeSignalRef(t).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;if(a&&(n.unshift({name:i+Cu,init:`[scale(${s}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${s}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),!c||!u)){n.find((e=>e.name===l))||n.unshift({name:l,update:`invert(${s}, [${g("width")}/2, ${g("height")}/2])`})}const y=`vlSelectionTuples(${`intersect(${m}, {markname: ${(0,j.r$)(e.getName("marks"))}}, unit.mark)`}, ${`{unit: ${zf(e)}}`})`,v=o.map((e=>e.signals.visual));return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...a?[{signal:Du}]:[]],update:y}]})}{if(!ku.defined(t)){const t=i+Su,r=o.map((t=>{const n=t.channel,{data:i,visual:r}=t.signals,o=(0,j.r$)(e.scaleName(n)),a=po(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: ${zf(e)}, fields: ${i+vu}, values`;return n.concat({name:r,...a?{init:`{${l}: ${lu(a)}}`}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:`${s.join(" && ")} ? {${l}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(bp(e)&&e.hasProjection&&t.init){n.filter((e=>e.name===Du)).length||n.unshift({name:Du,value:null,on:[{events:"timer{1}",update:`${Du} === null ? {} : ${Du}`}]})}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,j.r$)(t.name+Cf)})`;if(ku.defined(t)||!r&&!o)return n;const c={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 be(c))c[g]=[{test:`${l}.length && ${l}[0].unit === ${zf(e)}`,...c[g]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=t.mark,p=be(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)),{});return[{name:`${i+Au}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:i+Au,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}},Fu=Mu;const Ou={defined:e=>"point"===e.type,signals:(e,t,n)=>{const i=t.name,r=i+vu,o=t.project,a="(item().isVoronoi ? datum.datum : datum)",s=xe(e.component.selection??{}).reduce(((e,t)=>"interval"===t.type?e.concat(t.name+Au):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 c=`unit: ${zf(e)}, `;if(t.project.hasSelectionId)c+=`${pl}: ${a}[${(0,j.r$)(pl)}]`;else{c+=`fields: ${r}, values: [${o.items.map((t=>{const n=e.fieldDef(t.channel);return n?.bin?`[${a}[${(0,j.r$)(e.vgField(t.channel,{}))}], ${a}[${(0,j.r$)(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${a}[${(0,j.r$)(t.field)}]`})).join(", ")}]`}const u=t.events;return n.concat([{name:i+Mf,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}},Tu=Ou;function zu(e,t,n,i){const r=Na(t)&&t.condition,o=i(t);if(r){const t=(0,j.YO)(r).map((t=>{const n=i(t);if(function(e){return e.param}(t)){const{param:i,empty:r}=t;return{test:Uf(e,{param:i,empty:r}),...n}}return{test:Gf(e,t.test),...n}}));return{[n]:[...t,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Nu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const n=e.encoding[t];return zu(e,n,t,(t=>Ru(t,e.config)))}function Ru(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(e){if(Ya(e))return vi(e.value);if(Ga(e)){const{format:i,formatType:r}=as(e);return fa({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function Bu(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,j.cy)(a))return{tooltip:Lu({tooltip:a},o,r,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return zu(e,a,"tooltip",(e=>{const a=Ru(e,r,s);if(a)return a;if(null===e)return;let l=ki("tooltip",i,r);return!0===l&&(l={content:"encoding"}),(0,j.Kg)(l)?{value:l}:(0,j.Gv)(l)?ci(l)?l:"encoding"===l.content?Lu(n,o,r,t):{signal:s}:void 0}))}}function Pu(e,t,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r={...n,...n.tooltipFormat},o={},a=i?"datum.datum":"datum",s=[];function l(n,i){const l=Ht(i),c=Wa(n)?n:{...n,type:e[l].type},u=c.title||os(c,r),f=(0,j.YO)(u).join(", ").replaceAll(/"/g,'\\"');let d;if(xn(i)){const t="x"===i?"x2":"y2",n=ss(e[t]);if(ti(c.bin)&&n){const e=Ja(c,{expr:a}),i=Ja(n,{expr:a}),{format:s,formatType:l}=as(c);d=ba(e,i,s,l,r),o[t]=!0}}if((xn(i)||i===Ze||i===Qe)&&t&&t.fieldChannel===i&&"normalize"===t.offset){const{format:e,formatType:t}=as(c);d=fa({fieldOrDatumDef:c,format:e,formatType:t,expr:a,config:r,normalizeStack:!0}).signal}d??(d=Ru(c,r,a).signal),s.push({channel:i,key:f,value:d})}Ns(e,((e,t)=>{Pa(e)?l(e,t):Ra(e)&&l(e.condition,t)}));const c={};for(const{channel:u,key:f,value:d}of s)o[u]||c[f]||(c[f]=d);return c}function Lu(e,t,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Pu(e,t,n,{reactiveGeom:i}),o=_e(r).map((e=>{let[t,n]=e;return`"${t}": ${n}`}));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function Iu(e){const{markDef:t,config:n}=e,i=ki("aria",t,n);return!1===i?{}:{...i?{aria:i}:{},...ju(e),...Uu(e)}}function ju(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const r=ki("ariaRoleDescription",n,i);return null!=r?{ariaRoleDescription:{value:r}}:t in hi?{}:{ariaRoleDescription:{value:t}}}function Uu(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return zu(e,o,"description",(t=>Ru(t,e.config)));const a=ki("description",n,i);if(null!=a)return{description:vi(a)};if(!1===i.aria)return{};const s=Pu(t,r,i);return ve(s)?void 0:{description:{signal:_e(s).map(((e,t)=>{let[n,i]=e;return`"${t>0?"; ":""}${n}: " + (${i})`})).join(" + ")}}}function qu(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;void 0===s&&(l??(l=ki(e,i,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==l&&(s=vi(l)));const c=r[e];return zu(t,c,a??e,(n=>aa({channel:e,channelDef:n,markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function Gu(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??ki("filled",n,r),s=se(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=ki(!0===a?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[!0===a&&"color"]??s,c=ki(!1===a?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[!1===a&&"color"],u=a?"fill":"stroke",f={...l?{fill:vi(l)}:{},...c?{stroke:vi(c)}:{}};return n.color&&(a?n.fill:n.stroke)&&dr(Hi("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...qu("color",e,{vgChannel:u,defaultValue:a?l:c}),...qu("fill",e,{defaultValue:i.fill?l:void 0}),...qu("stroke",e,{defaultValue:i.stroke?c:void 0})}}function Wu(e){const{encoding:t,mark:n}=e,i=t.order;return!Go(n)&&Ya(i)?zu(e,i,"zindex",(e=>vi(e.value))):{}}function Yu(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:vi(s),bandPosition:o})}}const c=n[a];return c?{offsetType:"visual",offset:c}:{}}function Hu(e,t,n){let{defaultPos:i,vgChannel:r}=n;const{encoding:o,markDef:a,config:s,stack:l}=t,c=o[e],u=o[Vt(e)],f=t.scaleName(e),d=t.getScaleComponent(e),{offset:h,offsetType:p}=Yu({channel:e,markDef:a,encoding:o,model:t,bandPosition:.5}),g=Xu({model:t,defaultPos:i,channel:e,scaleName:f,scale:d}),m=!c&&xn(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(Ga(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 ta(e)}({channel:e,channelDef:c,channel2Def:u,markDef:a,config:s,scaleName:f,scale:d,stack:l,offset:h,defaultRef:g,bandPosition:"encoding"===p?0:void 0});return m?{[r||e]:m}:void 0}function Xu(e){let{model:t,defaultPos:n,channel:i,scaleName:r,scale:o}=e;const{markDef:a,config:s}=t;return()=>{const e=Ht(i),l=Xt(i),c=ki(i,a,s,{vgChannel:l});if(void 0!==c)return sa(i,c);switch(n){case"zeroOrMin":case"zeroOrMax":if(r){const e=o.get("type");if(se([to.LOG,to.TIME,to.UTC],e));else if(o.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===n)return"y"===e?{field:{group:"height"}}:{value:0};switch(e){case"radius":return{signal:`min(${t.width.signal},${t.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...t[Kt(i)],mult:.5}}}}const Vu={left:"x",center:"xc",right:"x2"},Ku={top:"y",middle:"yc",bottom:"y2"};function Qu(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===e||"theta"===e)return Xt(e);const r="x"===e?"align":"baseline",o=ki(r,t,n);let a;return ci(o)?(dr(function(e){return`The ${e} for range marks cannot be an expression`}(r)),a=void 0):a=o,"x"===e?Vu[a||("top"===i?"left":"center")]:Ku[a||i]}function Ju(e,t,n){let{defaultPos:i,defaultPos2:r,range:o}=n;return o?Zu(e,t,{defaultPos:i,defaultPos2:r}):Hu(e,t,{defaultPos:i})}function Zu(e,t,n){let{defaultPos:i,defaultPos2:r}=n;const{markDef:o,config:a}=t,s=Vt(e),l=Kt(e),c=function(e,t,n){const{encoding:i,mark:r,markDef:o,stack:a,config:s}=e,l=Ht(n),c=Kt(n),u=Xt(n),f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=Yu(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=Kt(n),i=e.markDef[t];return null!=i?{[t]:{value:i}}:{[u]:{field:e.getName(n)}}}const g=function(e){let{channel:t,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:l,offset:c,defaultRef:u}=e;if(Ga(n)&&l&&t.charAt(0)===l.fieldChannel.charAt(0))return ra(n,a,{suffix:"start"},{offset:c});return ta({channel:t,channelDef:i,scaleName:a,scale:s,stack:l,markDef:r,config:o,offset:c,defaultRef:u})}({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==g)return{[u]:g};return ef(n,o)||ef(n,{[n]:Ei(n,o,s.style),[c]:Ei(c,o,s.style)})||ef(n,s[r])||ef(n,s.mark)||{[u]:Xu({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,s);return{...Hu(e,t,{defaultPos:i,vgChannel:c[l]?Qu(e,o,a):Xt(e)}),...c}}function ef(e,t){const n=Kt(e),i=Xt(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(!Qo(i))return{[n]:sa(e,i)};dr(function(e){return`Position range does not support relative band size for ${e}.`}(n))}}function tf(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,a=Vt(t),s=Kt(t),l=i[t],c=i[a],u=e.getScaleComponent(t),f=u?u.get("type"):void 0,d=r.orient,h=i[s]??i.size??ki("size",r,n,{vgChannel:s}),p=Qt(t),g="bar"===o&&("x"===t?"vertical"===d:"horizontal"===d);return!Pa(l)||!(ei(l.bin)||ti(l.bin)||l.timeUnit&&!c)||h&&!Qo(h)||i[p]||ho(f)?(Ga(l)&&ho(f)||g)&&!c?function(e,t,n){const{markDef:i,encoding:r,config:o,stack:a}=n,s=i.orient,l=n.scaleName(t),c=n.getScaleComponent(t),u=Kt(t),f=Vt(t),d=Qt(t),h=n.scaleName(d),p=n.getScaleComponent(Jt(t)),g="horizontal"===s&&"y"===t||"vertical"===s&&"x"===t;let m;(r.size||i.size)&&(g?m=qu("size",n,{vgChannel:u,defaultRef:vi(i.size)}):dr(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(i.type)));const y=!!m,v=Oa({channel:t,fieldDef:e,markDef:i,config:o,scaleType:c?.get("type"),useVlSizeChannel:g});m=m||{[u]:nf(u,h||l,p||c,o,v,!!e,i.type)};const b="band"===c?.get("type")&&Qo(v)&&!y?"top":"middle",x=Qu(t,i,o,b),_="xc"===x||"yc"===x,{offset:w,offsetType:k}=Yu({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),$=ta({channel:t,channelDef:e,markDef:i,config:o,scaleName:l,scale:c,stack:a,offset:w,defaultRef:Xu({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:c}),bandPosition:_?"encoding"===k?0:.5:ci(v)?{signal:`(1-${v})/2`}:Qo(v)?(1-v.band)/2:0});if(u)return{[x]:$,...m};{const e=Xt(f),t=m[u],n=w?{...t,offset:w}:t;return{[x]:$,[e]:(0,j.cy)($)?[$[0],{...$[1],offset:n}]:{...$,offset:n}}}}(l,t,e):Zu(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),c=r.scaleName(i),u=l?l.get("type"):void 0,f=l.get("reverse"),d=Oa({channel:i,fieldDef:t,markDef:a,config:o,scaleType:u}),h=r.component.axes[i]?.[0],p=h?.get("translate")??.5,g=xn(i)?ki("binSpacing",a,o)??0:0,m=Vt(i),y=Xt(i),v=Xt(m),b=$i("minBandSize",a,o),{offset:x}=Yu({channel:i,markDef:a,encoding:s,model:r,bandPosition:0}),{offset:_}=Yu({channel:m,markDef:a,encoding:s,model:r,bandPosition:0}),w=function(e){let{scaleName:t,fieldDef:n}=e;const i=Ja(n,{expr:"datum"});return`abs(scale("${t}", ${Ja(n,{expr:"datum",suffix:"end"})}) - scale("${t}", ${i}))`}({fieldDef:t,scaleName:c}),k=rf(i,g,f,p,x,b,w),$=rf(m,g,f,p,_??x,b,w),E=ci(d)?{signal:`(1-${d.signal})/2`}:Qo(d)?(1-d.band)/2:.5;if(ei(t.bin)||t.timeUnit)return{[v]:of({fieldDef:t,scaleName:c,bandPosition:E,offset:$}),[y]:of({fieldDef:t,scaleName:c,bandPosition:ci(E)?{signal:`1-${E.signal}`}:1-E,offset:k})};if(ti(t.bin)){const e=ra(t,c,{},{offset:$});if(Pa(n))return{[v]:e,[y]:ra(n,c,{},{offset:k})};if(ni(t.bin)&&t.bin.step)return{[v]:e,[y]:{signal:`scale("${c}", ${Ja(t,{expr:"datum"})} + ${t.bin.step})`,offset:k}}}return void dr(lr(m))}({fieldDef:l,fieldDef2:c,channel:t,model:e})}function nf(e,t,n,i,r,o,a){if(Qo(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=$i("minBandSize",{type:a},i);return{signal:n?`max(${xi(n)}, ${e})`:e}}1!==r.band&&(dr(function(e){return`Cannot use the relative band size with ${e} scale.`}(e)),r=void 0)}}else{if(ci(r))return r;if(r)return{value:r}}if(n){const e=n.get("range");if(ui(e)&&(0,j.Et)(e.step))return{value:e.step-2}}if(!o){const{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:r}=i.scale,o=ze(t,"bar"===a?n:r);if(ci(o))return{signal:`(1 - (${o.signal})) * ${e}`};if((0,j.Et)(o))return{signal:`${1-o} * ${e}`}}return{value:Dl(i.view,e)-2}}function rf(e,t,n,i,r,o,a){if(Et(e))return 0;const s="x"===e||"y2"===e,l=s?-t/2:t/2;if(ci(n)||ci(r)||ci(i)||o){const e=xi(n),t=xi(r),c=xi(i),u=xi(o),f=o?`(${a} < ${u} ? ${s?"":"-"}0.5 * (${u} - (${a})) : ${l})`:l;return{signal:(c?`${c} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${f})`:f)}}return r=r||0,i+(n?-r-l:+r+l)}function of(e){let{fieldDef:t,scaleName:n,bandPosition:i,offset:r}=e;return oa({scaleName:n,fieldOrDatumDef:t,bandPosition:i,offset:r})}const af=new Set(["aria","width","height"]);function sf(e,t){const{fill:n,stroke:i}="include"===t.color?Gu(e):{};return{...cf(e.markDef,t),...lf(e,"fill",n),...lf(e,"stroke",i),...qu("opacity",e),...qu("fillOpacity",e),...qu("strokeOpacity",e),...qu("strokeWidth",e),...qu("strokeDash",e),...Wu(e),...Bu(e),...Nu(e,"href"),...Iu(e)}}function lf(e,t,n){const{config:i,mark:r,markDef:o}=e;if("hide"===ki("invalid",o,i)&&n&&!Go(r)){const i=function(e,t){let{invalid:n=!1,channels:i}=t;const r=i.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),o=e.vgField(n,{expr:"datum"});o&&po(r)&&(t[o]=!0)}return t}),{}),o=be(r);if(o.length>0){const e=n?"||":"&&";return o.map((e=>ia(e,n))).join(` ${e} `)}return}(e,{invalid:!0,channels:Bn});if(i)return{[t]:[{test:i,value:null},...(0,j.YO)(n)]}}return n?{[t]:n}:{}}function cf(e,t){return di.reduce(((n,i)=>(af.has(i)||void 0===e[i]||"ignore"===t[i]||(n[i]=vi(e[i])),n)),{})}function uf(e){const{config:t,markDef:n}=e;if(ki("invalid",n,t)){const t=function(e,t){let{invalid:n=!1,channels:i}=t;const r=i.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),o=e.vgField(n,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});o&&po(r)&&(t[o]=!0)}return t}),{}),o=be(r);if(o.length>0){const e=n?"||":"&&";return o.map((e=>ia(e,n))).join(` ${e} `)}return}(e,{channels:bn});if(t)return{defined:{signal:t}}}return{}}function ff(e,t){if(void 0!==t)return{[e]:vi(t)}}const df="voronoi",hf={defined:e=>"point"===e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(df)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(Go(o))return dr(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(df),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...Bu(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.indexOf(df)>=0&&(l=!0)})),l||n.splice(s+1,0,a),n}},pf=hf,gf={defined:e=>"point"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!ml(e.bind),parse:(e,t,n)=>Rf(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,a=t.init&&t.init[0],s=pf.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((e,r)=>{const l=ke(`${i}_${e.field}`);n.filter((e=>e.name===l)).length||n.unshift({name:l,...a?{init:lu(a[r])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${(0,j.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.filter((e=>e.name===i+Mf))[0],a=i+vu,s=r.items.map((e=>ke(`${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}},mf=gf,yf="_toggle",vf={defined:e=>"point"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+yf,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Mf,i=t.name+yf;return`${i} ? null : ${n}, `+("global"===t.resolve?`${i} ? null : true, `:`${i} ? null : {unit: ${zf(e)}}, `)+`${i} ? ${n} : null`}},bf={defined:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t)=>{t.clear&&(t.clear=(0,j.Kg)(t.clear)?(0,au.P)(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(mf.defined(t))for(const i of t.project.items){const e=n.findIndex((e=>e.name===ke(`${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+Mf));i(e,"null"),vf.defined(t)&&(e=n.findIndex((e=>e.name===t.name+yf)),i(e,"false"))}return n}},xf={defined:e=>{const t="global"===e.resolve&&e.bind&&ml(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==pl;return t&&!n&&dr("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n)=>{const i=ee(n);if(i.select=(0,j.Kg)(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},Rf(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,j.YO)(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}const r=yl(t.bind)?t.bind.legend:"click",o=(0,j.Kg)(r)?(0,au.P)(r,"view"):(0,j.YO)(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=yl(t.bind)&&t.bind.legend,o=e=>t=>{const n=ee(t);return n.markname=e,n};for(const a of t.project.items){if(!a.hasLegend)continue;const e=`${ke(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+Mf)),a=i+vu,s=r.items.filter((e=>e.hasLegend)).map((e=>ke(`${i}_${ke(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 c=n.find((e=>e.name===i+yf)),u=yl(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:u}):c.on[0].events=u),n}};const _f="_translate_anchor",wf="_translate_delta",kf={defined:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const i=t.name,r=ku.defined(t),o=i+_f,{x:a,y:s}=t.project.hasChannel;let l=(0,au.P)(t.translate,"scope");return r||(l=l.map((e=>(e.between[0].markname=i+Au,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?$u(e,We):`slice(${a.signals.visual})`}`:"")+(void 0!==s?`, extent_y: ${r?$u(e,Ye):`slice(${s.signals.visual})`}`:"")+"}"}]},{name:i+wf,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&$f(e,t,a,"width",n),void 0!==s&&$f(e,t,s,"height",n),n}};function $f(e,t,n,i,r){const o=t.name,a=o+_f,s=o+wf,l=n.channel,c=ku.defined(t),u=r.filter((e=>e.name===n.signals[c?"data":"visual"]))[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=`${a}.extent_${l}`,m=`${c&&d?"log"===h?"panLog":"symlog"===h?"panSymlog":"pow"===h?"panPow":"panLinear":"panLinear"}(${g}, ${`${c?l===We?p?"":"-":p?"-":"":""}${s}.${l} / ${c?`${f}`:`span(${g})`}`}${c?"pow"===h?`, ${d.get("exponent")??1}`:"symlog"===h?`, ${d.get("constant")??1}`:"":""})`;u.on.push({events:{signal:s},update:c?m:`clampRange(${m}, 0, ${f})`})}const Ef="_zoom_anchor",Af="_zoom_delta",Sf={defined:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=ku.defined(t),o=i+Af,{x:a,y:s}=t.project.hasChannel,l=(0,j.r$)(e.scaleName(We)),c=(0,j.r$)(e.scaleName(Ye));let u=(0,au.P)(t.zoom,"scope");return r||(u=u.map((e=>(e.markname=i+Au,e)))),n.push({name:i+Ef,on:[{events:u,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter((e=>e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&Df(e,t,a,"width",n),void 0!==s&&Df(e,t,s,"height",n),n}};function Df(e,t,n,i,r){const o=t.name,a=n.channel,s=ku.defined(t),l=r.filter((e=>e.name===n.signals[s?"data":"visual"]))[0],c=e.getSizeSignalRef(i).signal,u=e.getScaleComponent(a),f=u&&u.get("type"),d=s?$u(e,a):l.name,h=o+Af,p=`${s&&u?"log"===f?"zoomLog":"symlog"===f?"zoomSymlog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${d}, ${`${o}${Ef}.${a}`}, ${h}${s?"pow"===f?`, ${u.get("exponent")??1}`:"symlog"===f?`, ${u.get("constant")??1}`:"":""})`;l.on.push({events:{signal:h},update:s?p:`clampRange(${p}, 0, ${c})`})}const Cf="_store",Mf="_tuple",Ff="_modify",Of="vlSelectionResolve",Tf=[Tu,Fu,_u,vf,mf,ku,xf,bf,kf,Sf,pf];function zf(e){let{escape:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{escape:!0},n=t?(0,j.r$)(e.name):e.name;const i=function(e){let t=e.parent;for(;t&&!xp(t);)t=t.parent;return t}(e);if(i){const{facet:e}=i;for(const t of Tt)e[t]&&(n+=` + '__facet_${t}_' + (facet[${(0,j.r$)(i.vgField(t))}])`)}return n}function Nf(e){return xe(e.component.selection??{}).reduce(((e,t)=>e||t.project.hasSelectionId),!1)}function Rf(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 Bf=n(66906);function Pf(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...Pf(e.object)),t.push(...Pf(e.property))),t)}function Lf(e){return"MemberExpression"===e.object.type?Lf(e.object):"datum"===e.object.name}function If(e){const t=(0,Bf.YK)(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&Lf(e)&&n.add(Pf(e).slice(1).join("."))})),n}class jf extends hu{clone(){return new jf(null,this.model,ee(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=Gf(this.model,this.filter,this),this._dependentFields=If(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Uf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum";const r=(0,j.Kg)(t)?t:t.param,o=ke(r),a=(0,j.r$)(o+Cf);let s;try{s=e.getSelectionComponent(o,r)}catch(u){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,j.r$)(s.resolve)})`}`,c=`length(data(${a}))`;return!1===t.empty?`${c} && ${l}`:`!${c} || ${l}`}function qf(e,t,n){const i=ke(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,dr((e.length?"Multiple ":"No ")+`matching ${(0,j.r$)(r)} encoding found for selection ${(0,j.r$)(n.param)}. `+`Using "field": ${(0,j.r$)(a)}.`)):a=e[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&dr(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${(0,j.r$)(a)}.`);return`${o.name}[${(0,j.r$)(Me(a))}]`}function Gf(e,t,n){return $e(t,(t=>(0,j.Kg)(t)?t:function(e){return e?.param}(t)?Uf(e,t,n):Gr(t)))}function Wf(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 Yf(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:c,...u}=e.combine();if(!r){for(const e in u){const n=_s[e],i=u[e];if(n&&n!==t&&"both"!==n)delete u[e];else if(bs(i)){const{condition:t,...n}=i,r=(0,j.YO)(t),o=vs[e];if(o){const{vgProp:t,part:i}=o;Wf(u,i,t,[...r.map((e=>{const{test:t,...n}=e;return{test:Gf(null,t),...n}})),n]),delete u[e]}else if(null===o){const t={signal:r.map((e=>{const{test:t,...n}=e;return`${Gf(null,t)} ? ${bi(n)} : `})).join("")+bi(n)};u[e]=t}}else if(ci(i)){const t=vs[e];if(t){const{vgProp:n,part:r}=t;Wf(u,r,n,i),delete u[e]}}se(["labelAlign","labelBaseline"],e)&&null===u[e]&&delete u[e]}if("grid"===t){if(!u.grid)return;if(u.encode){const{grid:e}=u.encode;u.encode={...e?{grid:e}:{}},ve(u.encode)&&delete u.encode}return{scale:a,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ze(c,0)}}{if(!i.header&&e.mainExtracted)return;if(void 0!==s){let e=s;u.encode?.labels?.update&&ci(u.encode.labels.update.text)&&(e=Fe(s,"datum.label",u.encode.labels.update.text.signal)),Wf(u,"labels","text",{signal:e})}if(null===u.labelAlign&&delete u.labelAlign,u.encode){for(const t of xs)e.hasAxisPart(t)||delete u.encode[t];ve(u.encode)&&delete u.encode}const t=function(e,t){if(e)return(0,j.cy)(e)&&!li(e)?e.map((e=>os(e,t))).join(", "):e}(l,n);return{scale:a,orient:o,grid:!1,...t?{title:t}:{},...u,...!1===n.aria?{aria:!1}:{},zindex:ze(c,0)}}}}function Hf(e){const{axes:t}=e.component,n=[];for(const i of bn)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 Xf(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([...be(r),...be(o)]),s={};for(const t of a.values())s[t]={signal:`${i.signal} === "${e}" ? ${xi(r[t])} : ${xi(o[t])}`};return s}return t[e]}))])}function Vf(e,t){const n=[{}];for(const i of e){let e=t[i]?.style;if(e){e=(0,j.YO)(e);for(const i of e)n.push(t.style[i])}}return Object.assign.apply(null,n)}function Kf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Ai(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 Qf={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!ho(e)&&Pa(t)&&!ei(t?.bin)&&!ti(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||ed(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||Zf(n,i,r)},labelFlush:e=>{let{axis:t,fieldOrDatumDef:n,channel:i}=e;return t.labelFlush??function(e,t){if("x"===t&&se(["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,j.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&&!ho(n)&&"log"!==n){if(Pa(t)){if(ei(t.bin))return{signal:`ceil(${i.signal}/10)`};if(t.timeUnit&&se(["month","hours","day","quarter"],Fr(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=Or(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=td(n,i);if(void 0!==r)return r;const o=n.typedFieldDef(i),a="x"===i?"x2":"y2",s=n.fieldDef(a);return Di(o?[Ca(o)]:[],Pa(s)?[Ca(s)]:[])},values:e=>{let{axis:t,fieldOrDatumDef:n}=e;return function(e,t){const n=e.values;if((0,j.cy)(n))return ms(t,n);if(ci(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&&Za(t))return 1;return 0}(i,n)}};function Jf(e){return`(((${e.signal} % 360) + 360) % 360)`}function Zf(e,t,n,i){if(void 0!==e){if("x"===n){if(ci(e)){const n=Jf(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${ci(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(ci(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(ci(e)){const n=Jf(e);return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${ci(t)?`(${t.signal} === "left")`:"left"===t} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(ci(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 ed(e,t,n){if(void 0===e)return;const i="x"===n,r=i?0:90,o=i?"bottom":"left";if(ci(e)){const n=Jf(e);return{signal:`(${r?`(${n} + 90)`:n} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${n} && ${n} < ${180+r}) === ${ci(t)?`(${t.signal} === "${o}")`:t===o} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(ci(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 td(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?Ci(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class nd extends hu{clone(){return new nd(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=If(this.transform.calculate)}static parseAllForSortIndex(e,t){return t.forEachFieldDef(((t,n)=>{if(Ha(t)&&Ea(t.sort)){const{field:i,timeUnit:r}=t,o=t.sort,a=o.map(((e,t)=>`${Gr({field:i,timeUnit:r,equal:e})} ? ${t} : `)).join("")+o.length;e=new nd(e,{calculate:a,as:id(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 ${oe(this.transform)}`}}function id(e,t,n){return Ja(e,{prefix:t,suffix:"sort_index",...n??{}})}function rd(e,t){return se(["top","bottom"],t)?"column":se(["left","right"],t)||"row"===e?"row":"column"}function od(e,t,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return ze((t||{})[e],r[e],n.header[e])}function ad(e,t,n,i){const r={};for(const o of e){const e=od(o,t||{},n,i);void 0!==e&&(r[o]=e)}return r}const sd=["row","column"],ld=["header","footer"];function cd(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}=ad(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),l=rd(t,s),c=Ie(a);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...fd(c,l),...ud(l,c,o),...vd(i,r,t,cl,sl)}}}function ud(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=ed(t,"row"===e?"left":"top","row"===e?"y":"x");return n?{align:n}:{}}function fd(e,t){const n=Zf(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function dd(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of ld)if(n[r])for(const o of n[r]){const a=gd(e,t,r,n,o);null!=a&&i.push(a)}return i}function hd(e,t){const{sort:n}=e;return $a(n)?{field:Ja(n,{expr:"datum"}),order:n.order??"ascending"}:(0,j.cy)(n)?{field:id(e,t,{expr:"datum"}),order:"ascending"}:{field:Ja(e,{expr:"datum"}),order:n??"ascending"}}function pd(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:l}=ad(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),c=fa({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,u=rd(t,s);return{text:{signal:l?Fe(Fe(l,"datum.label",c),"datum.value",Ja(e,{expr:"parent"})):c},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...fd(o,u),...ud(u,o,a),...vd(n,e,t,ul,ll)}}function gd(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}=ad(["labelOrient"],a.header,s,t);("row"===t&&!se(["top","bottom"],e)||"column"===t&&!se(["left","right"],e))&&(o=pd(a,t,s))}const l=xp(e)&&!Aa(e.facet),c=r.axes,u=c?.length>0;if(o||u){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:hd(a,t)}:{},...u&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[s]:r.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const md={column:{start:0,end:1},row:{start:1,end:0}};function yd(e,t){return md[t][e]}function vd(e,t,n,i,r){const o={};for(const a of i){if(!r[a])continue;const i=od(a,t?.header,e,n);void 0!==i&&(o[r[a]]=i)}return o}function bd(e){return[...xd(e,"width"),...xd(e,"height"),...xd(e,"childWidth"),...xd(e,"childHeight")]}function xd(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(ho(i)&&ui(o)){const i=e.scaleName(n);if(xp(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[_d(i,o)]}return[_d(i,o),{name:r,update:wd(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} : ${Sl(e.config.view,t?"width":"height")}`;return[{name:r,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:r,value:i}]}function _d(e,t){const n=`${e}_step`;return ci(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function wd(e,t,n){const i=t.get("type"),r=t.get("padding"),o=ze(t.get("paddingOuter"),r);let a=t.get("paddingInner");return a="band"===i?void 0!==a?a:r:1,`bandspace(${n}, ${xi(a)}, ${xi(o)}) * ${e}_step`}function kd(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function $d(e,t){return be(e).reduce(((n,i)=>{const r=e[i];return{...n,...zu(t,r,i,(e=>vi(e.value)))}}),{})}function Ed(e,t){if(xp(t))return"theta"===e?"independent":"shared";if(wp(t))return"shared";if(_p(t))return xn(e)||"theta"===e||"radius"===e?"independent":"shared";throw new Error("invalid model type for resolve")}function Ad(e,t){const n=e.scale[t],i=xn(t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&dr(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 Sd={...hl,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Dd=be(Sd);class Cd extends Wc{}const Md={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:c,mark:u}=i,f=s.filled&&"trail"!==u;let d={..._i({},i,Xo),...Gu(i,{filled:f})};const h=o.get("symbolOpacity")??c.legend.symbolOpacity,p=o.get("symbolFillColor")??c.legend.symbolFillColor,g=o.get("symbolStrokeColor")??c.legend.symbolStrokeColor,m=void 0===h?Fd(l.opacity)??s.opacity:void 0;if(d.fill)if("fill"===r||f&&r===ot)delete d.fill;else if(d.fill.field)p?delete d.fill:(d.fill=vi(c.legend.symbolBaseFillColor??"black"),d.fillOpacity=vi(m??1));else if((0,j.cy)(d.fill)){const e=Od(l.fill??l.color)??s.fill??(f&&s.color);e&&(d.fill=vi(e))}if(d.stroke)if("stroke"===r||!f&&r===ot)delete d.stroke;else if(d.stroke.field||g)delete d.stroke;else if((0,j.cy)(d.stroke)){const e=ze(Od(l.stroke||l.color),s.stroke,f?s.color:void 0);e&&(d.stroke={value:e})}if(r!==ft){const e=Pa(n)&&zd(i,o,n);e?d.opacity=[{test:e,...vi(m??1)},vi(c.legend.unselectedOpacity)]:m&&(d.opacity=vi(m))}return d={...d,...e},ve(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 c=void 0===(r.get("gradientOpacity")??o.legend.gradientOpacity)?Fd(s.opacity)||a.opacity:void 0;c&&(l.opacity=vi(c));return l={...l,...e},ve(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)?zd(i,o,n):void 0,c=l?[{test:l,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:u,formatType:f}=a;let d;la(f)?d=ha({fieldOrDatumDef:n,field:"datum.value",format:u,formatType:f,config:s}):void 0===u&&void 0===f&&s.customFormatTypes&&("quantitative"===n.type&&s.numberFormatType?d=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={...c?{opacity:c}:{},...d?{text:d}:{},...e};return ve(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 Fd(e){return Td(e,((e,t)=>Math.max(e,t.value)))}function Od(e){return Td(e,((e,t)=>ze(e,t.value)))}function Td(e,t){return function(e){const t=e?.condition;return!!t&&((0,j.cy)(t)||Ya(t))}(e)?(0,j.YO)(e.condition).reduce(t,e.value):Ya(e)?e.value:void 0}function zd(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=(0,j.r$)(n.field);return i.map((e=>`(!length(data(${(0,j.r$)(ke(e)+Cf)})) || (${e}[${r}] && indexof(${e}[${r}], datum.value) >= 0))`)).join(" || ")}const Nd={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 ga(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:c}=t;if(go(o))return"horizontal"===i?"top"===r||"bottom"===r?Pd(n,"width",s,a):s:Pd(n,"height",c,l);return}(e)},labelOverlap:e=>{let{legend:t,legendConfig:n,scaleType:i}=e;return t.labelOverlap??n.labelOverlap??function(e){if(se(["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=Od(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 is(t,n,{allowDisabling:!0})},type:e=>{let{legendType:t,scaleType:n,channel:i}=e;if(Ft(i)&&go(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,j.cy)(n))return ms(t,n);if(ci(n))return n;return}(n,t)}};function Rd(e){const{legend:t}=e;return ze(t.type,function(e){let{channel:t,timeUnit:n,scaleType:i}=e;if(Ft(t)){if(se(["quarter","month","day"],n))return"symbol";if(go(i))return"gradient"}return"symbol"}(e))}function Bd(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 Pd(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Ld(e){const t=bp(e)?function(e){const{encoding:t}=e,n={};for(const i of[ot,...dl]){const r=ls(t[i]);r&&e.getScaleComponent(i)&&(i===lt&&Pa(r)&&r.type===eo||(n[i]=jd(e,i)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Ld(i);for(const r of be(i.component.legends))n.legend[r]=Ad(e.component.resolve,r),"shared"===n.legend[r]&&(t[r]=Ud(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of be(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 Id(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 jd(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,a=o.legend,s=new Cd({},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 xe(e.component.selection??{})){const e=r.project.hasField[i]??r.project.hasChannel[t];if(e&&xf.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 c=e.getScaleComponent(t).get("type"),u=ls(r[t]),f=Pa(u)?Fr(u.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=Rd({legend:n,channel:t,timeUnit:f,scaleType:c}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:u,legendConfig:a,config:o,scaleType:c,orient:d,legendType:h,direction:Bd({legend:n,legendType:h,orient:d,legendConfig:a})};for(const b of Dd){if("gradient"===h&&b.startsWith("symbol")||"symbol"===h&&b.startsWith("gradient"))continue;const i=b in Nd?Nd[b](p):n[b];if(void 0!==i){const r=Id(i,b,n,e.fieldDef(t));(r||void 0===o.legend[b])&&s.set(b,i,r)}}const g=n?.encoding??{},m=s.get("selections"),y={},v={fieldOrDatumDef:u,model:e,channel:t,legendCmpt:s,legendType:h};for(const b of["labels","legend","title","symbols","gradient","entries"]){const t=$d(g[b]??{},e),n=b in Md?Md[b](t,v):t;void 0===n||ve(n)||(y[b]={...m?.length&&Pa(u)?{name:`${ke(u.field)}_legend_${b}`}:{},...m?.length?{interactive:!!m}:{},update:n})}return ve(y)||s.set("encode",y,!!n?.encoding),s}function Ud(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 Dd){const n=Kc(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",((e,t)=>{switch(o){case"symbolType":return qd(e,t);case"title":return Mi(e,t);case"type":return r=!0,Hc("symbol")}return Vc(e,t,o,"legend")}));e.setWithExplicit(o,n)}return r&&(e.implicit?.encode?.gradient&&Ee(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&Ee(e.explicit,["encode","gradient"])),e}function qd(e,t){return"circle"===t.value?t:e}function Gd(e){const t=e.component.legends,n={};for(const i of be(t)){const r=e.getScaleComponent(i),o=re(r.get("domains"));if(n[o])for(const e of n[o]){Ud(e,t[i])||n[o].push(t[i])}else n[o]=[t[i].clone()]}return xe(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 dl)o[t]&&delete e[t]}o.title||delete o.title;if(void 0!==i){let e=i;o.encode?.labels?.update&&ci(o.encode.labels.update.text)&&(e=Fe(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 Wd(e){return wp(e)||_p(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),Yd(e))}(e):Yd(e)}function Yd(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=ci(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return se(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 Hd=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Xd extends Wc{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 Vd(e){e.component.projection=bp(e)?function(e){if(e.hasProjection){const t=ai(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[[nt,tt],[rt,it]])(ls(n[i[0]])||ls(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});e.channelHasField(lt)&&e.typedFieldDef(lt).type===eo&&t.push({signal:e.getName(`geojson_${t.length}`)});0===t.length&&t.push(e.requestDataName(ou.Main));return t}(e):void 0,o=new Xd(e.projectionName(!0),{...ai(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)Vd(i);const n=ce(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=ce(Hd,(n=>!(0,j.mQ)(e.explicit,n)&&!(0,j.mQ)(t.explicit,n)||!!((0,j.mQ)(e.explicit,n)&&(0,j.mQ)(t.explicit,n)&&Z(e.get(n),t.get(n)))));if(Z(e.size,t.size)){if(n)return e;if(Z(e.explicit,{}))return t;if(Z(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 Xd(n,t.specifiedProjection,t.size,ee(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 Kd(e,t,n,i){if(ys(t,n)){const r=bp(e)?e.axis(n)??e.legend(n)??{}:{},o=Ja(t,{expr:"datum"}),a=Ja(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Ja(t,{binSuffix:"range",forAs:!0}),formula:ba(o,a,r.format,r.formatType,i)}}return{}}function Qd(e,t){return`${Zn(e)}_${t}`}function Jd(e,t,n){const i=Qd(ds(n,void 0)??{},t);return e.getName(`${i}_bins`)}function Zd(e,t,n){let i,r;i=function(e){return"as"in e}(e)?(0,j.Kg)(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Ja(e,{forAs:!0}),Ja(e,{binSuffix:"end",forAs:!0})];const o={...ds(t,void 0)},a=Qd(o,e.field),{signal:s,extentSignal:l}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(ii(o.extent)){const e=o.extent;r=qf(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 eh extends hu{clone(){return new eh(null,ee(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{if(Wa(n)&&ei(n.bin)){const{key:r,binComponent:o}=Zd(n,n.bin,t);e[r]={...o,...e[r],...Kd(t,n,i,t.config)}}return e}),{});return ve(n)?null:new eh(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:r}=Zd(t,t.bin,n);return new eh(e,{[i]:r})}merge(e,t){for(const n of be(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=de([...this.bins[n].as,...e.bins[n].as],oe)):this.bins[n]=e.bins[n];for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}producedFields(){return new Set(xe(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(xe(this.bins).map((e=>e.field)))}hash(){return`Bin ${oe(this.bins)}`}assemble(){return xe(this.bins).flatMap((e=>{const t=[],[n,...i]=e.as,{extent:r,...o}=e.bin,a={type:"bin",field:Me(e.field),as:n,signal:e.signal,...ii(r)?{extent:null}:{extent:r},...e.span?{span:{signal:`span(${e.span})`}}:{},...o};!r&&e.extentSignal&&(t.push({type:"extent",field:Me(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:Ja({field:n[e]},{expr:"datum"}),as:s[e]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}function th(e,t,n,i){const r=bp(i)?i.encoding[Vt(t)]:void 0;if(Wa(n)&&bp(i)&&Ta(n,r,i.markDef,i.config))e.add(Ja(n,{})),e.add(Ja(n,{suffix:"end"})),n.bin&&ys(n,t)&&e.add(Ja(n,{binSuffix:"range"}));else if(Dt(t)){const n=St(t);e.add(i.getName(n))}else e.add(Ja(n));return Ha(n)&&function(e){return(0,L.isObject)(e)&&"field"in e}(n.scale?.range)&&e.add(n.scale.range.field),e}class nh extends hu{clone(){return new nh(null,new Set(this.dimensions),ee(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([Ja(e,{forAs:!0})]);else{if(Yn(o)||Hn(o)){const e=Yn(o)?"argmin":"argmax",t=o[e];i[t]??(i[t]={}),i[t][e]=new Set([Ja({op:e,field:t},{forAs:!0})])}else i[a]??(i[a]={}),i[a][o]=new Set([Ja(e,{forAs:!0})]);Pn(n)&&"unaggregated"===t.scaleDomain(n)&&(i[a]??(i[a]={}),i[a].min=new Set([Ja({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Ja({field:a,aggregate:"max"},{forAs:!0})]))}else th(r,n,e,t)})),r.size+be(i).length===0?null:new nh(e,r,i)):null}static makeFromTransform(e,t){const n=new Set,i={};for(const r of t.aggregate){const{op:e,field:t,as:n}=r;e&&("count"===e?(i["*"]??(i["*"]={}),i["*"].count=new Set([n||Ja(r,{forAs:!0})])):(i[t]??(i[t]={}),i[t][e]=new Set([n||Ja(r,{forAs:!0})])))}for(const r of t.groupby??[])n.add(r);return n.size+be(i).length===0?null:new nh(e,n,i)}merge(e){return pe(this.dimensions,e.dimensions)?(function(e,t){for(const n of be(t)){const i=t[n];for(const t of be(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(){ur.debug(...arguments)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...be(this.measures)])}producedFields(){const e=new Set;for(const t of be(this.measures))for(const n of be(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 ${oe({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const i of be(this.measures))for(const r of be(this.measures[i]))for(const o of this.measures[i][r])n.push(o),e.push(r),t.push("*"===i?null:Me(i));return{type:"aggregate",groupby:[...this.dimensions].map(Me),ops:e,fields:t,as:n}}}class ih extends hu{constructor(e,t,n,i){super(e),this.model=t,this.name=n,this.data=i;for(const r of Tt){const e=t.facet[r];if(e){const{bin:n,sort:i}=e;this[r]={name:t.getName(`${r}_domain`),fields:[Ja(e),...ei(n)?[Ja(e,{binSuffix:"end"})]:[]],...$a(i)?{sortField:i}:(0,j.cy)(i)?{sortIndexField:id(e,r)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of Tt)this[t]&&(e+=` ${t.charAt(0)}:${oe(this[t])}`);return e}get fields(){const e=[];for(const t of Tt)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){const e=new Set(this.fields);for(const t of Tt)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 bn){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(ho(i)&&ui(r)){const n=Kh(Qh(this.childModel,t));n?e[t]=n:dr(Ri(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=xa,field:t}=s;r.push(t),o.push(e),a.push(Ja(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 sd){for(const e of ld){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[qe,Ue])this[a]&&e.push(this.assembleRowColumnHeaderData(a,t,n));if(o){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}function rh(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function oh(e){const t={};return Q(e.filter,(e=>{if(Ur(e)){let n=null;Nr(e)?n=mi(e.equal):Br(e)?n=mi(e.lte):Rr(e)?n=mi(e.lt):Pr(e)?n=mi(e.gt):Lr(e)?n=mi(e.gte):Ir(e)?n=e.range[0]:jr(e)&&(n=(e.oneOf??e.in)[0]),n&&(hr(n)?t[e.field]="date":(0,j.Et)(n)?t[e.field]="number":(0,j.Kg)(n)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}function ah(e){const t={};function n(e){var n;ps(e)?t[e.field]="date":"quantitative"===e.type&&(n=e.aggregate,(0,j.Kg)(n)&&se(["min","max"],n))?t[e.field]="number":Te(e.field)>1?e.field in t||(t[e.field]="flatten"):Ha(e)&&$a(e.sort)&&Te(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((bp(e)||xp(e))&&e.forEachFieldDef(((t,i)=>{if(Wa(t))n(t);else{const r=Ht(i),o=e.fieldDef(r);n({...t,type:o.type})}})),bp(e)){const{mark:n,markDef:i,encoding:r}=e;if(Go(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 sh extends hu{clone(){return new sh(null,ee(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${oe(this._parse)}`}static makeExplicit(e,t,n){let i={};const r=t.data;return!tu(r)&&r?.format?.parse&&(i=r.format.parse),this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const a of be(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]:dr(Ui(a,n[a],e.value)))}for(const a of be(t)){const e=i.get(a);void 0!==e&&(e===t[a]?delete t[a]:dr(Ui(a,t[a],e)))}const r=new Wc(t,n);i.copyAll(r);const o={};for(const a of be(r.combine())){const e=r.get(a);null!==e&&(o[a]=e)}return 0===be(o).length||i.parseNothing?null:new sh(e,o)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of be(this._parse)){const n=this._parse[t];1===Te(t)&&(e[t]=n)}return e}producedFields(){return new Set(be(this._parse))}dependentFields(){return new Set(be(this._parse))}assembleTransforms(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return be(this._parse).filter((t=>!e||Te(t)>1)).map((e=>{const t=function(e,t){const n=Se(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},'${rh(t.slice(5,t.length))}')`;if(t.startsWith("utc:"))return`utcParse(${n},'${rh(t.slice(4,t.length))}')`;return dr(`Unrecognized parse "${t}".`),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:Oe(e)}})).filter((e=>null!==e))}}class lh extends hu{clone(){return new lh(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([pl])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:pl}}}class ch extends hu{clone(){return new ch(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${oe(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class uh extends hu{clone(){return new uh(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 ${oe(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class fh extends hu{constructor(e){let t;if(super(null),e??(e={name:"source"}),tu(e)||(t=e.format?{...ie(e.format,["parse"])}:{}),Zc(e))this._data={values:e.values};else if(Jc(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];se(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else iu(e)?this._data={values:[{type:"Sphere"}]}:(eu(e)||tu(e))&&(this._data={});this._generator=tu(e),e.name&&(this._name=e.name),t&&!ve(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 dh,hh=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},ph=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 gh(e){return e instanceof fh||e instanceof ch||e instanceof uh}class mh{constructor(){dh.set(this,void 0),hh(this,dh,!1,"f")}setModified(){hh(this,dh,!0,"f")}get modifiedFlag(){return ph(this,dh,"f")}}dh=new WeakMap;class yh extends mh{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 vh extends mh{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class bh extends vh{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 be(n))n[i].length>1&&(this.setModified(),this.mergeNodes(e,n[i]))}}class xh extends vh{constructor(e){super(),this.requiresSelectionId=e&&Nf(e)}run(e){e instanceof lh&&(this.requiresSelectionId&&(gh(e.parent)||e.parent instanceof nh||e.parent instanceof sh)||(this.setModified(),e.remove()))}}class _h extends mh{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof yu&&(n=e.producedFields(),ge(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 wh extends vh{constructor(){super()}run(e){e instanceof pu&&!e.isRequired()&&(this.setModified(),e.remove())}}class kh extends yh{run(e){if(!gh(e)&&!(e.numChildren()>1))for(const t of e.children)if(t instanceof sh)if(e instanceof sh)this.setModified(),e.merge(t);else{if(ye(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class $h extends yh{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof sh));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 be(t))e in i?i[e]!==t[e]&&r.add(e):i[e]=t[e]}for(const e of r)delete i[e];if(!ve(i)){this.setModified();const n=new sh(e,i);for(const r of t){if(r instanceof sh)for(const e of be(i))delete r.parse[e];e.removeChild(r),r.parent=n,r instanceof sh&&0===be(r.parse).length&&r.remove()}}}}}class Eh extends yh{run(e){e instanceof pu||e.numChildren()>0||e instanceof ih||e instanceof fh||(this.setModified(),e.remove())}}class Ah extends yh{run(e){const t=e.children.filter((e=>e instanceof yu)),n=t.pop();for(const i of t)this.setModified(),n.merge(i)}}class Sh extends yh{run(e){const t=e.children.filter((e=>e instanceof nh)),n={};for(const i of t){const e=oe(i.groupBy);e in n||(n[e]=[]),n[e].push(i)}for(const i of be(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 Dh extends yh{constructor(e){super(),this.model=e}run(e){const t=!(gh(e)||e instanceof jf||e instanceof sh||e instanceof lh),n=[],i=[];for(const r of e.children)r instanceof eh&&(t&&!ye(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 eh?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 Ch extends yh{run(e){const t=[...e.children];if(!le(t,(e=>e instanceof pu))||e.numChildren()<=1)return;const n=[];let i;for(const r of t)if(r instanceof pu){let t=r;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof pu))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 Mh extends hu{clone(){return new Mh(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=de(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??Ja(e)}hash(){return`JoinAggregateTransform ${oe(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 Fh extends hu{clone(){return new Fh(null,ee(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 u of t.sort)a.push(u.field),s.push(ze(u.order,"ascending"));const l={field:a,order:s};let c;return c=function(e){return(0,j.cy)(e)&&e.every((e=>(0,j.Kg)(e)))&&e.length>1}(r)?r:(0,j.Kg)(r)?[r,`${r}_end`]:[`${t.stack}_start`,`${t.stack}_end`],new Fh(e,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:o,sort:l,facetby:[],as:c})}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=>ss(i[e]))).filter((e=>!!e)),c=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Ja(t.fieldDef);return n&&e.push(n),e}),[])}(t),u=t.encoding.order;let f;if((0,j.cy)(u)||Pa(u))f=Si(u);else{const e=za(u)?u.sort:"y"===o?"descending":"ascending";f=c.reduce(((t,n)=>(t.field.push(n),t.order.push(e),t)),{field:[],order:[]})}return new Fh(e,{dimensionFieldDefs:l,stackField:t.vgField(o),facetby:[],stackby:c,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 ${oe(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map((e=>e.bin?t?[Ja(e,{binSuffix:"mid"})]:[Ja(e,{}),Ja(e,{binSuffix:"end"})]:[Ja(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 c of n){const{bandPosition:n=.5,bin:o}=c;if(o){const t=Ja(c,{expr:"datum"}),i=Ja(c,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${n}*${t}+${1-n}*${i}`,as:Ja(c,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...r,...t],key:Ja(c,{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 Oh extends hu{clone(){return new Oh(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=de(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??Ja(e)}hash(){return`WindowTransform ${oe(this.transform)}`}assemble(){const e=[],t=[],n=[],i=[];for(const u of this.transform.window)t.push(u.op),n.push(this.getDefaultName(u)),i.push(void 0===u.param?null:u.param),e.push(void 0===u.field?null:u.field);const r=this.transform.frame,o=this.transform.groupby;if(r&&null===r[0]&&null===r[1]&&t.every((e=>Xn(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 u of this.transform.sort)a.push(u.field),s.push(u.order??"ascending");const l={field:a,order:s},c=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:t,fields:e,sort:l,...void 0!==c?{ignorePeers:c}:{},...void 0!==o?{groupby:o}:{},...void 0!==r?{frame:r}:{}}}}function Th(e){if(e instanceof ih)if(1!==e.numChildren()||e.children[0]instanceof pu){const n=e.model.component.data.main;zh(n);const i=(t=e,function e(n){if(!(n instanceof ih)){const i=n.clone();if(i instanceof pu){const e=Nh+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof nh||i instanceof Fh||i instanceof Oh||i instanceof Mh)&&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 nh||t instanceof Fh||t instanceof Oh||t instanceof Mh)&&t.addDimensions(e.fields),t.swapWithParent(),Th(e)}else e.children.map(Th);var t}function zh(e){if(e instanceof pu&&e.type===ou.Main&&1===e.numChildren()){const t=e.children[0];t instanceof ih||(t.swapWithParent(),zh(e))}}const Nh="scale_",Rh=5;function Bh(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!Bh(t.children))return!1}return!0}function Ph(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function Lh(e,t,n){let i=e.sources,r=!1;return r=Ph(new wh,i)||r,r=Ph(new xh(t),i)||r,i=i.filter((e=>e.numChildren()>0)),r=Ph(new Eh,i)||r,i=i.filter((e=>e.numChildren()>0)),n||(r=Ph(new kh,i)||r,r=Ph(new Dh(t),i)||r,r=Ph(new _h,i)||r,r=Ph(new $h,i)||r,r=Ph(new Sh,i)||r,r=Ph(new Ah,i)||r,r=Ph(new bh,i)||r,r=Ph(new Ch,i)||r),e.sources=i,r}class Ih{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new Ih((()=>e(t)))}}function jh(e){bp(e)?function(e){const t=e.component.scales;for(const n of be(t)){const i=Uh(e,n);if(t[n].setWithExplicit("domains",i),Yh(e,n),e.component.data.isFaceted){let t=e;for(;!xp(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)fi(e)&&(e.data=Nh+e.data.replace(Nh,""))}}}(e):function(e){for(const n of e.children)jh(n);const t=e.component.scales;for(const n of be(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"):Kc(i,e.getWithExplicit("domains"),"domains","scale",Xh);const t=e.get("selectionExtent");r&&t&&r.param!==t.param&&dr(Ii),r=t}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}(e)}function Uh(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}=Hh(t,n);if(!e)return void dr(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=Hh(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&&ls(i.x2)?ls(i.x)?Kc(Gh(n,r,e,"x"),Gh(n,r,e,"x2"),"domain","scale",Xh):Gh(n,r,e,"x2"):"y"===t&&ls(i.y2)?ls(i.y)?Kc(Gh(n,r,e,"y"),Gh(n,r,e,"y2"),"domain","scale",Xh):Gh(n,r,e,"y2"):Gh(n,r,e,t)}function qh(e,t,n){const i=Fr(n)?.unit;return"temporal"===t||i?function(e,t,n){return e.map((e=>({signal:`{data: ${gs(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function Gh(e,t,n,i){const{encoding:r}=n,o=ls(r[i]),{type:a}=o,s=o.timeUnit;if(function(e){return e?.unionWith}(t)){const r=Gh(e,void 0,n,i);return Yc([...qh(t.unionWith,a,s),...r.value])}if(ci(t))return Yc([t]);if(t&&"unaggregated"!==t&&!yo(t))return Yc(qh(t,a,s));const l=n.stack;if(l&&i===l.fieldChannel){if("normalize"===l.offset)return Hc([[0,1]]);const e=n.requestDataName(ou.Main);return Hc([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const c=Pn(i)&&Pa(o)?function(e,t,n){if(!ho(n))return;const i=e.fieldDef(t),r=i.sort;if(Ea(r))return{op:"min",field:id(i,t),order:"ascending"};const{stack:o}=e,a=o?new Set([...o.groupbyFields,...o.stackBy.map((e=>e.fieldDef.field))]):void 0;if($a(r)){return Wh(r,o&&!a.has(r.field))}if(ka(r)){const{encoding:t,order:n}=r,i=e.fieldDef(t),{aggregate:s,field:l}=i,c=o&&!a.has(l);if(Yn(s)||Hn(s))return Wh({field:Ja(i),order:n},c);if(Xn(s)||!s)return Wh({op:s,field:l,order:n},c)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(se(["ascending",void 0],r))return!0}return}(n,i,e):void 0;if(Ia(o)){return Hc(qh([o.datum],a,s))}const u=o;if("unaggregated"===t){const e=n.requestDataName(ou.Main),{field:t}=o;return Hc([{data:e,field:Ja({field:t,aggregate:"min"})},{data:e,field:Ja({field:t,aggregate:"max"})}])}if(ei(u.bin)){if(ho(e))return Hc("bin-ordinal"===e?[]:[{data:we(c)?n.requestDataName(ou.Main):n.requestDataName(ou.Raw),field:n.vgField(i,ys(u,i)?{binSuffix:"range"}:{}),sort:!0!==c&&(0,j.Gv)(c)?c:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=u;if(ei(e)){const t=Jd(n,u.field,e);return Hc([new Ih((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return Hc([{data:n.requestDataName(ou.Main),field:n.vgField(i,{})}])}}if(u.timeUnit&&se(["time","utc"],e)&&Ta(u,bp(n)?n.encoding[Vt(i)]:void 0,n.markDef,n.config)){const e=n.requestDataName(ou.Main);return Hc([{data:e,field:n.vgField(i)},{data:e,field:n.vgField(i,{suffix:"end"})}])}return Hc(c?[{data:we(c)?n.requestDataName(ou.Main):n.requestDataName(ou.Raw),field:n.vgField(i),sort:c}]:[{data:n.requestDataName(ou.Main),field:n.vgField(i)}])}function Wh(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":xa),...i?{field:Me(i)}:{},...r?{order:r}:{}}}function Yh(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,o=yo(i)&&i,a=ni(r)&&ii(r.extent)&&r.extent;(o||a)&&n.set("selectionExtent",o??a,!0)}function Hh(e,t){const{aggregate:n,type:i}=e;return n?(0,j.Kg)(n)&&!Jn.has(n)?{valid:!1,reason:tr(n)}:"quantitative"===i&&"log"===t?{valid:!1,reason:nr(e)}:{valid:!0}:{valid:!1,reason:er(e)}}function Xh(e,t,n,i){return e.explicit&&t.explicit&&dr(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 Vh(e){const t=de(e.map((e=>{if(fi(e)){const{sort:t,...n}=e;return n}return e})),oe),n=de(e.map((e=>{if(fi(e)){const t=e.sort;return void 0===t||we(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),oe);if(0===t.length)return;if(1===t.length){const t=e[0];if(fi(t)&&n.length>0){let e=n[0];if(n.length>1){dr(or);const t=n.filter((e=>(0,j.Gv)(e)&&"op"in e&&"min"!==e.op));e=!n.every((e=>(0,j.Gv)(e)&&"op"in e))||1!==t.length||t[0]}else if((0,j.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=de(n.map((e=>we(e)||!("op"in e)||(0,j.Kg)(e.op)&&e.op in Wn?e:(dr(function(e){return`Dropping sort property ${re(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),oe);let r;1===i.length?r=i[0]:i.length>1&&(dr(or),r=!0);const o=de(e.map((e=>fi(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 Kh(e){if(fi(e)&&(0,j.Kg)(e.field))return e.field;if(function(e){return!(0,j.cy)(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(fi(n)&&(0,j.Kg)(n.field))if(t){if(t!==n.field)return dr("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return dr("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!(0,j.cy)(e)&&"fields"in e&&"data"in e}(e)){dr("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return(0,j.Kg)(t)?t:void 0}}function Qh(e,t){const n=e.component.scales[t].get("domains").map((t=>(fi(t)&&(t.data=e.lookupDataSource(t.data)),t)));return Vh(n)}function Jh(e){return wp(e)||_p(e)?e.children.reduce(((e,t)=>e.concat(Jh(t))),Zh(e)):Zh(e)}function Zh(e){return be(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:c,reverse:u,...f}=r,d=function(e,t,n,i){if(xn(n)){if(ui(e))return{step:{signal:`${t}_step`}}}else if((0,j.Gv)(e)&&fi(e))return{...e,data:i.lookupDataSource(e.data)};return e}(r.range,o,n,e),h=Qh(e,n),p=s?function(e,t,n,i){const r=qf(e,t.param,t);return{signal:po(n.get("type"))&&(0,j.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!==u?{reverse:u}:{},...f}),t}),[])}class ep extends Wc{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||le(this.get("domains"),(e=>(0,j.cy)(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const tp=["range","scheme"];function np(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,o=Kt(t),a=e.getName(o);if((0,j.Gv)(i)&&i.binned&&void 0!==i.step)return new Ih((()=>{const n=e.scaleName(t),r=`(domain("${n}")[1] - domain("${n}")[0]) / ${i.step}`;return`${e.getSignalName(a)} / (${r})`}));if(ei(i)){const t=Jd(e,r,i);return new Ih((()=>{const n=e.getSignalName(t),i=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(a)} / (${i})`}))}}}function ip(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e).get("type");for(const u of tp)if(void 0!==n[u]){const i=So(r,u),o=Do(e,u);if(i)if(o)dr(o);else switch(u){case"range":{const i=n.range;if((0,j.cy)(i)){if(xn(e))return Yc(i.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),i=t.getSignalName.bind(t);return Ih.fromName(i,n)}return e})))}else if((0,j.Gv)(i))return Yc({data:t.requestDataName(ou.Main),field:i.field,sort:{op:"min",field:t.vgField(e)}});return Yc(i)}case"scheme":return Yc(rp(n[u]))}else dr(ir(r,u,e))}const o=e===We||"xOffset"===e?"width":"height",a=i[o];if($l(a))if(xn(e))if(ho(r)){const n=op(a,t,e);if(n)return Yc({step:n})}else dr(rr(o));else if(En(e)){const n=e===Ve?"x":"y";if("band"===t.getScaleComponent(n).get("type")){const e=ap(a,r);if(e)return Yc(e)}}const{rangeMin:s,rangeMax:l}=n,c=function(e,t){const{size:n,config:i,mark:r,encoding:o}=t,a=t.getSignalName.bind(t),{type:s}=ls(o[e]),l=t.getScaleComponent(e),c=l.get("type"),{domain:u,domainMid:f}=t.specifiedScales[e];switch(e){case We:case Ye:{if(se(["point","band"],c)){const r=sp(e,n,i.view);if($l(r)){return{step:op(r,t,e)}}}const r=Kt(e),o=t.getName(r);return e===Ye&&po(c)?[Ih.fromName(a,o),0]:[0,Ih.fromName(a,o)]}case Ve:case Ke:return function(e,t,n){const i=e===Ve?"x":"y",r=t.getScaleComponent(i),o=r.get("type"),a=t.scaleName(i);if("band"===o){const e=sp(i,t.size,t.config.view);if($l(e)){const t=ap(e,n);if(t)return t}return[0,{signal:`bandwidth('${a}')`}]}{const n=t.encoding[i];if(Pa(n)&&n.timeUnit){const e=Or(n.timeUnit,(e=>`scale('${a}', ${e})`)),i=t.config.scale.bandWithNestedOffsetPaddingInner;if(i){return[{signal:`${ci(i)?`${i.signal}/2`:""+i/2} * (${e})`},{signal:`${ci(i)?`(1 - ${i.signal}/2)`:""+(1-i/2)} * (${e})`}]}return[0,{signal:e}]}return te(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}(e,t,c);case ct:{const o=lp(r,t.component.scales[e].get("zero"),i),a=function(e,t,n,i){const r={x:np(n,"x"),y:np(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=up(t,r,i.view);return(0,j.Et)(e)?e-1:new Ih((()=>`${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=up(t,r,i.view);return(0,j.Et)(e)?Math.pow(cp*e,2):new Ih((()=>`pow(${cp} * ${e.signal}, 2)`))}}throw new Error(Vi("size",e))}(r,n,t,i);return mo(c)?function(e,t,n){const i=()=>{const i=xi(t),r=xi(e),o=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${o}, ${o})`};return ci(t)?new Ih(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,j.cy)(n)?n.length+1:(dr(function(e){return`Domain for ${e} is required for threshold scale.`}(i)),3)}}(c,i,u,e)):[o,a]}case Ze:return[0,2*Math.PI];case ut:return[0,360];case Qe:return[0,new Ih((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case pt:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case gt:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case lt:return"symbol";case ot:case at:case st:return"ordinal"===c?"nominal"===s?"category":"ordinal":void 0!==f?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case ft:case dt:case ht:return[i.scale.minOpacity,i.scale.maxOpacity]}}(e,t);return(void 0!==s||void 0!==l)&&So(r,"rangeMin")&&(0,j.cy)(c)&&2===c.length?Yc([s??c[0],l??c[1]]):Hc(c)}function rp(e){return function(e){return!(0,j.Kg)(e)&&!!e.name}(e)?{scheme:e.name,...ie(e,["name"])}:{scheme:e}}function op(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=Jt(n),a=i[o];if("offset"===kl({step:e,offsetIsDiscrete:Ga(a)&&Vr(a.type)})&&Cs(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,ci(s)?s.signal:(0,j.r$)(s)})`}}return e.step;var s}function ap(e,t){if("offset"===kl({step:e,offsetIsDiscrete:ho(t)}))return{step:e.step}}function sp(e,t,n){const i=e===We?"width":"height",r=t[i];return r||Cl(n,i)}function lp(e,t,n){if(t)return ci(t)?{signal:`${t.signal} ? 0 : ${lp(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Vi("size",e))}const cp=.95;function up(e,t,n){const i=$l(e.width)?e.width.step:Dl(n,"width"),r=$l(e.height)?e.height.step:Dl(n,"height");return t.x||t.y?new Ih((()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`)):Math.min(i,r)}function fp(e,t){bp(e)?function(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:a}=e;for(const s of be(n)){const l=a[s],c=n[s],u=e.getScaleComponent(s),f=ls(r[s]),d=l[t],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=So(h,t),y=Do(s,t);if(void 0!==d&&(m?y&&dr(y):dr(ir(h,t,s))),m&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":hr(l[t])||"temporal"===n||e?c.set(t,{signal:gs(l[t],{type:n,timeUnit:e})},!0):c.set(t,l[t],!0);break;default:c.copyKeyFromObject(t,l)}}else{const n=t in dp?dp[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:i,hasNestedOffsetScale:Ms(r,s),hasSecondaryRangeChannel:!!r[Vt(s)]}):i.scale[t];void 0!==n&&c.set(t,n,!1)}}}(e,t):pp(e,t)}const dp={bins:e=>{let{model:t,fieldOrDatumDef:n}=e;return Pa(n)?function(e,t){const n=t.bin;if(ei(n)){const i=Jd(e,t.field,n);return new Ih((()=>e.getSignalName(i)))}if(ti(n)&&ni(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(se([ot,at,st],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(ss(o)?.bin||(0,j.cy)(n)||null!=r||null!=i||se([to.TIME,to.UTC],e))return;return!!xn(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(xn(e)){if(go(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===to.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(xn(t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i,bandWithNestedOffsetPaddingInner:a}=r;return o?a:ze(e,"bar"===n?t:i)}if(En(t)&&i===to.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(xn(t)){const{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=r;if(o)return t;if(n===to.BAND)return ze(e,ci(i)?{signal:`${i.signal}/2`}:i/2)}else if(En(t)){if(n===to.POINT)return.5;if(n===to.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 po(e)&&"descending"===t?ci(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(po(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&&po(r)){if((0,j.cy)(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!mo(r))return!0;if((!Pa(t)||!t.bin)&&se([...bn,...wn],e)){const{orient:t,type:n}=i;return(!se(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e))&&(!(!se(["bar","area"],n)||a)||o?.zero)}return!1}(t,n,i,r,o,a.scale,s)}};function hp(e){bp(e)?function(e){const t=e.component.scales;for(const n of Bn){const i=t[n];if(!i)continue;const r=ip(n,e);i.setWithExplicit("range",r)}}(e):pp(e,"range")}function pp(e,t){const n=e.component.scales;for(const i of e.children)"range"===t?hp(i):fp(i,t);for(const i of be(n)){let r;for(const n of e.children){const e=n.component.scales[i];if(e){r=Kc(r,e.getWithExplicit(t),t,"scale",Xc(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0)))}}n[i].setWithExplicit(t,r)}}function gp(e,t,n,i){const r=function(e,t,n,i){switch(t.type){case"nominal":case"ordinal":if(Ft(e)||"discrete"===qn(e))return"shape"===e&&"ordinal"===t.type&&dr(Zi(e,"ordinal")),"ordinal";if(xn(e)||En(e)){if(se(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&e in _n)return"band";return Qo(n[Kt(e)])||Xa(t)&&t.axis?.tickBand?"band":"point";case"temporal":return Ft(e)?"time":"discrete"===qn(e)?(dr(Zi(e,"temporal")),"ordinal"):Pa(t)&&t.timeUnit&&Fr(t.timeUnit).utc?"utc":"time";case"quantitative":return Ft(e)?Pa(t)&&ei(t.bin)?"bin-ordinal":"linear":"discrete"===qn(e)?(dr(Zi(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Yi(t.type))}(t,n,i,arguments.length>4&&void 0!==arguments[4]&&arguments[4]),{type:o}=e;return Pn(t)?void 0!==o?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Pn(e))return!1;switch(e){case We:case Ye:case Ve:case Ke:case Ze:case Qe:return!!go(t)||"band"===t||"point"===t&&!n;case ct:case pt:case ft:case dt:case ht:case ut:return go(t)||mo(t)||se(["band","point","ordinal"],t);case ot:case at:case st:return"band"!==t;case gt:case lt:return"ordinal"===t||mo(t)}}(t,o)?Pa(n)&&(a=o,s=n.type,!(se([Qr,Zr],s)?void 0===a||ho(a):s===Jr?se([to.TIME,to.UTC,void 0],a):s!==Kr||lo(a)||mo(a)||void 0===a))?(dr(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,r)),r):o:(dr(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 mp(e){bp(e)?e.component.scales=function(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of Bn){const a=ls(t[o]);if(a&&n===qo&&o===lt&&a.type===eo)continue;let s=a&&a.scale;if(En(o)){if(!Ms(t,Zt(o))){s&&dr(Ki(o));continue}}if(a&&null!==s&&!1!==s){s??(s={});const n=gp(s,o,a,i,Ms(t,o));r[o]=new ep(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){mp(o);for(const n of be(o.component.scales))if((t=r.scale)[n]??(t[n]=Ed(n,e)),"shared"===r.scale[n]){const e=i[n],t=o.component.scales[n].getWithExplicit("type");e?io(e.value,t.value)?i[n]=Kc(e,t,"type","scale",yp):(r.scale[n]="independent",delete i[n]):i[n]=t}}for(const o of be(i)){const t=e.scaleName(o,!0),r=i[o];n[o]=new ep(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 yp=Xc(((e,t)=>oo(e)-oo(t)));class vp{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 bp(e){return"unit"===e?.type}function xp(e){return"facet"===e?.type}function _p(e){return"concat"===e?.type}function wp(e){return"layer"===e?.type}class kp{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=ai(a),this.name=e.name??i,this.title=li(e.title)?{text:e.title}:e.title?ai(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new vp,this.projectionNameMap=n?n.projectionNameMap:new vp,this.signalNameMap=n?n.signalNameMap:new vp,this.data=e.data,this.description=e.description,this.transforms=(e.transform??[]).map((e=>dc(e)?{filter:J(e.filter,Yr)}: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)&&!Aa(e.facet)||xl(e))&&(r.columns=a),_l(e)&&(r.columns=1);for(const s of Al)if(void 0!==e[s])if("spacing"===s){const t=e[s];r[s]=(0,j.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 Wc,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?ee(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]:{};mp(e),jh(e);for(const n of Ao)fp(e,n);t||hp(e)}(this)}parseProjection(){Vd(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Ld(this)}assembleEncodeFromView(e){const{style:t,...n}=e,i={};for(const r of be(n)){const e=n[r];void 0!==e&&(i[r]=vi(e))}return i}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=vi(this.description)),"unit"!==this.type&&"layer"!==this.type)?ve(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 Tt){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:e,titleOrient:o}=ad(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=rd(i,o),s=yd(e,a);void 0!==s&&(n[a]=s)}}return ve(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 Tt)e[n].title&&t.push(cd(this,n));for(const n of sd)t=t.concat(dd(this,n));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map((e=>Yf(e,"grid",t))),...i.map((e=>Yf(e,"grid",t))),...n.map((e=>Yf(e,"main",t))),...i.map((e=>Yf(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return Gd(this)}assembleProjections(){return Wd(this)}assembleTitle(){const{encoding:e,...t}=this.title??{},n={...si(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return se(["unit","layer"],this.type)?se(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),ve(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||xp(this.parent)?Jh(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 ke((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(ou[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(xp(this.parent)){const t=kn(kd(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(ho(e)&&ui(i)){const e=n.get("name"),i=Kh(Qh(this,t));if(i){return{signal:wd(e,n,Ja({aggregate:"distinct",field:i},{expr:"datum"}))}}return dr(Ri(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):Gt(e)&&Pn(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}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 $p extends kp{vgField(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.fieldDef(e);if(n)return Ja(n,t)}reduceFieldDef(e,t){return function(e,t,n,i){return e?be(e).reduce(((n,r)=>{const o=e[r];return(0,j.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=ss(n);return r?e(t,r,i):t}),t)}forEachFieldDef(e,t){Ns(this.getMapping(),((t,n)=>{const i=ss(t);i&&e(i,n)}),t)}}class Ep extends hu{clone(){return new Ep(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"],t.groupby&&null==t.minsteps&&null==t.maxsteps&&null==t.steps&&(this.transform.steps=200)}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${oe(this.transform)}`}assemble(){const{density:e,...t}=this.transform;return{type:"kde",field:e,...t}}}class Ap extends hu{clone(){return new Ap(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${oe(this.transform)}`}assemble(){const{extent:e,param:t}=this.transform;return{type:"extent",field:e,signal:t}}}class Sp extends hu{clone(){return new Sp(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t){const{config:n,mark:i,markDef:r}=t;if("filter"!==ki("invalid",r,n))return null;const o=t.reduceFieldDef(((e,n,r)=>{const o=Pn(r)&&t.getScaleComponent(r);if(o){po(o.get("type"))&&"count"!==n.aggregate&&!Go(i)&&(e[n.field]=n)}return e}),{});return be(o).length?new Sp(e,o):null}dependentFields(){return new Set(be(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${oe(this.filter)}`}assemble(){const e=be(this.filter).reduce(((e,t)=>{const n=this.filter[t],i=Ja(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${i}) || (isValid(${i}) && isFinite(+${i})))`):"quantitative"===n.type&&(e.push(`isValid(${i})`),e.push(`isFinite(+${i})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class Dp extends hu{clone(){return new Dp(this.parent,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(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 ${oe(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class Cp extends hu{clone(){return new Cp(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(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 ${oe(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class Mp extends hu{clone(){return new Mp(null,ee(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[[nt,tt],[rt,it]]){const r=i.map((e=>{const n=ls(t.encoding[e]);return Pa(n)?n.field:Ia(n)?{expr:`${n.datum}`}:Ya(n)?{expr:`${n.value}`}:void 0}));(r[0]||r[1])&&(e=new Mp(e,r,null,t.getName("geojson_"+n++)))}if(t.channelHasField(lt)){const i=t.typedFieldDef(lt);i.type===eo&&(e=new Mp(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(j.Kg);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${oe(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 Fp extends hu{clone(){return new Fp(null,this.projection,ee(this.fields),ee(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[[nt,tt],[rt,it]]){const i=n.map((e=>{const n=ls(t.encoding[e]);return Pa(n)?n.field:Ia(n)?{expr:`${n.datum}`}:Ya(n)?{expr:`${n.value}`}:void 0})),r=n[0]===rt?"2":"";(i[0]||i[1])&&(e=new Fp(e,t.projectionName(),i,[t.getName(`x${r}`),t.getName(`y${r}`)]))}return e}dependentFields(){return new Set(this.fields.filter(j.Kg))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${oe(this.fields)} ${oe(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Op extends hu{clone(){return new Op(null,ee(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 Op(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:c,keyvals:u}=o.impute,f=Rs(t.mark,n);return new Op(e,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==l?{value:l}:{},...c?{frame:c}:{},...void 0!==u?{keyvals:u}:{},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${oe(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:hc(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 Tp extends hu{clone(){return new Tp(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(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 ${oe(this.transform)}`}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}class zp extends hu{clone(){return new zp(null,ee(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"data"in e}(o)){let e=Vp(o.data,r);e||(e=new fh(o.data),r.push(e));const n=t.getName(`lookup_${i}`);a=new pu(e,n,ou.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return"param"in e}(o)){const e=o.param;let i;n={as:e,...n};try{i=t.getSelectionComponent(ke(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 zp(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?(0,j.YO)(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${oe({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,j.YO)(this.transform.as)}:{}};else{let t=this.transform.as;(0,j.Kg)(t)||(dr('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),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 Np extends hu{clone(){return new Np(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(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 ${oe(this.transform)}`}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class Rp extends hu{clone(){return new Rp(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=ee(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 ${oe(this.transform)}`}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}class Bp extends hu{clone(){return new Bp(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=de((this.transform.groupby??[]).concat(e),(e=>e))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${oe(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 Pp extends hu{clone(){return new Pp(null,ee(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${oe(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Lp(e){let t=0;return function n(i,r){if(i instanceof fh&&!i.isGenerator&&!Jc(i.data)){e.push(r);r={name:null,source:r.name,transform:[]}}if(i instanceof sh&&(i.parent instanceof fh&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof ih)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 ch||i instanceof uh||i instanceof Sp||i instanceof jf||i instanceof nd||i instanceof Fp||i instanceof nh||i instanceof zp||i instanceof Oh||i instanceof Mh||i instanceof Cp||i instanceof Dp||i instanceof Ep||i instanceof Tp||i instanceof Np||i instanceof Rp||i instanceof lh||i instanceof Pp||i instanceof Bp||i instanceof Ap)&&r.transform.push(i.assemble()),(i instanceof eh||i instanceof yu||i instanceof Op||i instanceof Fh||i instanceof Mp)&&r.transform.push(...i.assemble()),i instanceof pu)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof pu)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 pu&&(!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 Ip(e){return"top"===e||"left"===e||ci(e)?"header":"footer"}function jp(e,t){const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],s=od("title",null,i,t);let l=is(a,i,{allowDisabling:!0,includeDefault:void 0===s||!!s});r.component.layoutHeaders[t].title&&(l=(0,j.cy)(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=od("labelOrient",a.header,i,t),u=null!==a.header&&ze(a.header?.labels,i.header.labels,!0),f=se(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:null!==a.header?l:null,facetFieldDef:a,[f]:"facet"===t?[]:[Up(e,t,u)]}}}function Up(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]=Ad(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=Ip(i.get("orient"));o[t]??(o[t]=[Up(e,r,!1)]);const n=Yf(i,"main",e.config,{header:!0});n&&o[t][0].axes.push(n),i.mainExtracted=!0}}}}function Gp(e){for(const t of e.children)t.parseLayoutSize()}function Wp(e,t){const n=kd(t),i=kn(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]??Ed(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=Kc(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 Yp(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(ho(e)){const e=Cl(i.view,t);return ui(n)||$l(e)?"step":e}return Sl(i.view,t)}if(e.hasProjection||"arc"===e.mark)return Sl(i.view,t);{const e=Cl(i.view,t);return $l(e)?e.step:e}}function Hp(e,t,n){return Ja(t,{suffix:`by_${Ja(e)}`,...n??{}})}class Xp extends $p{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve),this.child=wg(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!Aa(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=be(e),n={};for(const i of t){if(![Ue,qe].includes(i)){dr(Vi(i,"facet"));break}const t=e[i];if(void 0===t.field){dr(Xi(t,i));break}n[i]=this.initFacetFieldDef(t,i)}return n}initFacetFieldDef(e,t){const n=fs(e,t);return n.header?n.header=ai(n.header):null===n.header&&(n.header=null),n}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=Kp(this),this.child.parseData()}parseLayoutSize(){Gp(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 Tt)jp(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 Tt)for(const n of ld){const i=this.component.layoutHeaders[t],r=i[n],{facetFieldDef:o}=i;if(o){const n=od("titleOrient",o.header,this.config,t);if(["right","bottom"].includes(n)){const i=rd(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 Xp)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof Xp?{...this.channelHasField("column")?{encode:{update:{columns:{field:Ja(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof Xp){if(this.child.channelHasField("column")){const i=Ja(this.child.facet.column);e.push(i),t.push("distinct"),n.push(`distinct_${i}`)}}else for(const i of bn){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),a=r.get("range");if(ho(o)&&ui(a)){const r=Kh(Qh(this.child,i));r?(e.push(r),t.push("distinct"),n.push(`distinct_${r}`)):dr(Ri(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 c of Tt){const e=this.facet[c];if(e){s.push(Ja(e));const{bin:t,sort:l}=e;if(ei(t)&&s.push(Ja(e,{binSuffix:"end"})),$a(l)){const{field:t,op:s=xa}=l,c=Hp(e,l);n&&i?(r.push(c),o.push("max"),a.push(c)):(r.push(t),o.push(s),a.push(c))}else if((0,j.cy)(l)){const t=id(e,c);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?$a(n.sort)?[Hp(n,n.sort,{expr:"datum"})]:(0,j.cy)(n.sort)?[id(n,e,{expr:"datum"})]:[Ja(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[($a(e)?e.order:!(0,j.cy)(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return pd(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const i of sd)if(e[i]){const r=od("labelOrient",e[i]?.header,t,i);if(n[i].includes(r))return pd(e[i],i,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=Lp(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:Tt.map((e=>this.facetSortFields(e))).flat(),order:Tt.map((e=>this.facetSortOrder(e))).flat()},...t.length>0?{data:t}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(uu(this,[]))}]}getMapping(){return this.facet}}function Vp(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(Zc(e)&&Zc(t)){if(Z(e.values,t.values))return n}else if(Jc(e)&&Jc(t)){if(e.url===t.url)return n}else if(eu(e)&&e.name===n.dataName)return n}return null}function Kp(e){let t=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new fh({values:[]});return t.push(e),e}const n=Vp(e.data,t);if(n)return tu(e.data)||(n.data.format=ue({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new fh(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&&(tu(r)||Jc(r)||Zc(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Qc;tu(r)?(nu(r)?t=new uh(t,r.sequence):ru(r)&&(t=new ch(t,r.graticule)),o.parseNothing=!0):null===r?.format?.parse&&(o.parseNothing=!0),t=sh.makeExplicit(t,e,o)??t,t=new lh(t);const a=e.parent&&wp(e.parent);(bp(e)||xp(e))&&a&&(t=eh.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($c(r))a=e=new nd(e,r),o="derived";else if(dc(r)){const i=oh(r);a=e=sh.makeWithAncestors(e,{},i,n)??e,e=new jf(e,t,r.filter)}else if(Ec(r))a=e=eh.makeFromTransform(e,r,t),o="number";else if(Sc(r))o="date",void 0===n.getWithExplicit(r.field).value&&(e=new sh(e,{[r.field]:o}),n.set(r.field,o,!1)),a=e=yu.makeFromTransform(e,r);else if(Dc(r))a=e=nh.makeFromTransform(e,r),o="number",Nf(t)&&(e=new lh(e));else if(pc(r))a=e=zp.make(e,t,r,i++),o="derived";else if(_c(r))a=e=new Oh(e,r),o="number";else if(wc(r))a=e=new Mh(e,r),o="number";else if(Cc(r))a=e=Fh.makeFromTransform(e,r),o="derived";else if(Mc(r))a=e=new Cp(e,r),o="derived";else if(Fc(r))a=e=new Ap(e,r),o="derived";else if(kc(r))a=e=new Dp(e,r),o="derived";else if(gc(r))a=e=new Bp(e,r),o="derived";else if(xc(r))e=new Pp(e,r);else if(Ac(r))a=e=Op.makeFromTransform(e,r),o="derived";else if(mc(r))a=e=new Ep(e,r),o="derived";else if(yc(r))a=e=new Np(e,r),o="derived";else if(vc(r))a=e=new Rp(e,r),o="derived";else{if(!bc(r)){dr(`Ignoring an invalid transform: ${re(r)}.`);continue}a=e=new Tp(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(bp(e)&&e.component.selection)for(const n of be(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&Te(e.field)>1&&(t[e.field]="flatten")}return t}(e),l=ah(e);t=sh.makeWithAncestors(t,{},{...s,...l},o)??t,bp(e)&&(t=Mp.parseAll(t,e),t=Fp.parseAll(t,e)),(bp(e)||xp(e))&&(a||(t=eh.makeFromEncoding(t,e)??t),t=yu.makeFromEncoding(t,e)??t,t=nd.parseAllForSortIndex(t,e));const c=e.getDataName(ou.Raw),u=new pu(t,c,ou.Raw,i);if(n[c]=u,t=u,bp(e)){const n=nh.makeFromEncoding(t,e);n&&(t=n,Nf(e)&&(t=new lh(t))),t=Op.makeFromEncoding(t,e)??t,t=Fh.makeFromEncoding(t,e)??t}bp(e)&&(t=Sp.make(t,e)??t);const f=e.getDataName(ou.Main),d=new pu(t,f,ou.Main,i);n[f]=d,t=d,bp(e)&&function(e,t){for(const[n,i]of _e(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new pu(new jf(t,e,{param:n}),r,ou.Lookup,e.component.data.outputNodeRefCounts)}}(e,d);let h=null;if(xp(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($a(r.sort)){const{field:n,op:i=xa}=r.sort;e=t=new Mh(e,{joinaggregate:[{op:i,field:n,as:Hp(r,r.sort,{forAs:!0})}],groupby:[Ja(r)]})}return t}return null}(t,e.facet)??t,h=new ih(t,e,i,d.getSource()),n[i]=h}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:u,main:d,facetRoot:h,ancestorParse:o}}class Qp extends kp{constructor(e,t,n,i){super(e,"concat",t,n,i,e.resolve),"shared"!==e.resolve?.axis?.x&&"shared"!==e.resolve?.axis?.y||dr("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)=>wg(e,this,this.getName(`concat_${t}`),void 0,i)))}parseData(){this.component.data=Kp(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 be(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 _l(e)?e.vconcat:wl(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){Gp(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";Wp(e,t),Wp(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=bd(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 Jp={disable:1,gridScale:1,scale:1,...ws,labelExpr:1,encode:1},Zp=be(Jp);class eg extends Wc{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 eg(ee(this.explicit),ee(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 ci(this.explicit.orient)}}const tg={bottom:"top",top:"bottom",left:"right",right:"left"};function ng(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]=ig(n,r)}}}return e}function ig(e,t){for(const n of Zp){const i=Kc(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",((e,t)=>{switch(n){case"title":return Mi(e,t);case"gridScale":return{explicit:e.explicit,value:ze(e.value,t.value)}}return Vc(e,t,n,"axis")}));e.setWithExplicit(n,i)}return e}function rg(e,t,n,i,r){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ci(n.labelAngle)?n.labelAngle:Ie(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===td(i,r))return!0}return e===n[t]}const og=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function ag(e,t){let n=t.axis(e);const i=new eg,r=ls(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"),c=function(e,t,n,i){const r="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:lo(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=ci(n)?"axisOrient":`axis${Ae(n)}`,s=[...r,...r.map((e=>o+e.substr(4)))],l=["axis",a,o];return{vlOnlyAxisConfig:Xf(s,i,e,n),vgAxisConfig:Xf(l,i,e,n),axisConfigStyle:Vf([...l,...s],i)}}(e,l,s,t.config),u=void 0!==n?!n:Kf("disable",a.style,n?.style,c).configValue;if(i.set("disable",u,void 0!==n),u)return i;n=n||{};const f=function(e,t,n,i,r){const o=t?.labelAngle;if(void 0!==o)return ci(o)?o:Ie(o);{const{configValue:o}=Kf("labelAngle",i,t?.style,r);return void 0!==o?Ie(o):n!==We||!se([Zr,Qr],e.type)||Pa(e)&&e.timeUnit?void 0:270}}(r,n,e,a.style,c),d=ga(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 Zp){const r=y in Qf?Qf[y](p):$s(y)?n[y]:void 0,o=void 0!==r,s=rg(r,y,n,t,e);if(o&&s)i.set(y,r,s);else{const{configValue:e,configFrom:t}=$s(y)&&"values"!==y?Kf(y,a.style,n.style,c):{},l=void 0!==e;o&&!l?i.set(y,r,s):("vgAxisConfig"!==t||og.has(y)&&l||bs(e)||ci(e))&&i.set(y,e,!1)}}const g=n.encoding??{},m=xs.reduce(((n,r)=>{if(!i.hasAxisPart(r))return n;const o=$d(g[r]??{},t),a="labels"===r?function(e,t,n){const{encoding:i,config:r}=e,o=ls(i[t])??ls(i[Vt(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"===La(o)){if(Xa(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"===La(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||ve(a)||(n[r]={update:a}),n}),{});return ve(m)||i.set("encode",m,!!n.encoding||void 0!==n.labelAngle),i}function sg(e,t,n){const i=ai(e),r=ki("orient",i,n);if(i.orient=function(e,t,n){switch(e){case No:case jo:case Uo:case Po:case Ro:case To:return}const{x:i,y:r,x2:o,y2:a}=t;switch(e){case Oo:if(Pa(i)&&(ti(i.bin)||Pa(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Pa(r)&&(ti(r.bin)||Pa(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(Pa(i)&&i.type===Kr&&!ei(i.bin)||qa(i))&&Pa(r)&&ti(r.bin)?"horizontal":"vertical";if(!a)return(Pa(r)&&r.type===Kr&&!ei(r.bin)||qa(r))&&Pa(i)&&ti(i.bin)?"vertical":"horizontal"}case Bo:if(o&&(!Pa(i)||!ti(i.bin))&&a&&(!Pa(r)||!ti(r.bin)))return;case Fo:if(a)return Pa(r)&&ti(r.bin)?"horizontal":"vertical";if(o)return Pa(i)&&ti(i.bin)?"vertical":"horizontal";if(e===Bo){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case zo:case Lo:{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===Jr,t=Wa(r)&&r.type===Jr;if(e&&!t)return"vertical";if(!e&&t)return"horizontal"}return}}return"vertical"}(i.type,t,r),void 0!==r&&r!==i.orient&&dr(`Specified orient "${i.orient}" overridden with "${r}".`),"bar"===i.type&&i.orient){const e=ki("cornerRadiusEnd",i,n);if(void 0!==e){const n="horizontal"===i.orient&&t.x2||"vertical"===i.orient&&t.y2?["cornerRadius"]:Jo[i.orient];for(const t of n)i[t]=e;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}void 0===ki("opacity",i,n)&&(i.opacity=function(e,t){if(se([No,Lo,jo,Uo],e)&&!Fs(t))return.7;return}(i.type,t));return void 0===ki("cursor",i,n)&&(i.cursor=function(e,t,n){if(t.href||e.href||ki("href",e,n))return"pointer";return e.cursor}(i,t,n)),i}function lg(e,t){const{config:n}=e;return{...sf(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Hu("x",e,{defaultPos:"mid"}),...Hu("y",e,{defaultPos:"mid"}),...qu("size",e),...qu("angle",e),...cg(e,n,t)}}function cg(e,t,n){return n?{shape:{value:n}}:qu("shape",e)}const ug={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...sf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ju("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Ju("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...qu("size",e,{vgChannel:"strokeWidth"})}:{}}};function fg(e,t,n){if(void 0===ki("align",e,n))return"center"}function dg(e,t,n){if(void 0===ki("baseline",e,n))return"middle"}const hg={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r="horizontal"===i?"width":"height",o="horizontal"===i?"height":"width";return{...sf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hu("x",e,{defaultPos:"mid",vgChannel:"xc"}),...Hu("y",e,{defaultPos:"mid",vgChannel:"yc"}),...qu("size",e,{defaultValue:pg(e),vgChannel:r}),[o]:vi(ki("thickness",n,t))}}};function pg(e){const{config:t,markDef:n}=e,{orient:i}=n,r="horizontal"===i?"width":"height",o=e.getScaleComponent("horizontal"===i?"x":"y"),a=ki("size",n,t,{vgChannel:r})??t.tick.bandSize;if(void 0!==a)return a;{const e=o?o.get("range"):void 0;if(e&&ui(e)&&(0,j.Et)(e.step))return 3*e.step/4;return 3*Dl(t.view,r)/4}}const gg={arc:{vgMark:"arc",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Hu("x",e,{defaultPos:"mid"}),...Hu("y",e,{defaultPos:"mid"}),...tf(e,"radius"),...tf(e,"theta")})},area:{vgMark:"area",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Ju("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...Ju("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...uf(e)})},bar:{vgMark:"rect",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...tf(e,"x"),...tf(e,"y")})},circle:{vgMark:"symbol",encodeEntry:e=>lg(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>({...sf(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===eo?{field:Ja(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...tf(e,"x"),...tf(e,"y"),...Nu(e,"url")})},line:{vgMark:"line",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Hu("x",e,{defaultPos:"mid"}),...Hu("y",e,{defaultPos:"mid"}),...qu("size",e,{vgChannel:"strokeWidth"}),...uf(e)})},point:{vgMark:"symbol",encodeEntry:e=>lg(e)},rect:{vgMark:"rect",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...tf(e,"x"),...tf(e,"y")})},rule:ug,square:{vgMark:"symbol",encodeEntry:e=>lg(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...sf(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Hu("x",e,{defaultPos:"mid"}),...Hu("y",e,{defaultPos:"mid"}),...Nu(e),...qu("size",e,{vgChannel:"fontSize"}),...qu("angle",e),...ff("align",fg(e.markDef,n,t)),...ff("baseline",dg(e.markDef,n,t)),...Hu("radius",e,{defaultPos:null}),...Hu("theta",e,{defaultPos:null})}}},tick:hg,trail:{vgMark:"trail",encodeEntry:e=>({...sf(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Hu("x",e,{defaultPos:"mid"}),...Hu("y",e,{defaultPos:"mid"}),...qu("size",e),...uf(e)})}};function mg(e){if(se([zo,Fo,Io],e.mark)){const t=Rs(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:yg+e.requestDataName(ou.Main),data:e.requestDataName(ou.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:bg(e,{fromPrefix:yg})}]}(e,t)}else if(e.mark===Oo){const t=pi.some((t=>ki(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=bg(e,{fromPrefix:vg}),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={...ne(t.encode.update,["y","yc","y2","height",...pi]),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={...ie(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...ne(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={...ie(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of pi){const n=$i(l,e.markDef,e.config);t.encode.update[l]?(o[l]=t.encode.update[l],delete t.encode.update[l]):n&&(o[l]=vi(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=Ja(t);n&&s.push(n),(t?.bin||t?.timeUnit)&&s.push(Ja(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=$i(i,e.markDef,e.config);return void 0!==t?{...n,[i]:vi(t)}:n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(ou.Main),name:vg+e.requestDataName(ou.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 bg(e)}const yg="faceted_path_";const vg="stack_group_";function bg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""};const{mark:n,markDef:i,encoding:r,config:o}=e,a=ze(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=wi(i),l=r.key,c=function(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,a=t.order;if(!(!(0,j.cy)(a)&&Ya(a)&&ae(a.value)||!a&&ae(ki("order",r,o)))){if(((0,j.cy)(a)||Pa(a))&&!n)return Si(a,{expr:"datum"});if(Go(i)){const n="horizontal"===r.orient?"y":"x",i=t[n];if(Pa(i)){const t=i.sort;return(0,j.cy)(t)?{field:Ja(i,{prefix:n,suffix:"sort_index",expr:"datum"})}:$a(t)?{field:Ja({aggregate:Fs(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:ka(t)?{field:Ja(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:Ja(i,{binSuffix:e.stack?.impute?"mid":void 0,expr:"datum"})}}}}}(e),u=function(e){if(!e.component.selection)return null;const t=be(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=be(i.component.selection).length,i=i.parent;return n?{interactive:t>0||"geoshape"===e.mark||!!e.encoding.tooltip}:null}(e),f=ki("aria",i,o),d=gg[n].postEncodingTransform?gg[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:gg[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...!1===f?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(ou.Main)},encode:{update:gg[n].encodeEntry(e)},...d?{transform:d}:{}}]}class xg extends $p{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,El(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=Ho(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=$i("filled",e,t),o=e.type;return ze(r,o!==No&&o!==zo&&o!==Bo)}(o,r,{graticule:e.data&&ru(e.data)}));const s=this.encoding=function(e,t,n,i){const r={};for(const a of be(e))Gt(a)||dr(`${o=a}-encoding is dropped as ${o} is not a valid encoding channel.`);var o;for(let a of en){if(!e[a])continue;const o=e[a];if(En(a)){const e=Zt(a),t=r[e];if(Pa(t)){if(Xr(t.type)&&Pa(o)&&!t.timeUnit){dr(Gi(e));continue}}else a=e,dr(Wi(e))}if("angle"!==a||"arc"!==t||e.theta||(dr("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=Ze),Ts(e,a,t)){if(a===ct&&"line"===t){const t=ss(e[a]);if(t?.aggregate){dr("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(a===ot&&(n?"fill"in e:"stroke"in e))dr(Hi("encoding",{fill:"fill"in e,stroke:"stroke"in e}));else if(a===vt||a===yt&&!(0,j.cy)(o)&&!Ya(o)||a===xt&&(0,j.cy)(o)){if(o){if(a===yt){const t=e[a];if(za(t)){r[a]=t;continue}}r[a]=(0,j.YO)(o).reduce(((e,t)=>(Pa(t)?e.push(fs(t,a)):dr(Xi(t,a)),e)),[])}}else{if(a===xt&&null===o)r[a]=null;else if(!Pa(o)&&!Ia(o)&&!Ya(o)&&!Na(o)&&!ci(o)){dr(Xi(o,a));continue}r[a]=cs(o,a,i)}}else dr(Vi(a,t))}return r}(e.encoding||{},a,o.filled,r);this.markDef=sg(o,s,r),this.size=function(e){let{encoding:t,size:n}=e;for(const i of bn){const e=Kt(i);$l(n[e])&&ja(t[i])&&(delete n[e],dr(rr(e)))}return n}({encoding:s,size:El(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=Kl(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=>vl(e)))}get hasProjection(){const{encoding:e}=this,t=this.mark===qo,n=e&&Ct.some((t=>Ga(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 Bn.reduce(((e,n)=>{const i=ls(t[n]);return i&&(e[n]=this.initScale(i.scale??{})),e}),{})}initScale(e){const{domain:t,range:n}=e,i=ai(e);return(0,j.cy)(t)&&(i.domain=t.map(mi)),(0,j.cy)(n)&&(i.range=n.map(mi)),i}initAxes(e){return bn.reduce(((t,n)=>{const i=e[n];if(Ga(i)||n===We&&Ga(e.x2)||n===Ye&&Ga(e.y2)){const e=Ga(i)?i.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=be(e),n={};for(const i of t){const t=e[i];n[i]=bs(t)?gi(t):mi(t)}return n}initLegends(e){return Nn.reduce(((t,n)=>{const i=ls(e[n]);if(i&&function(e){switch(e){case ot:case at:case st:case ct:case lt:case ft:case pt:case gt:return!0;case dt:case ht:case ut:return!1}}(n)){const e=i.legend;t[n]=e?ai(e):e}return t}),{})}parseData(){this.component.data=Kp(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of bn){const r=Kt(i);if(t[r]){const e=t[r];n.layoutSize.set(r,$l(e)?"step":e,!0)}else{const t=Yp(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=ke(r.name),o=r.select,a=(0,j.Kg)(o)?o:o.type,s=(0,j.Gv)(o)?ee(o):{type:a},l=i[a];for(const e in l)"fields"!==e&&"encodings"!==e&&("mark"===e&&(s[e]={...l[e],...s[e]}),void 0!==s[e]&&!0!==s[e]||(s[e]=ee(l[e]??s[e])));const c=n[t]={...s,name:t,type:a,init:r.value,bind:r.bind,events:(0,j.Kg)(s.on)?(0,au.P)(s.on,"scope"):(0,j.YO)(ee(s.on))},u=ee(r);for(const n of Tf)n.defined(c)&&n.parse&&n.parse(e,c,u)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=mg(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,bn.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[ag(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;for(const i of xe(e.component.selection??{})){const r=i.name,o=(0,j.r$)(r+Cf);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:`${Of}(${o}, ${(0,j.r$)(e)}${n}`})}n=!0;for(const n of Tf)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:"mousemove",update:"isTuple(group()) ? group() : unit"}]});return du(t)}(this,e)}assembleSignals(){return[...Hf(this),...cu(this,[])]}assembleSelectionData(e){return function(e,t){const n=[...t],i=zf(e,{escape:!1});for(const r of xe(e.component.selection??{})){const e={name:r.name+Cf};if(r.project.hasSelectionId&&(e.transform=[{type:"collect",sort:{field:pl}}]),r.init){const t=r.project.items.map(su);e.values=r.project.hasSelectionId?r.init.map((e=>({unit:i,[pl]:lu(e,!1)[0]}))):r.init.map((e=>({unit:i,fields:t,values:lu(e,!1)})))}n.filter((e=>e.name===r.name+Cf)).length||n.push(e)}return n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return bd(this)}assembleMarks(){let e=this.component.mark??[];return this.parent&&wp(this.parent)||(e=fu(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 ss(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Wa(t)?t:null}}class _g extends kp{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(ql(e))return new _g(e,this,this.getName(`layer_${t}`),o,r);if(As(e))return new xg(e,this,this.getName(`layer_${t}`),o,r);throw new Error(Fi(e))}))}parseData(){this.component.data=Kp(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;Gp(e=this),Wp(e,"width"),Wp(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of be(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 be(r.component.axes))n.axis[i]=Ad(e.component.resolve,i),"shared"===n.axis[i]&&(t[i]=ng(t[i],r.component.axes[i]),t[i]||(n.axis[i]="independent",delete t[i]))}for(const r of bn){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(!ci(t)){if(i[t]>0&&!n){const n=tg[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())),Hf(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),bd(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,j.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)bp(n)&&(t=fu(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),Gd(this))}}function wg(e,t,n,i,r){if(Da(e))return new Xp(e,t,n,r);if(ql(e))return new _g(e,t,n,i,r);if(As(e))return new xg(e,t,n,i,r);if(function(e){return _l(e)||wl(e)||xl(e)}(e))return new Qp(e,t,n,r);throw new Error(Fi(e))}function kg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;t.logger&&(n=t.logger,ur=n),t.fieldTitle&&ns(t.fieldTitle);try{const n=Bl((0,j.io)(t.config,e.config)),i=Pc(e,n),r=wg(i,null,"",void 0,n);r.parse(),function(e,t){Bh(e.sources);let n=0,i=0;for(let r=0;r<Rh&&Lh(e,t,!0);r++)n++;e.sources.map(Th);for(let r=0;r<Rh&&Lh(e,t,!1);r++)i++;Bh(e.sources),Math.max(n,i)===Rh&&dr(`Maximum optimization runs(${Rh}) 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?jl(e.config):void 0,o=[].concat(e.assembleSelectionData([]),function(e,t){const n=[],i=Lp(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(),c=e.assembleGroupEncodeEntry(!0);let u=e.assembleLayoutSignals();u=u.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}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...u,...e.assembleSelectionTopLevelSignals([]),...bl(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,j.Kg)(t)&&(t={type:t});if(r&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===r&&"step"===o)dr(Ni()),t.type="pad";else if("step"===r||"step"===o){const e="step"===r?"width":"height";dr(Ni(kn(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${kn(e)}`:"fit"}(n)}var a;return{...1===be(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t},...Gc(n,!1),...Gc(e,!0)}}(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:o,normalized:i}}finally{t.logger&&fr(),t.fieldTitle&&ns(es)}}const $g="5.14.0";const Eg=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};var Ag="2.14.0";const Sg="#fff",Dg="#888",Cg={background:"#333",view:{stroke:Dg},title:{color:Sg,subtitleColor:Sg},style:{"guide-label":{fill:Sg},"guide-title":{fill:Sg}},axis:{domainColor:Sg,gridColor:Dg,tickColor:Sg}},Mg="#4572a7",Fg={background:"#fff",arc:{fill:Mg},area:{fill:Mg},line:{stroke:Mg,strokeWidth:2},path:{stroke:Mg},rect:{fill:Mg},shape:{stroke:Mg},symbol:{fill:Mg,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"]}},Og="#30a2da",Tg="#cbcbcb",zg="#f0f0f0",Ng="#333",Rg={arc:{fill:Og},area:{fill:Og},axis:{domainColor:Tg,grid:!0,gridColor:Tg,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Tg,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:zg,group:{fill:zg},legend:{labelColor:Ng,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Ng,titleFontSize:14,titlePadding:10},line:{stroke:Og,strokeWidth:2},path:{stroke:Og,strokeWidth:.5},rect:{fill:Og},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:Og},bar:{binSpacing:2,fill:Og,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Bg="#000",Pg={group:{fill:"#e5e5e5"},arc:{fill:Bg},area:{fill:Bg},line:{stroke:Bg},path:{stroke:Bg},rect:{fill:Bg},shape:{stroke:Bg},symbol:{fill:Bg,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"]}},Lg="Benton Gothic, sans-serif",Ig="#82c6df",jg="Benton Gothic Bold, sans-serif",Ug="normal",qg={"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"]},Gg={background:"#ffffff",title:{anchor:"start",color:"#000000",font:jg,fontSize:22,fontWeight:"normal"},arc:{fill:Ig},area:{fill:Ig},line:{stroke:Ig,strokeWidth:2},path:{stroke:Ig},rect:{fill:Ig},shape:{stroke:Ig},symbol:{fill:Ig,size:30},axis:{labelFont:Lg,labelFontSize:11.5,labelFontWeight:"normal",titleFont:jg,titleFontSize:13,titleFontWeight:Ug},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:Lg,labelFontSize:11.5,symbolType:"square",titleFont:jg,titleFontSize:13,titleFontWeight:Ug},range:{category:qg["category-6"],diverging:qg["fireandice-6"],heatmap:qg["fire-7"],ordinal:qg["fire-7"],ramp:qg["fire-7"]}},Wg="#ab5787",Yg="#979797",Hg={background:"#f9f9f9",arc:{fill:Wg},area:{fill:Wg},line:{stroke:Wg},path:{stroke:Wg},rect:{fill:Wg},shape:{stroke:Wg},symbol:{fill:Wg,size:30},axis:{domainColor:Yg,domainWidth:.5,gridWidth:.2,labelColor:Yg,tickColor:Yg,tickWidth:.2,titleColor:Yg},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"]}},Xg="#3e5c69",Vg={background:"#fff",arc:{fill:Xg},area:{fill:Xg},line:{stroke:Xg},path:{stroke:Xg},rect:{fill:Xg},shape:{stroke:Xg},symbol:{fill:Xg},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"]}},Kg="#1696d2",Qg="#000000",Jg="Lato",Zg="Lato",em={"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"]},tm={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:Jg},axisX:{domain:!0,domainColor:Qg,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Zg,labelAngle:0,tickColor:Qg,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Jg},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:Zg,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Jg,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Zg,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Jg,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:em["six-groups-cat-1"],diverging:em["diverging-colors"],heatmap:em["diverging-colors"],ordinal:em["six-groups-seq"],ramp:em["shades-blue"]},area:{fill:Kg},rect:{fill:Kg},line:{color:Kg,stroke:Kg,strokeWidth:5},trail:{color:Kg,stroke:Kg,strokeWidth:0,size:1},path:{stroke:Kg,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Kg,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Kg,stroke:null}},arc:{fill:Kg},shape:{stroke:Kg},symbol:{fill:Kg,size:30}},nm="#3366CC",im="#ccc",rm="Arial, sans-serif",om={arc:{fill:nm},area:{fill:nm},path:{stroke:nm},rect:{fill:nm},shape:{stroke:nm},symbol:{stroke:nm},circle:{fill:nm},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:rm,fontSize:12},"guide-title":{font:rm,fontSize:12},"group-title":{font:rm,fontSize:12}},title:{font:rm,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:im,tickColor:im,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},am=e=>e*(1/3+1),sm=am(9),lm=am(10),cm=am(12),um="Segoe UI",fm="wf_standard-font, helvetica, arial, sans-serif",dm="#252423",hm="#605E5C",pm="transparent",gm="#118DFF",mm="#DEEFFF",ym=[mm,gm],vm={view:{stroke:pm},background:pm,font:um,header:{titleFont:fm,titleFontSize:cm,titleColor:dm,labelFont:um,labelFontSize:lm,labelColor:hm},axis:{ticks:!1,grid:!1,domain:!1,labelColor:hm,labelFontSize:sm,titleFont:fm,titleColor:dm,titleFontSize:cm,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:gm},line:{stroke:gm,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:um,fontSize:sm,fill:hm},arc:{fill:gm},area:{fill:gm,line:!0,opacity:.6},path:{stroke:gm},rect:{fill:gm},point:{fill:gm,filled:!0,size:75},shape:{stroke:gm},symbol:{fill:gm,strokeWidth:1.5,size:50},legend:{titleFont:um,titleFontWeight:"bold",titleColor:hm,labelFont:um,labelFontSize:lm,labelColor:hm,symbolType:"circle",symbolSize:75},range:{category:[gm,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:ym,heatmap:ym,ordinal:[mm,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",gm]}},bm='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',xm=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],_m=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function wm(e){let{type:t,background:n}=e;const i="dark"===t?"#161616":"#ffffff",r="dark"===t?"#f4f4f4":"#161616",o="dark"===t?"#d4bbff":"#6929c4";return{background:n,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:bm,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:bm,fill:r,fontWeight:400},"guide-title":{font:bm,fill:r,fontWeight:400}},range:{category:"dark"===t?xm:_m,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 km=wm({type:"light",background:"#ffffff"}),$m=wm({type:"light",background:"#f4f4f4"}),Em=wm({type:"dark",background:"#262626"}),Am=wm({type:"dark",background:"#161616"}),Sm=Ag;function Dm(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 Cm="#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 Mm="vg-tooltip-element",Fm={offsetX:10,offsetY:10,id:Mm,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,j.cy)(e))return`[${e.map((e=>t((0,j.Kg)(e)?e:Dm(e,n)))).join(", ")}]`;if((0,j.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,j.Gv)(i)&&(i=Dm(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 Om{constructor(e){this.options={...Fm,...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 Cm.toString().replace(Mm,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 Tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zm,Nm;var Rm=Bm;function Bm(e){var t=this;if(t instanceof Bm||(t=new Bm),t.tail=null,t.head=null,t.length=0,e&&"function"===typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function Pm(e,t,n){var i=t===e.head?new jm(n,null,t,e):new jm(n,t,t.next,e);return null===i.next&&(e.tail=i),null===i.prev&&(e.head=i),e.length++,i}function Lm(e,t){e.tail=new jm(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Im(e,t){e.head=new jm(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function jm(e,t,n,i){if(!(this instanceof jm))return new jm(e,t,n,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}Bm.Node=jm,Bm.create=Bm,Bm.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},Bm.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Bm.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Bm.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Lm(this,arguments[e]);return this.length},Bm.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Im(this,arguments[e]);return this.length},Bm.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},Bm.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},Bm.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,i=0;null!==n;i++)e.call(t,n.value,i,this),n=n.next},Bm.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,i=this.length-1;null!==n;i--)e.call(t,n.value,i,this),n=n.prev},Bm.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},Bm.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},Bm.prototype.map=function(e,t){t=t||this;for(var n=new Bm,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},Bm.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Bm,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},Bm.prototype.reduce=function(e,t){var n,i=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=e(n,i.value,r),i=i.next;return n},Bm.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=e(n,i.value,r),i=i.prev;return n},Bm.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},Bm.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},Bm.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Bm;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,r=this.head;null!==r&&i<e;i++)r=r.next;for(;null!==r&&i<t;i++,r=r.next)n.push(r.value);return n},Bm.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Bm;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,r=this.tail;null!==r&&i>t;i--)r=r.prev;for(;null!==r&&i>e;i--,r=r.prev)n.push(r.value);return n},Bm.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var r=[];for(n=0;i&&n<t;n++)r.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<(arguments.length<=2?0:arguments.length-2);n++)i=Pm(this,i,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return r},Bm.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=t,this.tail=e,this};try{(Nm||(Nm=1,zm=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),zm)(Bm)}catch(dv){}const Um=Rm,qm=Symbol("max"),Gm=Symbol("length"),Wm=Symbol("lengthCalculator"),Ym=Symbol("allowStale"),Hm=Symbol("maxAge"),Xm=Symbol("dispose"),Vm=Symbol("noDisposeOnSet"),Km=Symbol("lruList"),Qm=Symbol("cache"),Jm=Symbol("updateAgeOnGet"),Zm=()=>1;const ey=(e,t,n)=>{const i=e[Qm].get(t);if(i){const t=i.value;if(ty(e,t)){if(iy(e,i),!e[Ym])return}else n&&(e[Jm]&&(i.value.now=Date.now()),e[Km].unshiftNode(i));return t.value}},ty=(e,t)=>{if(!t||!t.maxAge&&!e[Hm])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Hm]&&n>e[Hm]},ny=e=>{if(e[Gm]>e[qm])for(let t=e[Km].tail;e[Gm]>e[qm]&&null!==t;){const n=t.prev;iy(e,t),t=n}},iy=(e,t)=>{if(t){const n=t.value;e[Xm]&&e[Xm](n.key,n.value),e[Gm]-=n.length,e[Qm].delete(n.key),e[Km].removeNode(t)}};class ry{constructor(e,t,n,i,r){this.key=e,this.value=t,this.length=n,this.now=i,this.maxAge=r||0}}const oy=(e,t,n,i)=>{let r=n.value;ty(e,r)&&(iy(e,n),e[Ym]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};var ay=class{constructor(e){if("number"===typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!==typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[qm]=e.max||1/0;const t=e.length||Zm;if(this[Wm]="function"!==typeof t?Zm:t,this[Ym]=e.stale||!1,e.maxAge&&"number"!==typeof e.maxAge)throw new TypeError("maxAge must be a number");this[Hm]=e.maxAge||0,this[Xm]=e.dispose,this[Vm]=e.noDisposeOnSet||!1,this[Jm]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[qm]=e||1/0,ny(this)}get max(){return this[qm]}set allowStale(e){this[Ym]=!!e}get allowStale(){return this[Ym]}set maxAge(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[Hm]=e,ny(this)}get maxAge(){return this[Hm]}set lengthCalculator(e){"function"!==typeof e&&(e=Zm),e!==this[Wm]&&(this[Wm]=e,this[Gm]=0,this[Km].forEach((e=>{e.length=this[Wm](e.value,e.key),this[Gm]+=e.length}))),ny(this)}get lengthCalculator(){return this[Wm]}get length(){return this[Gm]}get itemCount(){return this[Km].length}rforEach(e,t){t=t||this;for(let n=this[Km].tail;null!==n;){const i=n.prev;oy(this,e,n,t),n=i}}forEach(e,t){t=t||this;for(let n=this[Km].head;null!==n;){const i=n.next;oy(this,e,n,t),n=i}}keys(){return this[Km].toArray().map((e=>e.key))}values(){return this[Km].toArray().map((e=>e.value))}reset(){this[Xm]&&this[Km]&&this[Km].length&&this[Km].forEach((e=>this[Xm](e.key,e.value))),this[Qm]=new Map,this[Km]=new Um,this[Gm]=0}dump(){return this[Km].map((e=>!ty(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[Km]}set(e,t,n){if((n=n||this[Hm])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,r=this[Wm](t,e);if(this[Qm].has(e)){if(r>this[qm])return iy(this,this[Qm].get(e)),!1;const o=this[Qm].get(e).value;return this[Xm]&&(this[Vm]||this[Xm](e,o.value)),o.now=i,o.maxAge=n,o.value=t,this[Gm]+=r-o.length,o.length=r,this.get(e),ny(this),!0}const o=new ry(e,t,r,i,n);return o.length>this[qm]?(this[Xm]&&this[Xm](e,t),!1):(this[Gm]+=o.length,this[Km].unshift(o),this[Qm].set(e,this[Km].head),ny(this),!0)}has(e){if(!this[Qm].has(e))return!1;const t=this[Qm].get(e).value;return!ty(this,t)}get(e){return ey(this,e,!0)}peek(e){return ey(this,e,!1)}pop(){const e=this[Km].tail;return e?(iy(this,e),e.value):null}del(e){iy(this,this[Qm].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const e=r-t;e>0&&this.set(i.k,i.v,e)}}}prune(){this[Qm].forEach(((e,t)=>ey(this,t,!1)))}};const sy=Object.freeze({loose:!0}),ly=Object.freeze({});var cy=e=>e?"object"!==typeof e?sy:e:ly,uy={exports:{}};var fy={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 dy="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}=fy,o=dy,a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],c=t.t={};let u=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=u++;o(e,r,t),c[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[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),h("FULL",`^${l[c.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),h("LOOSE",`^${l[c.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),h("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?`+`(?:${l[c.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",l[c.COERCE],!0),h("COERCERTLFULL",l[c.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(uy,uy.exports);var hy=uy.exports;const py=/^[0-9]+$/,gy=(e,t)=>{const n=py.test(e),i=py.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};var my={compareIdentifiers:gy,rcompareIdentifiers:(e,t)=>gy(t,e)};const yy=dy,{MAX_LENGTH:vy,MAX_SAFE_INTEGER:by}=fy,{safeRe:xy,t:_y}=hy,wy=cy,{compareIdentifiers:ky}=my;var $y=class e{constructor(t,n){if(n=wy(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>vy)throw new TypeError(`version is longer than ${vy} characters`);yy("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?xy[_y.LOOSE]:xy[_y.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>by||this.major<0)throw new TypeError("Invalid major version");if(this.minor>by||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>by||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<by)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(yy("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)),ky(this.major,t.major)||ky(this.minor,t.minor)||ky(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(yy("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 ky(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(yy("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 ky(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===ky(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 Ey=$y;var Ay=(e,t,n)=>new Ey(e,n).compare(new Ey(t,n));const Sy=Ay;const Dy=Ay;const Cy=Ay;const My=Ay;const Fy=Ay;const Oy=Ay;const Ty=(e,t,n)=>0===Sy(e,t,n),zy=(e,t,n)=>0!==Dy(e,t,n),Ny=(e,t,n)=>Cy(e,t,n)>0,Ry=(e,t,n)=>My(e,t,n)>=0,By=(e,t,n)=>Fy(e,t,n)<0,Py=(e,t,n)=>Oy(e,t,n)<=0;var Ly,Iy,jy,Uy,qy=(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 Ty(e,n,i);case"!=":return zy(e,n,i);case">":return Ny(e,n,i);case">=":return Ry(e,n,i);case"<":return By(e,n,i);case"<=":return Py(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};function Gy(){if(Uy)return jy;Uy=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,g=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(g,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],c),r("tilde trim",e),e=e.replace(a[s.CARETTRIM],u),r("caret trim",e);let y=e.split(" ").map((e=>m(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,b=y.map((e=>new i(e,this.options)));for(const t of b){if(h(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return t.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(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(dv){return!1}for(let t=0;t<this.set.length;t++)if(S(this.set[t],e,this.options))return!0;return!1}}jy=e;const t=new ay({max:1e3}),n=cy,i=function(){if(Iy)return Ly;Iy=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(dv){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(">")))}}Ly=t;const n=cy,{safeRe:i,t:r}=hy,o=qy,a=dy,s=$y,l=Gy();return Ly}(),r=dy,o=$y,{safeRe:a,t:s,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:u}=hy,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=fy,h=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,g=(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},m=(e,t)=>(r("comp",e,t),e=x(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=>b(e,t))).join(" "),b=(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}))},x=(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 c=y(o),u=c||y(a),f=u||y(s),d=f;return"="===i&&d&&(i=""),l=t.includePrerelease?"-0":"",c?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(u&&(a=0),s=0,">"===i?(i=">=",u?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",u?o=+o+1:a=+a+1),"<"===i&&(l="-0"),n=`${i+o}.${a}.${s}${l}`):u?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,c,u,f,d,h)=>`${n=y(i)?"":y(r)?`>=${i}.0.0${e?"-0":""}`:y(o)?`>=${i}.${r}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=y(c)?"":y(u)?`<${+c+1}.0.0-0`:y(f)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${f}-${d}`:e?`<${c}.${u}.${+f+1}-0`:`<=${l}`}`.trim(),S=(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 jy}const Wy=Gy();var Yy=(e,t,n)=>{try{t=new Wy(t,n)}catch(dv){return!1}return t.test(e)},Hy=Tm(Yy);var Xy='.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 Vy(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)Ky(e,r);return e}function Ky(e,t){for(const n of Object.keys(t))(0,L.writeConfig)(e,n,t[n],!0)}const Qy=L;let Jy=o;const Zy="undefined"!==typeof window?window:void 0;void 0===Jy&&Zy?.vl?.compile&&(Jy=Zy.vl);const ev={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},tv={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"},nv={vega:"Vega","vega-lite":"Vega-Lite"},iv={vega:Qy.version,"vega-lite":Jy?Jy.version:"not available"},rv={vega:e=>e,"vega-lite":(e,t)=>Jy.compile(e,{config:t}).spec},ov='\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>',av="chart-wrapper";function sv(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=`${nv[i]} JSON Source`}function lv(e){return!(!e||!("load"in e))}function cv(e){return lv(e)?e:Qy.loader(e)}async function uv(e,t){let n,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,L.isString)(t)?(i=cv(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=cv(r.loader??s));const l=await fv(o,i),c=await fv(r,i),u={...Vy(c,l),config:(0,L.mergeConfig)(c.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:Vy({},ev,n.actions??{}),s={...tv,...n.i18n},l=n.renderer??"canvas",c=n.logLevel??Qy.Warn,u=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?Xy.toString():n.defaultStyle,i.appendChild(t)}}const d=function(e,t){if(e.$schema){const n=Eg(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${nv[n.library]}, but mode argument sets ${nv[t]??t}.`);const i=n.library;return Hy(iv[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${nv[i]} ${n.version}, but the current version of ${nv[i]} is v${iv[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=rv[d](t,r);if("vega-lite"===d&&h.$schema){const e=Eg(h.$schema);Hy(iv.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${iv.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(av),f.appendChild(e),p=e}const g=n.patch;g&&(h=g instanceof Function?g(h):$(h,g,!0,!1).newDocument);n.formatLocale&&Qy.formatLocale(n.formatLocale);n.timeFormatLocale&&Qy.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const a in n.expressionFunctions){const e=n.expressionFunctions[a];"fn"in e?Qy.expressionFunction(a,e.fn,e.visitor):e instanceof Function&&Qy.expressionFunction(a,e)}const{ast:m}=n,y=Qy.parse(h,"vega-lite"===d?{}:r,{ast:m}),v=new(n.viewClass||Qy.View)(y,{loader:i,logLevel:c,renderer:l,...m?{expr:Qy.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&&!lv(e)?e?.baseURL:void 0,r="function"===typeof t?t:new Om({baseURL:i,...!0===t?{}:t}).call;v.tooltip(r)}let b,{hover:x}=n;void 0===x&&(x="vega"===d);if(x){const{hoverSet:e,updateSet:t}="boolean"===typeof x?{}:x;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=ov,t.append(n),b=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",b)}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=`${u}.${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){sv(P()(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){sv(P()(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:d,renderer:l,spec:P()(t)}),n.preventDefault()})),i.append(o)}}function _(){b&&document.removeEventListener("click",b),v.finalize()}return{view:v,spec:t,vgSpec:h,finalize:_,embedOptions:n}}(e,n,u,i)}async function fv(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:()=>m});const i="view",r="[",o="]",a="{",s="}",l=":",c=",",u="@",f=">",d=/[[\]{}]/,h={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let p,g;function m(e,t,n){return p=t||i,g=n||h,v(e.trim()).map(b)}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,c,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 b(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(b);const a=b(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],m=0,v=0,b=e.length,x=0;if(e[b-1]===s){if(x=e.lastIndexOf(a),!(x>=0))throw"Unmatched right brace: "+e;try{h=function(e){const t=e.split(c);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!==n)throw e;return n}))}(e.substring(x+1,b-1))}catch(w){throw"Invalid throttle specification: "+e}b=(e=e.slice(0,x).trim()).length,x=0}if(!b)throw e;e[0]===u&&(m=++x);i=y(e,x,l),i<b&&(n.push(e.substring(v,i).trim()),v=x=++i);if(x=y(e,x,r),x===b)n.push(e.substring(v,b).trim());else if(n.push(e.substring(v,x).trim()),f=[],v=++x,v===b)throw"Unmatched left bracket: "+e;for(;x<b;){if(x=y(e,x,o),x===b)throw"Unmatched left bracket: "+e;if(f.push(e.substring(v,x).trim()),x<b-1&&e[++x]!==r)throw"Expected left bracket: "+e;v=++x}if(!(b=n.length)||d.test(n[b-1]))throw"Invalid event selector: "+e;b>1?(t.type=n[1],m?t.markname=n[0].slice(1):(_=n[0],g[_]?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:()=>We,Cn:()=>Ye,DG:()=>l,Se:()=>He,YK:()=>Ge,uS:()=>r});var i=n(518);const r="Literal",o="Property",a="ArrayExpression",s="BinaryExpression",l="CallExpression",c="ConditionalExpression",u="LogicalExpression",f="MemberExpression",d="ObjectExpression",h="UnaryExpression";function p(e){this.type=e}var g,m,y,v,b;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 u:return[e.left,e.right];case l:return[e.callee].concat(e.arguments);case c: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 x=1,_=2,w=3,k=4,$=5,E=6,A=7,S=8;(g={})[x]="Boolean",g[_]="<end>",g[w]="Identifier",g[k]="Keyword",g[$]="Null",g[E]="Numeric",g[A]="Punctuator",g[S]="String",g[9]="RegularExpression";var D="ArrayExpression",C="BinaryExpression",M="CallExpression",F="ConditionalExpression",O="Identifier",T="Literal",z="LogicalExpression",N="MemberExpression",R="ObjectExpression",B="Property",P="UnaryExpression",L="Unexpected token %0",I="Unexpected number",j="Unexpected string",U="Unexpected identifier",q="Unexpected reserved word",G="Unexpected end of input",W="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".indexOf(e)>=0}function ne(e){return"01234567".indexOf(e)>=0}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].indexOf(e)>=0}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=m.charCodeAt(y);if(!ie(e)&&!re(e))break;++y}}function ce(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)y<v&&te(m[y])?(i=m[y++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):Ee({},L,V);return String.fromCharCode(r)}function ue(){var e,t,n,i;for(t=0,"}"===(e=m[y])&&Ee({},L,V);y<v&&te(e=m[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=m.charCodeAt(y++),t=String.fromCharCode(e),92===e&&(117!==m.charCodeAt(y)&&Ee({},L,V),++y,(e=ce("u"))&&"\\"!==e&&oe(e.charCodeAt(0))||Ee({},L,V),t=e);y<v&&ae(e=m.charCodeAt(y));)++y,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==m.charCodeAt(y)&&Ee({},L,V),++y,(e=ce("u"))&&"\\"!==e&&ae(e.charCodeAt(0))||Ee({},L,V),t+=e);return t}function de(){var e,t;return e=y,t=92===m.charCodeAt(y)?fe():function(){var e,t;for(e=y++;y<v;){if(92===(t=m.charCodeAt(y)))return y=e,fe();if(!ae(t))break;++y}return m.slice(e,y)}(),{type:1===t.length?w:se.hasOwnProperty(t)?k:"null"===t?$:"true"===t||"false"===t?x:w,value:t,start:e,end:y}}function he(){var e,t,n,i,r=y,o=m.charCodeAt(y),a=m[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=m.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===m.charCodeAt(y)&&++y,{type:A,value:m.slice(r,y),start:r,end:y}}}return">>>="===(i=m.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]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:A,value:t,start:r,end:y+=2}:("//"===t&&Ee({},L,V),"<>=!+-*%&|^/".indexOf(a)>=0?(++y,{type:A,value:a,start:r,end:y}):void Ee({},L,V))}function pe(){var e,t,n;if(Z(ee((n=m[y]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=y,e="","."!==n){if(e=m[y++],n=m[y],"0"===e){if("x"===n||"X"===n)return++y,function(e){let t="";for(;y<v&&te(m[y]);)t+=m[y++];return 0===t.length&&Ee({},L,V),oe(m.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"+m[y++];for(;y<v&&ne(m[y]);)t+=m[y++];return(oe(m.charCodeAt(y))||ee(m.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(m.charCodeAt(y));)e+=m[y++];n=m[y]}if("."===n){for(e+=m[y++];ee(m.charCodeAt(y));)e+=m[y++];n=m[y]}if("e"===n||"E"===n)if(e+=m[y++],"+"!==(n=m[y])&&"-"!==n||(e+=m[y++]),ee(m.charCodeAt(y)))for(;ee(m.charCodeAt(y));)e+=m[y++];else Ee({},L,V);return oe(m.charCodeAt(y))&&Ee({},L,V),{type:E,value:parseFloat(e),start:t,end:y}}function ge(){var e,t,n,i;return b=null,le(),e=y,t=function(){var e,t,n,i;for(Z("/"===(e=m[y]),"Regular expression literal must start with a slash"),t=m[y++],n=!1,i=!1;y<v;)if(t+=e=m[y++],"\\"===e)re((e=m[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=m[y]).charCodeAt(0));)++y,"\\"===e&&y<v?Ee({},L,V):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ee({},W,n),{value:n,literal:t}}(),i=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";Ee({},W)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(i){Ee({},W)}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 me(){if(le(),y>=v)return{type:_,start:y,end:y};const e=m.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=m[y])||'"'===e,"String literal must starts with a quote"),t=y,++y;y<v;){if((n=m[y++])===e){e="";break}if("\\"===n)if((n=m[y++])&&re(n.charCodeAt(0)))"\r"===n&&"\n"===m[y]&&++y;else switch(n){case"u":case"x":"{"===m[y]?(++y,r+=ue()):r+=ce(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(m[y])&&(o=!0,i=8*i+"01234567".indexOf(m[y++]),"0123".indexOf(n)>=0&&y<v&&ne(m[y])&&(i=8*i+"01234567".indexOf(m[y++]))),r+=String.fromCharCode(i)):r+=n}else{if(re(n.charCodeAt(0)))break;r+=n}}return""!==e&&Ee({},L,V),{type:S,value:r,octal:o,start:t,end:y}}():46===e?ee(m.charCodeAt(y+1))?pe():he():ee(e)?pe():he()}function ye(){const e=b;return y=e.end,b=me(),y=e.end,e}function ve(){const e=y;b=me(),y=e}function be(e,t,n){const i=new p("||"===e||"&&"===e?z:C);return i.operator=e,i.left=t,i.right=n,i}function xe(e,t){const n=new p(M);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=m.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(B);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,G),e.type===E&&Ee(e,I),e.type===S&&Ee(e,j),e.type===w&&Ee(e,U),e.type===k&&Ee(e,q),Ee(e,L,e.value)}function Se(e){const t=ye();t.type===A&&t.value===e||Ae(t)}function De(e){return b.type===A&&b.value===e}function Ce(e){return b.type===k&&b.value===e}function Me(){const e=[];for(y=b.start,Se("[");!De("]");)De(",")?(ye(),e.push(null)):(e.push(Ue()),De("]")||Se(","));return ye(),function(e){const t=new p(D);return t.elements=e,t}(e)}function Fe(){y=b.start;const e=ye();return e.type===S||e.type===E?(e.octal&&Ee(e,H),we(e)):_e(e.value)}function Oe(){var e,t,n;return y=b.start,(e=b).type===w?(n=Fe(),Se(":"),$e("init",n,Ue())):e.type!==_&&e.type!==A?(t=Fe(),Se(":"),$e("init",t,Ue())):void Ae(e)}function Te(){var e,t,n=[],i={},r=String;for(y=b.start,Se("{");!De("}");)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),De("}")||Se(",");return Se("}"),function(e){const t=new p(R);return t.properties=e,t}(n)}const ze={if:1};function Ne(){var e,t,n;if(De("("))return function(){Se("(");const e=qe();return Se(")"),e}();if(De("["))return Me();if(De("{"))return Te();if(e=b.type,y=b.start,e===w||ze[b.value])n=_e(ye().value);else if(e===S||e===E)b.octal&&Ee(b,H),n=we(ye());else{if(e===k)throw new Error(K);e===x?((t=ye()).value="true"===t.value,n=we(t)):e===$?((t=ye()).value=null,n=we(t)):De("/")||De("/=")?(n=we(ge()),ve()):Ae(ye())}return n}function Re(){const e=[];if(Se("("),!De(")"))for(;y<v&&(e.push(Ue()),!De(")"));)Se(",");return Se(")"),e}function Be(){y=b.start;const e=ye();return function(e){return e.type===w||e.type===k||e.type===x||e.type===$}(e)||Ae(e),_e(e.value)}function Pe(){Se("[");const e=qe();return Se("]"),e}function Le(){const e=function(){var e;for(e=Ne();;)if(De("."))Se("."),e=ke(".",e,Be());else if(De("("))e=xe(e,Re());else{if(!De("["))break;e=ke("[",e,Pe())}return e}();if(b.type===A&&(De("++")||De("--")))throw new Error(K);return e}function Ie(){var e,t;if(b.type!==A&&b.type!==k)t=Le();else{if(De("++")||De("--"))throw new Error(K);if(De("+")||De("-")||De("~")||De("!"))e=ye(),t=Ie(),t=function(e,t){const n=new p(P);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 je(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 Ue(){var e,t;return e=function(){var e,t,n,i,r,o,a,s,l,c;if(e=b,l=Ie(),0===(r=je(i=b)))return l;for(i.prec=r,ye(),t=[e,b],o=[l,i,a=Ie()];(r=je(b))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,l=o.pop(),t.pop(),n=be(s,l,a),o.push(n);(i=ye()).prec=r,o.push(i),t.push(b),n=Ie(),o.push(n)}for(n=o[c=o.length-1],t.pop();c>1;)t.pop(),n=be(o[c-1].value,o[c-2],n),c-=2;return n}(),De("?")&&(ye(),t=Ue(),Se(":"),e=function(e,t,n){const i=new p(F);return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,Ue())),e}function qe(){const e=Ue();if(De(","))throw new Error(K);return e}function Ge(e){y=0,v=(m=e).length,b=null,ve();const t=qe();if(b.type!==_)throw new Error("Unexpect token after expression.");return t}var We={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||We,o=(e.functions||Ye)(d),a=e.globalvar,s=e.fieldvar,l=(0,i.Tn)(a)?a:e=>`${a}["${e}"]`;let c={},u={},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:(c[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&&(u[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(c),fields:Object.keys(u)};return c={},u={},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 c=["view","item","group","xy","x","y"],u=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&u.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),!u.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,u.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,c.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:()=>x,$G:()=>X,$P:()=>ve,AU:()=>C,B:()=>ge,B2:()=>H,BS:()=>Q,Cc:()=>$e,D_:()=>h,EV:()=>Ae,Eb:()=>ke,Et:()=>xe,G4:()=>Oe,Gv:()=>A,KH:()=>I,Kg:()=>we,Lm:()=>ye,Ln:()=>Me,M1:()=>Re,N6:()=>r,NV:()=>b,P$:()=>_,PK:()=>me,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:()=>j,cy:()=>E,dI:()=>Ne,dY:()=>oe,eV:()=>Ce,gd:()=>_e,h1:()=>Se,id:()=>d,io:()=>D,iv:()=>u,lL:()=>G,mQ:()=>fe,me:()=>y,n:()=>ce,nG:()=>he,nS:()=>o,oV:()=>W,r$:()=>Fe,rt:()=>Pe,sY:()=>i,se:()=>F,sg:()=>ae,ux:()=>De,vF:()=>$,vN:()=>m,v_:()=>p,vu:()=>V,xH:()=>g,xZ:()=>be,xv:()=>Be,y:()=>k,z3:()=>c,zy:()=>U});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 c(e){throw Error(e)}function u(e){const t=[],n=e.length;let i,r,o,a=null,s=0,l="";function u(){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)u(),a=null,s=-1;else{if(a)continue;i===s&&'"'===o||i===s&&"'"===o?(i=r+1,a=o):"."!==o||s?"["===o?(r>i&&u(),s=i=r+1):"]"===o&&(s||c("Access path missing open bracket: "+e),s>0&&u(),s=0,i=r+1):r>i?u():i=r+1}return s&&c("Access path missing closing bracket: "+e),a&&c("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function f(e,t,n){const r=u(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"),g=i((()=>1),[],"one"),m=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 b=0,x=1,_=2,w=3,k=4;function $(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v,i=e||b;return{level(e){return arguments.length?(i=+e,this):i},error(){return i>=x&&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 S=e=>"__proto__"!==e;function D(){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=M(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(!S(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]):S(r)&&(o[r]=n[r]);else e[t]=n}function M(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 F(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,B=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function P(e,t,n,i){const r=n(e[0]),o=n(F(e)),a=(o-r)*t;return[i(r-a),i(o-a)]}function L(e,t){return P(e,t,O,h)}function I(e,t){var n=Math.sign(e[0]);return P(e,t,z(n),T(n))}function j(e,t,n){return P(e,t,B(n),B(1/n))}function U(e,t,n){return P(e,t,N(n),R(n))}function q(e,t,n,i,r){const o=i(e[0]),a=i(F(e)),s=null!=t?i(t):(o+a)/2;return[r(s+(o-s)*n),r(s+(a-s)*n)]}function G(e,t,n){return q(e,t,n,O,h)}function W(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,B(i),B(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 ce(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 ue=Object.prototype.hasOwnProperty;function fe(e,t){return ue.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],c=F(e);c<l&&(s=l,l=c,c=s),s=Math.abs(t-l);const u=Math.abs(c-t);return s<u&&s<=a?i:u<=a?r:o}function ge(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 me(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 be(e){return e&&J(e[Symbol.iterator])}function xe(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]:u(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=F(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 Se(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,c=0;for(;s<r&&l<o;++c)a[c]=e(t[s],n[l])>0?n[l++]:t[s++];for(;s<r;++s,++c)a[c]=t[s];for(;l<o;++l,++c)a[c]=n[l];return a}function De(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?De(r,a)+o:"center"===i?De(r,~~(a/2))+o+De(r,Math.ceil(a/2)):o+De(r,a)}function Me(e){return e&&F(e)-e[0]||0}function Fe(e){return E(e)?"["+e.map(Fe)+"]":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=>xe(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 Be(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 Pe(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)}},88478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Bounds:()=>VS,CanvasHandler:()=>FM,CanvasRenderer:()=>BM,DATE:()=>Me,DAY:()=>Fe,DAYOFYEAR:()=>Oe,Dataflow:()=>Tr,Debug:()=>g.y,Error:()=>g.$D,EventStream:()=>vr,Gradient:()=>ZA,GroupItem:()=>QS,HOURS:()=>Te,Handler:()=>lM,HybridHandler:()=>MF,HybridRenderer:()=>DF,Info:()=>g.R2,Item:()=>KS,MILLISECONDS:()=>Re,MINUTES:()=>ze,MONTH:()=>De,Marks:()=>YC,MultiPulse:()=>Dr,None:()=>g.NV,Operator:()=>gr,Parameters:()=>dr,Pulse:()=>$r,QUARTER:()=>Se,RenderType:()=>zF,Renderer:()=>uM,ResourceLoader:()=>JS,SECONDS:()=>Ne,SVGHandler:()=>LM,SVGRenderer:()=>fF,SVGStringRenderer:()=>EF,Scenegraph:()=>eM,TIME_UNITS:()=>Be,Transform:()=>Nr,View:()=>GN,WEEK:()=>Ce,Warn:()=>g.P$,YEAR:()=>Ae,accessor:()=>g.sY,accessorFields:()=>g.nS,accessorName:()=>g.N6,array:()=>g.YO,ascending:()=>g.V_,bandwidthNRD:()=>Yr,bin:()=>Hr,bootstrapCI:()=>Kr,boundClip:()=>UF,boundContext:()=>bD,boundItem:()=>HC,boundMark:()=>VC,boundStroke:()=>tD,changeset:()=>ur,clampRange:()=>g.BS,codegenExpression:()=>UO.Se,compare:()=>g.UD,constant:()=>g.dY,cumulativeLogNormal:()=>fo,cumulativeNormal:()=>oo,cumulativeUniform:()=>vo,dayofyear:()=>Ge,debounce:()=>g.sg,defaultLocale:()=>wi,definition:()=>Br,densityLogNormal:()=>uo,densityNormal:()=>ro,densityUniform:()=>yo,domChild:()=>rM,domClear:()=>oM,domCreate:()=>nM,domFind:()=>iM,dotbin:()=>Qr,error:()=>g.z3,expressionFunction:()=>rB,extend:()=>g.X$,extent:()=>g.Xx,extentIndex:()=>g.n,falsy:()=>g.me,fastmap:()=>g.nG,field:()=>g.ZZ,flush:()=>g.bX,font:()=>PC,fontFamily:()=>BC,fontSize:()=>OC,format:()=>Yi,formatLocale:()=>pi,formats:()=>Hi,hasOwnProperty:()=>g.mQ,id:()=>g.id,identity:()=>g.D_,inferType:()=>Li,inferTypes:()=>Ii,ingest:()=>rr,inherits:()=>g.B,inrange:()=>g.PK,interpolate:()=>_O,interpolateColors:()=>bO,interpolateRange:()=>vO,intersect:()=>BF,intersectBoxLine:()=>MD,intersectPath:()=>AD,intersectPoint:()=>SD,intersectRule:()=>CD,isArray:()=>g.cy,isBoolean:()=>g.Lm,isDate:()=>g.$P,isFunction:()=>g.Tn,isIterable:()=>g.xZ,isNumber:()=>g.Et,isObject:()=>g.Gv,isRegExp:()=>g.gd,isString:()=>g.Kg,isTuple:()=>tr,key:()=>g.Eb,lerp:()=>g.Cc,lineHeight:()=>TC,loader:()=>Ki,locale:()=>_i,logger:()=>g.vF,lruCache:()=>g.EV,markup:()=>iF,merge:()=>g.h1,mergeConfig:()=>g.io,multiLineOffset:()=>NC,one:()=>g.xH,pad:()=>g.eV,panLinear:()=>g.VC,panLog:()=>g.KH,panPow:()=>g.co,panSymlog:()=>g.zy,parse:()=>iU,parseExpression:()=>UO.YK,parseSelector:()=>aB.P,path:()=>El,pathCurves:()=>tS,pathEqual:()=>WF,pathParse:()=>sS,pathRectangle:()=>FS,pathRender:()=>vS,pathSymbols:()=>wS,pathTrail:()=>OS,peek:()=>g.se,point:()=>sM,projection:()=>z_,quantileLogNormal:()=>ho,quantileNormal:()=>ao,quantileUniform:()=>bo,quantiles:()=>Gr,quantizeInterpolator:()=>xO,quarter:()=>g.$G,quartiles:()=>Wr,random:()=>Xr,randomInteger:()=>Zr,randomKDE:()=>lo,randomLCG:()=>Jr,randomLogNormal:()=>po,randomMixture:()=>go,randomNormal:()=>so,randomUniform:()=>xo,read:()=>Vi,regressionConstant:()=>_o,regressionExp:()=>Do,regressionLinear:()=>Ao,regressionLoess:()=>No,regressionLog:()=>So,regressionPoly:()=>Fo,regressionPow:()=>Co,regressionQuad:()=>Mo,renderModule:()=>RF,repeat:()=>g.ux,resetDefaultLocale:()=>ki,resetSVGClipId:()=>HS,resetSVGDefIds:()=>YF,responseType:()=>Xi,runtimeContext:()=>Kz,sampleCurve:()=>Lo,sampleLogNormal:()=>co,sampleNormal:()=>io,sampleUniform:()=>mo,scale:()=>yO,sceneEqual:()=>GF,sceneFromJSON:()=>JC,scenePickVisit:()=>jD,sceneToJSON:()=>QC,sceneVisit:()=>ID,sceneZOrder:()=>LD,scheme:()=>EO,serializeXML:()=>rF,setHybridRendererOptions:()=>SF,setRandom:()=>Vr,span:()=>g.Ln,splitAccessPath:()=>g.iv,stringValue:()=>g.r$,textMetrics:()=>AC,timeBin:()=>zt,timeFloor:()=>at,timeFormatLocale:()=>bi,timeInterval:()=>dt,timeOffset:()=>gt,timeSequence:()=>vt,timeUnitSpecifier:()=>je,timeUnits:()=>Le,toBoolean:()=>g.G4,toDate:()=>g.ay,toNumber:()=>g.Ro,toSet:()=>g.M1,toString:()=>g.dI,transform:()=>Pr,transforms:()=>Rr,truncate:()=>g.xv,truthy:()=>g.vN,tupleid:()=>nr,typeParsers:()=>Ri,utcFloor:()=>ct,utcInterval:()=>ht,utcOffset:()=>mt,utcSequence:()=>bt,utcdayofyear:()=>Ke,utcquarter:()=>g.vu,utcweek:()=>Qe,version:()=>rU,visitArray:()=>g.rt,week:()=>We,writeConfig:()=>g.AU,zero:()=>g.v_,zoomLinear:()=>g.lL,zoomLog:()=>g.oV,zoomPow:()=>g.SW,zoomSymlog:()=>g.B2});var i={};n.r(i),n.d(i,{aggregate:()=>oa,bin:()=>aa,collect:()=>la,compare:()=>ca,countpattern:()=>fa,cross:()=>da,density:()=>ma,dotbin:()=>_a,expression:()=>wa,extent:()=>$a,facet:()=>Aa,field:()=>Sa,filter:()=>Ca,flatten:()=>Ma,fold:()=>Fa,formula:()=>Oa,generate:()=>Ta,impute:()=>Ra,joinaggregate:()=>Ba,kde:()=>Pa,key:()=>La,load:()=>ja,lookup:()=>qa,multiextent:()=>Ga,multivalues:()=>Ya,params:()=>Xa,pivot:()=>Va,prefacet:()=>Ka,project:()=>Qa,proxy:()=>Ja,quantile:()=>Za,relay:()=>es,sample:()=>ts,sequence:()=>ns,sieve:()=>is,subflow:()=>Ea,timeunit:()=>rs,tupleindex:()=>as,values:()=>ss,window:()=>ds});var r={};n.r(r),n.d(r,{interpolate:()=>hc.A,interpolateArray:()=>zc.A,interpolateBasis:()=>Nc.A,interpolateBasisClosed:()=>Rc.A,interpolateCubehelix:()=>Nu,interpolateCubehelixLong:()=>Ru,interpolateDate:()=>Bc.A,interpolateDiscrete:()=>Pc,interpolateHcl:()=>wu,interpolateHclLong:()=>ku,interpolateHsl:()=>Qc,interpolateHslLong:()=>Jc,interpolateHue:()=>Ic,interpolateLab:()=>xu,interpolateNumber:()=>jc.A,interpolateNumberArray:()=>Uc.A,interpolateObject:()=>qc.A,interpolateRgb:()=>Xc.Ay,interpolateRgbBasis:()=>Xc.Ik,interpolateRgbBasisClosed:()=>Xc.uL,interpolateRound:()=>pc.A,interpolateString:()=>Gc.A,interpolateTransformCss:()=>Wc.T,interpolateTransformSvg:()=>Wc.I,interpolateZoom:()=>Hc,piecewise:()=>wc,quantize:()=>Bu});var o={};n.r(o),n.d(o,{bound:()=>uy,identifier:()=>hy,mark:()=>py,overlap:()=>gy,render:()=>wy,viewlayout:()=>Gy});var a={};n.r(a),n.d(a,{axisticks:()=>Yy,datajoin:()=>Hy,encode:()=>Vy,legendentries:()=>Ky,linkpath:()=>tv,pie:()=>av,scale:()=>uv,sortitems:()=>pv,stack:()=>bv});var s={};n.r(s),n.d(s,{contour:()=>iw,geojson:()=>aw,geopath:()=>sw,geopoint:()=>lw,geoshape:()=>cw,graticule:()=>uw,heatmap:()=>fw,isocontour:()=>H_,kde2d:()=>ew,projection:()=>hw});var l={};n.r(l),n.d(l,{force:()=>Vw});var c={};n.r(c),n.d(c,{nest:()=>n$,pack:()=>l$,partition:()=>u$,stratify:()=>f$,tree:()=>p$,treelinks:()=>g$,treemap:()=>v$});var u={};n.r(u),n.d(u,{label:()=>j$});var f={};n.r(f),n.d(f,{loess:()=>q$,regression:()=>W$});var d={};n.r(d),n.d(d,{voronoi:()=>$E});var h={};n.r(h),n.d(h,{wordcloud:()=>IE});var p={};n.r(p),n.d(p,{crossfilter:()=>XE,resolvefilter:()=>VE});var g=n(518),m={},y={},v=34,b=10,x=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,c=!1;function u(){if(l)return y;if(c)return c=!1,m;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++))===b?c=!0:i===x&&(c=!0,e.charCodeAt(a)===b&&++a),e.slice(r+1,t-1).replace(/""/g,'"')}for(;a<o;){if((i=e.charCodeAt(t=a++))===b)c=!0;else if(i===x)c=!0,e.charCodeAt(a)===b&&++a;else if(i!==n)continue;return e.slice(r,t)}return l=!0,e.slice(r,o)}for(e.charCodeAt(o-1)===b&&--o,e.charCodeAt(o-1)===x&&--o;(i=u())!==y;){for(var f=[];i!==m&&i!==y;)f.push(i),i=u();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 S(e,t){return"string"===typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return D(e,t)}))}:D(e,t)}function D(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,c=e.length,u=new Array(c);for(u[0]=(t+=e[0])*i+o,u[1]=(n+=e[1])*r+a;l<c;)u[l]=e[l],++l;return u}}(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 M(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 c=o===n?n:n.concat(o);i[c.start=n.start]=r[c.end=o.end]=c}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 u=o===n?n:o.concat(n);i[u.start=o.start]=r[u.end=n.end]=u}else i[n.start]=r[n.end]=n;else i[(n=[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 F(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 c(e){e.forEach(l)}function u(e){switch(i=e,e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":c(e.arcs)}}return u(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:M(e,i)}}var T=n(17698),z=n(46047),N=n(16038),R=n(96324),B=n(52102),P=n(55453),L=n(75351);const I=new Date,j=new Date;function U(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=>U((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),j.setTime(+i),e(I),e(j),Math.floor(n(I,j))),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,G=6e4,W=36e5,Y=864e5,H=6048e5,X=2592e6,V=31536e6,K=U((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*G)/Y),(e=>e.getDate()-1)),Q=(K.range,U((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,U((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 U((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())*G)/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 U((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),ce=se(1),ue=se(2),fe=se(3),de=se(4),he=se(5),pe=se(6),ge=(le.range,ce.range,ue.range,fe.range,de.range,he.range,pe.range,U((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())));ge.every=e=>isFinite(e=Math.floor(e))&&e>0?U((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;ge.range;const me=U((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()));me.every=e=>isFinite(e=Math.floor(e))&&e>0?U((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;me.range;const ye=U((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,U((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()))),be=(ve.range,U((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*q-e.getMinutes()*G)}),((e,t)=>{e.setTime(+e+t*W)}),((e,t)=>(t-e)/W),(e=>e.getHours()))),xe=(be.range,U((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*W)}),((e,t)=>(t-e)/W),(e=>e.getUTCHours()))),_e=(xe.range,U((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*q)}),((e,t)=>{e.setTime(+e+t*G)}),((e,t)=>(t-e)/G),(e=>e.getMinutes()))),we=(_e.range,U((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*G)}),((e,t)=>(t-e)/G),(e=>e.getUTCMinutes()))),ke=(we.range,U((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*q)}),((e,t)=>(t-e)/q),(e=>e.getUTCSeconds()))),$e=(ke.range,U((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));$e.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?U((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",Se="quarter",De="month",Ce="week",Me="date",Fe="day",Oe="dayofyear",Te="hours",ze="minutes",Ne="seconds",Re="milliseconds",Be=[Ae,Se,De,Ce,Me,Fe,Oe,Te,ze,Ne,Re],Pe=Be.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function Le(e){const t=(0,g.YO)(e).slice(),n={};t.length||(0,g.z3)("Missing time unit."),t.forEach((e=>{(0,g.mQ)(Pe,e)?n[e]=1:(0,g.z3)(`Invalid time unit: ${e}.`)}));return(n[Ce]||n[Fe]?1:0)+(n[Se]||n[De]||n[Me]?1:0)+(n[Oe]?1:0)>1&&(0,g.z3)(`Incompatible time units: ${e}`),t.sort(((e,t)=>Pe[e]-Pe[t])),t}const Ie={[Ae]:"%Y ",[Se]:"Q%q ",[De]:"%b ",[Me]:"%d ",[Ce]:"W%U ",[Fe]:"%a ",[Oe]:"%j ",[Te]:"%H:00",[ze]:"00:%M",[Ne]:":%S",[Re]:".%L",[`${Ae}-${De}`]:"%Y-%m ",[`${Ae}-${De}-${Me}`]:"%Y-%m-%d ",[`${Te}-${ze}`]:"%H:%M"};function je(e,t){const n=(0,g.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 Ue=new Date;function qe(e){return Ue.setFullYear(e),Ue.setMonth(0),Ue.setDate(1),Ue.setHours(0,0,0,0),Ue}function Ge(e){return Ye(new Date(e))}function We(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 Ue.setTime(Date.UTC(e,0,1)),Ue.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,g.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,c=(0,g.M1)(e),u=c[Ae]?s(Ae):(0,g.dY)(2012),f=c[De]?s(De):c[Se]?s(Se):g.v_,d=c[Ce]&&c[Fe]?s(Fe,1,Ce+Fe):c[Ce]?s(Ce,1):c[Fe]?s(Fe,1):c[Me]?s(Me,1):c[Oe]?s(Oe,1):g.xH,h=c[Te]?s(Te):g.v_,p=c[ze]?s(ze):g.v_,m=c[Ne]?s(Ne):g.v_,y=c[Re]?s(Re):g.v_;return function(e){l.setTime(+e);const t=u(l);return r(t,f(l),d(l,t),h(l),p(l),m(l),y(l))}}function it(e,t,n){return t+7*e-(n+6)%7}const rt={[Ae]:e=>e.getFullYear(),[Se]:e=>Math.floor(e.getMonth()/3),[De]:e=>e.getMonth(),[Me]: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+Fe]:(e,t)=>it(He(e),e.getDay(),Xe(t)),[Fe]:(e,t)=>it(1,e.getDay(),Xe(t))},ot={[Se]: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(),[Se]:e=>Math.floor(e.getUTCMonth()/3),[De]:e=>e.getUTCMonth(),[Me]: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),[Fe]:(e,t)=>it(1,e.getUTCDay(),et(t)),[Ce+Fe]:(e,t)=>it(Ze(e),e.getUTCDay(),et(t))},lt={[Se]:e=>3*e,[Ce]:(e,t)=>it(e,0,et(t))};function ct(e,t){return nt(e,t||1,st,lt,tt)}const ut={[Ae]:ge,[Se]:ye.every(3),[De]:ye,[Ce]:ee,[Me]:K,[Fe]:K,[Oe]:K,[Te]:be,[ze]:_e,[Ne]:ke,[Re]:$e},ft={[Ae]:me,[Se]:ve.every(3),[De]:ve,[Ce]:le,[Me]:Q,[Fe]:Q,[Oe]:Q,[Te]:xe,[ze]:we,[Ne]:ke,[Re]:$e};function dt(e){return ut[e]}function ht(e){return ft[e]}function pt(e,t,n){return e?e.offset(t,n):void 0}function gt(e,t,n){return pt(dt(e),t,n)}function mt(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 bt(e,t,n,i){return yt(ht(e),t,n,i)}const xt=1e3,_t=6e4,wt=36e5,kt=864e5,$t=2592e6,Et=31536e6,At=[Ae,De,Me,Te,ze,Ne,Re],St=At.slice(0,-1),Dt=St.slice(0,-1),Ct=Dt.slice(0,-1),Mt=Ct.slice(0,-1),Ft=[Ae,De],Ot=[Ae],Tt=[[St,1,xt],[St,5,5e3],[St,15,15e3],[St,30,3e4],[Dt,1,_t],[Dt,5,3e5],[Dt,15,9e5],[Dt,30,18e5],[Ct,1,wt],[Ct,3,108e5],[Ct,6,216e5],[Ct,12,432e5],[Mt,1,kt],[[Ae,Ce],1,6048e5],[Ft,1,$t],[Ft,3,7776e6],[Ot,1,Et]];function zt(e){const t=e.extent,n=e.maxbins||40,i=Math.abs((0,g.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 Bt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Pt(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,c=Kt(r),u=Qt(r),f=Kt(o),d=Qt(o),h=Kt(a),p=Qt(a),g=Kt(s),m=Qt(s),y=Kt(l),v=Qt(l),b={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:bn,e:bn,f:$n,g:Nn,G:Bn,H:xn,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:Sn,u:Dn,U:Cn,V:Fn,w:On,W:Tn,x:null,X:null,y:zn,Y:Rn,Z:Pn,"%":oi},x={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:Gn,g:ti,G:ii,H:In,I:jn,j:Un,L:qn,m:Wn,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=g.exec(t.slice(n));return i?(e.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return $(e,t,n,i)},d:cn,e:cn,f:gn,g:on,G:rn,H:fn,I:fn,j:un,L:pn,m:ln,M:dn,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.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,"%":mn};function w(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=Gt[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=Bt(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(Bt(o.y,0,1))).getUTCDay(),i=r>4||0===r?ce.ceil(i):ce(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(Bt(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(Bt(o.y,0,1)).getUTCDay():Nt(Bt(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 Gt?t.charAt(a++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=w(n,b),b.X=w(i,b),b.c=w(t,b),x.x=w(n,x),x.X=w(i,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);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+="",x);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,jt,Ut,qt,Gt={"-":"",_:" ",0:"0"},Wt=/^\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=Wt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Zt(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function en(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function tn(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function nn(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function rn(e,t,n){var i=Wt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function on(e,t,n){var i=Wt.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=Wt.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=Wt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function cn(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function un(e,t,n){var i=Wt.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=Wt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function dn(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function hn(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function pn(e,t,n){var i=Wt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function gn(e,t,n){var i=Wt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function mn(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=Wt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function vn(e,t,n){var i=Wt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function bn(e,t){return Xt(e.getDate(),t,2)}function xn(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(ge(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 Sn(e,t){return Xt(e.getSeconds(),t,2)}function Dn(e){var t=e.getDay();return 0===t?7:t}function Cn(e,t){return Xt(ee.count(ge(e)-1,e),t,2)}function Mn(e){var t=e.getDay();return t>=4||0===t?re(e):re.ceil(e)}function Fn(e,t){return e=Mn(e),Xt(re.count(ge(e),e)+(4===ge(e).getDay()),t,2)}function On(e){return e.getDay()}function Tn(e,t){return Xt(te.count(ge(e)-1,e),t,2)}function zn(e,t){return Xt(e.getFullYear()%100,t,2)}function Nn(e,t){return Xt((e=Mn(e)).getFullYear()%100,t,2)}function Rn(e,t){return Xt(e.getFullYear()%1e4,t,4)}function Bn(e,t){var n=e.getDay();return Xt((e=n>=4||0===n?re(e):re.ceil(e)).getFullYear()%1e4,t,4)}function Pn(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 jn(e,t){return Xt(e.getUTCHours()%12||12,t,2)}function Un(e,t){return Xt(1+Q.count(me(e),e),t,3)}function qn(e,t){return Xt(e.getUTCMilliseconds(),t,3)}function Gn(e,t){return qn(e,t)+"000"}function Wn(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(me(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(me(e),e)+(4===me(e).getUTCDay()),t,2)}function Jn(e){return e.getUTCDay()}function Zn(e,t){return Xt(ce.count(me(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 ci(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,B.A)(a))||(o.precision=l-2*("%"===o.type))}return t(o)}}}let ui,fi;function di(){return ui=ci({format:P.GP,formatPrefix:P.s})}function hi(e){return ci((0,L.A)(e))}function pi(e){return arguments.length?ui=hi(e):ui}function gi(e,t,n){n=n||{},(0,g.Gv)(n)||(0,g.z3)(`Invalid time multi-format specifier: ${n}`);const i=t(Ne),r=t(ze),o=t(Te),a=t(Me),s=t(Ce),l=t(De),c=t(Se),u=t(Ae),f=e(n[Re]||".%L"),d=e(n[Ne]||":%S"),h=e(n[ze]||"%I:%M"),p=e(n[Te]||"%I %p"),m=e(n[Me]||n[Fe]||"%a %d"),y=e(n[Ce]||"%b %d"),v=e(n[De]||"%B"),b=e(n[Se]||"%B"),x=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?m:y:u(e)<e?c(e)<e?v:b:x)(e)}function mi(e){const t=li(e.format),n=li(e.utcFormat);return{timeFormat:e=>(0,g.Kg)(e)?t(e):gi(t,dt,e),utcFormat:e=>(0,g.Kg)(e)?n(e):gi(n,ht,e),timeParse:li(e.parse),utcParse:li(e.utcParse)}}function yi(){return fi=mi({format:It,parse:jt,utcFormat:Ut,utcParse:qt})}function vi(e){return mi(Pt(e))}function bi(e){return arguments.length?fi=vi(e):fi}!function(e){Lt=Pt(e),It=Lt.format,jt=Lt.parse,Ut=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 xi=(e,t)=>(0,g.X$)({},e,t);function _i(e,t){const n=e?hi(e):pi(),i=t?vi(t):bi();return xi(n,i)}function wi(e,t){const n=arguments.length;return n&&2!==n&&(0,g.z3)("defaultLocale expects either zero or two arguments."),n?xi(pi(e),bi(t)):xi(pi(),bi())}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,Si="file://";async function Di(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,g.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,g.z3)("Sanitize failure, invalid URI: "+(0,g.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(Si))||"file"===t.mode||"http"!==t.mode&&!l&&n,r?e=e.slice(Si.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 Mi(e){return e?t=>new Promise(((n,i)=>{e.readFile(t,((e,t)=>{e?i(e):n(t)}))})):Fi}async function Fi(){(0,g.z3)("No file system access.")}function Oi(e){return e?async function(t,n){const i=(0,g.X$)({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?(0,g.Tn)(o[r])?o[r]():o.text():(0,g.z3)(o.status+""+o.statusText)}:Ti}async function Ti(){(0,g.z3)("No HTTP fetch method available.")}const zi=e=>null!=e&&e===e,Ni=e=>!Number.isNaN(+e)&&!(e instanceof Date),Ri={boolean:g.G4,integer:g.Ro,number:g.Ro,date:g.ay,string:g.dI,unknown:g.D_},Bi=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>Ni(e)&&Number.isInteger(+e),Ni,e=>!Number.isNaN(Date.parse(e))],Pi=["boolean","integer","number","date"];function Li(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Bi.length,r=Bi.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)&&!Bi[o](a)&&(r[o]=0,++l,l===Bi.length))return"string";return Pi[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 ji(e){const t=function(t,n){const i={delimiter:e};return Ui(t,n?(0,g.X$)(n,i):i)};return t.responseType="text",t}function Ui(e,t){return t.header&&(e=t.header.map(g.r$).join(t.delimiter)+"\n"+e),E(t.delimiter).parse(e+"")}function qi(e,t){const n=t&&t.property?(0,g.ZZ)(t.property):g.D_;return!(0,g.Gv)(e)||(i=e,"function"===typeof Buffer&&(0,g.Tn)(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){!(0,g.cy)(e)&&(0,g.xZ)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}Ui.responseType="text",qi.responseType="json";const Gi={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Wi(e,t){let n,i,r,o;return e=qi(e,t),t&&t.feature?(n=S,r=t.feature):t&&t.mesh?(n=F,r=t.mesh,o=Gi[t.filter]):(0,g.z3)("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):(0,g.z3)("Invalid TopoJSON object: "+r),i&&i.features||[i]}Wi.responseType="json";const Yi={dsv:Ui,csv:ji(","),tsv:ji("\t"),json:qi,topojson:Wi};function Hi(e,t){return arguments.length>1?(Yi[e]=t,this):(0,g.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,g.z3)("Unknown data format type: "+t.type),e=r(e,t),t.parse&&function(e,t,n,i){if(!e.length)return;const r=bi();n=n||r.timeParse,i=i||r.utcParse;let o,a,s,l,c,u,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,c=e.length,u=f.length;s<c;++s)for(o=e[s],l=0;l<u;++l)a=f[l],o[a]=d[l](o[a])}(e,t.parse,n,i),(0,g.mQ)(e,"columns")&&delete e.columns,e}const Ki=function(e,t){return n=>({options:n||{},sanitize:Ci,load:Di,fileAccess:!!t,file:Mi(t),http:Oi(e)})}("undefined"!==typeof fetch&&fetch,null);function Qi(e){const t=e||g.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 cr(e){return e&&e.constructor===ur}function ur(){const e=[],t=[],n=[],i=[],r=[];let o=null,a=!1;return{constructor:ur,insert(t){const n=(0,g.YO)(t),i=n.length;for(let r=0;r<i;++r)e.push(n[r]);return this},remove(e){const n=(0,g.Tn)(e)?i:t,r=(0,g.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,g.dY)(i)};return(0,g.Tn)(e)?(o.filter=e,r.push(o)):(o.tuple=e,n.push(o)),this},encode(e,t){return(0,g.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 c={},u={};let f,d,h,p,g,m;for(f=0,d=l.length;f<d;++f)c[nr(l[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],c[nr(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],l.forEach((e=>{p(e)&&(c[nr(e)]=-1)}));for(f=0,d=e.length;f<d;++f)g=e[f],m=nr(g),c[m]?c[m]=1:s.add.push(rr(e[f]));for(f=0,d=l.length;f<d;++f)g=l[f],c[nr(g)]<0&&s.rem.push(g);function y(e,t,n){n?e[t]=n(e):s.encode=t,a||(u[nr(e)]=e)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=c[nr(g)],m>0&&(y(g,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)&&c[nr(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||i.length?l.filter((e=>c[nr(e)]>0)):l.slice();else for(m in u)s.mod.push(u[m]);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,g.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,g.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 gr(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 mr(e){return function(t){const n=this.flags;return 0===arguments.length?!!(n&e):(this.flags=t?n|e:n&~e,this)}}gr.prototype={targets(){return this._targets||(this._targets=Qi(g.id))},set(e){return this.value!==e?(this.value=e,1):0},skip:mr(1),modified:mr(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,c;const u=(e,n,a)=>{a instanceof gr?(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,g.YO)(s).forEach((e=>{e instanceof gr?e!==this&&(e.targets().add(this),o.push(e)):(0,g.z3)("Pulse parameters must be operator instances.")})),this.source=s;else if((0,g.cy)(s))for(i.set(a,-1,Array(l=s.length)),c=0;c<l;++c)u(a,c,s[c]);else u(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 br(e,t,n){return new vr(e,t,n)}vr.prototype={_filter:g.vN,_apply:g.D_,targets(){return this._targets||(this._targets=Qi(g.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=br(e);return this.targets().add(t),t},apply(e){const t=br(null,e);return this.targets().add(t),t},merge(){const e=br();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=br();return this.targets().add(br(null,null,(0,g.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(br(null,null,(()=>n=!0))),t.targets().add(br(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=g.vN,this._targets=null}};const xr={skip:!0};function _r(e,t,n,i,r,o){const a=(0,g.X$)({},o,xr);let s,l;(0,g.Tn)(n)||(n=(0,g.dY)(n)),void 0===i?s=t=>e.touch(n(t)):(0,g.Tn)(i)?(l=new gr(null,i,r,!1),s=t=>{l.evaluate(t);const i=n(t),r=l.value;cr(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 gr(null,function(e,t){return t=(0,g.Tn)(t)?t:(0,g.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,g.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 Sr(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}function Dr(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,g.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,g.cy)(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=Sr(n.addF,t)),2&e&&(n.remF=Sr(n.remF,t)),4&e&&(n.modF=Sr(n.modF,t)),16&e&&(n.srcF=Sr(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,g.rt)(n.source,n.srcF,i),n;1&e&&(0,g.rt)(n.add,n.addF,i),2&e&&(0,g.rt)(n.rem,n.remF,i),4&e&&(0,g.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,g.rt)(r,Ar(n,5),i):(0,g.rt)(r,n.srcF,i))}return n}},(0,g.B)(Dr,$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,g.cy)(e)?e.some((e=>n[e])):n[e]:0},filter(){(0,g.z3)("MultiPulse does not support filtering.")},materialize(){(0,g.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 Mr={skip:!1,force:!1};function Fr(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,g.vF)()),this.logLevel(g.$D),this._clock=0,this._rank=0,this._locale=wi();try{this._loader=Ki()}catch(e){}this._touched=Qi(g.id),this._input={},this._pulse=null,this._heap=Fr(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function zr(e){return function(){return this._log[e].apply(this,arguments)}}function Nr(e,t){gr.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 gr?r=e:e&&e.prototype instanceof gr?r=new e:(0,g.Tn)(e)?r=new gr(null,e):(o=0,r=new gr(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,g.z3)("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Mr);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||Mr;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const i=n||Mr;return(e.set(t)||i.force)&&this.touch(e,i),this},changeset:ur,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(g.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=br(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,g.YO)(e);const l=s.length;for(let c=0;c<l;++c)s[c].addEventListener(t,a);return o},on:function(e,t,n,i,r){return(e instanceof gr?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(g.id);let a,s,l,c=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))),++c):i._enqueue(a,!0)}catch(u){i._heap.clear(),l=u}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${c} 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(u){i.error(u)}}))})))),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,g.cy)(n)?new Dr(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,g.B)(Nr,gr,{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 Br(e){const t=Pr(e);return t&&t.Definition||null}function Pr(e){return e=e&&e.toLowerCase(),(0,g.mQ)(Rr,e)?Rr[e]:null}var Lr=n(25638),Ir=n(8410),jr=n(39687),Ur=n(89504);function*qr(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 Gr(e,t,n){const i=Float64Array.from(qr(e,n));return i.sort(Lr.A),t.map((e=>(0,Ir.Z4)(i,e)))}function Wr(e,t){return Gr(e,[.25,.5,.75],t)}function Yr(e,t){const n=e.length,i=(0,jr.A)(e,t),r=Wr(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 Hr(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o,a,s,l,c,u,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,c=0,u=e.steps.length;c<u&&e.steps[c]<l;++c);o=e.steps[Math.max(0,c-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(c=0,u=r.length;c<u;++c)l=o/r[c],l>=s&&h/l<=t&&(o=l)}l=Math.log(o);const p=l>=0?0:1+~~(-l/i),g=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(l=Math.floor(f/o+g)*o,f=f<l?l-o:l,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}var Xr=Math.random;function Vr(e){Xr=e}function Kr(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(qr(e,i)),o=r.length,a=t;let s,l,c,u;for(c=0,u=Array(a);c<a;++c){for(s=0,l=0;l<o;++l)s+=r[~~(Xr()*o)];u[c]=s/o}return u.sort(Lr.A),[(0,Ir.Ay)(u,n/2),(0,Ir.Ay)(u,1-n/2)]}function Qr(e,t,n,i){i=i||(e=>e);const r=e.length,o=new Float64Array(r);let a,s=0,l=1,c=i(e[0]),u=c,f=c+t;for(;l<r;++l){if(a=i(e[l]),a>=f){for(u=(c+u)/2;s<l;++s)o[s]=u;f=a+t,c=a}u=a}for(u=(c+u)/2;s<l;++s)o[s]=u;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 Jr(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function Zr(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*Xr()),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 eo=Math.sqrt(2*Math.PI),to=Math.SQRT2;let no=NaN;function io(e,t){e=e||0,t=null==t?1:t;let n,i,r=0,o=0;if(no===no)r=no,no=NaN;else{do{r=2*Xr()-1,o=2*Xr()-1,n=r*r+o*o}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,no=o*i}return e+r*t}function ro(e,t,n){const i=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*eo)}function oo(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 ao(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*to*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 so(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:()=>io(n,i),pdf:e=>ro(e,n,i),cdf:e=>oo(e,n,i),icdf:e=>ao(e,n,i)};return r.mean(e).stdev(t)}function lo(e,t){const n=so();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=Yr(e)),r):t},sample:()=>e[~~(Xr()*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 co(e,t){return e=e||0,t=null==t?1:t,Math.exp(e+io()*t)}function uo(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*eo*e)}function fo(e,t,n){return oo(Math.log(e),t,n)}function ho(e,t,n){return Math.exp(ao(e,t,n))}function po(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=>uo(e,n,i),cdf:e=>fo(e,n,i),icdf:e=>ho(e,n,i)};return r.mean(e).stdev(t)}function go(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=Xr();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 mo(e,t){return null==t&&(t=null==e?1:e,e=0),e+(t-e)*Xr()}function yo(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=t&&e<=n?1/(n-t):0}function vo(e,t,n){return null==n&&(n=null==t?1:t,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function bo(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function xo(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:()=>mo(n,i),pdf:e=>yo(e,n,i),cdf:e=>vo(e,n,i),icdf:e=>bo(e,n,i)};return null==t&&(t=null==e?1:e,e=0),r.min(e).max(t)}function _o(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 wo(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 ko(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,c,u=0,f=0,d=0;for(c of e)o[u]=s=+t(c),a[u]=l=+n(c),++u,f+=(s-f)/u,d+=(l-d)/u;for(u=0;u<r;++u)o[u]-=f,a[u]-=d;return[o,a,f,d]}function $o(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 Eo(e,t,n,i,r){let o=0,a=0;return $o(e,t,n,((e,t)=>{const n=t-r(e),s=t-i;o+=n*n,a+=s*s})),1-o/a}function Ao(e,t,n){let i=0,r=0,o=0,a=0,s=0;$o(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=wo(i,r,o,a),c=e=>l[0]+l[1]*e;return{coef:l,predict:c,rSquared:Eo(e,t,n,r,c)}}function So(e,t,n){let i=0,r=0,o=0,a=0,s=0;$o(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=wo(i,r,o,a),c=e=>l[0]+l[1]*Math.log(e);return{coef:l,predict:c,rSquared:Eo(e,t,n,r,c)}}function Do(e,t,n){const[i,r,o,a]=ko(e,t,n);let s,l,c,u=0,f=0,d=0,h=0,p=0;$o(e,t,n,((e,t)=>{s=i[p++],l=Math.log(t),c=s*t,u+=(t*l-u)/p,f+=(c-f)/p,d+=(c*l-d)/p,h+=(s*c-h)/p}));const[g,m]=wo(f/a,u/a,d/a,h/a),y=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:Eo(e,t,n,a,y)}}function Co(e,t,n){let i=0,r=0,o=0,a=0,s=0,l=0;$o(e,t,n,((e,t)=>{const n=Math.log(e),c=Math.log(t);++l,i+=(n-i)/l,r+=(c-r)/l,o+=(n*c-o)/l,a+=(n*n-a)/l,s+=(t-s)/l}));const c=wo(i,r,o,a),u=e=>c[0]*Math.pow(e,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:Eo(e,t,n,s,u)}}function Mo(e,t,n){const[i,r,o,a]=ko(e,t,n),s=i.length;let l,c,u,f,d=0,h=0,p=0,g=0,m=0;for(l=0;l<s;)c=i[l],u=r[l++],f=c*c,d+=(f-d)/l,h+=(f*c-h)/l,p+=(f*f-p)/l,g+=(c*u-g)/l,m+=(f*u-m)/l;const y=p-d*d,v=d*y-h*h,b=(m*d-g*h)/v,x=(g*y-m*h)/v,_=-b*d,w=e=>b*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:Eo(e,t,n,a,w)}}function Fo(e,t,n,i){if(0===i)return _o(e,t,n);if(1===i)return Ao(e,t,n);if(2===i)return Mo(e,t,n);const[r,o,a,s]=ko(e,t,n),l=r.length,c=[],u=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<l;++p)g+=Math.pow(r[p],d)*o[p];for(c.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<l;++p)g+=Math.pow(r[p],d+h);m[h]=g}u.push(m)}u.push(c);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}(u),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:Oo(f,y,-a,s),predict:v,rSquared:Eo(e,t,n,s,v)}}function Oo(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 To=2,zo=1e-12;function No(e,t,n,i){const[r,o,a,s]=ko(e,t,n,!0),l=r.length,c=Math.max(2,~~(i*l)),u=new Float64Array(l),f=new Float64Array(l),d=new Float64Array(l).fill(1);for(let h=-1;++h<=To;){const e=[0,c-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,c=0,h=0,p=0,g=0;const m=1/Math.abs(r[s]-t||1);for(let e=i;e<=a;++e){const n=r[e],i=o[e],a=Ro(Math.abs(t-n)*m)*d[e],s=n*a;l+=a,c+=s,h+=i*a,p+=i*s,g+=n*s}const[y,v]=wo(c/l,h/l,p/l,g/l);u[n]=y+v*t,f[n]=Math.abs(o[n]-u[n]),Bo(r,n+1,e)}if(h===To)break;const t=(0,Ur.A)(f);if(Math.abs(t)<zo)break;for(let n,i,r=0;r<l;++r)n=f[r]/(6*t),d[r]=n>=1?zo:(i=1-n*n)*i}return function(e,t,n,i){const r=e.length,o=[];let a,s=0,l=0,c=[];for(;s<r;++s)a=e[s]+n,c[0]===a?c[1]+=(t[s]-c[1])/++l:(l=0,c[1]+=i,c=[a,t[s]],o.push(c));return c[1]+=i,o}(r,u,a,s)}function Ro(e){return(e=1-e*e*e)*e*e}function Bo(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 Po=.5*Math.PI/180;function Lo(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,c=[r(o)],u=[];if(n===i){for(let e=1;e<i;++e)c.push(r(o+e/n*s));return c.push(r(a)),c}u.push(r(a));for(let g=n;--g>0;)u.push(r(o+g/n*s));let f=c[0],d=u[u.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],u);for(;d;){const e=r((f[0]+d[0])/2);e[0]-f[0]>=l&&Io(f,e,d,h,p)>Po?u.push(e):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function Io(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)}var jo=n(15232),Uo=n(57214),qo=n(65537);function Go(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 Wo(e,t,n){return n||e+(t?"_"+t:"")}const Yo=()=>{},Ho={init:Yo,add:Yo,rem:Yo,idx:0},Xo={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}},Vo=Object.keys(Xo).filter((e=>"__count__"!==e));function Ko(e,t,n){return Xo[e](n,t)}function Qo(e,t){return e.idx-t.idx}function Jo(){this.valid=0,this.missing=0,this._ops.forEach((e=>null==e.aggregate_param?e.init(this):e.init(this,e.aggregate_param)))}function Zo(e,t){null!=e&&""!==e?e===e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function ea(e,t){null!=e&&""!==e?e===e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function ta(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function na(e,t){const n=t||g.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]=Xo[e]())}))};return e.forEach(n),Object.values(t).sort(Qo)}(e),r=e.slice().sort(Qo);function o(e){this._ops=i,this._out=r,this.cell=e,this.init()}return o.prototype.init=Jo,o.prototype.add=Zo,o.prototype.rem=ea,o.prototype.set=ta,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function ia(e){this._key=e?(0,g.ZZ)(e):nr,this.reset()}[...Vo,"__count__"].forEach((e=>{Xo[e]=function(e,t){return(n,i)=>(0,g.X$)({name:e,aggregate_param:i,out:n||e},Ho,t)}(e,Xo[e])}));const ra=ia.prototype;function oa(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}ra.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ra.add=function(e){this._add.push(e)},ra.rem=function(e){this._rem.push(e)},ra.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,c;for(s=0;s<r;++s)a[n(t[s])]=1;for(s=0,l=0;s<i;++s)a[n(c=e[s])]?a[n(c)]=0:o[l++]=c;return this._rem=[],this._add=o},ra.distinct=function(e){const t=this.values(),n={};let i,r=t.length,o=0;for(;--r>=0;)i=e(t[r])+"",(0,g.mQ)(n,i)||(n[i]=1,++o);return o},ra.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=(0,g.n)(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},ra.argmin=function(e){return this.extent(e)[0]||{}},ra.argmax=function(e){return this.extent(e)[1]||{}},ra.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},ra.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},ra.quartile=function(e){return this._get===e&&this._q||(this._q=Wr(this.values(),e),this._get=e),this._q},ra.q1=function(e){return this.quartile(e)[0]},ra.q2=function(e){return this.quartile(e)[1]},ra.q3=function(e){return this.quartile(e)[2]},ra.ci=function(e){return this._get===e&&this._ci||(this._ci=Kr(this.values(),1e3,.05,e),this._get=e),this._ci},ra.ci0=function(e){return this.ci(e)[0]},ra.ci1=function(e){return this.ci(e)[1]},oa.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Vo},{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,g.B)(oa,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 c=n[l],u=i[l++];for(const n in u){const i=a?a+"|"+n:n;s[c]=u[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,g.YO)((0,g.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,g.YO)(e.groupby),this._dnames=this._dims.map((e=>{const t=(0,g.N6)(e);return r(e),n.push(t),t})),this.cellkey=e.key?e.key:Go(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||[],c=o.length,u={};let f,d,h,p,m,y,v;for(c!==a.length&&(0,g.z3)("Unmatched number of fields and aggregate ops."),v=0;v<c;++v)f=o[v],d=a[v],h=s[v]||null,null==f&&"count"!==d&&(0,g.z3)("Null aggregate field specified."),m=(0,g.N6)(f),y=Wo(d,m,l[v]),n.push(y),"count"!==d?(p=u[m],p||(r(f),p=u[m]=[],p.field=f,this._measures.push(p)),"count"!==d&&(this._countOnly=!1),p.push(Ko(d,h,y))):this._counts.push(y);return this._measures=this._measures.map((e=>na(e,e.field))),Object.create(null)},cellkey:Go(),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 ia),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,c,u,f;if(i)for(c in i)l=i[c],r&&!l.num||a.push(l.tuple);for(u=0,f=this._alen;u<f;++u)o.push(this.celltuple(t[u])),t[u]=null;for(u=0,f=this._mlen;u<f;++u)l=n[u],(0===l.num&&r?a:s).push(this.celltuple(l)),n[u]=null;return this._alen=this._mlen=0,this._prev=null,e}});function aa(e){Nr.call(this,null,e)}function sa(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,g.h1)(e,r,o.sort(e)):r.concat(o),o=[]),r)}}function la(e){Nr.call(this,[],e)}function ca(e){gr.call(this,null,ua,e)}function ua(e){return this.value&&!e.modified()?this.value:(0,g.UD)(e.fields,e.orders)}function fa(e){Nr.call(this,null,e)}function da(e){Nr.call(this,null,e)}aa.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},(0,g.B)(aa,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 c;return c=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified((0,g.nS)(e.field))?t.ADD_MOD:t.ADD,t.visit(c,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=Hr(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,g.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,g.sY)(l,(0,g.nS)(t),e.name||"bin_"+(0,g.N6)(t))}}),la.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,g.B)(la,Nr,{transform(e,t){const n=t.fork(t.ALL),i=sa(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,g.B)(ca,gr),fa.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},(0,g.B)(fa,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,c=r.length;l<c;++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"],c=n((e=>r[e]=1+(r[e]||0))),u=n((e=>r[e]-=1));return i?t.visit(t.SOURCE,c):(t.visit(t.ADD,c),t.visit(t.REM,u)),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,c;for(s in n)l=i[s],c=n[s]||0,!l&&c?(i[s]=l=rr({}),l[r]=s,l[o]=c,a.add.push(l)):0===c?(l&&a.rem.push(l),n[s]=null,i[s]=null):l[o]!==c&&(l[o]=c,a.mod.push(l));return a.modifies(t)}}),da.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},(0,g.B)(da,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,c=0;c<l;++c)for(s[t]=o=e[c],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||g.vN)):n.mod=s,n.source=this.value,n.modifies(i)}});const ha={kde:lo,mixture:go,normal:so,lognormal:po,uniform:xo},pa="function";function ga(e,t){const n=e[pa];(0,g.mQ)(ha,n)||(0,g.z3)("Unknown distribution function: "+n);const i=ha[n]();for(const r in e)"field"===r?i.data((e.from||t()).map(e[r])):"distributions"===r?i[r](e[r].map((e=>ga(e,t)))):typeof i[r]===pa&&i[r](e[r]);return i}function ma(e){Nr.call(this,null,e)}const ya=[{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}]}],va={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:ya},{name:"weights",type:"number",array:!0}]};function ba(e,t){return e?e.map(((e,n)=>t[n]||(0,g.N6)(e))):null}function xa(e,t,n){const i=[],r=e=>e(l);let o,a,s,l,c,u;if(null==t)i.push(e.map(n));else for(o={},a=0,s=e.length;a<s;++a)l=e[a],c=t.map(r),u=o[c],u||(o[c]=u=[],u.dims=c,i.push(u)),u.push(n(l));return i}ma.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:ya.concat(va)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,g.B)(ma,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=ga(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,g.z3)("Invalid density method: "+a),e.extent||i.data||(0,g.z3)("Missing density extent parameter."),a=i[a];const s=e.as||["value","density"],l=Lo(a,e.extent||(0,g.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 _a(e){Nr.call(this,null,e)}_a.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function wa(e){gr.call(this,null,ka,e),this.modified(!0)}function ka(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:(0,g.sY)((n=>t(n,e)),(0,g.nS)(t),(0,g.N6)(t))}function $a(e){Nr.call(this,[void 0,void 0],e)}function Ea(e,t){gr.call(this,e),this.parent=t,this.count=0}function Aa(e){Nr.call(this,{},e),this._keys=(0,g.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 Sa(e){gr.call(this,null,Da,e)}function Da(e){return this.value&&!e.modified()?this.value:(0,g.cy)(e.name)?(0,g.YO)(e.name).map((e=>(0,g.ZZ)(e))):(0,g.ZZ)(e.name,e.as)}function Ca(e){Nr.call(this,(0,g.nG)(),e)}function Ma(e){Nr.call(this,[],e)}function Fa(e){Nr.call(this,[],e)}function Oa(e){Nr.call(this,null,e)}function Ta(e){Nr.call(this,[],e)}(0,g.B)(_a,Nr,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,i=xa(t.source,e.groupby,g.D_),r=e.smooth||!1,o=e.field,a=e.step||((e,t)=>(0,g.Ln)((0,g.Xx)(e,t))/30)(n,o),s=lr(((e,t)=>o(e)-o(t))),l=e.as||"bin",c=i.length;let u,f=1/0,d=-1/0,h=0;for(;h<c;++h){const e=i[h].sort(s);u=-1;for(const t of Qr(e,a,r,o))t<f&&(f=t),t>d&&(d=t),e[++u][l]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(l)}}),(0,g.B)(wa,gr),$a.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,g.B)($a,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,g.Ro)(i(e));null!=t&&(t<o&&(o=t),t>a&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=(0,g.N6)(i);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),(0,g.B)(Ea,gr,{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,g.B)(Aa,Nr,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o,a,s=(0,g.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 Ea(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,g.B)(Sa,gr),Ca.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,g.B)(Ca,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 c=!0;function u(t){const n=nr(t),r=l(t,e),u=i.get(n);r&&u?(i.delete(n),o.push(t)):r||u?c&&r&&!u&&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,u),e.modified()&&(c=!1,t.visit(t.REFLOW,u)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),Ma.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},(0,g.B)(Ma,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=ba(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,c,u,f=0;for(;f<s;++f){for(c=or(e),l=0;l<a;++l)c[r[l]]=null==(u=t[l][f])?null:u;o&&(c[o]=f),n.add.push(c)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}}),Fa.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,g.B)(Fa,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(g.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)}}),Oa.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},(0,g.B)(Oa,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,g.B)(Ta,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 za={value:"value",median:Ur.A,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:jo.A,max:Uo.A},Na=[];function Ra(e){Nr.call(this,[],e)}function Ba(e){oa.call(this,e)}function Pa(e){Nr.call(this,null,e)}function La(e){gr.call(this,null,Ia,e)}function Ia(e){return this.value&&!e.modified()?this.value:(0,g.Eb)(e.fields,e.flat)}function ja(e){Nr.call(this,[],e),this._pending=null}function Ua(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 qa(e){Nr.call(this,{},e)}function Ga(e){gr.call(this,null,Wa,e)}function Wa(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 Ya(e){gr.call(this,null,Ha,e)}function Ha(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Xa(e){Nr.call(this,null,e)}function Va(e){oa.call(this,e)}function Ka(e){Aa.call(this,e)}function Qa(e){Nr.call(this,null,e)}function Ja(e){Nr.call(this,null,e)}function Za(e){Nr.call(this,null,e)}Ra.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,g.B)(Ra,Nr,{transform(e,t){var n,i,r,o,a,s,l,c,u,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||za.value;if(null!=za[n])return n===za.value?(t=void 0!==e.value?e.value:0,()=>t):za[n];(0,g.z3)("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),m=(0,g.N6)(e.field),y=(0,g.N6)(e.key),v=(e.groupby||[]).map(g.N6),b=function(e,t,n,i){var r,o,a,s,l,c,u,f,d=e=>e(f),h=[],p=i?i.slice():[],g={},m={};for(p.forEach(((e,t)=>g[e]=t+1)),s=0,u=e.length;s<u;++s)c=n(f=e[s]),l=g[c]||(g[c]=p.push(c)),(a=m[o=(r=t?t.map(d):Na)+""])||(a=m[o]=[],h.push(a),a.values=r),a[l-1]=f;return h.domain=p,h}(t.source,e.groupby,e.key,e.keyvals),x=[],_=this.value,w=b.domain.length;for(a=0,c=b.length;a<c;++a)for(r=(n=b[a]).values,i=NaN,l=0;l<w;++l)if(null==n[l]){for(o=b.domain[l],f={_impute:!0},s=0,u=r.length;s<u;++s)f[v[s]]=r[s];f[y]=o,f[m]=Number.isNaN(i)?i=h(n,p):i,x.push(rr(f))}return x.length&&(d.add=d.materialize(d.ADD).add.concat(x)),_.length&&(d.rem=d.materialize(d.REM).rem.concat(_)),this.value=x,d}}),Ba.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:Vo},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,g.B)(Ba,oa,{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,g.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}}),Pa.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,g.B)(Pa,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=xa(i,e.groupby,e.field),o=(e.groupby||[]).map(g.N6),a=e.bandwidth,s=e.cumulative?"cdf":"pdf",l=e.as||["value","density"],c=[];let u=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;"pdf"!==s&&"cdf"!==s&&(0,g.z3)("Invalid density method: "+s),"shared"===e.resolve&&(u||(u=(0,g.Xx)(i,e.field)),f=d=e.steps||d),r.forEach((t=>{const n=lo(t,a)[s],i=e.counts?t.length:1;Lo(n,u||(0,g.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,c.push(rr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}}),(0,g.B)(La,gr),(0,g.B)(ja,Nr,{transform(e,t){const n=t.dataflow;if(this._pending)return Ua(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 Ua(this,t,n.parse(e.values,e.format));if(e.async){const t=n.request(e.url,e.format).then((e=>(this._pending=(0,g.YO)(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>Ua(this,t,(0,g.YO)(e.data))))}}),qa.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,g.B)(qa,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,c,u,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return r?(c=r.length,s>1&&!h&&(0,g.z3)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*c&&(0,g.z3)('The "as" parameter has too few output field names.'),h=h||r.map(g.N6),l=function(e){for(var t,a,l=0,u=0;l<s;++l)if(null==(a=i.get(n[l](e))))for(t=0;t<c;++t,++u)e[h[u]]=o;else for(t=0;t<c;++t,++u)e[h[u]]=r[t](a)}):(h||(0,g.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):(u=n.some((e=>t.modified(e.fields))),f|=u?t.MOD:0),t.visit(f,l),d.modifies(h)}}),(0,g.B)(Ga,gr),(0,g.B)(Ya,gr),(0,g.B)(Xa,Nr,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Va.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:Vo,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,g.B)(Va,oa,{_transform:oa.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,g.nS)(n).concat((0,g.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(g.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,g.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,g.B)(Ka,Aa,{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,g.nS)(i)))&&(0,g.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}}),Qa.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},(0,g.B)(Qa,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=ba(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,g.B)(Ja,Nr,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Za.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 es(e){Nr.call(this,null,e)}function ts(e){Nr.call(this,[],e),this.count=0}function ns(e){Nr.call(this,null,e)}function is(e){Nr.call(this,null,e),this.modified(!0)}function rs(e){Nr.call(this,null,e)}(0,g.B)(Za,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=xa(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(g.N6),a=[],s=e.step||.01,l=e.probs||(0,qo.A)(s/2,1-1e-14,s),c=l.length;return r.forEach((e=>{const t=Gr(e,l);for(let n=0;n<c;++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,g.B)(es,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}}),ts.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,g.B)(ts,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 c(e){let t,i;a.length<r?a.push(e):(i=~~((s+1)*Xr()),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)]||c(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,c),(t.add.length||l<0)&&(n.add=a.filter((e=>!o[nr(e)]))),this.count=s,this.value=n.source=a,n}}),ns.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},(0,g.B)(ns,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=(0,qo.A)(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,g.B)(is,Nr,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const os=["unit0","unit1"];function as(e){Nr.call(this,(0,g.nG)(),e)}function ss(e){Nr.call(this,null,e)}rs.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Be,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:os}]},(0,g.B)(rs,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||os,l=s[0],c=s[1],u=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,g.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[c]=null)):(e[l]=r=s=o(t),i&&(e[c]=s=a(r,u)),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,g.Xx)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Le(i),a=this.value||{},s=(n?ct:at)(o,r);return s.unit=(0,g.se)(o),s.units=o,s.step=r,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,g.B)(as,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,g.B)(ss,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 ls={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=ls.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,g.z3)("ntile num must be greater than zero.");const n=ls.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,g.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 cs=Object.keys(ls);function us(e){const t=(0,g.YO)(e.ops),n=(0,g.YO)(e.fields),i=(0,g.YO)(e.params),r=(0,g.YO)(e.aggregate_params),o=(0,g.YO)(e.as),a=this.outputs=[],s=this.windows=[],l={},c={},u=[],f=[];let d=!0;function h(e){(0,g.YO)((0,g.nS)(e)).forEach((e=>l[e]=1))}h(e.sort),t.forEach(((e,t)=>{const l=n[t],p=i[t],m=r[t]||null,y=(0,g.N6)(l),v=Wo(e,y,o[t]);if(h(l),a.push(v),(0,g.mQ)(ls,e))s.push(function(e,t,n,i){const r=ls[e](t,n);return{init:r.init||g.v_,update:function(e,t){t[i]=r.next(e)}}}(e,l,p,v));else{if(null==l&&"count"!==e&&(0,g.z3)("Null aggregate field specified."),"count"===e)return void u.push(v);d=!1;let t=c[y];t||(t=c[y]=[],t.field=l,f.push(t)),t.push(Ko(e,m,v))}})),(u.length||f.length)&&(this.cell=function(e,t,n){e=e.map((e=>na(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 ia;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,u,d)),this.inputs=Object.keys(l)}const fs=us.prototype;function ds(e){Nr.call(this,{},e),this._mlen=0,this._mods=[]}function hs(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,a=i.frame||[null,0],s=e.data(n),l=s.length,c=o?(0,Ee.A)(r):null,u={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:r||(0,g.dY)(-1)};t.init();for(let f=0;f<l;++f)ps(u,a,f,l),o&&gs(u,c),t.update(u,s[f])}function ps(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 gs(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 ms(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 ys(e){this._context=e}function vs(e){return new ys(e)}function bs(){}function xs(e){this._context=e}function _s(e){return new xs(e)}function ws(e){this._context=e}function ks(e){return new ws(e)}function $s(e,t){this._basis=new ys(e),this._beta=t}fs.init=function(){this.windows.forEach((e=>e.init())),this.cell&&this.cell.init()},fs.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)},ds.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:cs.concat(Vo)},{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,g.B)(ds,Nr,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=lr(e.sort),r=Go(e.groupby),o=e=>this.group(r(e));let a=this.state;a&&!n||(a=this.state=new us(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)hs(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]=sa(nr),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}}),ys.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:ms(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:ms(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},xs.prototype={areaStart:bs,areaEnd:bs,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:ms(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=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(){(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:ms(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},$s.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 Es=function e(t){function n(e){return 1===t?new ys(e):new $s(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function As(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 Ss(e,t){this._context=e,this._k=(1-t)/6}Ss.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:As(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:As(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 Ds=function e(t){function n(e){return new Ss(e,t)}return n.tension=function(t){return e(+t)},n}(0);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(){(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:As(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 Ms=function e(t){function n(e){return new Cs(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Fs(e,t){this._context=e,this._k=(1-t)/6}Fs.prototype={areaStart:bs,areaEnd:bs,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:As(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 Fs(e,t)}return n.tension=function(t){return e(+t)},n}(0),Ts=Math.abs,zs=Math.atan2,Ns=Math.cos,Rs=Math.max,Bs=Math.min,Ps=Math.sin,Ls=Math.sqrt,Is=1e-12,js=Math.PI,Us=js/2,qs=2*js;function Gs(e){return e>=1?Us:e<=-1?-Us:Math.asin(e)}function Ws(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Is){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>Is){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}function Ys(e,t){this._context=e,this._alpha=t}Ys.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:Ws(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 Hs=function e(t){function n(e){return t?new Ys(e,t):new Ss(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Xs(e,t){this._context=e,this._alpha=t}Xs.prototype={areaStart:bs,areaEnd:bs,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:Ws(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 Fs(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: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:Ws(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 Cs(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Js(e){this._context=e}function Zs(e){return new Js(e)}function el(e){this._context=e}function tl(e){return new el(e)}function nl(e){return e<0?-1:1}function il(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(nl(o)+nl(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function rl(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ol(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 al(e){this._context=e}function sl(e){this._context=new ll(e)}function ll(e){this._context=e}function cl(e){return new al(e)}function ul(e){return new sl(e)}function fl(e){this._context=e}function dl(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 hl(e){return new fl(e)}function pl(e,t){this._context=e,this._t=t}function gl(e){return new pl(e,.5)}function ml(e){return new pl(e,0)}function yl(e){return new pl(e,1)}function vl(e){return function(){return e}}Js.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)}}},el.prototype={areaStart:bs,areaEnd:bs,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))}},al.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:ol(this,this._t0,rl(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,ol(this,rl(this,n=il(this,e,t)),n);break;default:ol(this,this._t0,n=il(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(sl.prototype=Object.create(al.prototype)).point=function(e,t){al.prototype.point.call(this,t,e)},ll.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)}},fl.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=dl(e),r=dl(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)}},pl.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 bl=Math.PI,xl=2*bl,_l=1e-6,wl=xl-_l;function kl(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class $l{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?kl:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return kl;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,c=o-e,u=a-t,f=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>_l)if(Math.abs(u*s-l*c)>_l&&r){let d=n-o,h=i-a,p=s*s+l*l,g=d*d+h*h,m=Math.sqrt(p),y=Math.sqrt(f),v=r*Math.tan((bl-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>_l&&this._append`L${e+b*c},${t+b*u}`,this._append`A${r},${r},0,0,${+(u*d>c*h)},${this._x1=e+x*s},${this._y1=t+x*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,c=t+s,u=1^o,f=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>_l||Math.abs(this._y1-c)>_l)&&this._append`L${l},${c}`,n&&(f<0&&(f=f%xl+xl),f>wl?this._append`A${n},${n},0,1,${u},${e-a},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:f>_l&&this._append`A${n},${n},0,${+(f>=bl)},${u},${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 El(){return new $l}function Al(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 $l(t)}function Sl(e){return e.innerRadius}function Dl(e){return e.outerRadius}function Cl(e){return e.startAngle}function Ml(e){return e.endAngle}function Fl(e){return e&&e.padAngle}function Ol(e,t,n,i,r,o,a){var s=e-n,l=t-i,c=(a?o:-o)/Ls(s*s+l*l),u=c*l,f=-c*s,d=e+u,h=t+f,p=n+u,g=i+f,m=(d+p)/2,y=(h+g)/2,v=p-d,b=g-h,x=v*v+b*b,_=r-o,w=d*g-p*h,k=(b<0?-1:1)*Ls(Rs(0,_*_*x-w*w)),$=(w*b-v*k)/x,E=(-w*v-b*k)/x,A=(w*b+v*k)/x,S=(-w*v+b*k)/x,D=$-m,C=E-y,M=A-m,F=S-y;return D*D+C*C>M*M+F*F&&($=A,E=S),{cx:$,cy:E,x01:-u,y01:-f,x11:$*(r/_-1),y11:E*(r/_-1)}}function Tl(){var e=Sl,t=Dl,n=vl(0),i=null,r=Cl,o=Ml,a=Fl,s=null,l=Al(c);function c(){var c,u,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=r.apply(this,arguments)-Us,p=o.apply(this,arguments)-Us,g=Ts(p-h),m=p>h;if(s||(s=c=l()),d<f&&(u=d,d=f,f=u),d>Is)if(g>qs-Is)s.moveTo(d*Ns(h),d*Ps(h)),s.arc(0,0,d,h,p,!m),f>Is&&(s.moveTo(f*Ns(p),f*Ps(p)),s.arc(0,0,f,p,h,m));else{var y,v,b=h,x=p,_=h,w=p,k=g,$=g,E=a.apply(this,arguments)/2,A=E>Is&&(i?+i.apply(this,arguments):Ls(f*f+d*d)),S=Bs(Ts(d-f)/2,+n.apply(this,arguments)),D=S,C=S;if(A>Is){var M=Gs(A/f*Ps(E)),F=Gs(A/d*Ps(E));(k-=2*M)>Is?(_+=M*=m?1:-1,w-=M):(k=0,_=w=(h+p)/2),($-=2*F)>Is?(b+=F*=m?1:-1,x-=F):($=0,b=x=(h+p)/2)}var O=d*Ns(b),T=d*Ps(b),z=f*Ns(w),N=f*Ps(w);if(S>Is){var R,B=d*Ns(x),P=d*Ps(x),L=f*Ns(_),I=f*Ps(_);if(g<js)if(R=function(e,t,n,i,r,o,a,s){var l=n-e,c=i-t,u=a-r,f=s-o,d=f*l-u*c;if(!(d*d<Is))return[e+(d=(u*(t-o)-f*(e-r))/d)*l,t+d*c]}(O,T,L,I,B,P,z,N)){var j=O-R[0],U=T-R[1],q=B-R[0],G=P-R[1],W=1/Ps(function(e){return e>1?0:e<-1?js:Math.acos(e)}((j*q+U*G)/(Ls(j*j+U*U)*Ls(q*q+G*G)))/2),Y=Ls(R[0]*R[0]+R[1]*R[1]);D=Bs(S,(f-Y)/(W-1)),C=Bs(S,(d-Y)/(W+1))}else D=C=0}$>Is?C>Is?(y=Ol(L,I,O,T,d,C,m),v=Ol(B,P,z,N,d,C,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),C<S?s.arc(y.cx,y.cy,C,zs(y.y01,y.x01),zs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,C,zs(y.y01,y.x01),zs(y.y11,y.x11),!m),s.arc(0,0,d,zs(y.cy+y.y11,y.cx+y.x11),zs(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,C,zs(v.y11,v.x11),zs(v.y01,v.x01),!m))):(s.moveTo(O,T),s.arc(0,0,d,b,x,!m)):s.moveTo(O,T),f>Is&&k>Is?D>Is?(y=Ol(z,N,B,P,f,-D,m),v=Ol(O,T,L,I,f,-D,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),D<S?s.arc(y.cx,y.cy,D,zs(y.y01,y.x01),zs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,D,zs(y.y01,y.x01),zs(y.y11,y.x11),!m),s.arc(0,0,f,zs(y.cy+y.y11,y.cx+y.x11),zs(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,D,zs(v.y11,v.x11),zs(v.y01,v.x01),!m))):s.arc(0,0,f,w,_,m):s.lineTo(z,N)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-js/2;return[Ns(i)*n,Ps(i)*n]},c.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:vl(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"===typeof e?e:vl(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"===typeof e?e:vl(+e),c):n},c.padRadius=function(e){return arguments.length?(i=null==e?null:"function"===typeof e?e:vl(+e),c):i},c.startAngle=function(e){return arguments.length?(r="function"===typeof e?e:vl(+e),c):r},c.endAngle=function(e){return arguments.length?(o="function"===typeof e?e:vl(+e),c):o},c.padAngle=function(e){return arguments.length?(a="function"===typeof e?e:vl(+e),c):a},c.context=function(e){return arguments.length?(s=null==e?null:e,c):s},c}El.prototype=$l.prototype;Array.prototype.slice;function zl(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}function Nl(e){return e[0]}function Rl(e){return e[1]}function Bl(e,t){var n=vl(!0),i=null,r=Zs,o=null,a=Al(s);function s(s){var l,c,u,f=(s=zl(s)).length,d=!1;for(null==i&&(o=r(u=a())),l=0;l<=f;++l)!(l<f&&n(c=s[l],l,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"===typeof e?e:void 0===e?Nl:vl(e),t="function"===typeof t?t:void 0===t?Rl:vl(t),s.x=function(t){return arguments.length?(e="function"===typeof t?t:vl(+t),s):e},s.y=function(e){return arguments.length?(t="function"===typeof e?e:vl(+e),s):t},s.defined=function(e){return arguments.length?(n="function"===typeof e?e:vl(!!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 Pl(e,t,n){var i=null,r=vl(!0),o=null,a=Zs,s=null,l=Al(c);function c(c){var u,f,d,h,p,g=(c=zl(c)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=l())),u=0;u<=g;++u){if(!(u<g&&r(h=c[u],u,c))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+e(h,u,c),v[u]=+t(h,u,c),s.point(i?+i(h,u,c):y[u],n?+n(h,u,c):v[u]))}if(p)return s=null,p+""||null}function u(){return Bl().defined(r).curve(a).context(o)}return e="function"===typeof e?e:void 0===e?Nl:vl(+e),t="function"===typeof t?t:vl(void 0===t?0:+t),n="function"===typeof n?n:void 0===n?Rl:vl(+n),c.x=function(t){return arguments.length?(e="function"===typeof t?t:vl(+t),i=null,c):e},c.x0=function(t){return arguments.length?(e="function"===typeof t?t:vl(+t),c):e},c.x1=function(e){return arguments.length?(i=null==e?null:"function"===typeof e?e:vl(+e),c):i},c.y=function(e){return arguments.length?(t="function"===typeof e?e:vl(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"===typeof e?e:vl(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:vl(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(i).y(t)},c.defined=function(e){return arguments.length?(r="function"===typeof e?e:vl(!!e),c):r},c.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),c):o},c}Ls(3);const Ll={draw(e,t){const n=Ls(t/js);e.moveTo(n,0),e.arc(0,0,n,0,qs)}},Il=(Ls(1/3),Ps(js/10)/Ps(7*js/10));Ps(qs/10),Ns(qs/10),Ls(3),Ls(3),Ls(3),Ls(12);function jl(e,t){let n=null,i=Al(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:vl(e||Ll),t="function"===typeof t?t:vl(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"===typeof t?t:vl(t),r):e},r.size=function(e){return arguments.length?(t="function"===typeof e?e:vl(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}function Ul(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 ql=()=>"undefined"!==typeof Image?Image:null;var Gl=n(66384),Wl=n(53142),Yl=n(68558);function Hl(e){var t;function n(e){return null==e||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Yl.A),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Hl(e).unknown(t)},e=arguments.length?Array.from(e,Yl.A):[0,1],(0,Wl.C)(n)}var Xl=n(18617),Vl=n(52509),Kl=n(95507),Ql=n(57113);function Jl(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Zl(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ec(e){var t=1,n=e(Jl(t),Zl(t));return n.constant=function(n){return arguments.length?e(Jl(t=+n),Zl(t)):t},(0,Wl.C)(n)}function tc(){var e=ec((0,Kl.Gu)());return e.copy=function(){return(0,Kl.C)(e,tc()).constant(e.constant())},Ql.C.apply(e,arguments)}function nc(e,t,n,i,r,o){const a=[[ke,1,q],[ke,5,5e3],[ke,15,15e3],[ke,30,3e4],[o,1,G],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,W],[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[ic,rc]=nc(me,ve,le,J,xe,we),[oc,ac]=nc(ge,ye,ee,K,be,_e);var sc=n(73806);function lc(e){return new Date(e)}function cc(e){return e instanceof Date?+e:+new Date(+e)}function uc(e,t,n,i,r,o,a,s,l,c){var u=(0,Kl.Ay)(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),b=c("%B"),x=c("%Y");function _(e){return(l(e)<e?h:s(e)<e?p:a(e)<e?g:o(e)<e?m:i(e)<e?r(e)<e?y:v:n(e)<e?b:x)(e)}return u.invert=function(e){return new Date(f(e))},u.domain=function(e){return arguments.length?d(Array.from(e,cc)):d().map(lc)},u.ticks=function(t){var n=d();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?_:c(t)},u.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((0,sc.A)(n,e)):u},u.copy=function(){return(0,Kl.C)(u,uc(e,t,n,i,r,o,a,s,l,c))},u}function fc(){return Ql.C.apply(uc(oc,ac,ge,ye,ee,K,be,_e,ke,It).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dc(){return Ql.C.apply(uc(ic,rc,me,ve,le,Q,xe,we,ke,Ut).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var hc=n(80039),pc=n(72970);function gc(){var e,t,n,i,r,o=0,a=1,s=Kl.D_,l=!1;function c(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 u(e){return function(t){var n,i;return arguments.length?([n,i]=t,s=e(n,i),c):[s(0),s(1)]}}return c.domain=function(r){return arguments.length?([o,a]=r,e=i(o=+o),t=i(a=+a),n=e===t?0:1/(t-e),c):[o,a]},c.clamp=function(e){return arguments.length?(l=!!e,c):l},c.interpolator=function(e){return arguments.length?(s=e,c):s},c.range=u(hc.A),c.rangeRound=u(pc.A),c.unknown=function(e){return arguments.length?(r=e,c):r},function(r){return i=r,e=r(o),t=r(a),n=e===t?0:1/(t-e),c}}function mc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function yc(){var e=(0,Wl.C)(gc()(Kl.D_));return e.copy=function(){return mc(e,yc())},Ql.K.apply(e,arguments)}function vc(){var e=(0,Xl.g)(gc()).domain([1,10]);return e.copy=function(){return mc(e,vc()).base(e.base())},Ql.K.apply(e,arguments)}function bc(){var e=ec(gc());return e.copy=function(){return mc(e,bc()).constant(e.constant())},Ql.K.apply(e,arguments)}function xc(){var e=(0,Vl.DS)(gc());return e.copy=function(){return mc(e,xc()).exponent(e.exponent())},Ql.K.apply(e,arguments)}function _c(){return xc.apply(null,arguments).exponent(.5)}function wc(e,t){void 0===t&&(t=e,e=hc.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 kc(){var e,t,n,i,r,o,a,s=0,l=.5,c=1,u=1,f=Kl.D_,d=!1;function h(e){return isNaN(e=+e)?a:(e=.5+((e=+o(e))-t)*(u*e<u*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=wc(e,[n,i,r]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,l,c]=a,e=o(s=+s),t=o(l=+l),n=o(c=+c),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),u=t<e?-1:1,h):[s,l,c]},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(hc.A),h.rangeRound=p(pc.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(c),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),u=t<e?-1:1,h}}function $c(){var e=(0,Wl.C)(kc()(Kl.D_));return e.copy=function(){return mc(e,$c())},Ql.K.apply(e,arguments)}function Ec(){var e=(0,Xl.g)(kc()).domain([.1,1,10]);return e.copy=function(){return mc(e,Ec()).base(e.base())},Ql.K.apply(e,arguments)}function Ac(){var e=ec(kc());return e.copy=function(){return mc(e,Ac()).constant(e.constant())},Ql.K.apply(e,arguments)}function Sc(){var e=(0,Vl.DS)(kc());return e.copy=function(){return mc(e,Sc()).exponent(e.exponent())},Ql.K.apply(e,arguments)}function Dc(){return Sc.apply(null,arguments).exponent(.5)}var Cc=n(39622),Mc=n(57892),Fc=n(31708),Oc=n(61562),Tc=n(10545),zc=n(63535),Nc=n(36368),Rc=n(16284),Bc=n(44700);function Pc(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Lc=n(73637);function Ic(e,t){var n=(0,Lc.lG)(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var jc=n(48853),Uc=n(30032),qc=n(47983),Gc=n(56409),Wc=n(83749);function Yc(e){return((e=Math.exp(e))+1/e)/2}const Hc=function e(t,n,i){function r(e,r){var o,a,s=e[0],l=e[1],c=e[2],u=r[0],f=r[1],d=r[2],h=u-s,p=f-l,g=h*h+p*p;if(g<1e-12)a=Math.log(d/c)/t,o=function(e){return[s+e*h,l+e*p,c*Math.exp(t*e*a)]};else{var m=Math.sqrt(g),y=(d*d-c*c+i*g)/(2*c*n*m),v=(d*d-c*c-i*g)/(2*d*n*m),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-b)/t,o=function(e){var i=e*a,r=Yc(b),o=c/(n*m)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*i+b)-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+o*h,l+o*p,c*r/Yc(t*i+b)]}}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 Xc=n(70701),Vc=n(89421);function Kc(e){return function(t,n){var i=e((t=(0,Vc.KI)(t)).h,(n=(0,Vc.KI)(n)).h),r=(0,Lc.Ay)(t.s,n.s),o=(0,Lc.Ay)(t.l,n.l),a=(0,Lc.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 Qc=Kc(Lc.lG);var Jc=Kc(Lc.Ay),Zc=n(39655);const eu=Math.PI/180,tu=180/Math.PI,nu=.96422,iu=1,ru=.82521,ou=4/29,au=6/29,su=3*au*au,lu=.008856451679035631;function cu(e){if(e instanceof fu)return new fu(e.l,e.a,e.b,e.opacity);if(e instanceof vu)return bu(e);e instanceof Vc.Gw||(e=(0,Vc.b)(e));var t,n,i=gu(e.r),r=gu(e.g),o=gu(e.b),a=du((.2225045*i+.7168786*r+.0606169*o)/iu);return i===r&&r===o?t=n=a:(t=du((.4360747*i+.3850649*r+.1430804*o)/nu),n=du((.0139322*i+.0971045*r+.7141733*o)/ru)),new fu(116*a-16,500*(t-a),200*(a-n),e.opacity)}function uu(e,t,n,i){return 1===arguments.length?cu(e):new fu(e,t,n,null==i?1:i)}function fu(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function du(e){return e>lu?Math.pow(e,1/3):e/su+ou}function hu(e){return e>au?e*e*e:su*(e-ou)}function pu(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function gu(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mu(e){if(e instanceof vu)return new vu(e.h,e.c,e.l,e.opacity);if(e instanceof fu||(e=cu(e)),0===e.a&&0===e.b)return new vu(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*tu;return new vu(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function yu(e,t,n,i){return 1===arguments.length?mu(e):new vu(e,t,n,null==i?1:i)}function vu(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function bu(e){if(isNaN(e.h))return new fu(e.l,0,0,e.opacity);var t=e.h*eu;return new fu(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function xu(e,t){var n=(0,Lc.Ay)((e=uu(e)).l,(t=uu(t)).l),i=(0,Lc.Ay)(e.a,t.a),r=(0,Lc.Ay)(e.b,t.b),o=(0,Lc.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 _u(e){return function(t,n){var i=e((t=yu(t)).h,(n=yu(n)).h),r=(0,Lc.Ay)(t.c,n.c),o=(0,Lc.Ay)(t.l,n.l),a=(0,Lc.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,Zc.A)(fu,uu,(0,Zc.X)(Vc.Q1,{brighter(e){return new fu(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new fu(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=nu*hu(t),e=iu*hu(e),n=ru*hu(n),new Vc.Gw(pu(3.1338561*t-1.6168667*e-.4906146*n),pu(-.9787684*t+1.9161415*e+.033454*n),pu(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),(0,Zc.A)(vu,yu,(0,Zc.X)(Vc.Q1,{brighter(e){return new vu(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new vu(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return bu(this).rgb()}}));const wu=_u(Lc.lG);var ku=_u(Lc.Ay),$u=-.14861,Eu=1.78277,Au=-.29227,Su=-.90649,Du=1.97294,Cu=Du*Su,Mu=Du*Eu,Fu=Eu*Au-Su*$u;function Ou(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Tu)return new Tu(e.h,e.s,e.l,e.opacity);e instanceof Vc.Gw||(e=(0,Vc.b)(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(Fu*i+Cu*t-Mu*n)/(Fu+Cu-Mu),o=i-r,a=(Du*(n-r)-Au*o)/Su,s=Math.sqrt(a*a+o*o)/(Du*r*(1-r)),l=s?Math.atan2(a,o)*tu-120:NaN;return new Tu(l<0?l+360:l,s,r,e.opacity)}(e):new Tu(e,t,n,null==i?1:i)}function Tu(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function zu(e){return function t(n){function i(t,i){var r=e((t=Ou(t)).h,(i=Ou(i)).h),o=(0,Lc.Ay)(t.s,i.s),a=(0,Lc.Ay)(t.l,i.l),s=(0,Lc.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,Zc.A)(Tu,Ou,(0,Zc.X)(Vc.Q1,{brighter(e){return e=null==e?Vc.Uw:Math.pow(Vc.Uw,e),new Tu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Vc.ef:Math.pow(Vc.ef,e),new Tu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*eu,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new Vc.Gw(255*(t+n*($u*i+Eu*r)),255*(t+n*(Au*i+Su*r)),255*(t+n*(Du*i)),this.opacity)}}));const Nu=zu(Lc.lG);var Ru=zu(Lc.Ay);function Bu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}function Pu(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}const Lu="linear",Iu="log",ju="pow",Uu="sqrt",qu="symlog",Gu="time",Wu="utc",Yu="sequential",Hu="diverging",Xu="quantile",Vu="quantize",Ku="threshold",Qu="ordinal",Ju="point",Zu="band",ef="bin-ordinal",tf="continuous",nf="discrete",rf="discretizing",of="interpolating",af="temporal";function sf(){const e=(0,Oc.A)().unknown(void 0),t=e.domain,n=e.range;let i,r,o=[0,1],a=!1,s=0,l=0,c=.5;function u(){const e=t().length,u=o[1]<o[0],f=o[1-u],d=Pu(e,s,l);let h=o[u-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(e-s))*c,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=(0,qo.A)(e).map((e=>h+i*e));return n(u?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),u()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],u()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,u()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(a=!!e,u()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,u()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),u()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},e.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),u()):c},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,c,u,f=+e[0],d=+e[1];return f!==f||d!==d||(d<f&&(u=f,f=d,d=u),d<a[0]||f>o[1-i])?void 0:(l=Math.max(0,(0,Gl.Jj)(a,f)-1),c=f===d?l:(0,Gl.Jj)(a,d)-1,f-a[l]>r+1e-10&&++l,i&&(u=l,l=s-c,c=s-u),l>c?void 0:t().slice(l,c+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return sf().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(c)},u()}function lf(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return lf(t())},e}var cf=Array.prototype.map;const uf=Array.prototype.slice;const ff=new Map,df=Symbol("vega_scale");function hf(e){return e[df]=!0,e}function pf(e){return e&&!0===e[df]}function gf(e,t,n){return arguments.length>1?(ff.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],c=-1;for(l<s&&(r=s,s=l,l=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=l&&(c<0&&(c=o),i=o);if(!(c<0))return s=e.invertExtent(n[c]),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,hf(n)};return i.metadata=(0,g.M1)((0,g.YO)(n)),i}(e,t,n)),this):function(e){return ff.has(e)}(e)?ff.get(e):void 0}function mf(e,t){const n=ff.get(e);return n&&n.metadata[t]}function yf(e){return mf(e,tf)}function vf(e){return mf(e,nf)}function bf(e){return mf(e,Iu)}function xf(e){return mf(e,of)}gf("identity",Hl),gf(Lu,Wl.A,tf),gf(Iu,Xl.A,[tf,Iu]),gf(ju,Vl.Ay,tf),gf(Uu,Vl.RZ,tf),gf(qu,tc,tf),gf(Gu,fc,[tf,af]),gf(Wu,dc,[tf,af]),gf(Yu,yc,[tf,of]),gf(`${Yu}-${Lu}`,yc,[tf,of]),gf(`${Yu}-${Iu}`,vc,[tf,of,Iu]),gf(`${Yu}-${ju}`,xc,[tf,of]),gf(`${Yu}-${Uu}`,_c,[tf,of]),gf(`${Yu}-${qu}`,bc,[tf,of]),gf(`${Hu}-${Lu}`,$c,[tf,of]),gf(`${Hu}-${Iu}`,Ec,[tf,of,Iu]),gf(`${Hu}-${ju}`,Sc,[tf,of]),gf(`${Hu}-${Uu}`,Dc,[tf,of]),gf(`${Hu}-${qu}`,Ac,[tf,of]),gf(Xu,Cc.A,[rf,Xu]),gf(Vu,Mc.A,rf),gf(Ku,Fc.A,rf),gf(ef,(function e(){let t=[],n=[];function i(e){return null==e||e!==e?void 0:n[((0,Gl.Ay)(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return cf.call(e,g.Ro)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=uf.call(e),i):n.slice()},i.tickFormat=function(e,n){return(0,Tc.A)(t[0],(0,g.se)(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[nf,rf]),gf(Qu,Oc.A,nf),gf(Zu,sf,nf),gf(Ju,(function(){return lf(sf().paddingInner(1))}),nf);const _f=["clamp","base","constant","exponent"];function wf(e,t,n){return wc($f(t||"rgb",n),e)}function kf(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=gf(o)().domain([t,n]).range([0,1]),_f.forEach((t=>e[t]?a[t](e[t]()):0)),a):(0,g.dY)(.5)}function $f(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 Ef(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 Af(e,t){for(const n in e)Df(n,t(e[n]))}const Sf={};function Df(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Sf[e]=t,this):Sf[e]}Af({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},Ef),Af({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=>wf(Ef(e))));const Cf="symbol",Mf="discrete",Ff=e=>(0,g.cy)(e)?e.map((e=>String(e))):String(e),Of=(e,t)=>e[1]-t[1],Tf=(e,t)=>t[1]-e[1];function zf(e,t,n){let i;return(0,g.Et)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor((0,g.Ln)(e.domain())/n||1)))),(0,g.Gv)(t)&&(i=t.step,t=t.interval),(0,g.Kg)(t)&&(t=e.type===Gu?dt(t):e.type==Wu?ht(t):(0,g.z3)("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function Nf(e,t,n){let i=e.range(),r=i[0],o=(0,g.se)(i),a=Of;if(r>o&&(i=o,o=r,r=i,a=Tf),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,g.se)(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function Rf(e,t){return e.bins?Nf(e,e.bins):e.ticks?e.ticks(t):e.domain()}function Bf(e,t,n,i,r,o){const a=t.type;let s=Ff;if(a===Gu||r===Gu)s=e.timeFormat(i);else if(a===Wu||r===Wu)s=e.utcFormat(i);else if(bf(a)){const r=e.formatFloat(i);if(o||t.bins)s=r;else{const e=Pf(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 Pf(e,t,n){const i=Rf(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 Lf={[Xu]:"quantiles",[Vu]:"thresholds",[Ku]:"domain"},If={[Xu]:"quantiles",[Vu]:"domain"};function jf(e,t){return e.bins?function(e){const t=e.slice(0,-1);return t.max=(0,g.se)(e),t}(e.bins):e.type===Iu?Pf(e,t,!0):Lf[e.type]?function(e){const t=[-1/0].concat(e);return t.max=1/0,t}(e[Lf[e.type]]()):Rf(e,t)}const Uf=e=>Lf[e.type]||e.bins;function qf(e,t,n,i,r,o,a){const s=If[t.type]&&o!==Gu&&o!==Wu?function(e,t,n){const i=t[If[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):Bf(e,t,n,r,o,a);return i===Cf&&Uf(t)?Gf(s):i===Mf?Yf(s):Hf(s)}const Gf=e=>(t,n,i)=>{const r=Wf(i[n+1],Wf(i.max,1/0)),o=Xf(t,e),a=Xf(r,e);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},Wf=(e,t)=>null!=e?e:t,Yf=e=>(t,n)=>n?e(t):null,Hf=e=>t=>e(t),Xf=(e,t)=>Number.isFinite(e)?t(e):null;function Vf(e,t,n,i){const r=i||t.type;return(0,g.Kg)(n)&&mf(r,af)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==Gu?n||r!==Wu?qf(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function Kf(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=Vf(e,t,n.format,n.formatType);if(mf(t.type,rf)){const e=jf(t).slice(1).map(r),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(vf(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,g.se)(e))}`}}let Qf=0;const Jf="p_";function Zf(e){return e&&e.gradient}function ed(e,t,n){const i=e.gradient;let r=e.id,o="radial"===i?Jf:"";return r||(r=e.id="gradient_"+Qf++,"radial"===i?(e.x1=td(e.x1,.5),e.y1=td(e.y1,.5),e.r1=td(e.r1,0),e.x2=td(e.x2,.5),e.y2=td(e.y2,.5),e.r2=td(e.r2,.5),o=Jf):(e.x1=td(e.x1,0),e.y1=td(e.y1,0),e.x2=td(e.x2,1),e.y2=td(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function td(e,t){return null!=e?e:t}function nd(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 id={basis:{curve:vs},"basis-closed":{curve:_s},"basis-open":{curve:ks},bundle:{curve:Es,tension:"beta",value:.85},cardinal:{curve:Ds,tension:"tension",value:0},"cardinal-open":{curve:Ms,tension:"tension",value:0},"cardinal-closed":{curve:Os,tension:"tension",value:0},"catmull-rom":{curve:Hs,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Vs,tension:"alpha",value:.5},"catmull-rom-open":{curve:Qs,tension:"alpha",value:.5},linear:{curve:Zs},"linear-closed":{curve:tl},monotone:{horizontal:ul,vertical:cl},natural:{curve:hl},step:{curve:gl},"step-after":{curve:yl},"step-before":{curve:ml}};function rd(e,t,n){var i=(0,g.mQ)(id,e)&&id[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const od={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},ad=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,sd=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,ld=/^((\s+,?\s*)|(,\s*))/,cd=/^[01]/;function ud(e){const t=[];return(e.match(ad)||[]).forEach((e=>{let n=e[0];const i=n.toLowerCase(),r=od[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?sd:cd,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(ld);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 fd=Math.PI/180,dd=Math.PI/2,hd=2*Math.PI,pd=Math.sqrt(3)/2;var gd={},md={},yd=[].join;function vd(e){const t=yd.call(e);if(md[t])return md[t];var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7];const u=c*a,f=-l*s,d=l*a,h=c*s,p=Math.cos(r),g=Math.sin(r),m=Math.cos(o),y=Math.sin(o),v=.5*(o-r),b=Math.sin(.5*v),x=8/3*b*b/Math.sin(v),_=n+p-x*g,w=i+g+x*p,k=n+m,$=i+y,E=k+x*y,A=$-x*m;return md[t]=[u*_+f*w,d*_+h*w,u*E+f*A,d*E+h*A,u*k+f*$,d*k+h*$]}const bd=["l",0,0,0,0,0,0,0];function xd(e,t,n){const i=bd[0]=e[0];if("a"===i||"A"===i)bd[1]=t*e[1],bd[2]=n*e[2],bd[3]=e[3],bd[4]=e[4],bd[5]=e[5],bd[6]=t*e[6],bd[7]=n*e[7];else if("h"===i||"H"===i)bd[1]=t*e[1];else if("v"===i||"V"===i)bd[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)bd[r]=(r%2==1?t:n)*e[r];return bd}function _d(e,t,n,i,r,o){var a,s,l,c,u,f=null,d=0,h=0,p=0,g=0,m=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,b=t.length;v<b;++v){switch(a=t[v],1===r&&1===o||(a=xd(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":m=d+=a[1],y=h+=a[2],e.moveTo(d+n,h+i);break;case"M":m=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],g=h+a[4],e.bezierCurveTo(d+a[1]+n,h+a[2]+i,p+n,g+i,s+n,l+i),d=s,h=l;break;case"C":d=a[5],h=a[6],p=a[3],g=a[4],e.bezierCurveTo(a[1]+n,a[2]+i,p+n,g+i,d+n,h+i);break;case"s":s=d+a[3],l=h+a[4],p=2*d-p,g=2*h-g,e.bezierCurveTo(p+n,g+i,d+a[1]+n,h+a[2]+i,s+n,l+i),p=d+a[1],g=h+a[2],d=s,h=l;break;case"S":s=a[3],l=a[4],p=2*d-p,g=2*h-g,e.bezierCurveTo(p+n,g+i,a[1]+n,a[2]+i,s+n,l+i),d=s,h=l,p=a[1],g=a[2];break;case"q":s=d+a[3],l=h+a[4],p=d+a[1],g=h+a[2],e.quadraticCurveTo(p+n,g+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],g=a[2];break;case"t":s=d+a[1],l=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,g=h):"t"===f[0]?(p=2*d-c,g=2*h-u):"q"===f[0]&&(p=2*d-p,g=2*h-g),c=p,u=g,e.quadraticCurveTo(p+n,g+i,s+n,l+i),h=l,p=(d=s)+a[1],g=h+a[2];break;case"T":s=a[1],l=a[2],p=2*d-p,g=2*h-g,e.quadraticCurveTo(p+n,g+i,s+n,l+i),d=s,h=l;break;case"a":wd(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":wd(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=m,h=y,e.closePath()}f=a}}function wd(e,t,n,i){const r=function(e,t,n,i,r,o,a,s,l){const c=yd.call(arguments);if(gd[c])return gd[c];const u=a*fd,f=Math.sin(u),d=Math.cos(u),h=d*(s-e)*.5+f*(l-t)*.5,p=d*(l-t)*.5-f*(s-e)*.5;let g=h*h/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,v=-f/i,b=d/i,x=m*s+y*l,_=v*s+b*l,w=m*e+y*t,k=v*e+b*t;let $=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;$<0&&($=0);let E=Math.sqrt($);o==r&&(E=-E);const A=.5*(x+w)-E*(k-_),S=.5*(_+k)+E*(w-x),D=Math.atan2(_-S,x-A);let C=Math.atan2(k-S,w-A)-D;C<0&&1===o?C+=hd:C>0&&0===o&&(C-=hd);const M=Math.ceil(Math.abs(C/(dd+.001))),F=[];for(let O=0;O<M;++O){const e=D+O*C/M,t=D+(O+1)*C/M;F[O]=[A,S,e,t,n,i,f,d]}return gd[c]=F}(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=vd(r[o]);e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}const kd=.5773502691896257,$d={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,hd)}},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=pd*n,r=i-n*kd,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=pd*n,r=i-n*kd;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=pd*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=pd*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=pd*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=pd*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 Ed(e){return(0,g.mQ)($d,e)?$d[e]:function(e){if(!(0,g.mQ)(Ad,e)){const t=ud(e);Ad[e]={draw:function(e,n){_d(e,t,0,0,Math.sqrt(n)/2)}}}return Ad[e]}(e)}var Ad={};const Sd=.448084975506;function Dd(e){return e.x}function Cd(e){return e.y}function Md(e){return e.width}function Fd(e){return e.height}function Od(e){return"function"===typeof e?e:()=>+e}function Td(e,t,n){return Math.max(t,Math.min(e,n))}function zd(e,t){return null!=e?e:t}const Nd=e=>e.x||0,Rd=e=>e.y||0,Bd=e=>!(!1===e.defined),Pd=Tl().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)),Ld=Pl().x(Nd).y1(Rd).y0((e=>(e.y||0)+(e.height||0))).defined(Bd),Id=Pl().y(Rd).x1(Nd).x0((e=>(e.x||0)+(e.width||0))).defined(Bd),jd=Bl().x(Nd).y(Rd).defined(Bd),Ud=function(){var e=Dd,t=Cd,n=Md,i=Fd,r=Od(0),o=r,a=r,s=r,l=null;function c(c,u,f){var d,h=null!=u?u:+e.call(this,c),p=null!=f?f:+t.call(this,c),g=+n.call(this,c),m=+i.call(this,c),y=Math.min(g,m)/2,v=Td(+r.call(this,c),0,y),b=Td(+o.call(this,c),0,y),x=Td(+a.call(this,c),0,y),_=Td(+s.call(this,c),0,y);if(l||(l=d=El()),v<=0&&b<=0&&x<=0&&_<=0)l.rect(h,p,g,m);else{var w=h+g,k=p+m;l.moveTo(h+v,p),l.lineTo(w-b,p),l.bezierCurveTo(w-Sd*b,p,w,p+Sd*b,w,p+b),l.lineTo(w,k-_),l.bezierCurveTo(w,k-Sd*_,w-Sd*_,k,w-_,k),l.lineTo(h+x,k),l.bezierCurveTo(h+Sd*x,k,h,k-Sd*x,h,k-x),l.lineTo(h,p+v),l.bezierCurveTo(h,p+Sd*v,h+Sd*v,p,h+v,p),l.closePath()}if(d)return l=null,d+""||null}return c.x=function(t){return arguments.length?(e=Od(t),c):e},c.y=function(e){return arguments.length?(t=Od(e),c):t},c.width=function(e){return arguments.length?(n=Od(e),c):n},c.height=function(e){return arguments.length?(i=Od(e),c):i},c.cornerRadius=function(e,t,n,i){return arguments.length?(r=Od(e),o=null!=t?Od(t):r,s=null!=n?Od(n):r,a=null!=i?Od(i):o,c):r},c.context=function(e){return arguments.length?(l=null==e?null:e,c):l},c}().x(Nd).y(Rd).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>zd(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>zd(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>zd(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>zd(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),qd=jl().type((e=>Ed(e.shape||"circle"))).size((e=>zd(e.size,64))),Gd=function(){var e,t,n,i,r,o,a,s,l=null;function c(e,t,n){const i=n/2;if(r){var c=a-t,u=e-o;if(c||u){var f=Math.sqrt(c*c+u*u),d=(c/=f)*s,h=(u/=f)*s,p=Math.atan2(u,c);l.moveTo(o-d,a-h),l.lineTo(e-c*i,t-u*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,hd);l.closePath()}else r=1;o=e,a=t,s=i}function u(o){var a,s,u,f=o.length,d=!1;for(null==l&&(l=u=El()),a=0;a<=f;++a)!(a<f&&i(s=o[a],a,o))===d&&(d=!d)&&(r=0),d&&c(+e(s,a,o),+t(s,a,o),+n(s,a,o));if(u)return l=null,u+""||null}return u.x=function(t){return arguments.length?(e=t,u):e},u.y=function(e){return arguments.length?(t=e,u):t},u.size=function(e){return arguments.length?(n=e,u):n},u.defined=function(e){return arguments.length?(i=e,u):i},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}().x(Nd).y(Rd).defined(Bd).size((e=>e.size||1));function Wd(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Yd(e,t,n,i){return Ud.context(e)(t,n,i)}var Hd=1;function Xd(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+Hd++),a=r.clipping[o]||(r.clipping[o]={id:o});return(0,g.Tn)(i)?a.path=i(null):Wd(n)?a.path=Yd(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Vd(e){this.clear(),e&&this.union(e)}function Kd(e){this.mark=e,this.bounds=this.bounds||new Vd}function Qd(e){Kd.call(this,e),this.items=this.items||[]}function Jd(e){this._pending=0,this._loader=e||Ki()}function Zd(e){e._pending+=1}function eh(e){e._pending-=1}function th(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}Vd.prototype={clone(){return new Vd(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),c=t-t*s+n*l,u=n-t*l-n*s;return[s*i-l*r+c,l*i+s*r+u,s*i-l*a+c,l*i+s*a+u,s*o-l*r+c,l*o+s*r+u,s*o-l*a+c,l*o+s*a+u]},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,g.B)(Qd,Kd),Jd.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return Zd(t),t._loader.sanitize(e,{context:"href"}).then((e=>(eh(t),e))).catch((()=>(eh(t),null)))},loadImage(e){const t=this,n=ql();return Zd(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,g.mQ)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>eh(t),r.onerror=()=>eh(t),r.src=i,r})).catch((e=>(eh(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)}))}};const nh=hd-1e-8;let ih,rh,oh,ah,sh,lh,ch,uh;const fh=(e,t)=>ih.add(e,t),dh=(e,t)=>fh(rh=e,oh=t),hh=e=>fh(e,ih.y1),ph=e=>fh(ih.x1,e),gh=(e,t)=>sh*e+ch*t,mh=(e,t)=>lh*e+uh*t,yh=(e,t)=>fh(gh(e,t),mh(e,t)),vh=(e,t)=>dh(gh(e,t),mh(e,t));function bh(e,t){return ih=e,t?(ah=t*fd,sh=uh=Math.cos(ah),lh=Math.sin(ah),ch=-lh):(sh=uh=1,ah=lh=ch=0),xh}const xh={beginPath(){},closePath(){},moveTo:vh,lineTo:vh,rect(e,t,n,i){ah?(yh(e+n,t),yh(e+n,t+i),yh(e,t+i),vh(e,t)):(fh(e+n,t+i),dh(e,t))},quadraticCurveTo(e,t,n,i){const r=gh(e,t),o=mh(e,t),a=gh(n,i),s=mh(n,i);_h(rh,r,a,hh),_h(oh,o,s,ph),dh(a,s)},bezierCurveTo(e,t,n,i,r,o){const a=gh(e,t),s=mh(e,t),l=gh(n,i),c=mh(n,i),u=gh(r,o),f=mh(r,o);wh(rh,a,l,u,hh),wh(oh,s,c,f,ph),dh(u,f)},arc(e,t,n,i,r,o){if(i+=ah,r+=ah,rh=n*Math.cos(r)+e,oh=n*Math.sin(r)+t,Math.abs(r-i)>nh)fh(e-n,t-n),fh(e+n,t+n);else{const a=i=>fh(n*Math.cos(i)+e,n*Math.sin(i)+t);let s,l;if(a(i),a(r),r!==i)if((i%=hd)<0&&(i+=hd),(r%=hd)<0&&(r+=hd),r<i&&(o=!o,s=i,i=r,r=s),o)for(r-=hd,s=i-i%dd,l=0;l<4&&s>r;++l,s-=dd)a(s);else for(s=i-i%dd+dd,l=0;l<4&&s<r;++l,s+=dd)a(s)}}};function _h(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function wh(e,t,n,i,r){const o=i-e+3*t-3*n,a=e+n-2*t,s=e-t;let l,c=0,u=0;Math.abs(o)>1e-14?(l=a*a+s*o,l>=0&&(l=Math.sqrt(l),c=(-a+l)/o,u=(-a-l)/o)):c=.5*s/a,0<c&&c<1&&r(kh(c,e,t,n,i)),0<u&&u<1&&r(kh(u,e,t,n,i))}function kh(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 $h=($h=Ul(1,1))?$h.getContext("2d"):null;const Eh=new Vd;function Ah(e){return function(t,n){if(!$h)return!0;e($h,t),Eh.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:a}=Eh;for(let e=r;e<=a;++e)for(let t=i;t<=o;++t)if($h.isPointInPath(t,e))return!0;return!1}}function Sh(e,t){return t.contains(e.x||0,e.y||0)}function Dh(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(Eh.set(n,i,n+r,i+o))}function Ch(e,t,n,i,r){const{x1:o,y1:a,x2:s,y2:l}=e,c=i-t,u=r-n;let f,d,h,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-c,d=-(o-t)),1===p&&(f=c,d=s-t),2===p&&(f=-u,d=-(a-n)),3===p&&(f=u,d=l-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>m)return!1;h>g&&(g=h)}else if(f>0){if(h<g)return!1;h<m&&(m=h)}}return!0}function Mh(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Fh(e,t){return null==e?t:e}function Oh(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Th(e,t,n){return Zf(n)?function(e,t,n){const i=n.width(),r=n.height();let o;if("radial"===t.gradient)o=e.createRadialGradient(n.x1+Fh(t.x1,.5)*i,n.y1+Fh(t.y1,.5)*r,Math.max(i,r)*Fh(t.r1,0),n.x1+Fh(t.x2,.5)*i,n.y1+Fh(t.y2,.5)*r,Math.max(i,r)*Fh(t.r2,.5));else{const a=Fh(t.x1,0),s=Fh(t.y1,0),l=Fh(t.x2,1),c=Fh(t.y2,0);if(a!==l&&s!==c&&i!==r){const n=Ul(Math.ceil(i),Math.ceil(r)),o=n.getContext("2d");return o.scale(i,r),o.fillStyle=Oh(o.createLinearGradient(a,s,l,c),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+c*r)}return Oh(o,t.stops)}(e,n,t.bounds):n}function zh(e,t,n){return(n*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=n,e.fillStyle=Th(e,t,t.fill),!0)}var Nh=[];function Rh(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=Th(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||Nh),e.lineDashOffset=t.strokeDashOffset||0),!0))}function Bh(e,t){return e.zindex-t.zindex||e.index-t.index}function Ph(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(Bh)}function Lh(e,t){var n,i,r=e.items;if(!r||!r.length)return;const o=Ph(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 Ih(e,t){var n,i,r=e.items;if(!r||!r.length)return null;const o=Ph(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 jh(e){return function(t,n,i){Lh(n,(n=>{i&&!i.intersects(n.bounds)||qh(e,t,n,n)}))}}function Uh(e){return function(t,n,i){!n.items.length||i&&!i.intersects(n.bounds)||qh(e,t,n.items[0],n.items)}}function qh(e,t,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(e(t,i)||(Mh(t,n),n.fill&&zh(t,n,r)&&t.fill(),n.stroke&&Rh(t,n,r)&&t.stroke()))}function Gh(e){return e=e||g.vN,function(t,n,i,r,o,a){return i*=t.pixelRatio,r*=t.pixelRatio,Ih(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 Wh(e,t){return function(n,i,r,o){var a,s,l=Array.isArray(i)?i[0]:i,c=null==t?l.fill:t,u=l.stroke&&n.isPointInStroke;return u&&(a=l.strokeWidth,s=l.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,i)&&(c&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o))}}function Yh(e){return Gh(Wh(e))}function Hh(e,t){return"translate("+e+","+t+")"}function Xh(e){return"rotate("+e+")"}function Vh(e){return Hh(e.x||0,e.y||0)}function Kh(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*=fd),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 Hh(e.x||0,e.y||0)+(e.angle?" "+Xh(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(bh(e,n.angle),n),th(e,n).translate(n.x||0,n.y||0)},draw:jh(i),pick:Yh(i),isect:n||Ah(i)}}var Qh=Kh("arc",(function(e,t){return Pd.context(e)(t)}));function Jh(e,t,n){function i(e,n){e.beginPath(),t(e,n)}const r=Wh(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(bh(e),i),th(e,i[0]))},draw:Uh(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:Sh,tip:n}}var Zh=Jh("area",(function(e,t){const n=t[0],i=n.interpolate||"linear";return("horizontal"===n.orient?Id:Ld).curve(rd(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 ep(e,t){e.beginPath(),Wd(t)?Yd(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function tp(e){const t=Fh(e.strokeWidth,1);return null!=e.strokeOffset?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function np(e,t){const n=tp(t);e("d",Yd(null,t,n,n))}function ip(e,t,n,i){const r=tp(t);e.beginPath(),Yd(e,t,(n||0)+r,(i||0)+r)}const rp=Wh(ip),op=Wh(ip,!1),ap=Wh(ip,!0);var sp={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Vh(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),th(e,t),e.translate(t.x||0,t.y||0)},draw:function(e,t,n){Lh(t,(t=>{const i=t.x||0,r=t.y||0,o=t.strokeForeground,a=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&a&&(ip(e,t,i,r),Mh(e,t),t.fill&&zh(e,t,a)&&e.fill(),t.stroke&&!o&&Rh(e,t,a)&&e.stroke()),e.save(),e.translate(i,r),t.clip&&ep(e,t),n&&n.translate(-i,-r),Lh(t,(t=>{this.draw(e,t,n)})),n&&n.translate(i,r),e.restore(),o&&t.stroke&&a&&(ip(e,t,i,r),Mh(e,t),Rh(e,t,a)&&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 Ih(t,(l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(r,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(r<u||r>h||o<f||o>p))return;if(e.save(),e.translate(u,f),u=r-u,f=o-f,g&&Wd(l)&&!ap(e,l,a,s))return e.restore(),null;const m=l.strokeForeground,y=!1!==t.interactive;return y&&m&&l.stroke&&op(e,l,a,s)?(e.restore(),l):(c=Ih(l,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,u,f)?this.pick(e,n,i,u,f):null)),!c&&y&&(l.fill||!m&&l.stroke)&&rp(e,l,a,s)&&(c=l),e.restore(),c||null)}))},isect:Dh,content:function(e,t,n){e("clip-path",t.clip?Xd(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),np(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?np(e,t):e("d","")}},lp={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function cp(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 up(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 fp(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 dp(e,t){return"center"===e?t/2:"right"===e?t:0}function hp(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var pp={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const i=cp(t,n),r=up(t,i),o=fp(t,i),a=(t.x||0)-dp(t.align,r),s=(t.y||0)-hp(t.baseline,o);e("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",lp["xmlns:xlink"],"xlink:href"),e("transform",Hh(a,s)),e("width",r),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,i=up(t,n),r=fp(t,n),o=(t.x||0)-dp(t.align,i),a=(t.y||0)-hp(t.baseline,r);return e.set(o,a,o+i,a+r)},draw:function(e,t,n){Lh(t,(t=>{if(n&&!n.intersects(t.bounds))return;const i=cp(t,this);let r=up(t,i),o=fp(t,i);if(0===r||0===o)return;let a,s,l,c,u=(t.x||0)-dp(t.align,r),f=(t.y||0)-hp(t.baseline,o);!1!==t.aspect&&(s=i.width/i.height,l=t.width/t.height,s===s&&l===l&&s!==l&&(l<s?(c=r/s,f+=(o-c)/2,o=c):(c=o*s,u+=(r-c)/2,r=c))),(i.complete||i.toDataURL)&&(Mh(e,t),e.globalAlpha=null!=(a=t.opacity)?a:1,e.imageSmoothingEnabled=!1!==t.smooth,e.drawImage(i,u,f,r,o))}))},pick:Gh(),isect:g.vN,get:cp,xOffset:dp,yOffset:hp},gp=Jh("line",(function(e,t){const n=t[0],i=n.interpolate||"linear";return jd.curve(rd(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 mp(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)*fd,l=t.pathCache;l&&l.path===n||((t.pathCache=l=ud(n)).path=n),s&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(s),_d(e,l,0,0,o,a),e.rotate(-s),e.translate(-i,-r)):_d(e,l,i,r,o,a)}var yp={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 Hh(e.x||0,e.y||0)+(e.angle?" "+Xh(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 mp(bh(e,t.angle),t)?e.set(0,0,0,0):th(e,t,!0)},draw:jh(mp),pick:Yh(mp),isect:Ah(mp)};function vp(e,t){e.beginPath(),Yd(e,t)}var bp={type:"rect",tag:"path",nested:!1,attr:function(e,t){e("d",Yd(null,t))},bound:function(e,t){var n,i;return th(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)},draw:jh(vp),pick:Yh(vp),isect:Dh};function xp(e,t,n){var i,r,o,a;return!(!t.stroke||!Rh(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 _p={type:"rule",tag:"line",nested:!1,attr:function(e,t){e("transform",Vh(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 th(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){Lh(t,(t=>{if(!n||n.intersects(t.bounds)){var i=null==t.opacity?1:t.opacity;i&&xp(e,t,i)&&(Mh(e,t),e.stroke())}}))},pick:Gh((function(e,t,n,i){return!!e.isPointInStroke&&(xp(e,t,1)&&e.isPointInStroke(n,i))})),isect:function(e,t){const n=e.x||0,i=e.y||0;return Ch(t,n,i,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i)}},wp=Kh("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),kp=Kh("symbol",(function(e,t){return qd.context(e)(t)}),Sh);const $p=(0,g.EV)();var Ep={height:Fp,measureWidth:Cp,estimateWidth:Sp,width:Sp,canvas:Ap};function Ap(e){Ep.width=e&&$h?Cp:Sp}function Sp(e,t){return Dp(Np(e,t),Fp(e))}function Dp(e,t){return~~(.8*e.length*t)}function Cp(e,t){return Fp(e)<=0||!(t=Np(e,t))?0:Mp(t,Bp(e))}function Mp(e,t){const n=`(${t}) ${e}`;let i=$p.get(n);return void 0===i&&($h.font=t,i=$h.measureText(e).width,$p.set(n,i)),i}function Fp(e){return null!=e.fontSize?+e.fontSize||0:11}function Op(e){return null!=e.lineHeight?e.lineHeight:Fp(e)+2}function Tp(e){return t=e.lineBreak&&e.text&&!(0,g.cy)(e.text)?e.text.split(e.lineBreak):e.text,(0,g.cy)(t)?t.length>1?t:t[0]:t;var t}function zp(e){const t=Tp(e);return((0,g.cy)(t)?t.length-1:0)*Op(e)}function Np(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(Ep.width===Cp){const t=Bp(e);return e=>Mp(e,t)}{const t=Fp(e);return e=>Dp(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 Rp(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Bp(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Fp(e)+"px "+Rp(e,t)}function Pp(e){var t=e.baseline,n=Fp(e);return Math.round("top"===t?.79*n:"middle"===t?.3*n:"bottom"===t?-.21*n:"line-top"===t?.29*n+.5*Op(e):"line-bottom"===t?.29*n-.5*Op(e):0)}Ap(!0);const Lp={left:"start",center:"middle",right:"end"},Ip=new Vd;function jp(e){var t,n=e.x||0,i=e.y||0,r=e.radius||0;return r&&(t=(e.theta||0)-dd,n+=r*Math.cos(t),i+=r*Math.sin(t)),Ip.x1=n,Ip.y1=i,Ip}function Up(e,t,n){var i,r=Ep.height(t),o=t.align,a=jp(t),s=a.x1,l=a.y1,c=t.dx||0,u=(t.dy||0)+Pp(t)-Math.round(.8*r),f=Tp(t);if((0,g.cy)(f)?(r+=Op(t)*(f.length-1),i=f.reduce(((e,n)=>Math.max(e,Ep.width(t,n))),0)):i=Ep.width(t,f),"center"===o?c-=i/2:"right"===o&&(c-=i),e.set(c+=s,u+=l,c+i,u+r),t.angle&&!n)e.rotate(t.angle*fd,s,l);else if(2===n)return e.rotatedPoints(t.angle*fd,s,l);return e}var qp={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,i=t.dx||0,r=(t.dy||0)+Pp(t),o=jp(t),a=o.x1,s=o.y1,l=t.angle||0;e("text-anchor",Lp[t.align]||"start"),l?(n=Hh(a,s)+" "+Xh(l),(i||r)&&(n+=" "+Hh(i,r))):n=Hh(a+i,s+r),e("transform",n)},bound:Up,draw:function(e,t,n){Lh(t,(t=>{var i,r,o,a,s,l,c,u=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===u||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=Bp(t),e.textAlign=t.align||"left",r=(i=jp(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(r,o),e.rotate(t.angle*fd),r=o=0),r+=t.dx||0,o+=(t.dy||0)+Pp(t),l=Tp(t),Mh(e,t),(0,g.cy)(l))for(s=Op(t),a=0;a<l.length;++a)c=Np(t,l[a]),t.fill&&zh(e,t,u)&&e.fillText(c,r,o),t.stroke&&Rh(e,t,u)&&e.strokeText(c,r,o),o+=s;else c=Np(t,l),t.fill&&zh(e,t,u)&&e.fillText(c,r,o),t.stroke&&Rh(e,t,u)&&e.strokeText(c,r,o);t.angle&&e.restore()}}))},pick:Gh((function(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=jp(t),s=a.x1,l=a.y1,c=Up(Ip,t,1),u=-t.angle*fd,f=Math.cos(u),d=Math.sin(u),h=f*r-d*o+(s-f*s+d*l),p=d*r+f*o+(l-d*s-f*l);return c.contains(h,p)})),isect:function(e,t){const n=Up(Ip,e,2);return Ch(t,n[0],n[1],n[2],n[3])||Ch(t,n[0],n[1],n[4],n[5])||Ch(t,n[4],n[5],n[6],n[7])||Ch(t,n[2],n[3],n[6],n[7])}},Gp=Jh("trail",(function(e,t){return Gd.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})),Wp={arc:Qh,area:Zh,group:sp,image:pp,line:gp,path:yp,rect:bp,rule:_p,shape:wp,symbol:kp,text:qp,trail:Gp};function Yp(e,t,n){var i=Wp[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new Vd),e,n)}var Hp={mark:null};const Xp=["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 Vp(e){return Kp("string"===typeof e?JSON.parse(e):e)}function Kp(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)&&Kp(o[n]);return r&&function(e,t,n){var i,r,o,a,s=Wp[e.marktype],l=s.bound,c=e.items,u=c&&c.length;if(s.nested)return u?o=c[0]:(Hp.mark=e,o=Hp),a=Yp(o,l,n),t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new Vd,u)for(i=0,r=c.length;i<r;++i)t.union(Yp(c[i],l,n));e.bounds=t}(e),e}function Qp(e){arguments.length?this.root=Vp(e):(this.root=Jp({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Qd(this.root)])}function Jp(e,t){const n={bounds:new Vd,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 Zp(e,t,n){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function eg(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 tg(e,t,n,i){var r,o=e.childNodes[t];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=Zp(e.ownerDocument,n,i),e.insertBefore(o,r)),o}function ng(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function ig(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function rg(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function og(e,t){this._active=null,this._handlers={},this._loader=e||Ki(),this._tooltip=t||ag}function ag(e,t,n,i){e.element().setAttribute("title",i||"")}function sg(e){this._el=null,this._bgcolor=null,this._loader=new Jd(e)}Qp.prototype={toJSON(e){return function(e,t){return JSON.stringify(e,Xp,t)}(this.root,e||0)},mark(e,t,n){const i=Jp(e,t=t||this.root.items[0]);return t.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},og.prototype={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=Zp(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=Wp[a.marktype]).tip){for((o=rg(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}}},sg.prototype={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){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then((()=>t)):Promise.resolve(t)},_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 lg="dragenter",cg="dragleave",ug="dragover",fg="mousedown",dg="mousemove",hg="mouseout",pg="mouseover",gg="click",mg="mousewheel",yg="touchstart",vg="touchmove",bg="touchend",xg=["keydown","keypress","keyup",lg,cg,ug,fg,"mouseup",dg,hg,pg,gg,"dblclick","wheel",mg,yg,vg,bg],_g=dg,wg=hg,kg=gg;function $g(e,t){og.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function Eg(e,t){(e=>e===yg||e===vg||e===bg?[yg,vg,bg]:[e])(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 Ag(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(t,i)),this.fire(e,i)}}function Sg(e){return function(t){this.fire(e,t),this._active=null}}(0,g.B)($g,og,{initialize(e,t,n){return this._canvas=e&&eg(e,"canvas"),[gg,fg,dg,hg,cg].forEach((e=>Eg(this,e))),og.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:xg,DOMMouseScroll(e){this.fire(mg,e)},mousemove:Ag(dg,pg,hg),dragover:Ag(ug,lg,cg),mouseout:Sg(hg),dragleave:Sg(cg),mousedown(e){this._down=this._active,this.fire(fg,e)},click(e){this._down===this._active&&(this.fire(gg,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(yg,e,!0)},touchmove(e){this.fire(vg,e,!0)},touchend(e){this.fire(bg,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===kg&&i&&i.href?this.handleHref(t,i,i.href):e!==_g&&e!==wg||this.handleTooltip(t,i,e!==wg),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&&(Eg(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=rg(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 Wp[e.marktype].pick.call(this,o,e,t,n,i,r)}});var Dg="undefined"!==typeof window&&window.devicePixelRatio||1;function Cg(e){sg.call(this,e),this._options={},this._redraw=!1,this._dirty=new Vd,this._tempb=new Vd}const Mg=sg.prototype;function Fg(e,t){og.call(this,e,t);const n=this;n._hrefHandler=Og(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=Og(n,((e,t)=>{n.handleTooltip(e,t,e.type!==wg)}))}(0,g.B)(Cg,sg,{initialize(e,t,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Ul(1,1,this._options.type),e&&this._canvas&&(ng(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Mg.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(Mg.resize.call(this,e,t,n,i),this._canvas)!function(e,t,n,i,r,o){const a="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),l=a?Dg:r;e.width=t*l,e.height=n*l;for(const c in o)s[c]=o[c];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])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||(0,g.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){const t=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty,a=((e,t,n)=>(new Vd).set(0,0,t,n).translate(-e[0],-e[1]))(n,i,r);t.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a.intersect(o),n);return this.clear(-n[0],-n[1],i,r),this.draw(t,e,s),t.restore(),o.clear(),this},draw(e,t,n){const i=Wp[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),(0,g.Tn)(n)?(e.beginPath(),n(e),e.clip()):ep(e,t.group)}(e,t),i.draw.call(this,e,t,n),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 Og=(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)};(0,g.B)(Fg,og,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(kg,this._hrefHandler),i.removeEventListener(_g,this._tooltipHandler),i.removeEventListener(wg,this._tooltipHandler)),this._svg=i=e&&eg(e,"svg"),i&&(i.addEventListener(kg,this._hrefHandler),i.addEventListener(_g,this._tooltipHandler),i.addEventListener(wg,this._tooltipHandler)),og.prototype.initialize.call(this,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:Og(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 Tg="aria-hidden",zg="aria-label",Ng="role",Rg="aria-roledescription",Bg="graphics-object",Pg="graphics-symbol",Lg=(e,t,n)=>({[Ng]:e,[Rg]:t,[zg]:n||void 0}),Ig=(0,g.M1)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),jg={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,i=t.title?Yg(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 ${vf(s)?"discrete":s} scale`+` with ${Kf(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?Yg(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,g.se)(e)}(o)}`+` with ${Kf(l,s,e)}`}},"title-text":{desc:"title",caption:e=>`Title text '${Wg(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${Wg(e)}'`}},Ug={ariaRole:Ng,ariaRoleDescription:Rg,description:zg};function qg(e,t){const n=!1===t.aria;if(e(Tg,n||void 0),n||null==t.description)for(const i in Ug)e(Ug[i],void 0);else{const n=t.mark.marktype;e(zg,t.description),e(Ng,t.ariaRole||("group"===n?Bg:Pg)),e(Rg,t.ariaRoleDescription||`${n} mark`)}}function Gg(e){return!1===e.aria?{[Tg]:!0}:Ig[e.role]?null:jg[e.role]?function(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return Lg(t.role||Pg,t.desc,n.description||i(n))}catch(n){return null}}(e,jg[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return Lg(n?Bg:Pg,`${t} mark container`,e.description)}(e)}function Wg(e){return(0,g.YO)(e.text).join(" ")}function Yg(e){try{return(0,g.YO)((0,g.se)(e.items).items[0].text).join(" ")}catch(t){return null}}const Hg=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function Xg(){let e="",t="",n="";const i=[],r=()=>t=n="",o=(e,n)=>{var i;return null!=n&&(t+=` ${e}="${i=n,Hg(i).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}"`),a},a={open(s){(o=>{t&&(e+=`${t}>${n}`,r()),i.push(o)})(s),t="<"+s;for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];for(const e of c)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+=Hg(e),a),toString:()=>e};return a}const Vg=e=>Kg(Xg(),e)+"";function Kg(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):Kg(e,t)}return e.close()}const Qg={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"},Jg={blend:"mix-blend-mode"},Zg={fill:"none","stroke-miterlimit":10},em="http://www.w3.org/2000/xmlns/",tm=lp.xmlns;function nm(e){sg.call(this,e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const im=sg.prototype;function rm(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 om(e,t,n){let i,r,o;if("radial"===t.gradient){let i=tg(e,n++,"pattern",tm);hm(i,{id:Jf+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=tg(i,0,"rect",tm),hm(i,{width:1,height:1,fill:`url(${gm()}#${t.id})`}),hm(e=tg(e,n++,"radialGradient",tm),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else hm(e=tg(e,n++,"linearGradient",tm),{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=tg(e,i,"stop",tm),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return ng(e,i),n}function am(e,t,n){let i;return(e=tg(e,n,"clipPath",tm)).setAttribute("id",t.id),t.path?(i=tg(e,0,"path",tm),i.setAttribute("d",t.path)):(i=tg(e,0,"rect",tm),hm(i,{x:0,y:0,width:t.width,height:t.height})),ng(e,1),n+1}function sm(e,t,n,i,r){let o,a=e._svg;if(!a&&(o=t.ownerDocument,a=Zp(o,i,tm),e._svg=a,e.mark&&(a.__data__=e,a.__values__={fill:"default"},"g"===i))){const t=Zp(o,"path",tm);a.appendChild(t),t.__data__=e;const n=Zp(o,"g",tm);a.appendChild(n),n.__data__=e;const i=Zp(o,"path",tm);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}(0,g.B)(nm,sg,{initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=tg(e,0,"svg",tm),this._svg.setAttributeNS(em,"xmlns",tm),this._svg.setAttributeNS(em,"xmlns:xlink",lp["xmlns:xlink"]),this._svg.setAttribute("version",lp.version),this._svg.setAttribute("class","marks"),ng(e,1),this._root=tg(this._svg,0,"g",tm),hm(this._root,Zg),ng(this._svg,1)),this.background(this._bgcolor),im.initialize.call(this,e,t,n,i,r)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),im.background.apply(this,arguments)},resize(e,t,n,i){return im.resize.call(this,e,t,n,i),this._svg&&(hm(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=tg(e,0,"rect",tm),hm(n,{width:this._width,height:this._height,fill:t}));const i=Vg(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),i},_render(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),ng(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=Wp[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,rm(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,rm(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const i=this._svg,r=Wp[t.marktype],o=!1===t.interactive?"none":null,a="g"===r.tag,s=sm(t,e,n,"g",i);s.setAttribute("class",ig(t));const l=Gg(t);for(const d in l)pm(s,d,l[d]);a||pm(s,"pointer-events",o),pm(s,"clip-path",t.clip?Xd(this,t,t.group):null);let c=null,u=0;const f=e=>{const t=this.isDirty(e),n=sm(e,s,c,r.tag,i);t&&(this._update(r,n,e),a&&function(e,t,n){t=t.lastChild.previousSibling;let i,r=0;Lh(n,(n=>{i=e.mark(t,n,i),++r})),ng(t,1+r)}(this,n,e)),c=n,++u};return r.nested?t.items.length&&f(t.items[0]):Lh(t,f),ng(s,u),s},_update(e,t,n){lm=t,cm=t.__values__,qg(fm,n),e.attr(fm,n,this);const i=um[e.type];i&&i.call(this,e,t,n),lm&&this.style(lm,n)},style(e,t){if(null!=t){for(const n in Qg){let i="font"===n?Rp(t):t[n];if(i===cm[n])continue;const r=Qg[n];null==i?e.removeAttribute(r):(Zf(i)&&(i=ed(i,this._defs.gradient,gm())),e.setAttribute(r,i+"")),cm[n]=i}for(const n in Jg)dm(e,Jg[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=tg(e,1,"defs",tm)),i=om(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=tg(e,1,"defs",tm)),i=am(n,t.clipping[r],i);n&&(0===i?(e.removeChild(n),t.el=null):ng(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let lm=null,cm=null;const um={group(e,t,n){const i=lm=t.childNodes[2];cm=i.__values__,e.foreground(fm,n,this),cm=t.__values__,lm=t.childNodes[1],e.content(fm,n,this);const r=lm=t.childNodes[0];e.background(fm,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==cm.events&&(pm(i,"pointer-events",o),pm(r,"pointer-events",o),cm.events=o),n.strokeForeground&&n.stroke){const e=n.fill;pm(i,"display",null),this.style(r,n),pm(r,"stroke",null),e&&(n.fill=null),cm=i.__values__,this.style(i,n),e&&(n.fill=e),lm=null}else pm(i,"display","none")},image(e,t,n){!1===n.smooth?(dm(t,"image-rendering","optimizeSpeed"),dm(t,"image-rendering","pixelated")):dm(t,"image-rendering",null)},text(e,t,n){const i=Tp(n);let r,o,a,s;(0,g.cy)(i)?(o=i.map((e=>Np(n,e))),r=o.join("\n"),r!==cm.text&&(ng(t,0),a=t.ownerDocument,s=Op(n),o.forEach(((e,i)=>{const r=Zp(a,"tspan",tm);r.__data__=n,r.textContent=e,i&&(r.setAttribute("x",0),r.setAttribute("dy",s)),t.appendChild(r)})),cm.text=r)):(o=Np(n,i),o!==cm.text&&(t.textContent=o,cm.text=o)),pm(t,"font-family",Rp(n)),pm(t,"font-size",Fp(n)+"px"),pm(t,"font-style",n.fontStyle),pm(t,"font-variant",n.fontVariant),pm(t,"font-weight",n.fontWeight)}};function fm(e,t,n){t!==cm[e]&&(n?function(e,t,n,i){null!=n?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}(lm,e,t,n):pm(lm,e,t),cm[e]=t)}function dm(e,t,n){n!==cm[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),cm[t]=n)}function hm(e,t){for(const n in t)pm(e,n,t[n])}function pm(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function gm(){let e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function mm(e){sg.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}(0,g.B)(mm,sg,{svg(){return this._text},_render(e){const t=Xg();t.open("svg",(0,g.X$)({},lp,{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",Zg,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=Wp[t.marktype],i=n.tag,r=[qg,n.attr];e.open("g",{class:ig(t),"clip-path":t.clip?Xd(this,t,t.group):null},Gg(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=Tp(o);if((0,g.cy)(t)){const n={x:0,dy:Op(o)};for(let i=0;i<t.length;++i)e.open("tspan",i?n:null).text(Np(o,t[i])).close()}else e.text(Np(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)),Lh(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]):Lh(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"]=Rp(t),e["font-size"]=Fp(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const a in Qg){let n=t[a];const i=Qg[a];("transparent"!==n||"fill"!==i&&"stroke"!==i)&&null!=n&&(Zf(n)&&(n=ed(n,r.gradient,"")),e[i]=n)}for(const a in Jg){const e=t[a];null!=e&&(o=o||[],o.push(`${Jg[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:Jf+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 ym="canvas",vm="none",bm={Canvas:ym,PNG:"png",SVG:"svg",None:vm},xm={};function _m(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(xm[e]=t,this):xm[e]}function wm(e,t,n){const i=[],r=(new Vd).union(t),o=e.marktype;return o?km(e,r,n,i):"group"===o?$m(e,r,n,i):(0,g.z3)("Intersect scene must be mark node or group item.")}function km(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)$m(r[s],t,n,i);else for(const e=Wp[o].isect;s<a;++s){const n=r[s];Em(n,t,e)&&i.push(n)}}return i}function $m(e,t,n,i){n&&n(e.mark)&&Em(e,t,Wp.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)km(r[e],t,n,i);t.translate(a,s)}return i}function Em(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}xm[ym]=xm.png={renderer:Cg,headless:Cg,handler:$g},xm.svg={renderer:nm,headless:mm,handler:Fg},xm[vm]={};const Am=new Vd;const Sm="top",Dm="left",Cm="right",Mm="bottom",Fm="top-left",Om="top-right",Tm="bottom-left",zm="bottom-right",Nm="start",Rm="middle",Bm="end",Pm="x",Lm="y",Im="group",jm="axis",Um="title",qm="frame",Gm="scope",Wm="legend",Ym="row-header",Hm="row-footer",Xm="row-title",Vm="column-header",Km="column-footer",Qm="column-title",Jm="padding",Zm="symbol",ey="fit",ty="fit-x",ny="fit-y",iy="pad",ry="none",oy="all",ay="each",sy="flush",ly="column",cy="row";function uy(e){Nr.call(this,null,e)}function fy(e,t,n){return t(e.bounds.clear(),e,n)}(0,g.B)(uy,Nr,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Wp[r],a=o.bound;let s,l=i.bounds;if(o.nested)i.items.length&&n.dirty(i.items[0]),l=fy(i,a),i.items.forEach((e=>{e.bounds.clear().union(l)}));else if(r===Im||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),l.clear(),i.items.forEach((e=>l.union(fy(e,a)))),i.role){case jm:case Wm:case Um:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{l.union(fy(e,a))})),t.visit(t.MOD,(e=>{s=s||l.alignsWith(e.bounds),n.dirty(e),l.union(fy(e,a))})),s&&(l.clear(),i.items.forEach((e=>l.union(e.bounds))));return function(e){const t=e.clip;if((0,g.Tn)(t))t(bh(Am.clear()));else{if(!t)return;Am.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(Am)}(i),t.modifies("bounds")}});const dy=":vega_identifier:";function hy(e){Nr.call(this,0,e)}function py(e){Nr.call(this,null,e)}function gy(e){Nr.call(this,null,e)}hy.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,g.B)(hy,Nr,{transform(e,t){const n=(r=t.dataflow)._signals[dy]||(r._signals[dy]=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,g.B)(py,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===Im?Qd:Kd;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 my={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,i)=>i&&yy(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},yy=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),vy=(e,t)=>{for(var n,i=1,r=e.length,o=e[0].bounds;i<r;o=n,++i)if(yy(o,n=e[i].bounds,t))return!0},by=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},xy=e=>(e.forEach((e=>e.opacity=1)),e),_y=(e,t)=>e.reflow(t.modified()).modifies("opacity");function wy(e){Nr.call(this,null,e)}(0,g.B)(gy,Nr,{transform(e,t){const n=my[e.method]||my.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")&&(xy(a),t=_y(t,e)),t;if(a=a.filter(by),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),r=xy(a),t=_y(t,e),r.length>=3&&vy(r,i)){do{r=n(r,i)}while(r.length>=3&&vy(r,i));r.length<3&&!(0,g.se)(a).opacity&&(r.length>1&&((0,g.se)(r).opacity=0),(0,g.se)(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var i=e.range(),r=new Vd;return t===Sm||t===Mm?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,g.B)(wy,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 ky=new Vd;function $y(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Ey(e){var t=e.items[0].orient;return t===Dm||t===Cm}function Ay(e,t,n,i){var r,o,a=t.items[0],s=a.datum,l=null!=a.translate?a.translate:.5,c=a.orient,u=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,g=a.maxExtent,m=s.title&&a.items[u[2]].items[0],y=a.titlePadding,v=a.bounds,b=m&&zp(m),x=0,_=0;switch(ky.clear().union(v),v.clear(),(r=u[0])>-1&&v.union(a.items[r].bounds),(r=u[1])>-1&&v.union(a.items[r].bounds),c){case Sm:x=h||0,_=-d,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&Sy(e,m,o,y,b,0,-1,v);break;case Dm:x=-d,_=h||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&Sy(e,m,o,y,b,1,-1,v);break;case Cm:x=n+d,_=h||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&Sy(e,m,o,y,b,1,1,v);break;case Mm:x=h||0,_=i+d,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&Sy(e,m,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return th(v.translate(x,_),a),$y(a,"x",x+l)|$y(a,"y",_+l)&&(a.bounds=ky,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function Sy(e,t,n,i,r,o,a,s){const l=t.bounds;if(t.auto){const s=a*(n+r+i);let c=0,u=0;e.dirty(t),o?c=(t.x||0)-(t.x=s):u=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(l.translate(-c,-u)),e.dirty(t)}s.union(l)}const Dy=(e,t)=>Math.floor(Math.min(e,t)),Cy=(e,t)=>Math.ceil(Math.max(e,t));function My(e){return(new Vd).set(0,0,e.width||0,e.height||0)}function Fy(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Oy(e,t,n){const i=(0,g.Gv)(e)?e[t]:e;return null!=i?i:void 0!==n?n:0}function Ty(e){return e<0?Math.ceil(-e):0}function zy(e,t,n){var i,r,o,a,s,l,c,u,f,d,h,p=!n.nodirty,g=n.bounds===sy?My:Fy,m=ky.set(0,0,0,0),y=Oy(n.align,ly),v=Oy(n.align,cy),b=Oy(n.padding,ly),x=Oy(n.padding,cy),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,$=Array(k),E=Array(_),A=0,S=Array(k),D=Array(w),C=0,M=Array(k),F=Array(k),O=Array(k);for(r=0;r<_;++r)E[r]=0;for(r=0;r<w;++r)D[r]=0;for(r=0;r<k;++r)l=t[r],s=O[r]=g(l),l.x=l.x||0,M[r]=0,l.y=l.y||0,F[r]=0,o=r%_,a=~~(r/_),A=Math.max(A,c=Math.ceil(s.x2)),C=Math.max(C,u=Math.ceil(s.y2)),E[o]=Math.max(E[o],c),D[a]=Math.max(D[a],u),$[r]=b+Ty(s.x1),S[r]=x+Ty(s.y1),p&&e.dirty(t[r]);for(r=0;r<k;++r)r%_===0&&($[r]=0),r<_&&(S[r]=0);if(y===ay)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===oy){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===ay)for(a=1;a<w;++a){for(h=0,i=(r=a*_)+_;r<i;++r)h<S[r]&&(h=S[r]);for(r=a*_;r<i;++r)S[r]=h+D[a-1]}else if(v===oy){for(h=0,r=_;r<k;++r)h<S[r]&&(h=S[r]);for(r=_;r<k;++r)S[r]=h+C}else for(v=!1,a=1;a<w;++a)for(i=(r=a*_)+_;r<i;++r)S[r]+=D[a-1];for(f=0,r=0;r<k;++r)f=$[r]+(r%_?f:0),M[r]+=f-t[r].x;for(o=0;o<_;++o)for(d=0,r=o;r<k;r+=_)d+=S[r],F[r]+=d-t[r].y;if(y&&Oy(n.center,ly)&&w>1)for(r=0;r<k;++r)(f=(s=y===oy?A:E[r%_])-O[r].x2-t[r].x-M[r])>0&&(M[r]+=f/2);if(v&&Oy(n.center,cy)&&1!==_)for(r=0;r<k;++r)(d=(s=v===oy?C:D[~~(r/_)])-O[r].y2-t[r].y-F[r])>0&&(F[r]+=d/2);for(r=0;r<k;++r)m.union(O[r].translate(M[r],F[r]));switch(f=Oy(n.anchor,Pm),d=Oy(n.anchor,Lm),Oy(n.anchor,ly)){case Bm:f-=m.width();break;case Rm:f-=m.width()/2}switch(Oy(n.anchor,cy)){case Bm:d-=m.height();break;case Rm:d-=m.height()/2}for(f=Math.round(f),d=Math.round(d),m.clear(),r=0;r<k;++r)t[r].mark.bounds.clear();for(r=0;r<k;++r)(l=t[r]).x+=M[r]+=f,l.y+=F[r]+=d,m.union(l.mark.bounds.union(l.bounds.translate(M[r],F[r]))),p&&e.dirty(l);return m}function Ny(e,t,n){var i,r,o,a,s,l,c,u=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===Im)switch(t.role){case jm:case Wm:case Um:break;case Ym:a.rowheaders.push(...n);break;case Hm:a.rowfooters.push(...n);break;case Vm:a.colheaders.push(...n);break;case Km:a.colfooters.push(...n);break;case Xm:a.rowtitle=n[0];break;case Qm:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(t),f=u.marks,d=n.bounds===sy?Ry:By,h=n.offset,p=n.columns||f.length,g=p<=0?1:Math.ceil(f.length/p),m=g*p;const y=zy(e,f,n);y.empty()&&y.set(0,0,0,0),u.rowheaders&&(l=Oy(n.headerBand,cy,null),i=Py(e,u.rowheaders,f,p,g,-Oy(h,"rowHeader"),Dy,0,d,"x1",0,p,1,l)),u.colheaders&&(l=Oy(n.headerBand,ly,null),r=Py(e,u.colheaders,f,p,p,-Oy(h,"columnHeader"),Dy,1,d,"y1",0,1,p,l)),u.rowfooters&&(l=Oy(n.footerBand,cy,null),o=Py(e,u.rowfooters,f,p,g,Oy(h,"rowFooter"),Cy,0,d,"x2",p-1,p,1,l)),u.colfooters&&(l=Oy(n.footerBand,ly,null),a=Py(e,u.colfooters,f,p,p,Oy(h,"columnFooter"),Cy,1,d,"y2",m-p,1,p,l)),u.rowtitle&&(s=Oy(n.titleAnchor,cy),c=Oy(h,"rowTitle"),c=s===Bm?o+c:i-c,l=Oy(n.titleBand,cy,.5),Ly(e,u.rowtitle,c,0,y,l)),u.coltitle&&(s=Oy(n.titleAnchor,ly),c=Oy(h,"columnTitle"),c=s===Bm?a+c:r-c,l=Oy(n.titleBand,ly,.5),Ly(e,u.coltitle,c,1,y,l))}function Ry(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 By(e,t){return e.bounds[t]}function Py(e,t,n,i,r,o,a,s,l,c,u,f,d,h){var p,g,m,y,v,b,x,_,w,k=n.length,$=0,E=0;if(!k)return $;for(p=u;p<k;p+=f)n[p]&&($=a($,l(n[p],c)));if(!t.length)return $;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),$+=o,g=0,y=t.length;g<y;++g)e.dirty(t[g]),t[g].mark.bounds.clear();for(p=u,g=0,y=t.length;g<y;++g,p+=f){for(v=(b=t[g]).mark.bounds,m=p;m>=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=$):(_=$,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,e.dirty(b),E=a(E,v[c])}return E}function Ly(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 Iy(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)),c=s("anchor",Nm),u=c===Bm?1:c===Rm?.5:0,f={align:ay,bounds:s("bounds",sy),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case Dm:f.anchor={x:Math.floor(i.x1)-l,column:Bm,y:u*(a||i.height()+2*i.y1),row:c};break;case Cm:f.anchor={x:Math.ceil(i.x2)+l,y:u*(a||i.height()+2*i.y1),row:c};break;case Sm:f.anchor={y:Math.floor(r.y1)-l,row:Bm,x:u*(o||r.width()+2*r.x1),column:c};break;case Mm:f.anchor={y:Math.ceil(r.y2)+l,x:u*(o||r.width()+2*r.x1),column:c};break;case Fm:f.anchor={x:l,y:l};break;case Om:f.anchor={x:o-l,y:l,column:Bm};break;case Tm:f.anchor={x:l,y:a-l,row:Bm};break;case zm:f.anchor={x:o-l,y:a-l,column:Bm,row:Bm}}return f}function jy(e,t){var n,i,r=t.items[0],o=r.datum,a=r.orient,s=r.bounds,l=r.x,c=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,c=i-a.x,u=i-a.y;switch(a.orient){case Dm:r+=Math.ceil(a.bounds.width())+l;break;case Cm:case Mm:break;default:o+=a.bounds.height()+l}switch((r||o)&&qy(e,n,r,o),a.orient){case Dm:u+=Uy(t,n,a,s,1,1);break;case Cm:c+=Uy(t,n,a,Bm,0,0)+l,u+=Uy(t,n,a,s,1,1);break;case Mm:c+=Uy(t,n,a,s,0,0),u+=Uy(t,n,a,Bm,-1,0,1)+l;break;default:c+=Uy(t,n,a,s,0,0)}(c||u)&&qy(e,a,c,u),(c=Math.round(a.bounds.x1-i))<0&&(qy(e,n,-c,0),qy(e,a,-c,0))}else(r||o)&&qy(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===Zm&&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!==ry&&(r.x=l=0,r.y=c=0),r.width=n,r.height=i,th(s.set(l,c,l+n,c+i),r),r.mark.bounds.clear().union(s),r}function Uy(e,t,n,i,r,o,a){const s="symbol"!==e.datum.type,l=n.datum.vgrad,c=(!s||!o&&l||a?t:t.items[0]).bounds[r?"y2":"x2"]-e.padding,u=l&&o?c:0,f=l&&o?0:c,d=r<=0?0:zp(n);return Math.round(i===Nm?u:i===Bm?f-d:.5*(c-d))}function qy(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 Gy(e){Nr.call(this,null,e)}function Wy(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 Yy(e){Nr.call(this,null,e)}function Hy(e){Nr.call(this,null,e)}function Xy(){return rr({})}function Vy(e){Nr.call(this,null,e)}function Ky(e){Nr.call(this,[],e)}(0,g.B)(Gy,Nr,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&Ny(n,t,e.layout),function(e,t,n){var i,r,o,a,s,l=t.items,c=Math.max(0,t.width||0),u=Math.max(0,t.height||0),f=(new Vd).set(0,0,c,u),d=f.clone(),h=f.clone(),p=[];for(a=0,s=l.length;a<s;++a)switch((r=l[a]).role){case jm:(Ey(r)?d:h).union(Ay(e,r,c,u));break;case Um:i=r;break;case Wm:p.push(jy(e,r));break;case qm:case Gm:case Ym:case Hm:case Xm:case Vm:case Km:case Qm: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||Cm)!==ry&&(t[o]||(t[o]=[])).push(e)}));for(const i in t){const r=t[i];zy(e,r,Iy(r,i,n.legends,d,h,c,u))}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!==ey&&n.autosize.type!==ty&&n.autosize.type!==ny)f.union(i);else switch(t.orient){case Dm:case Cm:f.add(i.x1,0).add(i.x2,0);break;case Sm:case Mm: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,c=a.anchor,u=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=l===Dm||l===Cm?i:n,g=0,m=0,y=0,v=0,b=0;if(s!==Im?l===Dm?(g=r.y2,p=r.y1):l===Cm?(g=r.y1,p=r.y2):(g=r.x1,p=r.x2):l===Dm&&(g=i,p=0),o=c===Nm?g:c===Bm?p:(g+p)/2,h&&h.text){switch(l){case Sm:case Mm:b=d.bounds.height()+f;break;case Dm:v=d.bounds.width()+f;break;case Cm:v=-d.bounds.width()-f}ky.clear().union(h.bounds),ky.translate(v-(h.x||0),b-(h.y||0)),$y(h,"x",v)|$y(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(ky),h.mark.bounds.clear().union(ky),e.dirty(h)),ky.clear().union(h.bounds)}else ky.clear();switch(ky.union(d.bounds),l){case Sm:m=o,y=r.y1-ky.height()-u;break;case Dm:m=r.x1-ky.width()-u,y=o;break;case Cm:m=r.x2+ky.width()+u,y=o;break;case Mm:m=o,y=r.y2+u;break;default:m=a.x,y=a.y}return $y(a,"x",m)|$y(a,"y",y)&&(ky.translate(m,y),e.dirty(a),a.bounds.clear().union(ky),t.bounds.clear().union(ky),e.dirty(a)),a.bounds}(e,i,c,u,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),c=Math.max(0,Math.ceil(-n.x1)),u=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-u));if(r.contains===Jm){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===ry?(c=0,f=0,l=a,u=s):o===ey?(l=Math.max(0,a-c-d),u=Math.max(0,s-f-h)):o===ty?(l=Math.max(0,a-c-d),s=u+f+h):o===ny?(a=l+c+d,u=Math.max(0,s-f-h)):o===iy&&(a=l+c+d,s=u+f+h);e._resizeView(a,s,l,u,[c,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,g.B)(Yy,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=zf(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||Bf(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?Nf(o,e.values,a):Rf(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,g.B)(Hy,Nr,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||Xy,o=e.key||nr,a=this.value;return(0,g.cy)(i.encode)&&(i.encode=null),a&&(e.modified("key")||t.modified(o))&&(0,g.z3)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=(0,g.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,g.B)(Vy,Nr,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if((0,g.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||g.me,l=r.enter||g.me,c=r.exit||g.me,u=(o&&!a?r[o]:s)||g.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),u!==g.me&&u!==s&&(t.visit(t.ADD,(t=>{u(t,e)})),n.modifies(u.output))),t.changed(t.REM)&&c!==g.me&&(t.visit(t.REM,(t=>{c(t,e)})),n.modifies(c.output)),a||u!==g.me){const r=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(r,(t=>{const r=l(t,e)||i;(u(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(l.output)):t.visit(r,(t=>{(u(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(u.output)}return n.changed()?n:t.StopPropagation}}),(0,g.B)(Ky,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),c=this.value,u=e.type||Cf,f=e.scale,d=+e.limit,h=zf(f,null==e.count?5:e.count,e.minstep),p=!!e.values||u===Cf,m=e.format||qf(s,f,h,u,e.formatSpecifier,e.formatType,p),y=e.values||jf(f,h);return c&&(l.rem=c),u===Cf?(d&&y.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),c=y.slice(0,d-1),a=!0):c=y,(0,g.Tn)(r=e.size)?(e.values||0!==f(c[0])||(c=c.slice(1)),o=c.reduce(((t,n)=>Math.max(t,r(n,e))),0)):r=(0,g.dY)(o=r||8),c=c.map(((t,n)=>rr({index:n,label:m(t,n,c),value:t,offset:o,size:r(t,e)}))),a&&(a=y[c.length],c.push(rr({index:c.length,label:`\u2026${y.length-c.length} entries`,value:a,offset:o,size:r(a,e)})))):"gradient"===u?(n=f.domain(),i=kf(f,n[0],(0,g.se)(n)),y.length<3&&!e.values&&n[0]!==(0,g.se)(n)&&(y=[n[0],(0,g.se)(n)]),c=y.map(((e,t)=>rr({index:t,label:m(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,g.se)(t),o=r-i;if(e.type===Ku){const e=n?o/n:.1;i-=e,r+=e,o=r-i}return e=>(e-i)/o}(f),c=y.map(((e,t)=>rr({index:t,label:m(e,t,y),value:e,perc:t?i(e):0,perc2:t===r?1:i(y[t+1])})))),l.source=c,l.add=c,this.value=c,l}});const Qy=e=>e.source.x,Jy=e=>e.source.y,Zy=e=>e.target.x,ev=e=>e.target.y;function tv(e){Nr.call(this,{},e)}tv.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,g.B)(tv,Nr,{transform(e,t){var n=e.sourceX||Qy,i=e.sourceY||Jy,r=e.targetX||Zy,o=e.targetY||ev,a=e.as||"path",s=e.orient||"vertical",l=e.shape||"line",c=ov.get(l+"-"+s)||ov.get(l);return c||(0,g.z3)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=c(n(e),i(e),r(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const nv=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,iv=(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},rv=(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},ov=(0,g.nG)({line:nv,"line-radial":(e,t,n,i)=>nv(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),arc:iv,"arc-radial":(e,t,n,i)=>iv(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),curve:rv,"curve-radial":(e,t,n,i)=>rv(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 av(e){Nr.call(this,null,e)}av.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,g.B)(av,Nr,{transform(e,t){var n,i,r,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],l=e.field||g.xH,c=e.startAngle||0,u=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(l),h=d.length,p=c,m=(u-c)/Wy(d),y=(0,qo.A)(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*m;return this.value=d,t.reflow(e.modified()).modifies(o)}});const sv=5;function lv(e){return yf(e)&&e!==Yu}const cv=(0,g.M1)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function uv(e){Nr.call(this,null,e),this.modified(!0)}function fv(e,t,n){if(bf(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,g.r$)(t))}return t}function dv(e,t,n){return(0,g.Tn)(e)&&(t||n)?function(e,t){const n=t[0],i=(0,g.se)(t)-n;return function(t){return e(n+t*i)}}(e,hv(t||[0,1],n)):e}function hv(e,t){return t?e.slice().reverse():e}function pv(e){Nr.call(this,null,e)}(0,g.B)(uv,Nr,{transform(e,t){var n=t.dataflow,i=this.value,r=function(e){var t,n=e.type,i="";if(n===Yu)return Yu+"-"+Lu;(function(e){const t=e.type;return yf(t)&&t!==Gu&&t!==Wu&&(e.scheme||e.range&&e.range.length&&e.range.every(g.Kg))})(e)&&(i=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?Yu+"-":3===t?Hu+"-":"");return(i+n||Lu).toLowerCase()}(e);for(r in i&&r===i.type||(this.value=i=gf(r)()),e)if(!cv[r]){if("padding"===r&&lv(i.type))continue;(0,g.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!==Zu&&e!==Ju&&(0,g.z3)("Only band and point scales support rangeStep.");var i=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,r=e===Ju?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Pu(n,r,i)]}(i,t,n);else if(t.scheme&&(o=function(e,t,n){var i,r=t.schemeExtent;(0,g.cy)(t.scheme)?i=wf(t.scheme,t.interpolate,t.interpolateGamma):(i=Df(t.scheme.toLowerCase()))||(0,g.z3)(`Unrecognized scheme name: ${t.scheme}`);return n=e===Ku?n+1:e===ef?n-1:e===Xu||e===Vu?+t.schemeCount||sv:n,xf(e)?dv(i,r,t.reverse):(0,g.Tn)(i)?function(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}(dv(i,r),n):e===Qu?i:i.slice(0,n)}(i,t,n),(0,g.Tn)(o))){if(e.interpolator)return e.interpolator(o);(0,g.z3)(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&xf(i))return e.interpolator(wf(hv(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate($f(t.interpolate,t.interpolateGamma)):(0,g.Tn)(e.round)?e.round(r):(0,g.Tn)(e.rangeRound)&&e.interpolate(r?pc.A:hc.A);o&&e.range(hv(o,t.reverse))}(i,e,function(e,t,n){let i=t.bins;if(i&&!(0,g.cy)(i)){const t=e.domain(),n=t[0],r=(0,g.se)(t),o=i.step;let a=null==i.start?n:i.start,s=null==i.stop?r:i.stop;o||(0,g.z3)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>r&&(s=o*Math.floor(r/o)),i=(0,qo.A)(a,s+o/2,o)}i?e.bins=i:e.bins&&delete e.bins;e.type===ef&&(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(fv(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===Lu||t===ju||t===Uu)}(e);if(!a)return 0;lv(s)&&t.padding&&a[0]!==(0,g.se)(a)&&(a=function(e,t,n,i,r,o){var a=Math.abs((0,g.se)(n)-n[0]),s=a/(a-2*i),l=e===Iu?(0,g.oV)(t,null,s):e===Uu?(0,g.SW)(t,null,s,.5):e===ju?(0,g.SW)(t,null,s,r||1):e===qu?(0,g.B2)(t,null,s,o||1):(0,g.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));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)}e.domain(fv(s,a,n)),s===Qu&&e.unknown(t.domainImplicit?Oc.h:void 0);t.nice&&e.nice&&e.nice(!0!==t.nice&&zf(e,t.nice)||null);return a.length}(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),(0,g.B)(pv,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 gv="zero",mv="center",yv="normalize",vv=["y0","y1"];function bv(e){Nr.call(this,null,e)}function xv(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 _v(e,t,n,i,r){for(var o,a=1/e.sum,s=0,l=e.length,c=0,u=0;c<l;++c)(o=e[c])[i]=s,o[r]=s=a*(u+=Math.abs(n(o)))}function wv(e,t,n,i,r){for(var o,a,s=0,l=0,c=e.length,u=0;u<c;++u)(o=+n(a=e[u]))<0?(a[i]=l,a[r]=l+=o):(a[i]=s,a[r]=s+=o)}bv.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:gv,values:[gv,mv,yv]},{name:"as",type:"string",array:!0,length:2,default:vv}]},(0,g.B)(bv,Nr,{transform(e,t){var n,i,r,o,a=e.as||vv,s=a[0],l=a[1],c=lr(e.sort),u=e.field||g.xH,f=e.offset===mv?xv:e.offset===yv?_v:wv;for(n=function(e,t,n,i){var r,o,a,s,l,c,u,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],(u=r[c=t.map(p)])||(r[c]=u=[],h.push(u)),u.push(l);for(c=0,d=0,s=h.length;c<s;++c){for(o=0,f=0,a=(u=h[c]).length;o<a;++o)f+=Math.abs(i(u[o]));u.sum=f,f>d&&(d=f),n&&u.sort(n)}return h.max=d,h}(t.source,e.groupby,c,u),i=0,r=n.length,o=n.max;i<r;++i)f(n[i],o,u,s,l);return t.reflow(e.modified()).modifies(a)}});const kv=e=>e;function $v(e,t){e&&Av.hasOwnProperty(e.type)&&Av[e.type](e,t)}var Ev={Feature:function(e,t){$v(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)$v(n[i].geometry,t)}},Av={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){Sv(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Sv(n[i],t,0)},Polygon:function(e,t){Dv(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Dv(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)$v(n[i],t)}};function Sv(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 Dv(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Sv(e[n],t,1);t.polygonEnd()}function Cv(e,t){e&&Ev.hasOwnProperty(e.type)?Ev[e.type](e,t):$v(e,t)}class Mv{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 Fv=1e-6,Ov=1e-12,Tv=Math.PI,zv=Tv/2,Nv=Tv/4,Rv=2*Tv,Bv=180/Tv,Pv=Tv/180,Lv=Math.abs,Iv=Math.atan,jv=Math.atan2,Uv=Math.cos,qv=Math.ceil,Gv=Math.exp,Wv=(Math.floor,Math.hypot),Yv=Math.log,Hv=Math.pow,Xv=Math.sin,Vv=Math.sign||function(e){return e>0?1:e<0?-1:0},Kv=Math.sqrt,Qv=Math.tan;function Jv(e){return e>1?0:e<-1?Tv:Math.acos(e)}function Zv(e){return e>1?zv:e<-1?-zv:Math.asin(e)}function eb(){}var tb,nb,ib,rb,ob=new Mv,ab=new Mv,sb={point:eb,lineStart:eb,lineEnd:eb,polygonStart:function(){sb.lineStart=lb,sb.lineEnd=fb},polygonEnd:function(){sb.lineStart=sb.lineEnd=sb.point=eb,ob.add(Lv(ab)),ab=new Mv},result:function(){var e=ob/2;return ob=new Mv,e}};function lb(){sb.point=cb}function cb(e,t){sb.point=ub,tb=ib=e,nb=rb=t}function ub(e,t){ab.add(rb*e-ib*t),ib=e,rb=t}function fb(){ub(tb,nb)}const db=sb;var hb=1/0,pb=hb,gb=-hb,mb=gb,yb={point:function(e,t){e<hb&&(hb=e);e>gb&&(gb=e);t<pb&&(pb=t);t>mb&&(mb=t)},lineStart:eb,lineEnd:eb,polygonStart:eb,polygonEnd:eb,result:function(){var e=[[hb,pb],[gb,mb]];return gb=mb=-(pb=hb=1/0),e}};const vb=yb;var bb,xb,_b,wb,kb=0,$b=0,Eb=0,Ab=0,Sb=0,Db=0,Cb=0,Mb=0,Fb=0,Ob={point:Tb,lineStart:zb,lineEnd:Bb,polygonStart:function(){Ob.lineStart=Pb,Ob.lineEnd=Lb},polygonEnd:function(){Ob.point=Tb,Ob.lineStart=zb,Ob.lineEnd=Bb},result:function(){var e=Fb?[Cb/Fb,Mb/Fb]:Db?[Ab/Db,Sb/Db]:Eb?[kb/Eb,$b/Eb]:[NaN,NaN];return kb=$b=Eb=Ab=Sb=Db=Cb=Mb=Fb=0,e}};function Tb(e,t){kb+=e,$b+=t,++Eb}function zb(){Ob.point=Nb}function Nb(e,t){Ob.point=Rb,Tb(_b=e,wb=t)}function Rb(e,t){var n=e-_b,i=t-wb,r=Kv(n*n+i*i);Ab+=r*(_b+e)/2,Sb+=r*(wb+t)/2,Db+=r,Tb(_b=e,wb=t)}function Bb(){Ob.point=Tb}function Pb(){Ob.point=Ib}function Lb(){jb(bb,xb)}function Ib(e,t){Ob.point=jb,Tb(bb=_b=e,xb=wb=t)}function jb(e,t){var n=e-_b,i=t-wb,r=Kv(n*n+i*i);Ab+=r*(_b+e)/2,Sb+=r*(wb+t)/2,Db+=r,Cb+=(r=wb*e-_b*t)*(_b+e),Mb+=r*(wb+t),Fb+=3*r,Tb(_b=e,wb=t)}const Ub=Ob;function qb(e){this._context=e}qb.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,Rv)}},result:eb};var Gb,Wb,Yb,Hb,Xb,Vb=new Mv,Kb={point:eb,lineStart:function(){Kb.point=Qb},lineEnd:function(){Gb&&Jb(Wb,Yb),Kb.point=eb},polygonStart:function(){Gb=!0},polygonEnd:function(){Gb=null},result:function(){var e=+Vb;return Vb=new Mv,e}};function Qb(e,t){Kb.point=Jb,Wb=Hb=e,Yb=Xb=t}function Jb(e,t){Hb-=e,Xb-=t,Vb.add(Kv(Hb*Hb+Xb*Xb)),Hb=e,Xb=t}const Zb=Kb;let ex,tx,nx,ix;class rx{constructor(e){this._append=null==e?ox:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return ox;if(t!==ex){const e=10**t;ex=t,tx=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 tx}(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!==nx||this._append!==tx){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`,nx=e,tx=this._append,ix=this._,this._=t}this._+=ix}}result(){const e=this._;return this._="",e.length?e:null}}function ox(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ax(e,t){let n,i,r=3,o=4.5;function a(e){return e&&("function"===typeof o&&i.pointRadius(+o.apply(this,arguments)),Cv(e,n(i))),i.result()}return a.area=function(e){return Cv(e,n(db)),db.result()},a.measure=function(e){return Cv(e,n(Zb)),Zb.result()},a.bounds=function(e){return Cv(e,n(vb)),vb.result()},a.centroid=function(e){return Cv(e,n(Ub)),Ub.result()},a.projection=function(t){return arguments.length?(n=null==t?(e=null,kv):(e=t).stream,a):e},a.context=function(e){return arguments.length?(i=null==e?(t=null,new rx(r)):new qb(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 rx(r)),a},a.projection(e).digits(r).context(t)}function sx(){var e,t=[];return{point:function(t,n,i){e.push([t,n,i])},lineStart:function(){t.push(e=[])},lineEnd:eb,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function lx(e,t){return Lv(e[0]-t[0])<Fv&&Lv(e[1]-t[1])<Fv}function cx(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 ux(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(lx(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*Fv}s.push(n=new cx(i,e,null,!0)),l.push(n.o=new cx(i,null,n,!1)),s.push(n=new cx(a,e,null,!1)),l.push(n.o=new cx(a,null,n,!0))}})),s.length){for(l.sort(t),fx(s),fx(l),o=0,a=l.length;o<a;++o)l[o].e=n=!n;for(var c,u,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=c.length;o<a;++o)r.point((u=c[o])[0],u[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,o=c.length-1;o>=0;--o)r.point((u=c[o])[0],u[1]);else i(d.x,d.p.x,-1,r);d=d.p}c=(d=d.o).z,h=!h}while(!d.v);r.lineEnd()}}}function fx(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 dx(e){return[jv(e[1],e[0]),Zv(e[2])]}function hx(e){var t=e[0],n=e[1],i=Uv(n);return[i*Uv(t),i*Xv(t),Xv(n)]}function px(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gx(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 mx(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function yx(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function vx(e){var t=Kv(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function bx(e){return Lv(e[0])<=Tv?e[0]:Vv(e[0])*((Lv(e[0])+Tv)%Rv-Tv)}function xx(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function _x(e,t,n,i){return function(r){var o,a,s,l=t(r),c=sx(),u=t(c),f=!1,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=v,d.lineEnd=b,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,a=xx(a);var e=function(e,t){var n=bx(t),i=t[1],r=Xv(i),o=[Xv(n),-Uv(n),0],a=0,s=0,l=new Mv;1===r?i=zv+Fv:-1===r&&(i=-zv-Fv);for(var c=0,u=e.length;c<u;++c)if(d=(f=e[c]).length)for(var f,d,h=f[d-1],p=bx(h),g=h[1]/2+Nv,m=Xv(g),y=Uv(g),v=0;v<d;++v,p=x,m=w,y=k,h=b){var b=f[v],x=bx(b),_=b[1]/2+Nv,w=Xv(_),k=Uv(_),$=x-p,E=$>=0?1:-1,A=E*$,S=A>Tv,D=m*w;if(l.add(jv(D*E*Xv(A),y*k+D*Uv(A))),a+=S?$+E*Rv:$,S^p>=n^x>=n){var C=gx(hx(h),hx(b));vx(C);var M=gx(o,C);vx(M);var F=(S^$>=0?-1:1)*Zv(M[2]);(i>F||i===F&&(C[0]||C[1]))&&(s+=S^$>=0?1:-1)}}return(a<-Fv||a<Fv&&l<-Ov)^1&s}(o,i);a.length?(f||(r.polygonStart(),f=!0),ux(a,kx,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 g(){d.point=p,l.lineStart()}function m(){d.point=h,l.lineEnd()}function y(e,t){s.push([e,t]),u.point(e,t)}function v(){u.lineStart(),s=[]}function b(){y(s[0][0],s[0][1]),u.lineEnd();var e,t,n,i,l=u.clean(),d=c.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(wx))}return d}}function wx(e){return e.length>1}function kx(e,t){return((e=e.x)[0]<0?e[1]-zv-Fv:zv-e[1])-((t=t.x)[0]<0?t[1]-zv-Fv:zv-t[1])}const $x=_x((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?Tv:-Tv,l=Lv(o-n);Lv(l-Tv)<Fv?(e.point(n,i=(i+a)/2>0?zv:-zv),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(s,i),e.point(o,i),t=0):r!==s&&l>=Tv&&(Lv(n-r)<Fv&&(n-=r*Fv),Lv(o-s)<Fv&&(o-=s*Fv),i=function(e,t,n,i){var r,o,a=Xv(e-n);return Lv(a)>Fv?Iv((Xv(t)*(o=Uv(i))*Xv(n)-Xv(i)*(r=Uv(t))*Xv(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*zv,i.point(-Tv,r),i.point(0,r),i.point(Tv,r),i.point(Tv,0),i.point(Tv,-r),i.point(0,-r),i.point(-Tv,-r),i.point(-Tv,0),i.point(-Tv,r);else if(Lv(e[0]-t[0])>Fv){var o=e[0]<t[0]?Tv:-Tv;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}),[-Tv,-zv]);function Ex(e,t,n,i,r,o){if(n){var a=Uv(t),s=Xv(t),l=i*n;null==r?(r=t+i*Rv,o=t-l/2):(r=Ax(a,r),o=Ax(a,o),(i>0?r<o:r>o)&&(r+=i*Rv));for(var c,u=r;i>0?u>o:u<o;u-=l)c=dx([a,-s*Uv(u),-s*Xv(u)]),e.point(c[0],c[1])}}function Ax(e,t){(t=hx(t))[0]-=e,vx(t);var n=Jv(-t[1]);return((-t[2]<0?-n:n)+Rv-Fv)%Rv}var Sx=1e9,Dx=-Sx;function Cx(e,t,n,i){function r(r,o){return e<=r&&r<=n&&t<=o&&o<=i}function o(r,o,s,c){var u=0,f=0;if(null==r||(u=a(r,s))!==(f=a(o,s))||l(r,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?i:t)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function a(i,r){return Lv(i[0]-e)<Fv?r>0?0:3:Lv(i[0]-n)<Fv?r>0?2:1:Lv(i[1]-t)<Fv?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,c,u,f,d,h,p,g,m,y,v,b=a,x=sx(),_={point:w,lineStart:function(){_.point=k,c&&c.push(u=[]);y=!0,m=!1,p=g=NaN},lineEnd:function(){l&&(k(f,d),h&&m&&x.rejoin(),l.push(x.result()));_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,l=[],c=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,r=c.length;n<r;++n)for(var o,a,s=c[n],l=1,u=s.length,f=s[0],d=f[0],h=f[1];l<u;++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=xx(l)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),r&&ux(l,s,t,o,a),a.polygonEnd());b=a,l=c=u=null}};function w(e,t){r(e,t)&&b.point(e,t)}function k(o,a){var s=r(o,a);if(c&&u.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var l=[p=Math.max(Dx,Math.min(Sx,p)),g=Math.max(Dx,Math.min(Sx,g))],x=[o=Math.max(Dx,Math.min(Sx,o)),a=Math.max(Dx,Math.min(Sx,a))];!function(e,t,n,i,r,o){var a,s=e[0],l=e[1],c=0,u=1,f=t[0]-s,d=t[1]-l;if(a=n-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=r-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=i-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)}if(a=o-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)}return c>0&&(e[0]=s+c*f,e[1]=l+c*d),u<1&&(t[0]=s+u*f,t[1]=l+u*d),!0}}}}}(l,x,e,t,n,i)?s&&(b.lineStart(),b.point(o,a),v=!1):(m||(b.lineStart(),b.point(l[0],l[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,m=s}return _}}function Mx(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 Fx(e,t){return Lv(e)>Tv&&(e-=Math.round(e/Rv)*Rv),[e,t]}function Ox(e,t,n){return(e%=Rv)?t||n?Mx(zx(e),Nx(t,n)):zx(e):t||n?Nx(t,n):Fx}function Tx(e){return function(t,n){return Lv(t+=e)>Tv&&(t-=Math.round(t/Rv)*Rv),[t,n]}}function zx(e){var t=Tx(e);return t.invert=Tx(-e),t}function Nx(e,t){var n=Uv(e),i=Xv(e),r=Uv(t),o=Xv(t);function a(e,t){var a=Uv(t),s=Uv(e)*a,l=Xv(e)*a,c=Xv(t),u=c*n+s*i;return[jv(l*r-u*o,s*n-c*i),Zv(u*r+l*o)]}return a.invert=function(e,t){var a=Uv(t),s=Uv(e)*a,l=Xv(e)*a,c=Xv(t),u=c*r-l*o;return[jv(l*r+c*o,s*n+u*i),Zv(u*n-s*i)]},a}function Rx(e){return function(t){var n=new Bx;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Bx(){}function Px(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=i&&e.clipExtent(null),Cv(n,e.stream(vb)),t(vb.result()),null!=i&&e.clipExtent(i),e}function Lx(e,t,n){return Px(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 Ix(e,t,n){return Lx(e,[[0,0],t],n)}function jx(e,t,n){return Px(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 Ux(e,t,n){return Px(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)}Fx.invert=Fx,Bx.prototype={constructor:Bx,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 qx=16,Gx=Uv(30*Pv);function Wx(e,t){return+t?function(e,t){function n(i,r,o,a,s,l,c,u,f,d,h,p,g,m){var y=c-i,v=u-r,b=y*y+v*v;if(b>4*t&&g--){var x=a+d,_=s+h,w=l+p,k=Kv(x*x+_*_+w*w),$=Zv(w/=k),E=Lv(Lv(w)-1)<Fv||Lv(o-f)<Fv?(o+f)/2:jv(_,x),A=e(E,$),S=A[0],D=A[1],C=S-i,M=D-r,F=v*C-y*M;(F*F/b>t||Lv((y*C+v*M)/b-.5)>.3||a*d+s*h+l*p<Gx)&&(n(i,r,o,a,s,l,S,D,E,x/=k,_/=k,w,g,m),m.point(S,D),n(S,D,E,x,_,w,c,u,f,d,h,p,g,m))}}return function(t){var i,r,o,a,s,l,c,u,f,d,h,p,g={point:m,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),g.lineStart=x},polygonEnd:function(){t.polygonEnd(),g.lineStart=y}};function m(n,i){n=e(n,i),t.point(n[0],n[1])}function y(){u=NaN,g.point=v,t.lineStart()}function v(i,r){var o=hx([i,r]),a=e(i,r);n(u,f,c,d,h,p,u=a[0],f=a[1],c=i,d=o[0],h=o[1],p=o[2],qx,t),t.point(u,f)}function b(){g.point=m,t.lineEnd()}function x(){y(),g.point=_,g.lineEnd=w}function _(e,t){v(i=e,t),r=u,o=f,a=d,s=h,l=p,g.point=v}function w(){n(u,f,c,d,h,p,r,o,i,a,s,l,qx,t),g.lineEnd=b,b()}return g}}(e,t):function(e){return Rx({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}var Yx=Rx({point:function(e,t){this.stream.point(e*Pv,t*Pv)}});function Hx(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=Uv(o),s=Xv(o),l=a*e,c=s*e,u=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)-c*(o*=r)+t,n-c*e-l*o]}return p.invert=function(e,t){return[i*(u*e-f*t+d),r*(h-f*e-u*t)]},p}function Xx(e){return Vx((function(){return e}))()}function Vx(e){var t,n,i,r,o,a,s,l,c,u,f=150,d=480,h=250,p=0,g=0,m=0,y=0,v=0,b=0,x=1,_=1,w=null,k=$x,$=null,E=kv,A=.5;function S(e){return l(e[0]*Pv,e[1]*Pv)}function D(e){return(e=l.invert(e[0],e[1]))&&[e[0]*Bv,e[1]*Bv]}function C(){var e=Hx(f,0,0,x,_,b).apply(null,t(p,g)),i=Hx(f,d-e[0],h-e[1],x,_,b);return n=Ox(m,y,v),s=Mx(t,i),l=Mx(n,s),a=Wx(s,A),M()}function M(){return c=u=null,S}return S.stream=function(e){return c&&u===e?c:c=Yx(function(e){return Rx({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}(n)(k(a(E(u=e)))))},S.preclip=function(e){return arguments.length?(k=e,w=void 0,M()):k},S.postclip=function(e){return arguments.length?(E=e,$=i=r=o=null,M()):E},S.clipAngle=function(e){return arguments.length?(k=+e?function(e){var t=Uv(e),n=6*Pv,i=t>0,r=Lv(t)>Fv;function o(e,n){return Uv(e)*Uv(n)>t}function a(e,n,i){var r=[1,0,0],o=gx(hx(e),hx(n)),a=px(o,o),s=o[0],l=a-s*s;if(!l)return!i&&e;var c=t*a/l,u=-t*s/l,f=gx(r,o),d=yx(r,c);mx(d,yx(o,u));var h=f,p=px(d,h),g=px(h,h),m=p*p-g*(px(d,d)-1);if(!(m<0)){var y=Kv(m),v=yx(h,(-p-y)/g);if(mx(v,d),v=dx(v),!i)return v;var b,x=e[0],_=n[0],w=e[1],k=n[1];_<x&&(b=x,x=_,_=b);var $=_-x,E=Lv($-Tv)<Fv;if(!E&&k<w&&(b=w,w=k,k=b),E||$<Fv?E?w+k>0^v[1]<(Lv(v[0]-x)<Fv?w:k):w<=v[1]&&v[1]<=k:$>Tv^(x<=v[0]&&v[0]<=_)){var A=yx(h,(-p+y)/g);return mx(A,d),[v,dx(A)]}}}function s(t,n){var r=i?e:Tv-e,o=0;return t<-r?o|=1:t>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return _x(o,(function(e){var t,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=i?g?0:s(f,d):g?s(f+(f<0?Tv:-Tv),d):0;if(!t&&(c=l=g)&&e.lineStart(),g!==l&&(!(h=a(t,p))||lx(t,h)||lx(p,h))&&(p[2]=1),g!==l)u=0,g?(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^g){var y;m&n||!(y=a(p,t,!0))||(u=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)))}!g||t&&lx(t,p)||e.point(p[0],p[1]),t=p,l=g,n=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return u|(c&&l)<<1}}}),(function(t,i,r,o){Ex(o,e,n,r,t,i)}),i?[0,-e]:[-Tv,e-Tv])}(w=e*Pv):(w=null,$x),M()):w*Bv},S.clipExtent=function(e){return arguments.length?(E=null==e?($=i=r=o=null,kv):Cx($=+e[0][0],i=+e[0][1],r=+e[1][0],o=+e[1][1]),M()):null==$?null:[[$,i],[r,o]]},S.scale=function(e){return arguments.length?(f=+e,C()):f},S.translate=function(e){return arguments.length?(d=+e[0],h=+e[1],C()):[d,h]},S.center=function(e){return arguments.length?(p=e[0]%360*Pv,g=e[1]%360*Pv,C()):[p*Bv,g*Bv]},S.rotate=function(e){return arguments.length?(m=e[0]%360*Pv,y=e[1]%360*Pv,v=e.length>2?e[2]%360*Pv:0,C()):[m*Bv,y*Bv,v*Bv]},S.angle=function(e){return arguments.length?(b=e%360*Pv,C()):b*Bv},S.reflectX=function(e){return arguments.length?(x=e?-1:1,C()):x<0},S.reflectY=function(e){return arguments.length?(_=e?-1:1,C()):_<0},S.precision=function(e){return arguments.length?(a=Wx(s,A=e*e),M()):Kv(A)},S.fitExtent=function(e,t){return Lx(S,e,t)},S.fitSize=function(e,t){return Ix(S,e,t)},S.fitWidth=function(e,t){return jx(S,e,t)},S.fitHeight=function(e,t){return Ux(S,e,t)},function(){return t=e.apply(this,arguments),S.invert=t.invert&&D,C()}}function Kx(e){var t=0,n=Tv/3,i=Vx(e),r=i(t,n);return r.parallels=function(e){return arguments.length?i(t=e[0]*Pv,n=e[1]*Pv):[t*Bv,n*Bv]},r}function Qx(e,t){var n=Xv(e),i=(n+Xv(t))/2;if(Lv(i)<Fv)return function(e){var t=Uv(e);function n(e,n){return[e*t,Xv(n)/t]}return n.invert=function(e,n){return[e/t,Zv(n*t)]},n}(e);var r=1+n*(2*i-n),o=Kv(r)/i;function a(e,t){var n=Kv(r-2*i*Xv(t))/i;return[n*Xv(e*=i),o-n*Uv(e)]}return a.invert=function(e,t){var n=o-t,a=jv(e,Lv(n))*Vv(n);return n*i<0&&(a-=Tv*Vv(e)*Vv(n)),[a/i,Zv((r-(e*e+n*n)*i*i)/(2*i))]},a}function Jx(){return Kx(Qx).scale(155.424).center([0,33.6442])}function Zx(){return Jx().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function e_(e){return function(t,n){var i=Uv(t),r=Uv(n),o=e(i*r);return o===1/0?[2,0]:[o*r*Xv(t),o*Xv(n)]}}function t_(e){return function(t,n){var i=Kv(t*t+n*n),r=e(i),o=Xv(r),a=Uv(r);return[jv(t*o,i*a),Zv(i&&n*o/i)]}}var n_=e_((function(e){return Kv(2/(1+e))}));n_.invert=t_((function(e){return 2*Zv(e/2)}));var i_=e_((function(e){return(e=Jv(e))&&e/Xv(e)}));function r_(e,t){return[e,Yv(Qv((zv+t)/2))]}function o_(e){var t,n,i,r=Xx(e),o=r.center,a=r.scale,s=r.translate,l=r.clipExtent,c=null;function u(){var o=Tv*a(),s=r(function(e){function t(t){return(t=e(t[0]*Pv,t[1]*Pv))[0]*=Bv,t[1]*=Bv,t}return e=Ox(e[0]*Pv,e[1]*Pv,e.length>2?e[2]*Pv:0),t.invert=function(t){return(t=e.invert(t[0]*Pv,t[1]*Pv))[0]*=Bv,t[1]*=Bv,t},t}(r.rotate()).invert([0,0]));return l(null==c?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===r_?[[Math.max(s[0]-o,c),t],[Math.min(s[0]+o,n),i]]:[[c,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,i)]])}return r.scale=function(e){return arguments.length?(a(e),u()):a()},r.translate=function(e){return arguments.length?(s(e),u()):s()},r.center=function(e){return arguments.length?(o(e),u()):o()},r.clipExtent=function(e){return arguments.length?(null==e?c=t=n=i=null:(c=+e[0][0],t=+e[0][1],n=+e[1][0],i=+e[1][1]),u()):null==c?null:[[c,t],[n,i]]},u()}function a_(e){return Qv((zv+e)/2)}function s_(e,t){var n=Uv(e),i=e===t?Xv(e):Yv(n/Uv(t))/Yv(a_(t)/a_(e)),r=n*Hv(a_(e),i)/i;if(!i)return r_;function o(e,t){r>0?t<-zv+Fv&&(t=-zv+Fv):t>zv-Fv&&(t=zv-Fv);var n=r/Hv(a_(t),i);return[n*Xv(i*e),r-n*Uv(i*e)]}return o.invert=function(e,t){var n=r-t,o=Vv(i)*Kv(e*e+n*n),a=jv(e,Lv(n))*Vv(n);return n*i<0&&(a-=Tv*Vv(e)*Vv(n)),[a/i,2*Iv(Hv(r/o,1/i))-zv]},o}function l_(e,t){return[e,t]}function c_(e,t){var n=Uv(e),i=e===t?Xv(e):(n-Uv(t))/(t-e),r=n/i+e;if(Lv(i)<Fv)return l_;function o(e,t){var n=r-t,o=i*e;return[n*Xv(o),r-n*Uv(o)]}return o.invert=function(e,t){var n=r-t,o=jv(e,Lv(n))*Vv(n);return n*i<0&&(o-=Tv*Vv(e)*Vv(n)),[o/i,r-Vv(i)*Kv(e*e+n*n)]},o}i_.invert=t_((function(e){return e})),r_.invert=function(e,t){return[e,2*Iv(Gv(t))-zv]},l_.invert=l_;var u_=1.340264,f_=-.081106,d_=893e-6,h_=.003796,p_=Kv(3)/2;function g_(e,t){var n=Zv(p_*Xv(t)),i=n*n,r=i*i*i;return[e*Uv(n)/(p_*(u_+3*f_*i+r*(7*d_+9*h_*i))),n*(u_+f_*i+r*(d_+h_*i))]}function m_(e,t){var n=Uv(t),i=Uv(e)*n;return[n*Xv(e)/i,Xv(t)/i]}function y_(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 v_(e,t){return[Uv(t)*Xv(e),Xv(t)]}function b_(e,t){var n=Uv(t),i=1+Uv(e)*n;return[n*Xv(e)/i,Xv(t)/i]}function x_(e,t){return[Yv(Qv((zv+t)/2)),-e]}g_.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*(u_+f_*r+o*(d_+h_*r))-t)/(u_+3*f_*r+o*(7*d_+9*h_*r)))*i)*r*r,!(Lv(n)<Ov));++a);return[p_*e*(u_+3*f_*r+o*(7*d_+9*h_*r))/Uv(i),Zv(Xv(i)/p_)]},m_.invert=t_(Iv),y_.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(Lv(n)>Fv&&--r>0);return[e/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},v_.invert=t_(Zv),b_.invert=t_((function(e){return 2*Iv(e)})),x_.invert=function(e,t){return[-t,2*Iv(Gv(e))-zv]};var __=Math.abs,w_=(Math.atan,Math.atan2,Math.ceil,Math.cos),k_=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),$_=(Math.tan,1e-6),E_=Math.PI,A_=E_/2,S_=(Math.SQRT1_2,C_(2));C_(E_);function D_(e){return e>1?A_:e<-1?-A_:Math.asin(e)}function C_(e){return e>0?Math.sqrt(e):0}function M_(e,t){var n,i=e*k_(t),r=30;do{t-=n=(t+k_(t)-i)/(1+w_(t))}while(__(n)>$_&&--r>0);return t/2}var F_=function(e,t,n){function i(i,r){return[e*i*w_(r=M_(n,r)),t*k_(r)]}return i.invert=function(i,r){return r=D_(r/t),[i/(e*w_(r)),D_((2*r+k_(2*r))/n)]},i}(S_/A_,S_,E_);const O_=ax(),T_=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function z_(e,t){if(!e||"string"!==typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(R_[e]=function(e,t){return function n(){const i=t();return i.type=e,i.path=ax().projection(i),i.copy=i.copy||function(){const e=n();return T_.forEach((t=>{i[t]&&e[t](i[t]())})),e.path.pointRadius(i.path.pointRadius()),e},hf(i)}}(e,t),this):R_[e]||null}function N_(e){return e&&e.path||O_}const R_={albers:Zx,albersusa:function(){var e,t,n,i,r,o,a=Zx(),s=Jx().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=Jx().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(e,t){o=[e,t]}};function u(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,u}return u.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)},u.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)])},u.precision=function(e){return arguments.length?(a.precision(e),s.precision(e),l.precision(e),f()):a.precision()},u.scale=function(e){return arguments.length?(a.scale(e),s.scale(.35*e),l.scale(e),u.translate(a.translate())):a.scale()},u.translate=function(e){if(!arguments.length)return a.translate();var t=a.scale(),o=+e[0],u=+e[1];return n=a.translate(e).clipExtent([[o-.455*t,u-.238*t],[o+.455*t,u+.238*t]]).stream(c),i=s.translate([o-.307*t,u+.201*t]).clipExtent([[o-.425*t+Fv,u+.12*t+Fv],[o-.214*t-Fv,u+.234*t-Fv]]).stream(c),r=l.translate([o-.205*t,u+.212*t]).clipExtent([[o-.214*t+Fv,u+.166*t+Fv],[o-.115*t-Fv,u+.234*t-Fv]]).stream(c),f()},u.fitExtent=function(e,t){return Lx(u,e,t)},u.fitSize=function(e,t){return Ix(u,e,t)},u.fitWidth=function(e,t){return jx(u,e,t)},u.fitHeight=function(e,t){return Ux(u,e,t)},u.scale(1070)},azimuthalequalarea:function(){return Xx(n_).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return Xx(i_).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Kx(s_).scale(109.5).parallels([30,30])},conicequalarea:Jx,conicequidistant:function(){return Kx(c_).scale(131.154).center([0,13.9389])},equalEarth:function(){return Xx(g_).scale(177.158)},equirectangular:function(){return Xx(l_).scale(152.63)},gnomonic:function(){return Xx(m_).scale(144.049).clipAngle(60)},identity:function(){var e,t,n,i,r,o,a,s=1,l=0,c=0,u=1,f=1,d=0,h=null,p=1,g=1,m=Rx({point:function(e,t){var n=b([e,t]);this.stream.point(n[0],n[1])}}),y=kv;function v(){return p=s*u,g=s*f,o=a=null,b}function b(n){var i=n[0]*p,r=n[1]*g;if(d){var o=r*e-i*t;i=i*e+r*t,r=o}return[i+l,r+c]}return b.invert=function(n){var i=n[0]-l,r=n[1]-c;if(d){var o=r*e+i*t;i=i*e-r*t,r=o}return[i/p,r/g]},b.stream=function(e){return o&&a===e?o:o=m(y(a=e))},b.postclip=function(e){return arguments.length?(y=e,h=n=i=r=null,v()):y},b.clipExtent=function(e){return arguments.length?(y=null==e?(h=n=i=r=null,kv):Cx(h=+e[0][0],n=+e[0][1],i=+e[1][0],r=+e[1][1]),v()):null==h?null:[[h,n],[i,r]]},b.scale=function(e){return arguments.length?(s=+e,v()):s},b.translate=function(e){return arguments.length?(l=+e[0],c=+e[1],v()):[l,c]},b.angle=function(n){return arguments.length?(t=Xv(d=n%360*Pv),e=Uv(d),v()):d*Bv},b.reflectX=function(e){return arguments.length?(u=e?-1:1,v()):u<0},b.reflectY=function(e){return arguments.length?(f=e?-1:1,v()):f<0},b.fitExtent=function(e,t){return Lx(b,e,t)},b.fitSize=function(e,t){return Ix(b,e,t)},b.fitWidth=function(e,t){return jx(b,e,t)},b.fitHeight=function(e,t){return Ux(b,e,t)},b},mercator:function(){return o_(r_).scale(961/Rv)},mollweide:function(){return Xx(F_).scale(169.529)},naturalEarth1:function(){return Xx(y_).scale(175.295)},orthographic:function(){return Xx(v_).scale(249.5).clipAngle(90+Fv)},stereographic:function(){return Xx(b_).scale(250).clipAngle(142)},transversemercator:function(){var e=o_(x_),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 oU in R_)z_(oU,R_[oU]);function B_(e,t,n){var i=(0,qo.A)(e,t-Fv,n).concat(t);return function(e){return i.map((function(t){return[e,t]}))}}function P_(e,t,n){var i=(0,qo.A)(e,t-Fv,n).concat(t);return function(e){return i.map((function(t){return[t,e]}))}}function L_(){var e,t,n,i,r,o,a,s,l,c,u,f,d=10,h=d,p=90,g=360,m=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return(0,qo.A)(qv(i/p)*p,n,p).map(u).concat((0,qo.A)(qv(s/g)*g,a,g).map(f)).concat((0,qo.A)(qv(t/d)*d,e,d).filter((function(e){return Lv(e%p)>Fv})).map(l)).concat((0,qo.A)(qv(o/h)*h,r,h).filter((function(e){return Lv(e%g)>Fv})).map(c))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(f(a).slice(1),u(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(m)):[[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(m)):[[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],g=+e[1],y):[p,g]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(m=+d,l=B_(o,r,90),c=P_(t,e,m),u=B_(s,a,90),f=P_(i,n,m),y):m},y.extentMajor([[-180,-90+Fv],[180,90-Fv]]).extentMinor([[-180,-80-Fv],[180,80+Fv]])}function I_(){}const j_=[[],[[[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 U_(){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,c,u,f,d=new Array,h=new Array;a=s=-1,c=n[0]>=i,j_[c<<1].forEach(p);for(;++a<e-1;)l=c,c=n[a+1]>=i,j_[l|c<<1].forEach(p);j_[c|0].forEach(p);for(;++s<t-1;){for(a=-1,c=n[s*e+e]>=i,u=n[s*e]>=i,j_[c<<1|u<<2].forEach(p);++a<e-1;)l=c,c=n[s*e+e+a+1]>=i,f=u,u=n[s*e+a+1]>=i,j_[l|c<<1|u<<2|f<<3].forEach(p);j_[c|u<<3].forEach(p)}a=-1,u=n[s*e]>=i,j_[u<<2].forEach(p);for(;++a<e-1;)f=u,u=n[s*e+a+1]>=i,j_[u<<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],c=o(i),u=o(l);(t=h[c])?(n=d[u])?(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=u]=t):(t=d[u])?(n=h[c])?(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=c]=t):d[c]=h[u]={start:c,end:u,ring:[i,l]}}j_[u<<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!==q_((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,c=0|s,u=i[c*e+l];a>0&&a<e&&l===a&&(o=i[c*e+l-1],n[0]=a+(r-o)/(u-o)-.5),s>0&&s<t&&c===s&&(o=i[(c-1)*e+l],n[1]=s+(r-o)/(u-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,g.z3)("invalid size"),e=r,t=o,i},i.smooth=function(e){return arguments.length?(n=e?a:I_,i):n===a},i}function q_(e,t){for(var n,i=-1,r=t.length;++i<r;)if(n=G_(e,t[i]))return n;return 0}function G_(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],c=l[0],u=l[1],f=e[s],d=f[0],h=f[1];if(W_(l,f,t))return 0;u>i!==h>i&&n<(d-c)*(i-u)/(h-u)+c&&(r=-r)}return r}function W_(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 Y_(e,t,n){return function(i){var r=(0,g.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(0,qo.A)(o+l,a,l)}}function H_(e){Nr.call(this,null,e)}function X_(e,t,n,i,r){const o=e.x1||0,a=e.y1||0,s=t*n<0;function l(e){e.forEach(c)}function c(e){s&&e.reverse(),e.forEach(u)}function u(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 V_(e,t,n){const i=e>=0?e:Yr(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function K_(e){return(0,g.Tn)(e)?e:(0,g.dY)(+e)}function Q_(){var e=e=>e[0],t=e=>e[1],n=g.xH,i=[-1,-1],r=960,o=500,a=2;function s(s,l){const c=V_(i[0],s,e)>>a,u=V_(i[1],s,t)>>a,f=c?c+2:0,d=u?u+2:0,h=2*f+(r>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let y=g;s.forEach((i=>{const r=f+(+e(i)>>a),o=d+(+t(i)>>a);r>=0&&r<h&&o>=0&&o<p&&(g[r+o*h]+=+n(i))})),c>0&&u>0?(J_(h,p,g,m,c),Z_(h,p,m,g,u),J_(h,p,g,m,c),Z_(h,p,m,g,u),J_(h,p,g,m,c),Z_(h,p,m,g,u)):c>0?(J_(h,p,g,m,c),J_(h,p,m,g,c),J_(h,p,g,m,c),y=m):u>0&&(Z_(h,p,g,m,u),Z_(h,p,m,g,u),Z_(h,p,g,m,u),y=m);const v=l?Math.pow(2,-2*a):1/Wy(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=K_(t),s):e},s.y=function(e){return arguments.length?(t=K_(e),s):t},s.weight=function(e){return arguments.length?(n=K_(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,g.z3)("invalid size"),r=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||(0,g.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,g.YO)(e)).length&&(e=[+e[0],+e[0]]),2!==e.length&&(0,g.z3)("invalid bandwidth"),i=e,s):i},s}function J_(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 Z_(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 ew(e){Nr.call(this,null,e)}H_.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,g.B)(H_,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||g.D_,o=U_().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const i=Y_(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(e.map((e=>(0,Uo.A)(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,g.cy)(a)?a:a(n.values));!function(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;(0,g.Tn)(r)&&(r=r(n,i));(0,g.Tn)(o)&&(o=o(n,i));if((1===r||null==r)&&!o)return;const a=((0,g.Et)(r)?r:r[0])||1,s=((0,g.Et)(r)?r:r[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;e.forEach(X_(t,a,s,l,c))}(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}}),ew.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 tw=["x","y","weight","size","cellSize","bandwidth"];function nw(e,t){return tw.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function iw(e){Nr.call(this,null,e)}(0,g.B)(ew,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=[],c=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(c)])||(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(g.N6),a=nw(Q_(),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}}),iw.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,g.B)(iw,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=U_().smooth(!1!==e.smooth),a=e.values,s=e.thresholds||Y_(e.count||10,e.nice,!!a),l=e.size;return a||(a=t.materialize(t.SOURCE).source,i=X_(n=nw(Q_(),e)(a,!0),n.scale||1,n.scale||1,0,0),l=[n.width,n.height],a=n.values),s=(0,g.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 rw="Feature",ow="FeatureCollection";function aw(e){Nr.call(this,null,e)}function sw(e){Nr.call(this,null,e)}function lw(e){Nr.call(this,null,e)}function cw(e){Nr.call(this,null,e)}function uw(e){Nr.call(this,[],e),this.generator=L_()}function fw(e){Nr.call(this,null,e)}function dw(e){if(!(0,g.Tn)(e))return!1;const t=(0,g.M1)((0,g.nS)(e));return t.$x||t.$y||t.$value||t.$max}function hw(e){Nr.call(this,null,e),this.modified(!0)}function pw(e,t,n){(0,g.Tn)(e[t])&&e[t](n)}function gw(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o,a,s,l,c,u,f,d,h=e._root,p={data:i},g=e._x0,m=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((c=t>=(o=(g+y)/2))?g=o:y=o,(u=n>=(a=(m+v)/2))?m=a:v=a,r=h,!(h=h[f=u<<1|c]))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),(c=t>=(o=(g+y)/2))?g=o:y=o,(u=n>=(a=(m+v)/2))?m=a:v=a}while((f=u<<1|c)===(d=(l>=a)<<1|s>=o));return r[d]=h,r[f]=p,e}function mw(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function yw(e){return e[0]}function vw(e){return e[1]}function bw(e,t,n){var i=new xw(null==t?yw:t,null==n?vw:n,NaN,NaN,NaN,NaN);return null==e?i:i.addAll(e)}function xw(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 _w(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}aw.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,g.B)(aw,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&&g.D_,c=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified((0,g.nS)(l))||a&&t.modified((0,g.nS)(a))||s&&t.modified((0,g.nS)(s)),this.value&&!n||(c=t.SOURCE,this._features=i=[],this._points=r=[]),l&&t.visit(c,(e=>i.push(l(e)))),a&&s&&(t.visit(c,(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:rw,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:ow,features:i}}}),sw.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,g.B)(sw,Nr,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||g.D_,o=e.as||"path",a=n.SOURCE;!i||e.modified()?(this.value=i=N_(e.projection),n.materialize().reflow()):a=r===g.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)}}),lw.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,g.B)(lw,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 c(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,c):(n=t.modified(r.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,c)),t.modifies(a)}}),cw.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,g.B)(cw,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}(N_(e.projection),e.field||(0,g.ZZ)("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[r]=i)),n.modifies(r)}}),uw.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,g.B)(uw,Nr,{transform(e,t){var n,i=this.value,r=this.generator;if(!i.length||e.modified())for(const o in e)(0,g.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}}),fw.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,g.B)(fw,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||g.D_,o=function(e,t){let n;(0,g.Tn)(e)?(n=n=>e(n,t),n.dep=dw(e)):e?n=(0,g.dY)(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;(0,g.Tn)(e)?(n=n=>(0,Vc.Qh)(e(n,t)),n.dep=dw(e)):n=(0,g.dY)((0,Vc.Qh)(e||"#888"));return n}(e.color,e),s=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?(0,Uo.A)(n.map((e=>(0,Uo.A)(r(e).values)))):0};return n.forEach((e=>{const t=r(e),n=(0,g.X$)({},e,l);i||(n.$max=(0,Uo.A)(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,c=e.y2||o,u=e.values,f=u?e=>u[e]:g.v_,d=Ul(l-a,c-s),h=d.getContext("2d"),p=h.getImageData(0,0,l-a,c-s),m=p.data;for(let g=s,y=0;g<c;++g){t.$y=g-s;for(let e=a,o=g*r;e<l;++e,y+=4){t.$x=e-a,t.$value=f(e+o);const r=n(t);m[y+0]=r.r,m[y+1]=r.g,m[y+2]=r.b,m[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}(t,n,a.dep?a:(0,g.dY)(a(n)),o.dep?o:(0,g.dY)(o(n)))})),t.reflow(!0).modifies(s)}}),(0,g.B)(hw,Nr,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=function(e){const t=z_((e||"mercator").toLowerCase());t||(0,g.z3)("Unrecognized projection type: "+e);return t()}(e.type),T_.forEach((t=>{null!=e[t]&&pw(n,t,e[t])}))):T_.forEach((t=>{e.modified(t)&&pw(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return e=(0,g.YO)(e),1===e.length?e[0]:{type:ow,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===ow?e.features:(0,g.YO)(e).filter((e=>null!=e)).map((e=>e.type===rw?e:{type:rw,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 ww=bw.prototype=xw.prototype;function kw(e){return function(){return e}}function $w(e){return 1e-6*(e()-.5)}function Ew(e){return e.x+e.vx}function Aw(e){return e.y+e.vy}ww.copy=function(){var e,t,n=new xw(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=_w(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]=_w(t));return n},ww.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return gw(this.cover(t,n),t,n,e)},ww.addAll=function(e){var t,n,i,r,o=e.length,a=new Array(o),s=new Array(o),l=1/0,c=1/0,u=-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>u&&(u=i),r<c&&(c=r),r>f&&(f=r));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;n<o;++n)gw(this,a[n],s[n],e[n]);return this},ww.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,c=this._root;n>e||e>=r||i>t||t>=o;)switch(s=(t<i)<<1|e<n,(a=new Array(4))[s]=c,c=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=c)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},ww.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},ww.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]]},ww.find=function(e,t,n){var i,r,o,a,s,l,c,u=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new mw(g,u,f,d,h)),null==n?n=1/0:(u=e-n,f=t-n,d=e+n,h=t+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(o=l.y0)>h||(a=l.x1)<u||(s=l.y1)<f))if(g.length){var m=(r+a)/2,y=(o+s)/2;p.push(new mw(g[3],m,y,a,s),new mw(g[2],r,y,m,s),new mw(g[1],m,o,a,y),new mw(g[0],r,o,m,y)),(c=(t>=y)<<1|e>=m)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var v=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),x=v*v+b*b;if(x<n){var _=Math.sqrt(n=x);u=e-_,f=t-_,d=e+_,h=t+_,i=g.data}}return i},ww.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,c,u,f,d,h=this._root,p=this._x0,g=this._y0,m=this._x1,y=this._y1;if(!h)return this;if(h.length)for(;;){if((c=o>=(s=(p+m)/2))?p=s:m=s,(u=a>=(l=(g+y)/2))?g=l:y=l,t=h,!(h=h[f=u<<1|c]))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)},ww.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},ww.root=function(){return this._root},ww.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},ww.visit=function(e){var t,n,i,r,o,a,s=[],l=this._root;for(l&&s.push(new mw(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 c=(i+o)/2,u=(r+a)/2;(n=l[3])&&s.push(new mw(n,c,u,o,a)),(n=l[2])&&s.push(new mw(n,i,u,c,a)),(n=l[1])&&s.push(new mw(n,c,r,o,u)),(n=l[0])&&s.push(new mw(n,i,r,c,u))}return this},ww.visitAfter=function(e){var t,n=[],i=[];for(this._root&&n.push(new mw(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,c=t.y1,u=(a+l)/2,f=(s+c)/2;(o=r[0])&&n.push(new mw(o,a,s,u,f)),(o=r[1])&&n.push(new mw(o,u,s,l,f)),(o=r[2])&&n.push(new mw(o,a,f,u,c)),(o=r[3])&&n.push(new mw(o,u,f,l,c))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},ww.x=function(e){return arguments.length?(this._x=e,this):this._x},ww.y=function(e){return arguments.length?(this._y=e,this):this._y};var Sw={value:()=>{}};function Dw(){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 Cw(i)}function Cw(e){this._=e}function Mw(e,t){for(var n,i=0,r=e.length;i<r;++i)if((n=e[i]).name===t)return n.value}function Fw(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=Sw,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}Cw.prototype=Dw.prototype={constructor:Cw,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]=Fw(r[n],e.name,t);else if(null==t)for(n in r)r[n]=Fw(r[n],e.name,null);return this}for(;++a<s;)if((n=(e=o[a]).type)&&(n=Mw(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Cw(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 Ow=Dw;var Tw=n(79341);const zw=1664525,Nw=1013904223,Rw=4294967296;function Bw(e){return e.x}function Pw(e){return e.y}var Lw=10,Iw=Math.PI*(3-Math.sqrt(5));function jw(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,a=.6,s=new Map,l=(0,Tw.O1)(f),c=Ow("tick","end"),u=function(){let e=1;return()=>(e=(zw*e+Nw)%Rw)/Rw}();function f(){d(),c.call("tick",t),n<i&&(l.stop(),c.call("end",t))}function d(i){var l,c,u=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<u;++l)null==(c=e[l]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return 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=Lw*Math.sqrt(.5+n),o=n*Iw;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,u),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?(u=e,s.forEach(p),t):u},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,c=0,u=e.length;for(null==i?i=1/0:i*=i,c=0;c<u;++c)(a=(r=t-(s=e[c]).x)*r+(o=n-s.y)*o)<i&&(l=s,i=a);return l},on:function(e,n){return arguments.length>1?(c.on(e,n),t):c.on(e)}}}function Uw(e){return e.index}function qw(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const Gw={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,c,u,f,d,h=t.length,p=0;p<o;++p)for(a=bw(t,Ew,Aw).visitAfter(s),e=0;e<h;++e)l=t[e],f=n[l.index],d=f*f,c=l.x+l.vx,u=l.y+l.vy,a.visit(g);function g(e,t,n,o,a){var s=e.data,h=e.r,p=f+h;if(!s)return t>c+p||o<c-p||n>u+p||a<u-p;if(s.index>l.index){var g=c-s.x-s.vx,m=u-s.y-s.vy,y=g*g+m*m;y<p*p&&(0===g&&(y+=(g=$w(i))*g),0===m&&(y+=(m=$w(i))*m),y=(p-(y=Math.sqrt(y)))/y*r,l.vx+=(g*=y)*(p=(h*=h)/(d+h)),l.vy+=(m*=y)*p,s.vx-=g*(p=1-p),s.vy-=m*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=kw(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:kw(+t),l(),a):e},a},nbody:function(){var e,t,n,i,r,o=kw(-30),a=1,s=1/0,l=.81;function c(n){var r,o=e.length,a=bw(e,Bw,Pw).visitAfter(f);for(i=n,r=0;r<o;++r)t=e[r],a.visit(d)}function u(){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,c,u){if(!e.value)return!0;var f=e.x-t.x,d=e.y-t.y,h=u-o,p=f*f+d*d;if(h*h/l<p)return p<s&&(0===f&&(p+=(f=$w(n))*f),0===d&&(p+=(d=$w(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=$w(n))*f),0===d&&(p+=(d=$w(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 c.initialize=function(t,i){e=t,n=i,u()},c.strength=function(e){return arguments.length?(o="function"===typeof e?e:kw(+e),u(),c):o},c.distanceMin=function(e){return arguments.length?(a=e*e,c):Math.sqrt(a)},c.distanceMax=function(e){return arguments.length?(s=e*e,c):Math.sqrt(s)},c.theta=function(e){return arguments.length?(l=e*e,c):Math.sqrt(l)},c},link:function(e){var t,n,i,r,o,a,s=Uw,l=function(e){return 1/Math.min(r[e.source.index],r[e.target.index])},c=kw(30),u=1;function f(i){for(var r=0,s=e.length;r<u;++r)for(var l,c,f,d,h,p,g,m=0;m<s;++m)c=(l=e[m]).source,d=(f=l.target).x+f.vx-c.x-c.vx||$w(a),h=f.y+f.vy-c.y-c.vy||$w(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[m])/p*i*t[m],h*=p,f.vx-=d*(g=o[m]),f.vy-=h*g,c.vx+=d*(g=1-g),c.vy+=h*g}function d(){if(i){var a,l,c=i.length,u=e.length,f=new Map(i.map(((e,t)=>[s(e,t,i),e])));for(a=0,r=new Array(c);a<u;++a)(l=e[a]).index=a,"object"!==typeof l.source&&(l.source=qw(f,l.source)),"object"!==typeof l.target&&(l.target=qw(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(u);a<u;++a)l=e[a],o[a]=r[l.source.index]/(r[l.source.index]+r[l.target.index]);t=new Array(u),h(),n=new Array(u),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]=+c(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?(u=+e,f):u},f.strength=function(e){return arguments.length?(l="function"===typeof e?e:kw(+e),h(),f):l},f.distance=function(e){return arguments.length?(c="function"===typeof e?e:kw(+e),p(),f):c},f},x:function(e){var t,n,i,r=kw(.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=kw(null==e?0:+e)),o.initialize=function(e){t=e,a()},o.strength=function(e){return arguments.length?(r="function"===typeof e?e:kw(+e),a(),o):r},o.x=function(t){return arguments.length?(e="function"===typeof t?t:kw(+t),a(),o):e},o},y:function(e){var t,n,i,r=kw(.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=kw(null==e?0:+e)),o.initialize=function(e){t=e,a()},o.strength=function(e){return arguments.length?(r="function"===typeof e?e:kw(+e),a(),o):r},o.y=function(t){return arguments.length?(e="function"===typeof t?t:kw(+t),a(),o):e},o}},Ww="forces",Yw=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Hw=["static","iterations"],Xw=["x","y","vx","vy"];function Vw(e){Nr.call(this,null,e)}function Kw(e,t,n,i){var r,o,a,s,l=(0,g.YO)(t.forces);for(r=0,o=Yw.length;r<o;++r)(a=Yw[r])!==Ww&&t.modified(a)&&e[a](t[a]);for(r=0,o=l.length;r<o;++r)s=Ww+r,(a=n||t.modified(Ww,r)?Jw(l[r]):i&&Qw(l[r],i)?e.force(s):null)&&e.force(s,a);for(o=e.numForces||0;r<o;++r)e.force(Ww+r,null);return e.numForces=l.length,e}function Qw(e,t){var n,i;for(n in e)if((0,g.Tn)(i=e[n])&&t.modified((0,g.nS)(i)))return 1;return 0}function Jw(e){var t,n;for(n in(0,g.mQ)(Gw,e.force)||(0,g.z3)("Unrecognized force: "+e.force),t=Gw[e.force](),e)(0,g.Tn)(t[n])&&Zw(t[n],e[n],e);return t}function Zw(e,t,n){e((0,g.Tn)(t)?e=>t(e,n):t)}function ek(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 tk(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=ik)):void 0===t&&(t=nk);for(var n,i,r,o,a,s=new ak(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 ak(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(ok)}function nk(e){return e.children}function ik(e){return Array.isArray(e)?e[1]:null}function rk(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function ok(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function ak(e){this.data=e,this.depth=this.height=0,this.parent=null}function sk(e){return null==e?null:lk(e)}function lk(e){if("function"!==typeof e)throw new Error;return e}function ck(){return 0}function uk(e){return function(){return e}}Vw.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:Xw}]},(0,g.B)(Vw,Nr,{transform(e,t){var n,i,r=this.value,o=t.changed(t.ADD_REM),a=e.modified(Yw),s=e.iterations||300;if(r?(o&&(t.modifies("index"),r.nodes(t.source)),(a||t.changed(t.MOD))&&Kw(r,e,0,t)):(this.value=r=function(e,t){const n=jw(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),Kw(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(Hw)||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,c=0,u=l.length;c<u;++c)if(s=l[c],s.name===Ww&&"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(Xw)}}),ak.prototype=tk.prototype={constructor:ak,count:function(){return this.eachAfter(ek)},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 tk(this).eachBefore(rk)},[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 fk=1664525,dk=1013904223,hk=4294967296;function pk(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&&yk(i,n)?++r:(i=bk(a=gk(a,n)),r=0);return i}function gk(e,t){var n,i;if(vk(t,e))return[t];for(n=0;n<e.length;++n)if(mk(t,e[n])&&vk(xk(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(mk(xk(e[n],e[i]),t)&&mk(xk(e[n],t),e[i])&&mk(xk(e[i],t),e[n])&&vk(_k(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function mk(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 yk(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 vk(e,t){for(var n=0;n<t.length;++n)if(!yk(e,t[n]))return!1;return!0}function bk(e){switch(e.length){case 1:return function(e){return{x:e.x,y:e.y,r:e.r}}(e[0]);case 2:return xk(e[0],e[1]);case 3:return _k(e[0],e[1],e[2])}}function xk(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,a=t.y,s=t.r,l=o-n,c=a-i,u=s-r,f=Math.sqrt(l*l+c*c);return{x:(n+o+l/f*u)/2,y:(i+a+c/f*u)/2,r:(f+r+s)/2}}function _k(e,t,n){var i=e.x,r=e.y,o=e.r,a=t.x,s=t.y,l=t.r,c=n.x,u=n.y,f=n.r,d=i-a,h=i-c,p=r-s,g=r-u,m=l-o,y=f-o,v=i*i+r*r-o*o,b=v-a*a-s*s+l*l,x=v-c*c-u*u+f*f,_=h*p-d*g,w=(p*x-g*b)/(2*_)-i,k=(g*m-p*y)/_,$=(h*b-d*x)/(2*_)-r,E=(d*y-h*m)/_,A=k*k+E*E-1,S=2*(o+w*k+$*E),D=w*w+$*$-o*o,C=-(Math.abs(A)>1e-6?(S+Math.sqrt(S*S-4*A*D))/(2*A):D/S);return{x:i+w+k*C,y:r+$+E*C,r:C}}function wk(e,t,n){var i,r,o,a,s=e.x-t.x,l=e.y-t.y,c=s*s+l*l;c?(r=t.r+n.r,r*=r,a=e.r+n.r,r>(a*=a)?(i=(c+a-r)/(2*c),o=Math.sqrt(Math.max(0,a/c-i*i)),n.x=e.x-i*s-o*l,n.y=e.y-i*l+o*s):(i=(c+r-a)/(2*c),o=Math.sqrt(Math.max(0,r/c-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 kk(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 $k(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 Ek(e){this._=e,this.next=null,this.previous=null}function Ak(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,c,u,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;wk(i,n,r=e[2]),n=new Ek(n),i=new Ek(i),r=new Ek(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(l=3;l<o;++l){wk(n._,i._,r=e[l]),r=new Ek(r),c=i.next,u=n.previous,f=i._.r,d=n._.r;do{if(f<=d){if(kk(c._,r._)){i=c,n.next=i,i.previous=n,--l;continue e}f+=c._.r,c=c.next}else{if(kk(u._,r._)){(n=u).next=i,i.previous=n,--l;continue e}d+=u._.r,u=u.previous}}while(c!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=$k(n);(r=r.next)!==i;)(s=$k(r))<a&&(n=r,a=s);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=pk(n,t),l=0;l<o;++l)(n=e[l]).x-=r.x,n.y-=r.y;return r.r}function Sk(e){return Math.sqrt(e.value)}function Dk(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Ck(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=Ak(r,n),l)for(o=0;o<s;++o)r[o].r-=l;i.r=a+l}}}function Mk(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 Fk(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 Ok(e,t,n,i,r){for(var o,a=e.children,s=-1,l=a.length,c=e.value&&(i-t)/e.value;++s<l;)(o=a[s]).y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*c}var Tk={depth:-1},zk={},Nk={};function Rk(e){return e.id}function Bk(e){return e.parentId}function Pk(){var e,t=Rk,n=Bk;function i(i){var r,o,a,s,l,c,u,f,d=Array.from(i),h=t,p=n,g=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Ik(e,t-1)&&!Ik(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(Lk),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(Lk(e)),d.push(Nk));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new ak(o),null!=(u=h(o,a,i))&&(u+="")&&(f=c.id=u,g.set(f,g.has(f)?zk:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===zk)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===Nk&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Nk;--e)c.data=null}if(s.parent=Tk,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(ok),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=sk(e),i):t},i.parentId=function(e){return arguments.length?(n=sk(e),i):n},i.path=function(t){return arguments.length?(e=sk(t),i):e},i}function Lk(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Ik(e,t););return e.slice(0,t)}function Ik(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0===(1&n))return!0}return!1}function jk(e,t){return e.parent===t.parent?1:2}function Uk(e){var t=e.children;return t?t[0]:e.t}function qk(e){var t=e.children;return t?t[t.length-1]:e.t}function Gk(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 Wk(e,t,n){return e.a.parent===t.parent?e.a:n}function Yk(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 Hk(e,t){return e.parent===t.parent?1:2}function Xk(e,t){return e+t.x}function Vk(e,t){return Math.max(e,t.y)}function Kk(e,t,n,i,r){for(var o,a=e.children,s=-1,l=a.length,c=e.value&&(r-n)/e.value;++s<l;)(o=a[s]).x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*c}Yk.prototype=Object.create(ak.prototype);var Qk=(1+Math.sqrt(5))/2;function Jk(e,t,n,i,r,o){for(var a,s,l,c,u,f,d,h,p,g,m,y=[],v=t.children,b=0,x=0,_=v.length,w=t.value;b<_;){l=r-n,c=o-i;do{u=v[x++].value}while(!u&&x<_);for(f=d=u,m=u*u*(g=Math.max(c/l,l/c)/(w*e)),p=Math.max(d/m,m/f);x<_;++x){if(u+=s=v[x].value,s<f&&(f=s),s>d&&(d=s),m=u*u*g,(h=Math.max(d/m,m/f))>p){u-=s;break}p=h}y.push(a={value:u,dice:l<c,children:v.slice(b,x)}),a.dice?Ok(a,n,i,r,w?i+=c*u/w:o):Kk(a,n,i,w?n+=l*u/w:r,o),w-=u,b=x}return y}const Zk=function e(t){function n(e,n,i,r,o){Jk(t,e,n,i,r,o)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(Qk),e$=function e(t){function n(e,n,i,r,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,l,c,u,f=-1,d=a.length,h=e.value;++f<d;){for(l=(s=a[f]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?Ok(s,n,i,r,h?i+=(o-i)*s.value/h:o):Kk(s,n,i,h?n+=(r-n)*s.value/h:r,o),h-=s.value}else e._squarify=a=Jk(t,e,n,i,r,o),a.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(Qk);function t$(e,t,n){const i={};return e.each((e=>{const r=e.data;n(r)&&(i[t(r)]=e)})),e.lookup=i,e}function n$(e){Nr.call(this,null,e)}n$.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const i$=e=>e.values;function r$(){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,c,u,f=-1;for(;++f<r;)l=o(c=t[f])+"",(u=a[l])?u.push(c):a[l]=[c];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 o$(e){Nr.call(this,null,e)}(0,g.B)(n$,Nr,{transform(e,t){t.source||(0,g.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=tk({values:(0,g.YO)(e.keys).reduce(((e,t)=>(e.key(t),e)),r$()).entries(r.source)},i$),n&&o.each((e=>{e.children&&(e=rr(e.data),r.add.push(e),r.source.push(e))})),t$(o,nr,nr)),r.source.root=o,r}});const a$=(e,t)=>e.parent===t.parent?1:2;(0,g.B)(o$,Nr,{transform(e,t){t.source&&t.source.root||(0,g.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?a$:g.xH);try{this.value=n(r)}catch(a){(0,g.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 s$=["x","y","r","depth","children"];function l$(e){o$.call(this,e)}l$.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:s$.length,default:s$}]},(0,g.B)(l$,o$,{layout:function(){var e=null,t=1,n=1,i=ck;function r(r){const o=function(){let e=1;return()=>(e=(fk*e+dk)%hk)/hk}();return r.x=t/2,r.y=n/2,e?r.eachBefore(Dk(e)).eachAfter(Ck(i,.5,o)).eachBefore(Mk(1)):r.eachBefore(Dk(Sk)).eachAfter(Ck(ck,1,o)).eachAfter(Ck(i,r.r/Math.min(t,n),o)).eachBefore(Mk(Math.min(t,n)/(2*r.r))),r}return r.radius=function(t){return arguments.length?(e=sk(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:uk(+e),r):i},r},params:["radius","size","padding"],fields:s$});const c$=["x0","y0","x1","y1","depth","children"];function u$(e){o$.call(this,e)}function f$(e){Nr.call(this,null,e)}u$.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:c$.length,default:c$}]},(0,g.B)(u$,o$,{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&&Ok(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(Fk),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:c$}),f$.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,g.B)(f$,Nr,{transform(e,t){t.source||(0,g.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?t$(Pk().id(e.key).parentId(e.parentKey)(r.source),e.key,g.vN):t$(Pk()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const d$={tidy:function(){var e=jk,t=1,n=1,i=null;function r(r){var l=function(e){for(var t,n,i,r,o,a=new Yk(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 Yk(i[r],r)),n.parent=t;return(a.parent=new Yk(null,0)).children=[a],a}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),i)r.eachBefore(s);else{var c=r,u=r,f=r;r.eachBefore((function(e){e.x<c.x&&(c=e),e.x>u.x&&(u=e),e.depth>f.depth&&(f=e)}));var d=c===u?1:e(c,u)/2,h=d-c.x,p=t/(u.x+d+h),g=n/(f.depth||1);r.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*g}))}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],c=o.m,u=a.m,f=s.m,d=l.m;s=qk(s),o=Uk(o),s&&o;)l=Uk(l),(a=qk(a)).a=t,(r=s.z+f-o.z-c+e(s._,o._))>0&&(Gk(Wk(s,t,i),t,r),c+=r,u+=r),f+=s.m,c+=o.m,d+=l.m,u+=a.m;s&&!qk(a)&&(a.t=s,a.m+=f-u),o&&!Uk(l)&&(l.t=o,l.m+=c-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=Hk,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(Xk,0)/e.length}(n),t.y=function(e){return 1+e.reduce(Vk,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),c=s.x-e(s,l)/2,u=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-c)/(u-c)*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 p$(e){o$.call(this,e)}function g$(e){Nr.call(this,[],e)}p$.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,g.B)(p$,o$,{layout(e){const t=e||"tidy";if((0,g.mQ)(d$,t))return d$[t]();(0,g.z3)("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:h$}),g$.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,g.B)(g$,Nr,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||(0,g.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 m$={binary:function(e,t,n,i,r){var o,a,s=e.children,l=s.length,c=new Array(l+1);for(c[0]=a=o=0;o<l;++o)c[o+1]=a+=s[o].value;!function e(t,n,i,r,o,a,l){if(t>=n-1){var u=s[t];return u.x0=r,u.y0=o,u.x1=a,void(u.y1=l)}var f=c[t],d=i/2+f,h=t+1,p=n-1;for(;h<p;){var g=h+p>>>1;c[g]<d?h=g+1:p=g}d-c[h-1]<c[h]-d&&t+1<h&&--h;var m=c[h]-f,y=i-m;if(a-r>l-o){var v=i?(r*y+a*m)/i:a;e(t,h,m,r,o,v,l),e(h,n,y,v,o,a,l)}else{var b=i?(o*y+l*m)/i:l;e(t,h,m,r,o,a,b),e(h,n,y,r,b,a,l)}}(0,l,e.value,t,n,i,r)},dice:Ok,slice:Kk,slicedice:function(e,t,n,i,r){(1&e.depth?Kk:Ok)(e,t,n,i,r)},squarify:Zk,resquarify:e$},y$=["x0","y0","x1","y1","depth","children"];function v$(e){o$.call(this,e)}v$.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:y$.length,default:y$}]},(0,g.B)(v$,o$,{layout(){const e=function(){var e=Zk,t=!1,n=1,i=1,r=[0],o=ck,a=ck,s=ck,l=ck,c=ck;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=i,e.eachBefore(f),r=[0],t&&e.eachBefore(Fk),e}function f(t){var n=r[t.depth],i=t.x0+n,u=t.y0+n,f=t.x1-n,d=t.y1-n;f<i&&(i=f=(i+f)/2),d<u&&(u=d=(u+d)/2),t.x0=i,t.y0=u,t.x1=f,t.y1=d,t.children&&(n=r[t.depth+1]=o(t)/2,i+=c(t)-n,u+=a(t)-n,(f-=s(t)-n)<i&&(i=f=(i+f)/2),(d-=l(t)-n)<u&&(u=d=(u+d)/2),e(t,i,u,f,d))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],i=+e[1],u):[n,i]},u.tile=function(t){return arguments.length?(e=lk(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(o="function"===typeof e?e:uk(+e),u):o},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(a="function"===typeof e?e:uk(+e),u):a},u.paddingRight=function(e){return arguments.length?(s="function"===typeof e?e:uk(+e),u):s},u.paddingBottom=function(e){return arguments.length?(l="function"===typeof e?e:uk(+e),u):l},u.paddingLeft=function(e){return arguments.length?(c="function"===typeof e?e:uk(+e),u):c},u}();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{(0,g.mQ)(m$,t)?e.tile(m$[t]):(0,g.z3)("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:y$});const b$=4278190080;function x$(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function _$(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;"group"===i?t.forEach((t=>{t.items.forEach((t=>_$(e,t.items,n)))})):Wp[i].draw(e,{items:n?t.map(w$):t})}function w$(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 k$=5,$$=31,E$=32,A$=new Uint32Array(E$+1),S$=new Uint32Array(E$+1);S$[0]=0,A$[0]=~S$[0];for(let oU=1;oU<=E$;++oU)S$[oU]=S$[oU-1]<<1|1,A$[oU]=~S$[oU];function D$(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+E$)/E$));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>>>k$]&1<<(r&$$)},set:(t,n)=>{const r=n*e+t;i(r>>>k$,1<<(r&$$))},clear:(t,n)=>{const i=n*e+t;r(i>>>k$,~(1<<(i&$$)))},getRange:(t,i,r,o)=>{let a,s,l,c,u=o;for(;u>=i;--u)if(a=u*e+t,s=u*e+r,l=a>>>k$,c=s>>>k$,l===c){if(n[l]&A$[a&$$]&S$[1+(s&$$)])return!0}else{if(n[l]&A$[a&$$])return!0;if(n[c]&S$[1+(s&$$)])return!0;for(let e=l+1;e<c;++e)if(n[e])return!0}return!1},setRange:(t,n,r,o)=>{let a,s,l,c,u;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,l=a>>>k$,c=s>>>k$,l===c)i(l,A$[a&$$]&S$[1+(s&$$)]);else for(i(l,A$[a&$$]),i(c,S$[1+(s&$$)]),u=l+1;u<c;++u)i(u,4294967295)},clearRange:(t,n,i,o)=>{let a,s,l,c,u;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,l=a>>>k$,c=s>>>k$,l===c)r(l,S$[a&$$]|A$[1+(s&$$)]);else for(r(l,S$[a&$$]),r(c,A$[1+(s&$$)]),u=l+1;u<c;++u)r(u,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 C$(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 M$(e,t,n,i,r,o,a,s){const l=r*o/(2*i),c=e(t-l),u=e(t+l),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(c,f,u,d)||a.getRange(c,f,u,d)||s&&s.getRange(c,f,u,d)}const F$=[-1,-1,1,1],O$=[-1,1,-1,1];const T$=["right","center","left"],z$=["bottom","middle","top"];function N$(e,t,n,i,r,o,a,s,l,c,u,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const R$={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},B$={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=Ep.width(e.datum,e.datum.text);let l,c,u,f,d,h,p,g=0;for(let i=0;i<n;++i)l=t[i].x,u=t[i].y,c=void 0===t[i].x2?l:t[i].x2,f=void 0===t[i].y2?u:t[i].y2,d=(l+c)/2,h=(u+f)/2,p=Math.abs(c-l+f-u),p>=g&&(g=p,e.x=d,e.y=h);return d=s/2,h=a/2,l=e.x-d,c=e.x+d,u=e.y-h,f=e.y+h,e.align="center",l<0&&c<=r?e.align="left":0<=l&&r<c&&(e.align="right"),e.baseline="middle",u<0&&f<=o?e.baseline="top":0<=u&&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,c){const u=e.invert(t),f=e.invert(n);let d,h=i,p=o;if(!C$(u,f,l,c,r,o)&&!M$(e,u,f,c,l,h,a,s)&&!M$(e,u,f,c,l,c,a,null)){for(;p-h>=1;)d=(h+p)/2,M$(e,u,f,c,l,d,a,s)?p=d:h=d;if(h>i)return[u,f,h,!0]}}return function(t){const s=t.datum.datum.items[i].items,c=s.length,u=t.datum.fontSize,f=Ep.width(t.datum,t.datum.text);let d,h,p,g,m,y,v,b,x,_,w,k,$,E,A,S,D,C=n?u:0,M=!1,F=!1,O=0;for(let i=0;i<c;++i){for(d=s[i].x,p=s[i].y,h=void 0===s[i].x2?d:s[i].x2,g=void 0===s[i].y2?p:s[i].y2,d>h&&(D=d,d=h,h=D),p>g&&(D=p,p=g,g=D),x=e(d),w=e(h),_=~~((x+w)/2),k=e(p),E=e(g),$=~~((k+E)/2),v=_;v>=x;--v)for(b=$;b>=k;--b)S=l(v,b,C,f,u),S&&([t.x,t.y,C,M]=S);for(v=_;v<=w;++v)for(b=$;b<=E;++b)S=l(v,b,C,f,u),S&&([t.x,t.y,C,M]=S);M||n||(A=Math.abs(h-d+g-p),m=(d+h)/2,y=(p+g)/2,A>=O&&!C$(m,y,f,u,r,o)&&!M$(e,m,y,u,f,u,a,null)&&(O=A,t.x=m,t.y=y,F=!0))}return!(!M&&!F)&&(m=f/2,y=u/2,a.setRange(e(t.x-m),e(t.y-y),e(t.x+m),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 c=t.datum.datum.items[i].items,u=c.length,f=t.datum.fontSize,d=Ep.width(t.datum,t.datum.text),h=[];let p,g,m,y,v,b,x,_,w,k,$,E,A=n?f:0,S=!1,D=!1,C=0;for(let i=0;i<u;++i){for(p=c[i].x,m=c[i].y,g=void 0===c[i].x2?p:c[i].x2,y=void 0===c[i].y2?m:c[i].y2,h.push([e((p+g)/2),e((m+y)/2)]);h.length;)if([x,_]=h.pop(),!(a.get(x,_)||s.get(x,_)||l.get(x,_))){l.set(x,_);for(let e=0;e<4;++e)v=x+F$[e],b=_+O$[e],l.outOfBounds(v,b,v,b)||h.push([v,b]);if(v=e.invert(x),b=e.invert(_),w=A,k=o,!C$(v,b,d,f,r,o)&&!M$(e,v,b,f,d,w,a,s)&&!M$(e,v,b,f,d,f,a,null)){for(;k-w>=1;)$=(w+k)/2,M$(e,v,b,f,d,$,a,s)?k=$:w=$;w>A&&(t.x=v,t.y=b,A=w,S=!0)}}S||n||(E=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,E>=C&&!C$(v,b,d,f,r,o)&&!M$(e,v,b,f,d,f,a,null)&&(C=E,t.x=v,t.y=b,D=!0))}return!(!S&&!D)&&(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",!0)}}};function P$(e,t,n,i,r,o,a,s,l,c,u){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]|=R$[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}(r,f),p=(x=e[0].datum)&&x.mark&&x.mark.marktype,g="group"===p&&e[0].datum.items[l].marktype,m="area"===g,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,g,s,l),v=null===c||c===1/0,b=m&&"naive"===u;var x;let _=-1,w=-1;const k=e.map((e=>{const t=v?Ep.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}}));c=null===c||c===1/0?Math.max(_,w)+Math.max(...i):c;const $=D$(t[0],t[1],c);let E;if(!b){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||m)&&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=Ul(o,a).getContext("2d"),c=Ul(o,a).getContext("2d"),u=s&&Ul(o,a).getContext("2d");n.forEach((e=>_$(l,e,!1))),_$(c,t,!1),s&&_$(u,t,!0);const f=x$(l,o,a),d=x$(c,o,a),h=s&&x$(u,o,a),p=e.bitmap(),g=s&&e.bitmap();let m,y,v,b,x,_,w,k;for(y=0;y<a;++y)for(m=0;m<o;++m)x=y*o+m,_=f[x]&b$,k=d[x]&b$,w=s&&h[x]&b$,(_||w||k)&&(v=e(m),b=e(y),r||!_&&!k||p.set(v,b),s&&(_||w)&&g.set(v,b));return[p,g]}($,i||[],o,t,m):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=m?B$[u]($,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 c=t.boundary,u=t.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let f,d,h,p,g,m,y,v,b,x,_,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,g=i[r]<0?-1:1,m=c[1+f]+i[r]*f*p,_=c[4+d]+g*u*d/2+i[r]*d*p,v=_-u/2,b=_+u/2,w=e(m),$=e(v),E=e(b),!A){if(!N$(w,w,$,E,a,s,0,0,0,0,0,h))continue;A=Ep.width(t.datum,t.datum.text)}if(x=m+g*A*f/2,m=x-A/2,y=x+A/2,w=e(m),k=e(y),N$(w,k,$,E,a,s,0,0,0,0,0,h))return t.x=f?f*g<0?y:m:x,t.y=d?d*g<0?b:v:_,t.align=T$[f*g+1],t.baseline=z$[d*g+1],a.setRange(w,$,k,E),!0}return!1}}($,E,h,d);return k.forEach((e=>e.opacity=+A(e))),k}const L$=["x","y","opacity","align","baseline"],I$=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function j$(e){Nr.call(this,null,e)}function U$(e,t){var n,i,r,o,a,s,l=[],c=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(c)])||(n[a]=s=[],s.dims=a,l.push(s)),s.push(o);return l}function q$(e){Nr.call(this,null,e)}j$.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:I$},{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:L$.length,default:L$}]},(0,g.B)(j$,Nr,{transform(e,t){const n=e.modified();if(!(n||t.changed(t.ADD_REM)||function(n){const i=e[n];return(0,g.Tn)(i)&&t.modified(i.fields)}("sort")))return;e.size&&2===e.size.length||(0,g.z3)("Size parameter should be specified as a [width, height] array.");const i=e.as||L$;return P$(t.materialize(t.SOURCE).source||[],e.size,e.sort,(0,g.YO)(null==e.offset?1:e.offset),(0,g.YO)(e.anchor||I$),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)}}),q$.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,g.B)(q$,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=U$(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(g.N6),o=r.length,a=e.as||[(0,g.N6)(e.x),(0,g.N6)(e.y)],s=[];i.forEach((t=>{No(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 G$={constant:_o,linear:Ao,log:So,exp:Do,pow:Co,quad:Mo,poly:Fo};function W$(e){Nr.call(this,null,e)}W$.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(G$)},{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,g.B)(W$,Nr,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=U$(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(g.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,g.N6)(e.x),(0,g.N6)(e.y)],c=G$[o],u=[];let f=e.extent;(0,g.mQ)(G$,o)||(0,g.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=c(n,e.x,e.y,a);if(e.params)return void u.push(rr({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const d=f||(0,g.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],u.push(rr(t))};"linear"===o||"constant"===o?d.forEach((e=>h([e,i.predict(e)]))):Lo(i.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const Y$=134217729,H$=33306690738754706e-32;function X$(e,t,n,i,r){let o,a,s,l,c=t[0],u=i[0],f=0,d=0;u>c===u>-c?(o=c,c=t[++f]):(o=u,u=i[++d]);let h=0;if(f<e&&d<n)for(u>c===u>-c?(a=c+o,s=o-(a-c),c=t[++f]):(a=u+o,s=o-(a-u),u=i[++d]),o=a,0!==s&&(r[h++]=s);f<e&&d<n;)u>c===u>-c?(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++f]):(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=i[++d]),o=a,0!==s&&(r[h++]=s);for(;f<e;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++f],o=a,0!==s&&(r[h++]=s);for(;d<n;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=i[++d],o=a,0!==s&&(r[h++]=s);return 0===o&&0!==h||(r[h++]=o),h}function V$(e){return new Float64Array(e)}const K$=22204460492503146e-32,Q$=11093356479670487e-47,J$=V$(4),Z$=V$(8),eE=V$(12),tE=V$(16),nE=V$(4);function iE(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 c=Math.abs(a+s);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,n,i,r,o,a){let s,l,c,u,f,d,h,p,g,m,y,v,b,x,_,w,k,$;const E=e-r,A=n-r,S=t-o,D=i-o;x=E*D,d=Y$*E,h=d-(d-E),p=E-h,d=Y$*D,g=d-(d-D),m=D-g,_=p*m-(x-h*g-p*g-h*m),w=S*A,d=Y$*S,h=d-(d-S),p=S-h,d=Y$*A,g=d-(d-A),m=A-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,J$[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,J$[1]=b-(y+f)+(f-w),$=v+y,f=$-v,J$[2]=v-($-f)+(y-f),J$[3]=$;let C=function(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}(4,J$),M=K$*a;if(C>=M||-C>=M)return C;if(f=e-E,s=e-(E+f)+(f-r),f=n-A,c=n-(A+f)+(f-r),f=t-S,l=t-(S+f)+(f-o),f=i-D,u=i-(D+f)+(f-o),0===s&&0===l&&0===c&&0===u)return C;if(M=Q$*a+H$*Math.abs(C),C+=E*u+D*s-(S*c+A*l),C>=M||-C>=M)return C;x=s*D,d=Y$*s,h=d-(d-s),p=s-h,d=Y$*D,g=d-(d-D),m=D-g,_=p*m-(x-h*g-p*g-h*m),w=l*A,d=Y$*l,h=d-(d-l),p=l-h,d=Y$*A,g=d-(d-A),m=A-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,nE[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,nE[1]=b-(y+f)+(f-w),$=v+y,f=$-v,nE[2]=v-($-f)+(y-f),nE[3]=$;const F=X$(4,J$,4,nE,Z$);x=E*u,d=Y$*E,h=d-(d-E),p=E-h,d=Y$*u,g=d-(d-u),m=u-g,_=p*m-(x-h*g-p*g-h*m),w=S*c,d=Y$*S,h=d-(d-S),p=S-h,d=Y$*c,g=d-(d-c),m=c-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,nE[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,nE[1]=b-(y+f)+(f-w),$=v+y,f=$-v,nE[2]=v-($-f)+(y-f),nE[3]=$;const O=X$(F,Z$,4,nE,eE);x=s*u,d=Y$*s,h=d-(d-s),p=s-h,d=Y$*u,g=d-(d-u),m=u-g,_=p*m-(x-h*g-p*g-h*m),w=l*c,d=Y$*l,h=d-(d-l),p=l-h,d=Y$*c,g=d-(d-c),m=c-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,nE[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,nE[1]=b-(y+f)+(f-w),$=v+y,f=$-v,nE[2]=v-($-f)+(y-f),nE[3]=$;const T=X$(O,eE,4,nE,tE);return tE[T-1]}(e,t,n,i,r,o,c)}V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(8),V$(8),V$(8),V$(4),V$(8),V$(8),V$(8),V$(12);V$(192),V$(192);V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(8),V$(8),V$(8),V$(8),V$(8),V$(8),V$(8),V$(8),V$(8),V$(4),V$(4),V$(4),V$(8),V$(16),V$(16),V$(16),V$(32),V$(32),V$(48),V$(64);V$(1152),V$(1152);V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(4),V$(24),V$(24),V$(24),V$(24),V$(24),V$(24),V$(24),V$(24),V$(24),V$(24),V$(1152),V$(1152),V$(1152),V$(1152),V$(1152),V$(2304),V$(2304),V$(3456),V$(5760),V$(8),V$(8),V$(8),V$(16),V$(24),V$(48),V$(48),V$(96),V$(192),V$(384),V$(384),V$(384),V$(768);V$(96),V$(96),V$(96),V$(1152);const rE=Math.pow(2,-52),oE=new Uint32Array(512);class aE{static from(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dE,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 aE(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,c=-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>c&&(c=n),this._ids[E]=E}const u=(a+l)/2,f=(s+c)/2;let d,h,p,g=1/0;for(let E=0;E<o;E++){const t=sE(u,f,e[2*E],e[2*E+1]);t<g&&(d=E,g=t)}const m=e[2*d],y=e[2*d+1];g=1/0;for(let E=0;E<o;E++){if(E===d)continue;const t=sE(m,y,e[2*E],e[2*E+1]);t<g&&t>0&&(h=E,g=t)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let E=0;E<o;E++){if(E===d||E===h)continue;const t=cE(m,y,v,b,e[2*E],e[2*E+1]);t<x&&(p=E,x=t)}let _=e[2*p],w=e[2*p+1];if(x===1/0){for(let i=0;i<o;i++)this._dists[i]=e[2*i]-e[0]||e[2*i+1]-e[1];uE(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(iE(m,y,v,b,_,w)<0){const e=h,t=v,n=b;h=p,v=_,b=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,c=o-t,u=a*a+s*s,f=l*l+c*c,d=.5/(a*c-s*l),h=e+(c*u-s*f)*d,p=t+(a*f-l*u)*d;return{x:h,y:p}}(m,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let E=0;E<o;E++)this._dists[E]=sE(e[2*E],e[2*E+1],k.x,k.y);uE(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(m,y)]=d,r[this._hashKey(v,b)]=h,r[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let E,A,S=0;S<this._ids.length;S++){const o=this._ids[S],a=e[2*o],s=e[2*o+1];if(S>0&&Math.abs(a-E)<=rE&&Math.abs(s-A)<=rE)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 c,u=l;for(;c=n[u],iE(a,s,e[2*u],e[2*u+1],e[2*c],e[2*c+1])>=0;)if(u=c,u===l){u=-1;break}if(-1===u)continue;let f=this._addTriangle(u,o,n[u],-1,-1,i[u]);i[o]=this._legalize(f+2),i[u]=f,$++;let g=n[u];for(;c=n[g],iE(a,s,e[2*g],e[2*g+1],e[2*c],e[2*c+1])<0;)f=this._addTriangle(g,o,c,i[o],-1,i[g]),i[o]=this._legalize(f+2),n[g]=g,$--,g=c;if(u===l)for(;c=t[u],iE(a,s,e[2*c],e[2*c+1],e[2*u],e[2*u+1])<0;)f=this._addTriangle(c,o,u,-1,i[u],i[c]),this._legalize(f+2),i[c]=f,n[u]=u,$--,u=c;this._hullStart=t[o]=u,n[u]=t[g]=o,n[o]=g,r[this._hashKey(a,s)]=o,r[this._hashKey(e[2*u],e[2*u+1])]=u}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=oE[--r];continue}const l=a-a%3,c=s+(e+1)%3,u=l+(a+2)%3,f=t[o],d=t[e],h=t[c],p=t[u];if(lE(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[u];if(-1===i){let t=this._hullStart;do{if(this._hullTri[t]===u){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,u);const s=l+(a+1)%3;r<oE.length&&(oE[r++]=s)}else{if(0===r)break;e=oE[--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 sE(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function lE(e,t,n,i,r,o,a,s){const l=e-a,c=t-s,u=n-a,f=i-s,d=r-a,h=o-s,p=u*u+f*f,g=d*d+h*h;return l*(f*g-p*h)-c*(u*g-p*d)+(l*l+c*c)*(u*h-f*d)<0}function cE(e,t,n,i,r,o){const a=n-e,s=i-t,l=r-e,c=o-t,u=a*a+s*s,f=l*l+c*c,d=.5/(a*c-s*l),h=(c*u-s*f)*d,p=(a*f-l*u)*d;return h*h+p*p}function uE(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;fE(e,n+i>>1,r),t[e[n]]>t[e[i]]&&fE(e,n,i),t[e[r]]>t[e[i]]&&fE(e,r,i),t[e[n]]>t[e[r]]&&fE(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;fE(e,r,o)}e[n+1]=e[o],e[o]=a,i-r+1>=o-n?(uE(e,t,r,i),uE(e,t,n,o-1)):(uE(e,t,n,o-1),uE(e,t,r,i))}}function fE(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function dE(e){return e[0]}function hE(e){return e[1]}const pE=1e-6;class gE{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)>pE||Math.abs(this._y1-r)>pE)&&(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 mE{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 yE{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,g=0,m=n.length;p<m;p+=3,g+=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],c=e[i+1],u=e[o],f=e[o+1],m=l-a,y=c-s,v=u-a,b=f-s,x=2*(m*b-y*v);if(Math.abs(x)<1e-9){let t=1e9;const i=2*n[0];t*=Math.sign((e[i]-a)*b-(e[i+1]-s)*v),d=(a+u)/2-t*b,h=(s+f)/2+t*v}else{const e=1/x,t=m*m+y*y,n=v*v+b*b;d=a+(b*t-y*n)*e,h=s+(m*n-v*t)*e}r[g]=d,r[g+1]=h}let o,a,s,l=t[t.length-1],c=4*l,u=e[2*l],f=e[2*l+1];i.fill(0);for(let d=0;d<t.length;++d)l=t[d],o=c,a=u,s=f,c=4*l,u=e[2*l],f=e[2*l+1],i[o+2]=i[c]=s-f,i[o+3]=i[c+1]=u-a}render(e){const t=null==e?e=new gE:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:a}=this;if(r.length<=1)return null;for(let c=0,u=n.length;c<u;++c){const t=n[c];if(t<c)continue;const i=2*Math.floor(c/3),r=2*Math.floor(t/3),a=o[i],s=o[i+1],l=o[r],u=o[r+1];this._renderSegment(a,s,l,u,e)}let s,l=r[r.length-1];for(let c=0;c<r.length;++c){s=l,l=r[c];const t=2*Math.floor(i[l]/3),n=o[t],u=o[t+1],f=4*s,d=this._project(n,u,a[f+2],a[f+3]);d&&this._renderSegment(n,u,d[0],d[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new gE: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 gE: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 mE;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],c=t[n-1],u=this._regioncode(l,c),f=0;for(let d=0;d<n;d+=2)if(i=l,r=c,l=t[d],c=t[d+1],o=u,u=this._regioncode(l,c),0===o&&0===u)a=f,f=0,s?s.push(l,c):s=[l,c];else{let t,n,d,h,p;if(0===o){if(null===(t=this._clipSegment(i,r,l,c,o,u)))continue;[n,d,h,p]=t}else{if(null===(t=this._clipSegment(l,c,i,r,u,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,c=0,u=s.length,f=this._edgecode(s[u-2],s[u-1]);c<u;c+=2)l=f,f=this._edgecode(s[c],s[c+1]),l&&f&&(c=this._edge(e,l,f,s,c),u=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 vE=2*Math.PI,bE=Math.pow;function xE(e){return e[0]}function _E(e){return e[1]}function wE(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class kE{static from(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_E,i=arguments.length>3?arguments[3]:void 0;return new kE("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 aE(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=wE(t[2*o],t[2*o+1],r);t[2*o]=e[0],t[2*o+1]=e[1]}this._delaunator=new aE(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 yE(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,c=-1;do{if(yield c=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!==c&&(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 c=e,u=bE(t-l[2*e],2)+bE(n-l[2*e+1],2);const f=i[e];let d=f;do{let i=s[d];const f=bE(t-l[2*i],2)+bE(n-l[2*i+1],2);if(f<u&&(u=f,c=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&&bE(t-l[2*d],2)+bE(n-l[2*d+1],2)<u)return d;break}}while(d!==f);return c}render(e){const t=null==e?e=new gE: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 gE: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,vE)}return n&&n.value()}renderHull(e){const t=null==e?e=new gE: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 mE;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new gE: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 mE;return this.renderTriangle(e,t),t.value()}}function $E(e){Nr.call(this,null,e)}$E.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 EE=[-1e5,-1e5,1e5,1e5];function AE(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,g.B)($E,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]]:EE;const o=this.value=kE.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])?AE(e):null}var a;return t.reflow(e.modified()).modifies(n)}});var SE=Math.PI/180,DE=64,CE=2048;function ME(){var e,t,n,i,r,o,a,s=[256,256],l=NE,c=[],u=Math.random,f={};function d(e,t,n){for(var i,r,o,a=t.x,c=t.y,f=Math.sqrt(s[0]*s[0]+s[1]*s[1]),d=l(s),h=u()<.5?1:-1,p=-h;(i=d(p+=h))&&(r=~~i[0],o=~~i[1],!(Math.min(Math.abs(r),Math.abs(o))>=f));)if(t.x=a+r,t.y=c+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!OE(t,e,s[0]))&&(!n||zE(t,n))){for(var g,m=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,_=32-x,w=t.y1-t.y0,k=(t.y+t.y0)*v+(b>>5),$=0;$<w;$++){g=0;for(var E=0;E<=y;E++)e[k+E]|=g<<_|(E<y?(g=m[$*y+E])>>>x: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=(DE<<5)/t,e.height=CE/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Ul()),f=function(e){var t=[],n=-1;for(;++n<e;)t[n]=0;return t}((s[0]>>5)*s[1]),h=null,p=c.length,g=-1,m=[],y=c.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));++g<p;){var v=y[g];v.x=s[0]*(u()+.5)>>1,v.y=s[1]*(u()+.5)>>1,FE(l,v,y,g),v.hasText&&d(f,v,h)&&(m.push(v),h?TE(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 m},f.words=function(e){return arguments.length?(c=e,f):c},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=RE(e),f):t},f.fontStyle=function(e){return arguments.length?(i=RE(e),f):i},f.fontWeight=function(e){return arguments.length?(r=RE(e),f):r},f.rotate=function(e){return arguments.length?(o=RE(e),f):o},f.text=function(t){return arguments.length?(e=RE(t),f):e},f.spiral=function(e){return arguments.length?(l=BE[e]||e,f):l},f.fontSize=function(e){return arguments.length?(n=RE(e),f):n},f.padding=function(e){return arguments.length?(a=RE(e),f):a},f.random=function(e){return arguments.length?(u=e,f):u},f}function FE(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(DE<<5)/o,CE/o);var a,s,l,c,u,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 g=Math.sin(t.rotate*SE),m=Math.cos(t.rotate*SE),y=a*m,v=a*g,b=l*m,x=l*g;a=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,l=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(l>h&&(h=l),f+a>=DE<<5&&(f=0,d+=h,h=0),d+l>=CE)break;r.translate((f+(a>>1))/o,(d+(l>>1))/o),t.rotate&&r.rotate(t.rotate*SE),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,(DE<<5)/o,CE/o).data,w=[];--i>=0;)if((t=n[i]).hasText){for(s=(a=t.width)>>5,l=t.y1-t.y0,c=0;c<l*s;c++)w[c]=0;if(null==(f=t.xoff))return;d=t.yoff;var k=0,$=-1;for(u=0;u<l;u++){for(c=0;c<a;c++){var E=s*u+(c>>5),A=_[(d+u)*(DE<<5)+(f+c)<<2]?1<<31-c%32:0;w[E]|=A,k|=A}k?$=u:(t.y0++,l--,u--,d++)}t.y1=t.y0+$,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function OE(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,c=e.y1-e.y0,u=(e.y+e.y0)*n+(a>>5),f=0;f<c;f++){i=0;for(var d=0;d<=o;d++)if((i<<l|(d<o?(i=r[f*o+d])>>>s:0))&t[u+d])return!0;u+=n}return!1}function TE(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 zE(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 NE(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function RE(e){return"function"===typeof e?e:function(){return e}}var BE={archimedean:NE,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 PE=["x","y","font","fontSize","fontStyle","fontWeight","angle"],LE=["text","font","rotate","fontSize","fontStyle","fontWeight"];function IE(e){Nr.call(this,ME(),e)}IE.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:PE}]},(0,g.B)(IE,Nr,{transform(e,t){!e.size||e.size[0]&&e.size[1]||(0,g.z3)("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||LE.some((function(n){const i=e[n];return(0,g.Tn)(i)&&t.modified(i.fields)}))))return;const i=t.materialize(t.SOURCE).source,r=this.value,o=e.as||PE;let a,s=e.fontSize||14;if((0,g.Tn)(s)?a=e.fontSizeRange:s=(0,g.dY)(s),a){const e=s,t=gf("sqrt")().domain((0,g.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(Xr).layout(),c=r.size(),u=c[0]>>1,f=c[1]>>1,d=l.length;for(let h,p,g=0;g<d;++g)h=l[g],p=h.datum,p[o[0]]=h.x+u,p[o[1]]=h.y+f,p[o[2]]=h.font,p[o[3]]=h.size,p[o[4]]=h.style,p[o[5]]=h.weight,p[o[6]]=h.rotate;return t.reflow(n).modifies(o)}});var jE=n(14826);const UE=e=>new Uint8Array(e),qE=e=>new Uint16Array(e),GE=e=>new Uint32Array(e);function WE(e,t,n){const i=(t<257?UE:t<65537?qE:GE)(e);return n&&i.set(n),i}function YE(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 c;for(c=0;c<a;++c)t[o[c]]|=i;for(c=s;c<l;++c)t[o[c]]|=i;return n}}}function HE(){let e=GE(0),t=[],n=0;return{insert:function(i,r,o){if(!r.length)return[];const a=n,s=r.length,l=GE(s);let c,u,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})),(0,jE.A)(e,t)}(d,l),a)c=t,u=e,t=Array(a+s),e=GE(a+s),function(e,t,n,i,r,o,a,s,l){let c,u=0,f=0;for(c=0;u<i&&f<a;++c)t[u]<r[f]?(s[c]=t[u],l[c]=n[u++]):(s[c]=r[f],l[c]=o[f++]+e);for(;u<i;++u,++c)s[c]=t[u],l[c]=n[u];for(;f<a;++f,++c)s[c]=r[f],l[c]=o[f]+e}(o,c,u,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,Gl.ah)(i,e[0],0,r),(0,Gl.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 XE(e){Nr.call(this,function(){let e=8,t=[],n=GE(0),i=WE(0,e),r=WE(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,c,u;for(c=0;!n[c]&&c<o;++c)a[c]=t[c],s[c]=c;for(u=c;c<o;++c)l=t[c],n[c]?s[c]=-1:(s[c]=u,i[u]=i[c],r[u]=r[c],a[u]=l,l._index=u++),i[c]=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=WE(t,e,i),r=WE(t,e))}}}(),e),this._indices=null,this._dims=null}function VE(e){Nr.call(this,null,e)}XE.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,g.B)(XE,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,c=0;for(;c<a;++c)s=n[c].fname,l=r[s]||(r[s]=HE()),o.push(YE(l,c,i[c]));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(),c=s.prev(),u=s.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,v,b,x,_,w,k;if(c.set(l),t.rem.length&&(b=this.remove(e,t,n)),t.add.length&&s.add(t.add),t.mod.length)for(x={},v=t.mod,_=0,w=v.length;_<w;++_)x[v[_]._index]=1;for(_=0;_<h;++_)k=i[_],(!a[_]||e.modified("fields",_)||t.modified(k.fields))&&(y=k.fname,(g=p[y])||(o[y]=m=HE(),p[y]=g=m.insert(k,t.source,0)),a[_]=YE(m,_,r[_]).onAdd(g,l));for(_=0,w=s.data().length;_<w;++_)b[_]||(c[_]!==l[_]?f.push(_):x[_]&&l[_]!==u&&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={},c=n.add,u=r.size()+i.length,f=o.length;let d,h,p,g=r.size();r.resize(u,f),r.add(i);const m=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,g)),o[d].onAdd(p,m);for(;g<u;++g)y[g]=v,m[g]!==v&&c.push(g)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),a=e.mod;let s,l,c;for(s=0,l=a.length;s<l;++s)c=a[s]._index,r[c]!==o&&n.push(c)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),a=r.prev(),s=r.all(),l={},c=n.rem,u=t.rem;let f,d,h,p;for(f=0,d=u.length;f<d;++f)h=u[f]._index,l[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&c.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,c=0;for(n.filters=0,l=0;l<a;++l)e.modified("query",l)&&(s=l,++c);if(1===c)c=i[s].one,this.incrementOne(i[s],r[s],n.add,n.rem);else for(l=0,c=0;l<a;++l)e.modified("query",l)&&(c|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return c},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),a=r.curr(),s=r.prev(),l=e.index(),c=e.bisect(e.range),u=e.bisect(t),f=u[0],d=u[1],h=c[0],p=c[1],g=e.one;let m,y,v;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)v=l[m],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)v=l[m],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)v=l[m],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)v=l[m],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=g;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],c=s[1],u=a[0],f=a[1],d=e.one;let h,p,g;if(l<u)for(h=l,p=Math.min(u,c);h<p;++h)g=o[h],r[g]^=d,n.push(g);else if(l>u)for(h=u,p=Math.min(l,f);h<p;++h)g=o[h],r[g]^=d,i.push(g);if(c>f)for(h=Math.max(l,f),p=c;h<p;++h)g=o[h],r[g]^=d,n.push(g);else if(c<f)for(h=Math.max(u,c),p=f;h<p;++h)g=o[h],r[g]^=d,i.push(g);e.range=t.slice()}}),VE.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,g.B)(VE,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(),c=e=>s[e]&n?null:a[e];return o.filter(o.MOD,c),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,c),o.filter(o.REM,(e=>(s[e]&n)===r?a[e]:null))),o.filter(o.SOURCE,(e=>c(e._index)))}});const KE="linear",QE="log",JE="pow",ZE="sqrt",eA="symlog",tA="time",nA="utc",iA="sequential",rA="diverging",oA="quantile",aA="quantize",sA="threshold",lA="continuous",cA="discrete",uA="discretizing",fA="interpolating",dA="temporal";function hA(){const e=(0,Oc.A)().unknown(void 0),t=e.domain,n=e.range;let i,r,o=[0,1],a=!1,s=0,l=0,c=.5;function u(){const e=t().length,u=o[1]<o[0],f=o[1-u],d=function(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}(e,s,l);let h=o[u-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(e-s))*c,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=(0,qo.A)(e).map((e=>h+i*e));return n(u?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),u()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],u()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,u()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(a=!!e,u()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,u()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),u()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},e.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),u()):c},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,c,u,f=+e[0],d=+e[1];return f!==f||d!==d||(d<f&&(u=f,f=d,d=u),d<a[0]||f>o[1-i])?void 0:(l=Math.max(0,(0,Gl.Jj)(a,f)-1),c=f===d?l:(0,Gl.Jj)(a,d)-1,f-a[l]>r+1e-10&&++l,i&&(u=l,l=s-c,c=s-u),l>c?void 0:t().slice(l,c+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return hA().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(c)},u()}function pA(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return pA(t())},e}var gA=Array.prototype.map;const mA=Array.prototype.slice;const yA=new Map,vA=Symbol("vega_scale");function bA(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],c=-1;for(l<s&&(r=s,s=l,l=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=l&&(c<0&&(c=o),i=o);if(!(c<0))return s=e.invertExtent(n[c]),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,function(e){return e[vA]=!0,e}(n)};return i.metadata=(0,g.M1)((0,g.YO)(n)),i}function xA(e,t,n){return arguments.length>1?(yA.set(e,bA(e,t,n)),this):function(e){return yA.has(e)}(e)?yA.get(e):void 0}function _A(e,t){const n=yA.get(e);return n&&n.metadata[t]}function wA(e){return _A(e,cA)}xA("identity",Hl),xA(KE,Wl.A,lA),xA(QE,Xl.A,[lA,QE]),xA(JE,Vl.Ay,lA),xA(ZE,Vl.RZ,lA),xA(eA,tc,lA),xA(tA,fc,[lA,dA]),xA(nA,dc,[lA,dA]),xA(iA,yc,[lA,fA]),xA(`${iA}-${KE}`,yc,[lA,fA]),xA(`${iA}-${QE}`,vc,[lA,fA,QE]),xA(`${iA}-${JE}`,xc,[lA,fA]),xA(`${iA}-${ZE}`,_c,[lA,fA]),xA(`${iA}-${eA}`,bc,[lA,fA]),xA(`${rA}-${KE}`,$c,[lA,fA]),xA(`${rA}-${QE}`,Ec,[lA,fA,QE]),xA(`${rA}-${JE}`,Sc,[lA,fA]),xA(`${rA}-${ZE}`,Dc,[lA,fA]),xA(`${rA}-${eA}`,Ac,[lA,fA]),xA(oA,Cc.A,[uA,oA]),xA(aA,Mc.A,uA),xA(sA,Fc.A,uA),xA("bin-ordinal",(function e(){let t=[],n=[];function i(e){return null==e||e!==e?void 0:n[((0,Gl.Ay)(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return gA.call(e,g.Ro)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=mA.call(e),i):n.slice()},i.tickFormat=function(e,n){return(0,Tc.A)(t[0],(0,g.se)(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[cA,uA]),xA("ordinal",Oc.A,cA),xA("band",hA,cA),xA("point",(function(){return pA(hA().paddingInner(1))}),cA);function kA(e,t,n){return wc(function(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}(t||"rgb",n),e)}function $A(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 EA(e,t){for(const n in e)SA(n,t(e[n]))}const AA={};function SA(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(AA[e]=t,this):AA[e]}EA({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},$A),EA({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=>kA($A(e))));const DA="symbol",CA="discrete",MA=e=>(0,g.cy)(e)?e.map((e=>String(e))):String(e),FA=(e,t)=>e[1]-t[1],OA=(e,t)=>t[1]-e[1];function TA(e,t){return e.bins?function(e,t,n){let i=e.range(),r=i[0],o=(0,g.se)(i),a=FA;if(r>o&&(i=o,o=r,r=i,a=OA),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,g.se)(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}(e,e.bins):e.ticks?e.ticks(t):e.domain()}function zA(e,t,n,i,r,o){const a=t.type;let s=MA;if(a===tA||r===tA)s=e.timeFormat(i);else if(a===nA||r===nA)s=e.utcFormat(i);else if(_A(a,QE)){const r=e.formatFloat(i);if(o||t.bins)s=r;else{const e=NA(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 NA(e,t,n){const i=TA(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 RA={[oA]:"quantiles",[aA]:"thresholds",[sA]:"domain"},BA={[oA]:"quantiles",[aA]:"domain"};function PA(e,t){return e.bins?function(e){const t=e.slice(0,-1);return t.max=(0,g.se)(e),t}(e.bins):e.type===QE?NA(e,t,!0):RA[e.type]?function(e){const t=[-1/0].concat(e);return t.max=1/0,t}(e[RA[e.type]]()):TA(e,t)}const LA=e=>RA[e.type]||e.bins;function IA(e,t,n,i,r,o,a){const s=BA[t.type]&&o!==tA&&o!==nA?function(e,t,n){const i=t[BA[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):zA(e,t,n,r,o,a);return i===DA&&LA(t)?jA(s):i===CA?qA(s):GA(s)}const jA=e=>(t,n,i)=>{const r=UA(i[n+1],UA(i.max,1/0)),o=WA(t,e),a=WA(r,e);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},UA=(e,t)=>null!=e?e:t,qA=e=>(t,n)=>n?e(t):null,GA=e=>t=>e(t),WA=(e,t)=>Number.isFinite(e)?t(e):null;function YA(e,t,n,i){const r=i||t.type;return(0,g.Kg)(n)&&_A(r,dA)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==tA?n||r!==nA?IA(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function HA(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=YA(e,t,n.format,n.formatType);if(_A(t.type,uA)){const e=PA(t).slice(1).map(r),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(wA(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,g.se)(e))}`}}let XA=0;const VA="p_";function KA(e){return e&&e.gradient}function QA(e,t,n){const i=e.gradient;let r=e.id,o="radial"===i?VA:"";return r||(r=e.id="gradient_"+XA++,"radial"===i?(e.x1=JA(e.x1,.5),e.y1=JA(e.y1,.5),e.r1=JA(e.r1,0),e.x2=JA(e.x2,.5),e.y2=JA(e.y2,.5),e.r2=JA(e.r2,.5),o=VA):(e.x1=JA(e.x1,0),e.y1=JA(e.y1,0),e.x2=JA(e.x2,1),e.y2=JA(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function JA(e,t){return null!=e?e:t}function ZA(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 eS={basis:{curve:vs},"basis-closed":{curve:_s},"basis-open":{curve:ks},bundle:{curve:Es,tension:"beta",value:.85},cardinal:{curve:Ds,tension:"tension",value:0},"cardinal-open":{curve:Ms,tension:"tension",value:0},"cardinal-closed":{curve:Os,tension:"tension",value:0},"catmull-rom":{curve:Hs,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Vs,tension:"alpha",value:.5},"catmull-rom-open":{curve:Qs,tension:"alpha",value:.5},linear:{curve:Zs},"linear-closed":{curve:tl},monotone:{horizontal:ul,vertical:cl},natural:{curve:hl},step:{curve:gl},"step-after":{curve:yl},"step-before":{curve:ml}};function tS(e,t,n){var i=(0,g.mQ)(eS,e)&&eS[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const nS={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},iS=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,rS=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,oS=/^((\s+,?\s*)|(,\s*))/,aS=/^[01]/;function sS(e){const t=[];return(e.match(iS)||[]).forEach((e=>{let n=e[0];const i=n.toLowerCase(),r=nS[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?rS:aS,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(oS);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 lS=Math.PI/180,cS=Math.PI/2,uS=2*Math.PI,fS=Math.sqrt(3)/2;var dS={},hS={},pS=[].join;function gS(e){const t=pS.call(e);if(hS[t])return hS[t];var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7];const u=c*a,f=-l*s,d=l*a,h=c*s,p=Math.cos(r),g=Math.sin(r),m=Math.cos(o),y=Math.sin(o),v=.5*(o-r),b=Math.sin(.5*v),x=8/3*b*b/Math.sin(v),_=n+p-x*g,w=i+g+x*p,k=n+m,$=i+y,E=k+x*y,A=$-x*m;return hS[t]=[u*_+f*w,d*_+h*w,u*E+f*A,d*E+h*A,u*k+f*$,d*k+h*$]}const mS=["l",0,0,0,0,0,0,0];function yS(e,t,n){const i=mS[0]=e[0];if("a"===i||"A"===i)mS[1]=t*e[1],mS[2]=n*e[2],mS[3]=e[3],mS[4]=e[4],mS[5]=e[5],mS[6]=t*e[6],mS[7]=n*e[7];else if("h"===i||"H"===i)mS[1]=t*e[1];else if("v"===i||"V"===i)mS[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)mS[r]=(r%2==1?t:n)*e[r];return mS}function vS(e,t,n,i,r,o){var a,s,l,c,u,f=null,d=0,h=0,p=0,g=0,m=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,b=t.length;v<b;++v){switch(a=t[v],1===r&&1===o||(a=yS(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":m=d+=a[1],y=h+=a[2],e.moveTo(d+n,h+i);break;case"M":m=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],g=h+a[4],e.bezierCurveTo(d+a[1]+n,h+a[2]+i,p+n,g+i,s+n,l+i),d=s,h=l;break;case"C":d=a[5],h=a[6],p=a[3],g=a[4],e.bezierCurveTo(a[1]+n,a[2]+i,p+n,g+i,d+n,h+i);break;case"s":s=d+a[3],l=h+a[4],p=2*d-p,g=2*h-g,e.bezierCurveTo(p+n,g+i,d+a[1]+n,h+a[2]+i,s+n,l+i),p=d+a[1],g=h+a[2],d=s,h=l;break;case"S":s=a[3],l=a[4],p=2*d-p,g=2*h-g,e.bezierCurveTo(p+n,g+i,a[1]+n,a[2]+i,s+n,l+i),d=s,h=l,p=a[1],g=a[2];break;case"q":s=d+a[3],l=h+a[4],p=d+a[1],g=h+a[2],e.quadraticCurveTo(p+n,g+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],g=a[2];break;case"t":s=d+a[1],l=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,g=h):"t"===f[0]?(p=2*d-c,g=2*h-u):"q"===f[0]&&(p=2*d-p,g=2*h-g),c=p,u=g,e.quadraticCurveTo(p+n,g+i,s+n,l+i),h=l,p=(d=s)+a[1],g=h+a[2];break;case"T":s=a[1],l=a[2],p=2*d-p,g=2*h-g,e.quadraticCurveTo(p+n,g+i,s+n,l+i),d=s,h=l;break;case"a":bS(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":bS(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=m,h=y,e.closePath()}f=a}}function bS(e,t,n,i){const r=function(e,t,n,i,r,o,a,s,l){const c=pS.call(arguments);if(dS[c])return dS[c];const u=a*lS,f=Math.sin(u),d=Math.cos(u),h=d*(s-e)*.5+f*(l-t)*.5,p=d*(l-t)*.5-f*(s-e)*.5;let g=h*h/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,v=-f/i,b=d/i,x=m*s+y*l,_=v*s+b*l,w=m*e+y*t,k=v*e+b*t;let $=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;$<0&&($=0);let E=Math.sqrt($);o==r&&(E=-E);const A=.5*(x+w)-E*(k-_),S=.5*(_+k)+E*(w-x),D=Math.atan2(_-S,x-A);let C=Math.atan2(k-S,w-A)-D;C<0&&1===o?C+=uS:C>0&&0===o&&(C-=uS);const M=Math.ceil(Math.abs(C/(cS+.001))),F=[];for(let O=0;O<M;++O){const e=D+O*C/M,t=D+(O+1)*C/M;F[O]=[A,S,e,t,n,i,f,d]}return dS[c]=F}(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=gS(r[o]);e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}const xS=.5773502691896257,_S={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,uS)}},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=fS*n,r=i-n*xS,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=fS*n,r=i-n*xS;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=fS*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=fS*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=fS*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=fS*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 wS(e){return(0,g.mQ)(_S,e)?_S[e]:function(e){if(!(0,g.mQ)(kS,e)){const t=sS(e);kS[e]={draw:function(e,n){vS(e,t,0,0,Math.sqrt(n)/2)}}}return kS[e]}(e)}var kS={};const $S=.448084975506;function ES(e){return e.x}function AS(e){return e.y}function SS(e){return e.width}function DS(e){return e.height}function CS(e){return"function"===typeof e?e:()=>+e}function MS(e,t,n){return Math.max(t,Math.min(e,n))}function FS(){var e=ES,t=AS,n=SS,i=DS,r=CS(0),o=r,a=r,s=r,l=null;function c(c,u,f){var d,h=null!=u?u:+e.call(this,c),p=null!=f?f:+t.call(this,c),g=+n.call(this,c),m=+i.call(this,c),y=Math.min(g,m)/2,v=MS(+r.call(this,c),0,y),b=MS(+o.call(this,c),0,y),x=MS(+a.call(this,c),0,y),_=MS(+s.call(this,c),0,y);if(l||(l=d=El()),v<=0&&b<=0&&x<=0&&_<=0)l.rect(h,p,g,m);else{var w=h+g,k=p+m;l.moveTo(h+v,p),l.lineTo(w-b,p),l.bezierCurveTo(w-$S*b,p,w,p+$S*b,w,p+b),l.lineTo(w,k-_),l.bezierCurveTo(w,k-$S*_,w-$S*_,k,w-_,k),l.lineTo(h+x,k),l.bezierCurveTo(h+$S*x,k,h,k-$S*x,h,k-x),l.lineTo(h,p+v),l.bezierCurveTo(h,p+$S*v,h+$S*v,p,h+v,p),l.closePath()}if(d)return l=null,d+""||null}return c.x=function(t){return arguments.length?(e=CS(t),c):e},c.y=function(e){return arguments.length?(t=CS(e),c):t},c.width=function(e){return arguments.length?(n=CS(e),c):n},c.height=function(e){return arguments.length?(i=CS(e),c):i},c.cornerRadius=function(e,t,n,i){return arguments.length?(r=CS(e),o=null!=t?CS(t):r,s=null!=n?CS(n):r,a=null!=i?CS(i):o,c):r},c.context=function(e){return arguments.length?(l=null==e?null:e,c):l},c}function OS(){var e,t,n,i,r,o,a,s,l=null;function c(e,t,n){const i=n/2;if(r){var c=a-t,u=e-o;if(c||u){var f=Math.hypot(c,u),d=(c/=f)*s,h=(u/=f)*s,p=Math.atan2(u,c);l.moveTo(o-d,a-h),l.lineTo(e-c*i,t-u*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,uS);l.closePath()}else r=1;o=e,a=t,s=i}function u(o){var a,s,u,f=o.length,d=!1;for(null==l&&(l=u=El()),a=0;a<=f;++a)!(a<f&&i(s=o[a],a,o))===d&&(d=!d)&&(r=0),d&&c(+e(s,a,o),+t(s,a,o),+n(s,a,o));if(u)return l=null,u+""||null}return u.x=function(t){return arguments.length?(e=t,u):e},u.y=function(e){return arguments.length?(t=e,u):t},u.size=function(e){return arguments.length?(n=e,u):n},u.defined=function(e){return arguments.length?(i=e,u):i},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}function TS(e,t){return null!=e?e:t}const zS=e=>e.x||0,NS=e=>e.y||0,RS=e=>!(!1===e.defined),BS=Tl().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)),PS=Pl().x(zS).y1(NS).y0((e=>(e.y||0)+(e.height||0))).defined(RS),LS=Pl().y(NS).x1(zS).x0((e=>(e.x||0)+(e.width||0))).defined(RS),IS=Bl().x(zS).y(NS).defined(RS),jS=FS().x(zS).y(NS).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>TS(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>TS(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>TS(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>TS(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),US=jl().type((e=>wS(e.shape||"circle"))).size((e=>TS(e.size,64))),qS=OS().x(zS).y(NS).defined(RS).size((e=>e.size||1));function GS(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function WS(e,t,n,i){return jS.context(e)(t,n,i)}var YS=1;function HS(){YS=1}function XS(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+YS++),a=r.clipping[o]||(r.clipping[o]={id:o});return(0,g.Tn)(i)?a.path=i(null):GS(n)?a.path=WS(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function VS(e){this.clear(),e&&this.union(e)}function KS(e){this.mark=e,this.bounds=this.bounds||new VS}function QS(e){KS.call(this,e),this.items=this.items||[]}function JS(e){this._pending=0,this._loader=e||Ki()}function ZS(e){e._pending+=1}function eD(e){e._pending-=1}function tD(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}VS.prototype={clone(){return new VS(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),c=t-t*s+n*l,u=n-t*l-n*s;return[s*i-l*r+c,l*i+s*r+u,s*i-l*a+c,l*i+s*a+u,s*o-l*r+c,l*o+s*r+u,s*o-l*a+c,l*o+s*a+u]},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,g.B)(QS,KS),JS.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return ZS(t),t._loader.sanitize(e,{context:"href"}).then((e=>(eD(t),e))).catch((()=>(eD(t),null)))},loadImage(e){const t=this,n=ql();return ZS(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,g.mQ)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>eD(t),r.onerror=()=>eD(t),r.src=i,r})).catch((e=>(eD(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)}))}};const nD=uS-1e-8;let iD,rD,oD,aD,sD,lD,cD,uD;const fD=(e,t)=>iD.add(e,t),dD=(e,t)=>fD(rD=e,oD=t),hD=e=>fD(e,iD.y1),pD=e=>fD(iD.x1,e),gD=(e,t)=>sD*e+cD*t,mD=(e,t)=>lD*e+uD*t,yD=(e,t)=>fD(gD(e,t),mD(e,t)),vD=(e,t)=>dD(gD(e,t),mD(e,t));function bD(e,t){return iD=e,t?(aD=t*lS,sD=uD=Math.cos(aD),lD=Math.sin(aD),cD=-lD):(sD=uD=1,aD=lD=cD=0),xD}const xD={beginPath(){},closePath(){},moveTo:vD,lineTo:vD,rect(e,t,n,i){aD?(yD(e+n,t),yD(e+n,t+i),yD(e,t+i),vD(e,t)):(fD(e+n,t+i),dD(e,t))},quadraticCurveTo(e,t,n,i){const r=gD(e,t),o=mD(e,t),a=gD(n,i),s=mD(n,i);_D(rD,r,a,hD),_D(oD,o,s,pD),dD(a,s)},bezierCurveTo(e,t,n,i,r,o){const a=gD(e,t),s=mD(e,t),l=gD(n,i),c=mD(n,i),u=gD(r,o),f=mD(r,o);wD(rD,a,l,u,hD),wD(oD,s,c,f,pD),dD(u,f)},arc(e,t,n,i,r,o){if(i+=aD,r+=aD,rD=n*Math.cos(r)+e,oD=n*Math.sin(r)+t,Math.abs(r-i)>nD)fD(e-n,t-n),fD(e+n,t+n);else{const a=i=>fD(n*Math.cos(i)+e,n*Math.sin(i)+t);let s,l;if(a(i),a(r),r!==i)if((i%=uS)<0&&(i+=uS),(r%=uS)<0&&(r+=uS),r<i&&(o=!o,s=i,i=r,r=s),o)for(r-=uS,s=i-i%cS,l=0;l<4&&s>r;++l,s-=cS)a(s);else for(s=i-i%cS+cS,l=0;l<4&&s<r;++l,s+=cS)a(s)}}};function _D(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function wD(e,t,n,i,r){const o=i-e+3*t-3*n,a=e+n-2*t,s=e-t;let l,c=0,u=0;Math.abs(o)>1e-14?(l=a*a+s*o,l>=0&&(l=Math.sqrt(l),c=(-a+l)/o,u=(-a-l)/o)):c=.5*s/a,0<c&&c<1&&r(kD(c,e,t,n,i)),0<u&&u<1&&r(kD(u,e,t,n,i))}function kD(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 $D=($D=Ul(1,1))?$D.getContext("2d"):null;const ED=new VS;function AD(e){return function(t,n){if(!$D)return!0;e($D,t),ED.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:a}=ED;for(let e=r;e<=a;++e)for(let t=i;t<=o;++t)if($D.isPointInPath(t,e))return!0;return!1}}function SD(e,t){return t.contains(e.x||0,e.y||0)}function DD(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(ED.set(n,i,n+r,i+o))}function CD(e,t){const n=e.x||0,i=e.y||0;return MD(t,n,i,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i)}function MD(e,t,n,i,r){const{x1:o,y1:a,x2:s,y2:l}=e,c=i-t,u=r-n;let f,d,h,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-c,d=-(o-t)),1===p&&(f=c,d=s-t),2===p&&(f=-u,d=-(a-n)),3===p&&(f=u,d=l-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>m)return!1;h>g&&(g=h)}else if(f>0){if(h<g)return!1;h<m&&(m=h)}}return!0}function FD(e,t){e.globalCompositeOperation=t.blend||"source-over"}function OD(e,t){return null==e?t:e}function TD(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function zD(e,t,n){return KA(n)?function(e,t,n){const i=n.width(),r=n.height();let o;if("radial"===t.gradient)o=e.createRadialGradient(n.x1+OD(t.x1,.5)*i,n.y1+OD(t.y1,.5)*r,Math.max(i,r)*OD(t.r1,0),n.x1+OD(t.x2,.5)*i,n.y1+OD(t.y2,.5)*r,Math.max(i,r)*OD(t.r2,.5));else{const a=OD(t.x1,0),s=OD(t.y1,0),l=OD(t.x2,1),c=OD(t.y2,0);if(a!==l&&s!==c&&i!==r){const n=Ul(Math.ceil(i),Math.ceil(r)),o=n.getContext("2d");return o.scale(i,r),o.fillStyle=TD(o.createLinearGradient(a,s,l,c),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+c*r)}return TD(o,t.stops)}(e,n,t.bounds):n}function ND(e,t,n){return(n*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=n,e.fillStyle=zD(e,t,t.fill),!0)}var RD=[];function BD(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=zD(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||RD),e.lineDashOffset=t.strokeDashOffset||0),!0))}function PD(e,t){return e.zindex-t.zindex||e.index-t.index}function LD(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(PD)}function ID(e,t){var n,i,r=e.items;if(!r||!r.length)return;const o=LD(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 jD(e,t){var n,i,r=e.items;if(!r||!r.length)return null;const o=LD(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 UD(e){return function(t,n,i){ID(n,(n=>{i&&!i.intersects(n.bounds)||GD(e,t,n,n)}))}}function qD(e){return function(t,n,i){!n.items.length||i&&!i.intersects(n.bounds)||GD(e,t,n.items[0],n.items)}}function GD(e,t,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(e(t,i)||(FD(t,n),n.fill&&ND(t,n,r)&&t.fill(),n.stroke&&BD(t,n,r)&&t.stroke()))}function WD(e){return e=e||g.vN,function(t,n,i,r,o,a){return i*=t.pixelRatio,r*=t.pixelRatio,jD(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 YD(e,t){return function(n,i,r,o){var a,s,l=Array.isArray(i)?i[0]:i,c=null==t?l.fill:t,u=l.stroke&&n.isPointInStroke;return u&&(a=l.strokeWidth,s=l.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,i)&&(c&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o))}}function HD(e){return WD(YD(e))}function XD(e,t){return"translate("+e+","+t+")"}function VD(e){return"rotate("+e+")"}function KD(e){return XD(e.x||0,e.y||0)}function QD(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*=lS),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 XD(e.x||0,e.y||0)+(e.angle?" "+VD(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(bD(e,n.angle),n),tD(e,n).translate(n.x||0,n.y||0)},draw:UD(i),pick:HD(i),isect:n||AD(i)}}var JD=QD("arc",(function(e,t){return BS.context(e)(t)}));function ZD(e,t,n){function i(e,n){e.beginPath(),t(e,n)}const r=YD(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(bD(e),i),tD(e,i[0]))},draw:qD(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:SD,tip:n}}var eC=ZD("area",(function(e,t){const n=t[0],i=n.interpolate||"linear";return("horizontal"===n.orient?LS:PS).curve(tS(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 tC(e,t){e.beginPath(),GS(t)?WS(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function nC(e){const t=OD(e.strokeWidth,1);return null!=e.strokeOffset?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function iC(e,t){const n=nC(t);e("d",WS(null,t,n,n))}function rC(e,t,n,i){const r=nC(t);e.beginPath(),WS(e,t,(n||0)+r,(i||0)+r)}const oC=YD(rC),aC=YD(rC,!1),sC=YD(rC,!0);var lC={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",KD(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),tD(e,t),e.translate(t.x||0,t.y||0)},draw:function(e,t,n,i){ID(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&&(rC(e,t,r,o),FD(e,t),t.fill&&ND(e,t,s)&&e.fill(),t.stroke&&!a&&BD(e,t,s)&&e.stroke()),e.save(),e.translate(r,o),t.clip&&tC(e,t),n&&n.translate(-r,-o),ID(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&&(rC(e,t,r,o),FD(e,t),BD(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 jD(t,(l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(r,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(r<u||r>h||o<f||o>p))return;if(e.save(),e.translate(u,f),u=r-u,f=o-f,g&&GS(l)&&!sC(e,l,a,s))return e.restore(),null;const m=l.strokeForeground,y=!1!==t.interactive;return y&&m&&l.stroke&&aC(e,l,a,s)?(e.restore(),l):(c=jD(l,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,u,f)?this.pick(e,n,i,u,f):null)),!c&&y&&(l.fill||!m&&l.stroke)&&oC(e,l,a,s)&&(c=l),e.restore(),c||null)}))},isect:DD,content:function(e,t,n){e("clip-path",t.clip?XS(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),iC(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?iC(e,t):e("d","")}},cC={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function uC(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 fC(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 dC(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 hC(e,t){return"center"===e?t/2:"right"===e?t:0}function pC(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var gC={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const i=uC(t,n),r=fC(t,i),o=dC(t,i),a=(t.x||0)-hC(t.align,r),s=(t.y||0)-pC(t.baseline,o);e("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",cC["xmlns:xlink"],"xlink:href"),e("transform",XD(a,s)),e("width",r),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,i=fC(t,n),r=dC(t,n),o=(t.x||0)-hC(t.align,i),a=(t.y||0)-pC(t.baseline,r);return e.set(o,a,o+i,a+r)},draw:function(e,t,n){ID(t,(t=>{if(n&&!n.intersects(t.bounds))return;const i=uC(t,this);let r=fC(t,i),o=dC(t,i);if(0===r||0===o)return;let a,s,l,c,u=(t.x||0)-hC(t.align,r),f=(t.y||0)-pC(t.baseline,o);!1!==t.aspect&&(s=i.width/i.height,l=t.width/t.height,s===s&&l===l&&s!==l&&(l<s?(c=r/s,f+=(o-c)/2,o=c):(c=o*s,u+=(r-c)/2,r=c))),(i.complete||i.toDataURL)&&(FD(e,t),e.globalAlpha=null!=(a=t.opacity)?a:1,e.imageSmoothingEnabled=!1!==t.smooth,e.drawImage(i,u,f,r,o))}))},pick:WD(),isect:g.vN,get:uC,xOffset:hC,yOffset:pC},mC=ZD("line",(function(e,t){const n=t[0],i=n.interpolate||"linear";return IS.curve(tS(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 yC(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)*lS,l=t.pathCache;l&&l.path===n||((t.pathCache=l=sS(n)).path=n),s&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(s),vS(e,l,0,0,o,a),e.rotate(-s),e.translate(-i,-r)):vS(e,l,i,r,o,a)}var vC={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 XD(e.x||0,e.y||0)+(e.angle?" "+VD(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 yC(bD(e,t.angle),t)?e.set(0,0,0,0):tD(e,t,!0)},draw:UD(yC),pick:HD(yC),isect:AD(yC)};function bC(e,t){e.beginPath(),WS(e,t)}var xC={type:"rect",tag:"path",nested:!1,attr:function(e,t){e("d",WS(null,t))},bound:function(e,t){var n,i;return tD(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)},draw:UD(bC),pick:HD(bC),isect:DD};function _C(e,t,n){var i,r,o,a;return!(!t.stroke||!BD(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 wC={type:"rule",tag:"line",nested:!1,attr:function(e,t){e("transform",KD(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 tD(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){ID(t,(t=>{if(!n||n.intersects(t.bounds)){var i=null==t.opacity?1:t.opacity;i&&_C(e,t,i)&&(FD(e,t),e.stroke())}}))},pick:WD((function(e,t,n,i){return!!e.isPointInStroke&&(_C(e,t,1)&&e.isPointInStroke(n,i))})),isect:CD},kC=QD("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),$C=QD("symbol",(function(e,t){return US.context(e)(t)}),SD);const EC=(0,g.EV)();var AC={height:OC,measureWidth:MC,estimateWidth:DC,width:DC,canvas:SC};function SC(e){AC.width=e&&$D?MC:DC}function DC(e,t){return CC(RC(e,t),OC(e))}function CC(e,t){return~~(.8*e.length*t)}function MC(e,t){return OC(e)<=0||!(t=RC(e,t))?0:FC(t,PC(e))}function FC(e,t){const n=`(${t}) ${e}`;let i=EC.get(n);return void 0===i&&($D.font=t,i=$D.measureText(e).width,EC.set(n,i)),i}function OC(e){return null!=e.fontSize?+e.fontSize||0:11}function TC(e){return null!=e.lineHeight?e.lineHeight:OC(e)+2}function zC(e){return t=e.lineBreak&&e.text&&!(0,g.cy)(e.text)?e.text.split(e.lineBreak):e.text,(0,g.cy)(t)?t.length>1?t:t[0]:t;var t}function NC(e){const t=zC(e);return((0,g.cy)(t)?t.length-1:0)*TC(e)}function RC(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(AC.width===MC){const t=PC(e);return e=>FC(e,t)}if(AC.width===DC){const t=OC(e);return e=>CC(e,t)}return t=>AC.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 BC(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function PC(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+OC(e)+"px "+BC(e,t)}function LC(e){var t=e.baseline,n=OC(e);return Math.round("top"===t?.79*n:"middle"===t?.3*n:"bottom"===t?-.21*n:"line-top"===t?.29*n+.5*TC(e):"line-bottom"===t?.29*n-.5*TC(e):0)}SC(!0);const IC={left:"start",center:"middle",right:"end"},jC=new VS;function UC(e){var t,n=e.x||0,i=e.y||0,r=e.radius||0;return r&&(t=(e.theta||0)-cS,n+=r*Math.cos(t),i+=r*Math.sin(t)),jC.x1=n,jC.y1=i,jC}function qC(e,t,n){var i,r=AC.height(t),o=t.align,a=UC(t),s=a.x1,l=a.y1,c=t.dx||0,u=(t.dy||0)+LC(t)-Math.round(.8*r),f=zC(t);if((0,g.cy)(f)?(r+=TC(t)*(f.length-1),i=f.reduce(((e,n)=>Math.max(e,AC.width(t,n))),0)):i=AC.width(t,f),"center"===o?c-=i/2:"right"===o&&(c-=i),e.set(c+=s,u+=l,c+i,u+r),t.angle&&!n)e.rotate(t.angle*lS,s,l);else if(2===n)return e.rotatedPoints(t.angle*lS,s,l);return e}var GC={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,i=t.dx||0,r=(t.dy||0)+LC(t),o=UC(t),a=o.x1,s=o.y1,l=t.angle||0;e("text-anchor",IC[t.align]||"start"),l?(n=XD(a,s)+" "+VD(l),(i||r)&&(n+=" "+XD(i,r))):n=XD(a+i,s+r),e("transform",n)},bound:qC,draw:function(e,t,n){ID(t,(t=>{var i,r,o,a,s,l,c,u=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===u||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=PC(t),e.textAlign=t.align||"left",r=(i=UC(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(r,o),e.rotate(t.angle*lS),r=o=0),r+=t.dx||0,o+=(t.dy||0)+LC(t),l=zC(t),FD(e,t),(0,g.cy)(l))for(s=TC(t),a=0;a<l.length;++a)c=RC(t,l[a]),t.fill&&ND(e,t,u)&&e.fillText(c,r,o),t.stroke&&BD(e,t,u)&&e.strokeText(c,r,o),o+=s;else c=RC(t,l),t.fill&&ND(e,t,u)&&e.fillText(c,r,o),t.stroke&&BD(e,t,u)&&e.strokeText(c,r,o);t.angle&&e.restore()}}))},pick:WD((function(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=UC(t),s=a.x1,l=a.y1,c=qC(jC,t,1),u=-t.angle*lS,f=Math.cos(u),d=Math.sin(u),h=f*r-d*o+(s-f*s+d*l),p=d*r+f*o+(l-d*s-f*l);return c.contains(h,p)})),isect:function(e,t){const n=qC(jC,e,2);return MD(t,n[0],n[1],n[2],n[3])||MD(t,n[0],n[1],n[4],n[5])||MD(t,n[4],n[5],n[6],n[7])||MD(t,n[2],n[3],n[6],n[7])}},WC=ZD("trail",(function(e,t){return qS.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})),YC={arc:JD,area:eC,group:lC,image:gC,line:mC,path:vC,rect:xC,rule:wC,shape:kC,symbol:$C,text:GC,trail:WC};function HC(e,t,n){var i=YC[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new VS),e,n)}var XC={mark:null};function VC(e,t,n){var i,r,o,a,s=YC[e.marktype],l=s.bound,c=e.items,u=c&&c.length;if(s.nested)return u?o=c[0]:(XC.mark=e,o=XC),a=HC(o,l,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new VS,u)for(i=0,r=c.length;i<r;++i)t.union(HC(c[i],l,n));return e.bounds=t}const KC=["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 QC(e,t){return JSON.stringify(e,KC,t)}function JC(e){return ZC("string"===typeof e?JSON.parse(e):e)}function ZC(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)&&ZC(o[n]);return r&&VC(e),e}function eM(e){arguments.length?this.root=JC(e):(this.root=tM({marktype:"group",name:"root",role:"frame"}),this.root.items=[new QS(this.root)])}function tM(e,t){const n={bounds:new VS,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 nM(e,t,n){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function iM(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 rM(e,t,n,i){var r,o=e.childNodes[t];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=nM(e.ownerDocument,n,i),e.insertBefore(o,r)),o}function oM(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function aM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function sM(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function lM(e,t){this._active=null,this._handlers={},this._loader=e||Ki(),this._tooltip=t||cM}function cM(e,t,n,i){e.element().setAttribute("title",i||"")}function uM(e){this._el=null,this._bgcolor=null,this._loader=new JS(e)}eM.prototype={toJSON(e){return QC(this.root,e||0)},mark(e,t,n){const i=tM(e,t=t||this.root.items[0]);return t.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},lM.prototype={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=nM(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=YC[a.marktype]).tip){for((o=sM(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}}},uM.prototype={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 fM="dragenter",dM="dragleave",hM="dragover",pM="pointerdown",gM="pointermove",mM="pointerout",yM="pointerover",vM="mousedown",bM="mousemove",xM="mouseout",_M="mouseover",wM="click",kM="mousewheel",$M="touchstart",EM="touchmove",AM="touchend",SM=["keydown","keypress","keyup",fM,dM,hM,pM,"pointerup",gM,mM,yM,vM,"mouseup",bM,xM,_M,wM,"dblclick","wheel",kM,$M,EM,AM],DM=gM,CM=mM,MM=wM;function FM(e,t){lM.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function OM(e,t){(e=>e===$M||e===EM||e===AM?[$M,EM,AM]:[e])(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 TM(e,t,n){t.forEach((t=>e.fire(t,n)))}function zM(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||TM(this,n,i),this._active=o,TM(this,t,i)),TM(this,e,i)}}function NM(e){return function(t){TM(this,e,t),this._active=null}}function RM(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 c in o)s[c]=o[c];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}function BM(e){uM.call(this,e),this._options={},this._redraw=!1,this._dirty=new VS,this._tempb=new VS}(0,g.B)(FM,lM,{initialize(e,t,n){return this._canvas=e&&iM(e,"canvas"),[wM,vM,pM,gM,mM,dM].forEach((e=>OM(this,e))),lM.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:SM,DOMMouseScroll(e){this.fire(kM,e)},pointermove:zM([gM,bM],[yM,_M],[mM,xM]),dragover:zM([hM],[fM],[dM]),pointerout:NM([mM,xM]),dragleave:NM([dM]),pointerdown(e){this._down=this._active,this.fire(pM,e)},mousedown(e){this._down=this._active,this.fire(vM,e)},click(e){this._down===this._active&&(this.fire(wM,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire($M,e,!0)},touchmove(e){this.fire(EM,e,!0)},touchend(e){this.fire(AM,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===MM&&i&&i.href?this.handleHref(t,i,i.href):e!==DM&&e!==CM||this.handleTooltip(t,i,e!==CM),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&&(OM(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=sM(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 YC[e.marktype].pick.call(this,o,e,t,n,i,r)}});const PM=uM.prototype;function LM(e,t){lM.call(this,e,t);const n=this;n._hrefHandler=IM(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=IM(n,((e,t)=>{n.handleTooltip(e,t,e.type!==CM)}))}(0,g.B)(BM,uM,{initialize(e,t,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Ul(1,1,this._options.type),e&&this._canvas&&(oM(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),PM.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(PM.resize.call(this,e,t,n,i),this._canvas)RM(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||(0,g.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=((e,t,n)=>(new VS).set(0,0,t,n).translate(-e[0],-e[1]))(i,r,o);n.save();const l=this._redraw||a.empty()?(this._redraw=!1,s.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),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=YC[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),(0,g.Tn)(n)?(e.beginPath(),n(e),e.clip()):tC(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 IM=(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)};(0,g.B)(LM,lM,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(MM,this._hrefHandler),i.removeEventListener(DM,this._tooltipHandler),i.removeEventListener(CM,this._tooltipHandler)),this._svg=i=e&&iM(e,"svg"),i&&(i.addEventListener(MM,this._hrefHandler),i.addEventListener(DM,this._tooltipHandler),i.addEventListener(CM,this._tooltipHandler)),lM.prototype.initialize.call(this,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:IM(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 jM="aria-hidden",UM="aria-label",qM="role",GM="aria-roledescription",WM="graphics-object",YM="graphics-symbol",HM=(e,t,n)=>({[qM]:e,[GM]:t,[UM]:n||void 0}),XM=(0,g.M1)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),VM={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,i=t.title?eF(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 ${wA(s)?"discrete":s} scale`+` with ${HA(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?eF(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,g.se)(e)}(o)}`+` with ${HA(l,s,e)}`}},"title-text":{desc:"title",caption:e=>`Title text '${ZM(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${ZM(e)}'`}},KM={ariaRole:qM,ariaRoleDescription:GM,description:UM};function QM(e,t){const n=!1===t.aria;if(e(jM,n||void 0),n||null==t.description)for(const i in KM)e(KM[i],void 0);else{const n=t.mark.marktype;e(UM,t.description),e(qM,t.ariaRole||("group"===n?WM:YM)),e(GM,t.ariaRoleDescription||`${n} mark`)}}function JM(e){return!1===e.aria?{[jM]:!0}:XM[e.role]?null:VM[e.role]?function(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return HM(t.role||YM,t.desc,n.description||i(n))}catch(n){return null}}(e,VM[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return HM(n?WM:YM,`${t} mark container`,e.description)}(e)}function ZM(e){return(0,g.YO)(e.text).join(" ")}function eF(e){try{return(0,g.YO)((0,g.se)(e.items).items[0].text).join(" ")}catch(t){return null}}const tF=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),nF=e=>tF(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function iF(){let e="",t="",n="";const i=[],r=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${nF(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,r()),i.push(o)})(s),t="<"+s;for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];for(const e of c)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+=tF(e),a),toString:()=>e};return a}const rF=e=>oF(iF(),e)+"";function oF(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):oF(e,t)}return e.close()}const aF={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"},sF={blend:"mix-blend-mode"},lF={fill:"none","stroke-miterlimit":10},cF="http://www.w3.org/2000/xmlns/",uF=cC.xmlns;function fF(e){uM.call(this,e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const dF=uM.prototype;function hF(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 pF(e,t,n){let i,r,o;if("radial"===t.gradient){let i=rM(e,n++,"pattern",uF);wF(i,{id:VA+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=rM(i,0,"rect",uF),wF(i,{width:1,height:1,fill:`url(${$F()}#${t.id})`}),wF(e=rM(e,n++,"radialGradient",uF),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else wF(e=rM(e,n++,"linearGradient",uF),{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=rM(e,i,"stop",uF),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return oM(e,i),n}function gF(e,t,n){let i;return(e=rM(e,n,"clipPath",uF)).setAttribute("id",t.id),t.path?(i=rM(e,0,"path",uF),i.setAttribute("d",t.path)):(i=rM(e,0,"rect",uF),wF(i,{x:0,y:0,width:t.width,height:t.height})),oM(e,1),n+1}function mF(e,t,n,i,r){let o,a=e._svg;if(!a&&(o=t.ownerDocument,a=nM(o,i,uF),e._svg=a,e.mark&&(a.__data__=e,a.__values__={fill:"default"},"g"===i))){const t=nM(o,"path",uF);a.appendChild(t),t.__data__=e;const n=nM(o,"g",uF);a.appendChild(n),n.__data__=e;const i=nM(o,"path",uF);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}(0,g.B)(fF,uM,{initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=rM(e,0,"svg",uF),this._svg.setAttributeNS(cF,"xmlns",uF),this._svg.setAttributeNS(cF,"xmlns:xlink",cC["xmlns:xlink"]),this._svg.setAttribute("version",cC.version),this._svg.setAttribute("class","marks"),oM(e,1),this._root=rM(this._svg,0,"g",uF),wF(this._root,lF),oM(this._svg,1)),this.background(this._bgcolor),dF.initialize.call(this,e,t,n,i,r)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),dF.background.apply(this,arguments)},resize(e,t,n,i){return dF.resize.call(this,e,t,n,i),this._svg&&(wF(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=rM(e,0,"rect",uF),wF(n,{width:this._width,height:this._height,fill:t}));const i=rF(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),oM(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=YC[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,hF(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,hF(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=YC[o],s=!1===t.interactive?"none":null,l="g"===a.tag,c=mF(t,e,n,"g",r);if("group"!==o&&null!=i&&!i.includes(o))return oM(c,0),t._svg;c.setAttribute("class",aM(t));const u=JM(t);for(const p in u)kF(c,p,u[p]);l||kF(c,"pointer-events",s),kF(c,"clip-path",t.clip?XS(this,t,t.group):null);let f=null,d=0;const h=e=>{const t=this.isDirty(e),n=mF(e,c,f,a.tag,r);t&&(this._update(a,n,e),l&&function(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;ID(n,(n=>{r=e.mark(t,n,r,i),++o})),oM(t,1+o)}(this,n,e,i)),f=n,++d};return a.nested?t.items.length&&h(t.items[0]):ID(t,h),oM(c,d),c},_update(e,t,n){yF=t,vF=t.__values__,QM(xF,n),e.attr(xF,n,this);const i=bF[e.type];i&&i.call(this,e,t,n),yF&&this.style(yF,n)},style(e,t){if(null!=t){for(const n in aF){let i="font"===n?BC(t):t[n];if(i===vF[n])continue;const r=aF[n];null==i?e.removeAttribute(r):(KA(i)&&(i=QA(i,this._defs.gradient,$F())),e.setAttribute(r,i+"")),vF[n]=i}for(const n in sF)_F(e,sF[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=rM(e,1,"defs",uF)),i=pF(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=rM(e,1,"defs",uF)),i=gF(n,t.clipping[r],i);n&&(0===i?(e.removeChild(n),t.el=null):oM(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let yF=null,vF=null;const bF={group(e,t,n){const i=yF=t.childNodes[2];vF=i.__values__,e.foreground(xF,n,this),vF=t.__values__,yF=t.childNodes[1],e.content(xF,n,this);const r=yF=t.childNodes[0];e.background(xF,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==vF.events&&(kF(i,"pointer-events",o),kF(r,"pointer-events",o),vF.events=o),n.strokeForeground&&n.stroke){const e=n.fill;kF(i,"display",null),this.style(r,n),kF(r,"stroke",null),e&&(n.fill=null),vF=i.__values__,this.style(i,n),e&&(n.fill=e),yF=null}else kF(i,"display","none")},image(e,t,n){!1===n.smooth?(_F(t,"image-rendering","optimizeSpeed"),_F(t,"image-rendering","pixelated")):_F(t,"image-rendering",null)},text(e,t,n){const i=zC(n);let r,o,a,s;(0,g.cy)(i)?(o=i.map((e=>RC(n,e))),r=o.join("\n"),r!==vF.text&&(oM(t,0),a=t.ownerDocument,s=TC(n),o.forEach(((e,i)=>{const r=nM(a,"tspan",uF);r.__data__=n,r.textContent=e,i&&(r.setAttribute("x",0),r.setAttribute("dy",s)),t.appendChild(r)})),vF.text=r)):(o=RC(n,i),o!==vF.text&&(t.textContent=o,vF.text=o)),kF(t,"font-family",BC(n)),kF(t,"font-size",OC(n)+"px"),kF(t,"font-style",n.fontStyle),kF(t,"font-variant",n.fontVariant),kF(t,"font-weight",n.fontWeight)}};function xF(e,t,n){t!==vF[e]&&(n?function(e,t,n,i){null!=n?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}(yF,e,t,n):kF(yF,e,t),vF[e]=t)}function _F(e,t,n){n!==vF[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),vF[t]=n)}function wF(e,t){for(const n in t)kF(e,n,t[n])}function kF(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function $F(){let e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function EF(e){uM.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}(0,g.B)(EF,uM,{svg(){return this._text},_render(e){const t=iF();t.open("svg",(0,g.X$)({},cC,{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",lF,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=YC[t.marktype],i=n.tag,r=[QM,n.attr];e.open("g",{class:aM(t),"clip-path":t.clip?XS(this,t,t.group):null},JM(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=zC(o);if((0,g.cy)(t)){const n={x:0,dy:TC(o)};for(let i=0;i<t.length;++i)e.open("tspan",i?n:null).text(RC(o,t[i])).close()}else e.text(RC(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)),ID(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]):ID(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"]=BC(t),e["font-size"]=OC(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const a in aF){let n=t[a];const i=aF[a];("transparent"!==n||"fill"!==i&&"stroke"!==i)&&null!=n&&(KA(n)&&(n=QA(n,r.gradient,"")),e[i]=n)}for(const a in sF){const e=t[a];null!=e&&(o=o||[],o.push(`${sF[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:VA+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 AF={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function SF(e){AF.svgMarkTypes=e.svgMarkTypes??["text"],AF.svgOnTop=e.svgOnTop??!0,AF.debug=e.debug??!1}function DF(e){uM.call(this,e),this._svgRenderer=new fF(e),this._canvasRenderer=new BM(e)}const CF=uM.prototype;function MF(e,t){FM.call(this,e,t)}(0,g.B)(DF,uM,{initialize(e,t,n,i,r){this._root_el=rM(e,0,"div");const o=rM(this._root_el,0,"div"),a=rM(this._root_el,1,"div");return this._root_el.style.position="relative",AF.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=AF.svgOnTop?a:o,this._canvasEl=AF.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),CF.initialize.call(this,e,t,n,i,r)},dirty(e){return AF.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=>!AF.svgMarkTypes.includes(e)));this._svgRenderer.render(e,AF.svgMarkTypes),this._canvasRenderer.render(e,n)},resize(e,t,n,i){return CF.resize.call(this,e,t,n,i),this._svgRenderer.resize(e,t,n,i),this._canvasRenderer.resize(e,t,n,i),this},background(e){return AF.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}),(0,g.B)(MF,FM,{initialize(e,t,n){const i=rM(rM(e,0,"div"),AF.svgOnTop?0:1,"div");return FM.prototype.initialize.call(this,i,t,n)}});const FF="canvas",OF="hybrid",TF="none",zF={Canvas:FF,PNG:"png",SVG:"svg",Hybrid:OF,None:TF},NF={};function RF(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(NF[e]=t,this):NF[e]}function BF(e,t,n){const i=[],r=(new VS).union(t),o=e.marktype;return o?PF(e,r,n,i):"group"===o?LF(e,r,n,i):(0,g.z3)("Intersect scene must be mark node or group item.")}function PF(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)LF(r[s],t,n,i);else for(const e=YC[o].isect;s<a;++s){const n=r[s];IF(n,t,e)&&i.push(n)}}return i}function LF(e,t,n,i){n&&n(e.mark)&&IF(e,t,YC.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)PF(r[e],t,n,i);t.translate(a,s)}return i}function IF(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}NF[FF]=NF.png={renderer:BM,headless:BM,handler:FM},NF.svg={renderer:fF,headless:EF,handler:LM},NF[OF]={renderer:DF,headless:DF,handler:MF},NF[TF]={};const jF=new VS;function UF(e){const t=e.clip;if((0,g.Tn)(t))t(bD(jF.clear()));else{if(!t)return;jF.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(jF)}const qF=1e-9;function GF(e,t,n){return e===t||("path"===n?WF(e,t):e instanceof Date&&t instanceof Date?+e===+t:(0,g.Et)(e)&&(0,g.Et)(t)?Math.abs(e-t)<=qF:e&&t&&((0,g.Gv)(e)||(0,g.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(!GF(e[n=r[i]],t[n],n))return!1;return typeof e===typeof t}(e,t):e==t)}function WF(e,t){return GF(sS(e),sS(t))}function YF(){HS(),XA=0}const HF="linear",XF="log",VF="pow",KF="sqrt",QF="symlog",JF="time",ZF="utc",eO="sequential",tO="diverging",nO="quantile",iO="quantize",rO="threshold",oO="continuous",aO="discrete",sO="discretizing",lO="interpolating",cO="temporal";function uO(){const e=(0,Oc.A)().unknown(void 0),t=e.domain,n=e.range;let i,r,o=[0,1],a=!1,s=0,l=0,c=.5;function u(){const e=t().length,u=o[1]<o[0],f=o[1-u],d=function(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}(e,s,l);let h=o[u-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(e-s))*c,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=(0,qo.A)(e).map((e=>h+i*e));return n(u?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),u()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],u()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,u()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(a=!!e,u()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,u()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),u()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},e.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),u()):c},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,c,u,f=+e[0],d=+e[1];return f!==f||d!==d||(d<f&&(u=f,f=d,d=u),d<a[0]||f>o[1-i])?void 0:(l=Math.max(0,(0,Gl.Jj)(a,f)-1),c=f===d?l:(0,Gl.Jj)(a,d)-1,f-a[l]>r+1e-10&&++l,i&&(u=l,l=s-c,c=s-u),l>c?void 0:t().slice(l,c+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return uO().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(c)},u()}function fO(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return fO(t())},e}var dO=Array.prototype.map;const hO=Array.prototype.slice;const pO=new Map,gO=Symbol("vega_scale");function mO(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],c=-1;for(l<s&&(r=s,s=l,l=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=l&&(c<0&&(c=o),i=o);if(!(c<0))return s=e.invertExtent(n[c]),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,function(e){return e[gO]=!0,e}(n)};return i.metadata=(0,g.M1)((0,g.YO)(n)),i}function yO(e,t,n){return arguments.length>1?(pO.set(e,mO(e,t,n)),this):function(e){return pO.has(e)}(e)?pO.get(e):void 0}yO("identity",Hl),yO(HF,Wl.A,oO),yO(XF,Xl.A,[oO,XF]),yO(VF,Vl.Ay,oO),yO(KF,Vl.RZ,oO),yO(QF,tc,oO),yO(JF,fc,[oO,cO]),yO(ZF,dc,[oO,cO]),yO(eO,yc,[oO,lO]),yO(`${eO}-${HF}`,yc,[oO,lO]),yO(`${eO}-${XF}`,vc,[oO,lO,XF]),yO(`${eO}-${VF}`,xc,[oO,lO]),yO(`${eO}-${KF}`,_c,[oO,lO]),yO(`${eO}-${QF}`,bc,[oO,lO]),yO(`${tO}-${HF}`,$c,[oO,lO]),yO(`${tO}-${XF}`,Ec,[oO,lO,XF]),yO(`${tO}-${VF}`,Sc,[oO,lO]),yO(`${tO}-${KF}`,Dc,[oO,lO]),yO(`${tO}-${QF}`,Ac,[oO,lO]),yO(nO,Cc.A,[sO,nO]),yO(iO,Mc.A,sO),yO(rO,Fc.A,sO),yO("bin-ordinal",(function e(){let t=[],n=[];function i(e){return null==e||e!==e?void 0:n[((0,Gl.Ay)(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return dO.call(e,g.Ro)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=hO.call(e),i):n.slice()},i.tickFormat=function(e,n){return(0,Tc.A)(t[0],(0,g.se)(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[aO,sO]),yO("ordinal",Oc.A,aO),yO("band",uO,aO),yO("point",(function(){return fO(uO().paddingInner(1))}),aO);function vO(e,t){const n=t[0],i=(0,g.se)(t)-n;return function(t){return e(n+t*i)}}function bO(e,t,n){return wc(_O(t||"rgb",n),e)}function xO(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function _O(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 wO(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 kO(e,t){for(const n in e)EO(n,t(e[n]))}const $O={};function EO(e,t){return e=e&&e.toLowerCase(),arguments.length>1?($O[e]=t,this):$O[e]}kO({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},wO),kO({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=>bO(wO(e))));var AO,SO,DO,CO,MO,FO,OO,TO,zO,NO,RO,BO,PO,LO,IO,jO,UO=n(66906),qO=new Mv,GO=new Mv,WO={point:eb,lineStart:eb,lineEnd:eb,polygonStart:function(){qO=new Mv,WO.lineStart=YO,WO.lineEnd=HO},polygonEnd:function(){var e=+qO;GO.add(e<0?Rv+e:e),this.lineStart=this.lineEnd=this.point=eb},sphere:function(){GO.add(Rv)}};function YO(){WO.point=XO}function HO(){VO(AO,SO)}function XO(e,t){WO.point=VO,AO=e,SO=t,DO=e*=Pv,CO=Uv(t=(t*=Pv)/2+Nv),MO=Xv(t)}function VO(e,t){var n=(e*=Pv)-DO,i=n>=0?1:-1,r=i*n,o=Uv(t=(t*=Pv)/2+Nv),a=Xv(t),s=MO*a,l=CO*o+s*Uv(r),c=s*i*Xv(r);qO.add(jv(c,l)),DO=e,CO=o,MO=a}function KO(e){return GO=new Mv,Cv(e,WO),2*GO}var QO,JO,ZO,eT,tT,nT,iT,rT,oT,aT,sT,lT,cT,uT,fT,dT,hT={point:pT,lineStart:mT,lineEnd:yT,polygonStart:function(){hT.point=vT,hT.lineStart=bT,hT.lineEnd=xT,LO=new Mv,WO.polygonStart()},polygonEnd:function(){WO.polygonEnd(),hT.point=pT,hT.lineStart=mT,hT.lineEnd=yT,qO<0?(FO=-(TO=180),OO=-(zO=90)):LO>Fv?zO=90:LO<-Fv&&(OO=-90),jO[0]=FO,jO[1]=TO},sphere:function(){FO=-(TO=180),OO=-(zO=90)}};function pT(e,t){IO.push(jO=[FO=e,TO=e]),t<OO&&(OO=t),t>zO&&(zO=t)}function gT(e,t){var n=hx([e*Pv,t*Pv]);if(PO){var i=gx(PO,n),r=gx([i[1],-i[0],0],i);vx(r),r=dx(r);var o,a=e-NO,s=a>0?1:-1,l=r[0]*Bv*s,c=Lv(a)>180;c^(s*NO<l&&l<s*e)?(o=r[1]*Bv)>zO&&(zO=o):c^(s*NO<(l=(l+360)%360-180)&&l<s*e)?(o=-r[1]*Bv)<OO&&(OO=o):(t<OO&&(OO=t),t>zO&&(zO=t)),c?e<NO?_T(FO,e)>_T(FO,TO)&&(TO=e):_T(e,TO)>_T(FO,TO)&&(FO=e):TO>=FO?(e<FO&&(FO=e),e>TO&&(TO=e)):e>NO?_T(FO,e)>_T(FO,TO)&&(TO=e):_T(e,TO)>_T(FO,TO)&&(FO=e)}else IO.push(jO=[FO=e,TO=e]);t<OO&&(OO=t),t>zO&&(zO=t),PO=n,NO=e}function mT(){hT.point=gT}function yT(){jO[0]=FO,jO[1]=TO,hT.point=pT,PO=null}function vT(e,t){if(PO){var n=e-NO;LO.add(Lv(n)>180?n+(n>0?360:-360):n)}else RO=e,BO=t;WO.point(e,t),gT(e,t)}function bT(){WO.lineStart()}function xT(){vT(RO,BO),WO.lineEnd(),Lv(LO)>Fv&&(FO=-(TO=180)),jO[0]=FO,jO[1]=TO,PO=null}function _T(e,t){return(t-=e)<0?t+360:t}function wT(e,t){return e[0]-t[0]}function kT(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function $T(e){var t,n,i,r,o,a,s;if(zO=TO=-(FO=OO=1/0),IO=[],Cv(e,hT),n=IO.length){for(IO.sort(wT),t=1,o=[i=IO[0]];t<n;++t)kT(i,(r=IO[t])[0])||kT(i,r[1])?(_T(i[0],r[1])>_T(i[0],i[1])&&(i[1]=r[1]),_T(r[0],i[1])>_T(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=_T(i[1],r[0]))>a&&(a=s,FO=r[0],TO=i[1])}return IO=jO=null,FO===1/0||OO===1/0?[[NaN,NaN],[NaN,NaN]]:[[FO,OO],[TO,zO]]}var ET={sphere:eb,point:AT,lineStart:DT,lineEnd:FT,polygonStart:function(){ET.lineStart=OT,ET.lineEnd=TT},polygonEnd:function(){ET.lineStart=DT,ET.lineEnd=FT}};function AT(e,t){e*=Pv;var n=Uv(t*=Pv);ST(n*Uv(e),n*Xv(e),Xv(t))}function ST(e,t,n){++QO,ZO+=(e-ZO)/QO,eT+=(t-eT)/QO,tT+=(n-tT)/QO}function DT(){ET.point=CT}function CT(e,t){e*=Pv;var n=Uv(t*=Pv);uT=n*Uv(e),fT=n*Xv(e),dT=Xv(t),ET.point=MT,ST(uT,fT,dT)}function MT(e,t){e*=Pv;var n=Uv(t*=Pv),i=n*Uv(e),r=n*Xv(e),o=Xv(t),a=jv(Kv((a=fT*o-dT*r)*a+(a=dT*i-uT*o)*a+(a=uT*r-fT*i)*a),uT*i+fT*r+dT*o);JO+=a,nT+=a*(uT+(uT=i)),iT+=a*(fT+(fT=r)),rT+=a*(dT+(dT=o)),ST(uT,fT,dT)}function FT(){ET.point=AT}function OT(){ET.point=zT}function TT(){NT(lT,cT),ET.point=AT}function zT(e,t){lT=e,cT=t,e*=Pv,t*=Pv,ET.point=NT;var n=Uv(t);uT=n*Uv(e),fT=n*Xv(e),dT=Xv(t),ST(uT,fT,dT)}function NT(e,t){e*=Pv;var n=Uv(t*=Pv),i=n*Uv(e),r=n*Xv(e),o=Xv(t),a=fT*o-dT*r,s=dT*i-uT*o,l=uT*r-fT*i,c=Wv(a,s,l),u=Zv(c),f=c&&-u/c;oT.add(f*a),aT.add(f*s),sT.add(f*l),JO+=u,nT+=u*(uT+(uT=i)),iT+=u*(fT+(fT=r)),rT+=u*(dT+(dT=o)),ST(uT,fT,dT)}function RT(e){QO=JO=ZO=eT=tT=nT=iT=rT=0,oT=new Mv,aT=new Mv,sT=new Mv,Cv(e,ET);var t=+oT,n=+aT,i=+sT,r=Wv(t,n,i);return r<Ov&&(t=nT,n=iT,i=rT,JO<Fv&&(t=ZO,n=eT,i=tT),(r=Wv(t,n,i))<Ov)?[NaN,NaN]:[jv(n,t)*Bv,Zv(i/r)*Bv]}var BT=n(19639);function PT(e){return e instanceof BT.v?e:new BT.v(e)}const LT="intersect",IT="union",jT="or",UT="and",qT="_vgsid_",GT=(0,g.ZZ)(qT),WT="E",YT="R",HT="R-E",XT="R-LE",VT="R-RE",KT="index:unit";function QT(e,t){for(var n,i,r=t.fields,o=t.values,a=r.length,s=0;s<a;++s)if((i=r[s]).getter=g.ZZ.getter||(0,g.ZZ)(i.field),n=i.getter(e),(0,g.$P)(n)&&(n=(0,g.Ro)(n)),(0,g.$P)(o[s])&&(o[s]=(0,g.Ro)(o[s])),(0,g.$P)(o[s][0])&&(o[s]=o[s].map(g.Ro)),i.type===WT){if((0,g.cy)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(i.type===YT){if(!(0,g.PK)(n,o[s]))return!1}else if(i.type===VT){if(!(0,g.PK)(n,o[s],!0,!1))return!1}else if(i.type===HT){if(!(0,g.PK)(n,o[s],!1,!1))return!1}else if(i.type===XT&&!(0,g.PK)(n,o[s],!1,!0))return!1;return!0}const JT=(0,Ee.A)(GT),ZT=JT.left,ez=JT.right;var tz={[`${qT}_union`]:function(){const e=new BT.v;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},[`${qT}_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 BT.v(e),n=n.map(PT);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,g.Ro)(t[0]),i=(0,g.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,g.Ro)(t[0]),i=(0,g.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 nz(e,t,n,i){t[0].type!==UO.uS&&(0,g.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,g.se)(t).value)!==LT||(0,g.mQ)(i,a)||(i[a]=n.getData(r).indataRef(n,o)),(0,g.mQ)(i,s)||(i[s]=n.getData(r).tuplesRef())}function iz(e){const t=this.context.data[e];return t?t.values.value:[]}const rz=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},oz=rz("format"),az=rz("timeFormat"),sz=rz("utcFormat"),lz=rz("timeParse"),cz=rz("utcParse"),uz=new Date(2e3,0,1);function fz(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(uz.setYear(2e3),uz.setMonth(e),uz.setDate(t),az.call(this,uz,n)):""}const dz="%";function hz(e,t,n,i){t[0].type!==UO.uS&&(0,g.z3)("First argument to data functions must be a string literal.");const r=t[0].value,o=":"+r;if(!(0,g.mQ)(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(a){}}function pz(e,t,n,i){if(t[0].type===UO.uS)gz(n,i,t[0].value);else for(e in n.scales)gz(n,i,e)}function gz(e,t,n){const i=dz+n;if(!(0,g.mQ)(t,i))try{t[i]=e.scaleRef(n)}catch(r){}}function mz(e,t){if((0,g.Tn)(e))return e;if((0,g.Kg)(e)){const n=t.scales[e];return n&&pf(n.value)?n.value:void 0}}function yz(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=pz,n._range=pz,n._scale=pz;const i=t=>"_["+(t.type===UO.uS?(0,g.r$)(dz+t.value):(0,g.r$)(dz)+"+"+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 vz(e,t){return function(n,i,r){if(n){const t=mz(n,(r||this).context);return t&&t.path[e](i)}return t(i)}}const bz=vz("area",KO),xz=vz("bounds",$T),_z=vz("centroid",RT);function wz(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function kz(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $z(e){const t=(0,Vc.Qh)(e);return.2126*kz(t.r)+.7152*kz(t.g)+.0722*kz(t.b)}function Ez(e,t){return e===t||e!==e&&t!==t||((0,g.cy)(e)?!(!(0,g.cy)(t)||e.length!==t.length)&&function(e,t){for(let n=0,i=e.length;n<i;++n)if(!Ez(e[n],t[n]))return!1;return!0}(e,t):!(!(0,g.Gv)(e)||!(0,g.Gv)(t))&&Az(e,t))}function Az(e,t){for(const n in e)if(!Ez(e[n],t[n]))return!1;return!0}function Sz(e){return t=>Az(e,t)}const Dz={};function Cz(e){return(0,g.cy)(e)||ArrayBuffer.isView(e)?e:null}function Mz(e){return Cz(e)||((0,g.Kg)(e)?e:null)}const Fz=e=>e.data;function Oz(e,t){const n=iz.call(t,e);return n.root&&n.root.lookup||{}}const Tz=()=>"undefined"!==typeof window&&window||null;function zz(e,t,n){if(!e)return[];const[i,r]=e,o=(new Vd).set(i[0],i[1],r[0],r[1]);return wm(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=(0,g.YO)(e.marktype),i=(0,g.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 Nz={random:()=>Xr(),cumulativeNormal:oo,cumulativeLogNormal:fo,cumulativeUniform:vo,densityNormal:ro,densityLogNormal:uo,densityUniform:yo,quantileNormal:ao,quantileLogNormal:ho,quantileUniform:bo,sampleNormal:io,sampleLogNormal:co,sampleUniform:mo,isArray:g.cy,isBoolean:g.Lm,isDate:g.$P,isDefined:e=>void 0!==e,isNumber:g.Et,isObject:g.Gv,isRegExp:g.gd,isString:g.Kg,isTuple:tr,isValid:e=>null!=e&&e===e,toBoolean:g.G4,toDate:e=>(0,g.ay)(e),toNumber:g.Ro,toString:g.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 Mz(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 Cz(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 Mz(e).lastIndexOf(...n)},replace:function(e,t,n){return(0,g.Tn)(n)&&(0,g.z3)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return Cz(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 Mz(e).slice(...n)},flush:g.bX,lerp:g.Cc,merge:function(){const e=[].slice.call(arguments);return e.unshift({}),(0,g.X$)(...e)},pad:g.eV,peek:g.se,pluck:function(e,t){const n=Dz[t]||(Dz[t]=(0,g.ZZ)(t));return(0,g.cy)(e)?e.map(n):n(e)},span:g.Ln,inrange:g.PK,truncate:g.xv,rgb:Vc.Qh,lab:uu,hcl:yu,hsl:Vc.KI,luminance:$z,contrast:function(e,t){const n=$z(e),i=$z(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:qo.A,format:oz,utcFormat:sz,utcParse:cz,utcOffset:mt,utcSequence:bt,timeFormat:az,timeParse:lz,timeOffset:gt,timeSequence:vt,timeUnitSpecifier:je,monthFormat:function(e){return fz.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return fz.call(this,e,1,"%b")},dayFormat:function(e){return fz.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return fz.call(this,0,2+e,"%a")},quarter:g.$G,utcquarter:g.vu,week:We,utcweek:Qe,dayofyear:Ge,utcdayofyear:Ke,warn:function(){return wz(this.context.dataflow,"warn",arguments)},info:function(){return wz(this.context.dataflow,"info",arguments)},debug:function(){return wz(this.context.dataflow,"debug",arguments)},extent:e=>(0,g.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:zz,clampRange:g.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=Tz();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=Tz();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return Pu(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(g.vN).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?_d(n,t=t||ud(e)):e}},panLinear:g.VC,panLog:g.KH,panPow:g.co,panSymlog:g.zy,zoomLinear:g.lL,zoomLog:g.oV,zoomPow:g.SW,zoomSymlog:g.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,c=a.stamp();let u,f,d=s.changes;if(!1===a._trigger||!(l.value.length||t||i))return 0;if((!d||d.stamp<c)&&(s.changes=d=a.changeset(),d.stamp=c,a.runAfter((()=>{s.modified=!0,a.pulse(l,d).run()}),!0,1)),n&&(u=!0===n?g.vN:(0,g.cy)(n)||tr(n)?n:Sz(n),d.remove(u)),t&&d.insert(t),i&&(u=Sz(i),l.value.some(u)?d.remove(u):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,g.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,g.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 Vd).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),zz([[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,c]=n[r];c>t!=s>t&&e<(a-l)*(t-c)/(s-c)+l&&i++}return 1&i}(e.x,e.y,t)))}},Rz=["view","item","group","xy","x","y"],Bz="this.",Pz={},Lz={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${(0,g.r$)("$"+e)}]`,functions:function(e){const t=(0,UO.Cn)(e);Rz.forEach((e=>t[e]="event.vega."+e));for(const n in Nz)t[n]=Bz+n;return(0,g.X$)(t,yz(e,Nz,Pz)),t},constants:UO.AA,visitors:Pz},Iz=(0,UO.Se)(Lz);function jz(e,t,n){return 1===arguments.length?Nz[e]:(Nz[e]=t,n&&(Pz[e]=n),Iz&&(Iz.functions[e]=Bz+e),this)}jz("bandwidth",(function(e,t){const n=mz(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),pz),jz("copy",(function(e,t){const n=mz(e,(t||this).context);return n?n.copy():void 0}),pz),jz("domain",(function(e,t){const n=mz(e,(t||this).context);return n?n.domain():[]}),pz),jz("range",(function(e,t){const n=mz(e,(t||this).context);return n&&n.range?n.range():[]}),pz),jz("invert",(function(e,t,n){const i=mz(e,(n||this).context);return i?(0,g.cy)(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}),pz),jz("scale",(function(e,t,n){const i=mz(e,(n||this).context);return i?i(t):void 0}),pz),jz("gradient",(function(e,t,n,i,r){e=mz(e,(r||this).context);const o=nd(t,n);let a=e.domain(),s=a[0],l=(0,g.se)(a),c=g.D_;return l-s?c=kf(e,s,l):e=(e.interpolator?gf("sequential")().interpolator(e.interpolator()):gf("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,g.se)(a)&&a.push(l)),a.forEach((t=>o.stop(c(t),e(t)))),o}),pz),jz("geoArea",bz,pz),jz("geoBounds",xz,pz),jz("geoCentroid",_z,pz),jz("geoShape",(function(e,t,n){const i=mz(e,(n||this).context);return function(e){return i?i.path.context(e)(t):""}}),pz),jz("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!==UO.uS&&(0,g.z3)("First argument to indata must be a string literal."),t[1].type!==UO.uS&&(0,g.z3)("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,a="@"+o;(0,g.mQ)(a,i)||(i[a]=n.getData(r).indataRef(n,o))})),jz("data",iz,hz),jz("treePath",(function(e,t,n){const i=Oz(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(Fz):void 0}),hz),jz("treeAncestors",(function(e,t){const n=Oz(e,this)[t];return n?n.ancestors().map(Fz):void 0}),hz),jz("vlSelectionTest",(function(e,t,n){for(var i,r,o,a,s,l=this.context.data[e],c=l?l.values.value:[],u=l?l[KT]&&l[KT].value:void 0,f=n===LT,d=c.length,h=0;h<d;++h)if(i=c[h],u&&f){if(-1===(o=(r=r||{})[a=i.unit]||0))continue;if(s=QT(t,i),r[a]=s?-1:++o,s&&1===u.size)return!0;if(!s&&o===u.get(a).count)return!1}else if(f^(s=QT(t,i)))return s;return d&&f}),nz),jz("vlSelectionIdTest",(function(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[KT]&&i[KT].value:void 0,a=n===LT,s=GT(t),l=ZT(r,s);if(l===r.length)return!1;if(GT(r[l])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(ez(r,s)-l<o.size)return!1}return!0}),nz),jz("vlSelectionResolve",(function(e,t,n,i){for(var r,o,a,s,l,c,u,f,d,h,p,m,y=this.context.data[e],v=y?y.values.value:[],b={},x={},_={},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,m=o.length;p<m;++p)l=o[p],f=(u=b[l.field]||(b[l.field]={}))[s]||(u[s]=[]),_[l.field]=d=l.type.charAt(0),h=tz[`${d}_union`],u[s]=h(f,(0,g.YO)(a[p]));n&&(f=x[s]||(x[s]=[])).push((0,g.YO)(a).reduce(((e,t,n)=>(e[o[n].field]=t,e)),{}))}else l=qT,c=GT(r),(f=(u=b[l]||(b[l]={}))[s]||(u[s]=[])).push(c),n&&(f=x[s]||(x[s]=[])).push({[qT]:c});if(t=t||IT,b[qT]?b[qT]=tz[`${qT}_${t}`](...Object.values(b[qT])):Object.keys(b).forEach((e=>{b[e]=Object.keys(b[e]).map((t=>b[e][t])).reduce(((n,i)=>void 0===n?i:tz[`${_[e]}_${t}`](n,i)))})),v=Object.keys(x),n&&v.length){b[i?"vlPoint":"vlMulti"]=t===IT?{[jT]:v.reduce(((e,t)=>(e.push(...x[t]),e)),[])}:{[UT]:v.map((e=>({[jT]:x[e]})))}}return b}),nz),jz("vlSelectionTuples",(function(e,t){return e.map((e=>(0,g.X$)(t.fields?{values:t.fields.map((t=>(t.getter||(t.getter=(0,g.ZZ)(t.field)))(e.datum)))}:{[qT]:GT(e.datum)},t)))}));const Uz=(0,g.M1)(["rule"]),qz=(0,g.M1)(["group","image","rect"]);function Gz(e){return(e+"").toLowerCase()}function Wz(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}var Yz={operator:(e,t)=>Wz(e,["_"],t.code),parameter:(e,t)=>Wz(e,["datum","_"],t.code),event:(e,t)=>Wz(e,["event"],t.code),handler:(e,t)=>Wz(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,g.r$)(o)+"]";r+=`$=${i[o].code};if(${e}!==$)${e}=$,m=1;`}return r+=function(e,t){let n="";return Uz[t]||(e.x2&&(e.x?(qz[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?(qz[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;",Wz(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(g.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 Hz(e,t,n){if(!e||!(0,g.Gv)(e))return e;for(let i,r=0,o=Xz.length;r<o;++r)if(i=Xz[r],(0,g.mQ)(e,i.key))return i.parse(e,t,n);return e}var Xz=[{key:"$ref",parse:function(e,t){return t.get(e.$ref)||(0,g.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,g.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,g.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,g.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,g.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,g.YO)(e.$compare).map((e=>e&&e.$tupleid?nr:e));return t.fn[n]||(t.fn[n]=(0,g.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 Vz={skip:!0};function Kz(e,t,n,i){return new Qz(e,t,n,i)}function Qz(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||Yz,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Jz(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 Zz(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}Qz.prototype=Jz.prototype={fork(){const e=new Jz(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"===Gz(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[Gz(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"===Gz(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,g.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,g.cy)(r)?r.map((e=>Hz(e,n,t))):Hz(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,g.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,g.Gv)(i=e.source)?i.$ref:i,r=n.get(i),o=e.update,a=void 0;r||(0,g.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],Vz)})),Object.keys(i||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(g.vN).insert(i[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const i=t.subcontext[n];i&&i.setState(e)}))}};const eN="default";function tN(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 nN(e,t){var n=e._runtime.data;return(0,g.mQ)(n,t)||(0,g.z3)("Unrecognized data set: "+t),n[t]}function iN(e,t){cr(t)||(0,g.z3)("Second argument to changes must be a changeset.");const n=nN(this,e);return n.modified=!0,this.pulse(n.input,t)}function rN(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function oN(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function aN(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function sN(e,t,n){var i,r,o=e._renderer,a=o&&o.canvas();return a&&(r=aN(e),(i=rg(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,g.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,g.dY)(e),item:(0,g.dY)(t||{}),group:r,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,i),t}const lN="view",cN={trap:!1};function uN(e,t,n,i){e._eventListeners.push({type:n,sources:(0,g.YO)(t),handler:i})}function fN(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return!(!1===i||(0,g.Gv)(i)&&!i[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function dN(e){return e.item}function hN(e){return e.item.mark.source}function pN(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function gN(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 mN="vega-bind",yN="vega-bind-name",vN="vega-bind-radio";function bN(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),uN(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 xN(e,t,n,i){const r=i.signal(n.signal),o=gN("div",{class:mN}),a="radio"===n.input?o:o.appendChild(gN("label"));a.appendChild(gN("span",{class:yN},n.name||n.signal)),t.appendChild(o);let s=_N;switch(n.input){case"checkbox":s=wN;break;case"select":s=kN;break;case"radio":s=$N;break;case"range":s=EN}s(e,a,n,r)}function _N(e,t,n,i){const r=gN("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 wN(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=gN("input",r);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function kN(e,t,n,i){const r=gN("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};AN(e,i)&&(n.selected=!0),r.appendChild(gN("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(AN(n.options[t],e))return void(r.selectedIndex=t)}}function $N(e,t,n,i){const r=gN("span",{class:vN}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map(((t,a)=>{const s={type:"radio",name:n.signal,value:t};AN(t,i)&&(s.checked=!0);const l=gN("input",s);l.addEventListener("change",(()=>e.update(t)));const c=gN("label",{},(o[a]||t)+"");return c.prepend(l),r.appendChild(c),l})),e.set=t=>{const n=e.elements,i=n.length;for(let e=0;e<i;++e)AN(n[e].value,t)&&(n[e].checked=!0)}}function EN(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=gN("input",{type:"range",name:n.signal,min:o,max:r,step:a});s.value=i;const l=gN("span",{},+i);t.appendChild(s),t.appendChild(l);const c=()=>{l.textContent=s.value,e.update(+s.value)};s.addEventListener("input",c),s.addEventListener("change",c),e.elements=[s],e.set=e=>{s.value=e,l.textContent=e}}function AN(e,t){return e===t||e+""===t+""}function SN(e,t,n,i,r,o){return(t=t||new i(e.loader())).initialize(n,rN(e),oN(e),aN(e),r,o).background(e.background())}function DN(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function CN(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 MN=e=>+e||0;function FN(e){return(0,g.Gv)(e)?{top:MN(e.top),bottom:MN(e.bottom),left:MN(e.left),right:MN(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(MN(e))}async function ON(e,t,n,i){const r=_m(t),o=r&&r.headless;return o||(0,g.z3)("Unrecognized renderer type: "+t),await e.runAsync(),SN(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}var TN="width",zN="height",NN="padding",RN={skip:!0};function BN(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===NN?i.left+i.right:0)}function PN(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===NN?i.top+i.bottom:0)}function LN(e,t){return t.modified&&(0,g.cy)(t.input.value)&&!e.startsWith("_:vega:_")}function IN(e,t){return!("parent"===e||t instanceof Rr.proxy)}function jN(e,t,n,i){const r=e.element();r&&r.setAttribute("title",function(e){return null==e?"":(0,g.cy)(e)?UN(e):(0,g.Gv)(e)&&!(0,g.$P)(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+((0,g.cy)(n)?UN(n):qN(n))})).join("\n")):e+"";var t}(i))}function UN(e){return"["+e.map(qN).join(", ")+"]"}function qN(e){return(0,g.cy)(e)?"[\u2026]":(0,g.Gv)(e)&&!(0,g.$P)(e)?"{\u2026}":e}function GN(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,g.X$)({},e.locale,t.locale);n.locale(_i(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||bm.Canvas,n._scenegraph=new Qp;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||jN,n._redraw=!0,n._handler=(new $g).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=(0,g.X$)({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{(0,g.cy)(e[t])&&(e[t]=(0,g.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 Kz(e,Rr,Nz,n).parse(t)}(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:(0,g.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=BN(n,n._width),n._viewHeight=PN(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[TN],i=t[zN],r=t[NN];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=BN(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=PN(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:eN,item:null}));e.on(e.events("view","pointermove"),t,((e,n)=>{const i=t.value,r=i?(0,g.Kg)(i)?i:i.user:eN,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,g.Kg)(n)||(i=n.item,n=n.user),tN(e,n&&n!==eN?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 WN(e,t){return(0,g.mQ)(e._signals,t)?e._signals[t]:(0,g.z3)("Unrecognized signal name: "+(0,g.r$)(t))}function YN(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function HN(e,t,n,i){let r=YN(n,i);return r||(r=DN(e,(()=>i(t,n.value))),r.handler=i,e.on(n,null,r)),e}function XN(e,t,n){const i=YN(t,n);return i&&t._targets.remove(i),e}function VN(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function KN(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function QN(){return 0}function JN(e){return e instanceof BT.v?e:new BT.v(e)}(0,g.B)(GN,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=aN(e),n=rN(e),i=oN(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&&Zz(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=WN(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",FN(e)):FN(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?(_m(e)||(0,g.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(WN(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(TN,n,RN),a._resizeWidth.skip(!0)),a.height()!==i&&(s=1,a.signal(zN,i,RN),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=DN(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 HN(this,e,WN(this,e),t)},removeSignalListener(e,t){return XN(this,WN(this,e),t)},addDataListener(e,t){return HN(this,e,nN(this,e).values,t)},removeDataListener(e,t){return XN(this,nN(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=tN(this,null);this._globalCursor=!!e,t&&tN(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 Tw.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,Tw.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===lN&&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(sN(r,n,i))}))};if("timer"===e)fN(r,"timer",t)&&r.timer(a,t);else if(e===lN)fN(r,"view",t)&&r.addEventListener(t,a,cN);else if("window"===e?fN(r,"window",t)&&"undefined"!==typeof window&&(i=[window]):"undefined"!==typeof document&&fN(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);uN(r,i,t,a)}else r.warn("Can not resolve event source: "+e);return o},finalize:function(){var e,t,n,i=this._tooltip,r=this._timers,o=this._eventListeners;for(e=r.length;--e>=0;)r[e].stop();for(e=o.length;--e>=0;)for(t=(n=o[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return i&&i.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","pointerover",dN),hN,pN(e)),this.on(this.events("view","pointerout",dN),hN,pN(t)),this},data:function(e,t){return arguments.length<2?nN(this,e).values.value:iN.call(this,e,ur().remove(g.vN).insert(t))},change:iN,insert:function(e,t){return iN.call(this,e,ur().insert(t))},remove:function(e,t){return iN.call(this,e,ur().remove(t))},scale:function(e){var t=this._runtime.scales;return(0,g.mQ)(t,e)||(0,g.z3)("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=_m(i);e=n._el=e?CN(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),Zz(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+i);const a=o.handler||$g,s=e?o.renderer:o.headless;return n._renderer=s?SN(n,n._renderer,e,s):null,n._handler=function(e,t,n,i){const r=new i(e.loader(),DN(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,aN(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=CN(n,t,!0):e.appendChild(gN("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==r&&(e.element=CN(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,g.sg)(i.debounce,r.update))),(null==i.input&&i.element?bN:xN)(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!==bm.Canvas&&e!==bm.SVG&&e!==bm.PNG&&(0,g.z3)("Unrecognized image type: "+e);const n=await ON(this,e,t);return e===bm.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 ON(this,bm.Canvas,e,t)).canvas()},toSVG:async function(e){return(await ON(this,bm.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:LN,signals:IN,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()}}});const ZN=Symbol("vega_selection_getter");function eR(e){return e.getter&&e.getter[ZN]||(e.getter=(0,g.ZZ)(e.field),e.getter[ZN]=!0),e.getter}const tR="intersect",nR="union",iR="or",rR="and",oR="_vgsid_",aR=(0,g.ZZ)(oR),sR="E",lR="R",cR="R-E",uR="R-LE",fR="R-RE",dR="index:unit";function hR(e,t){for(var n,i,r=t.fields,o=t.values,a=r.length,s=0;s<a;++s)if(n=eR(i=r[s])(e),(0,g.$P)(n)&&(n=(0,g.Ro)(n)),(0,g.$P)(o[s])&&(o[s]=(0,g.Ro)(o[s])),(0,g.cy)(o[s])&&(0,g.$P)(o[s][0])&&(o[s]=o[s].map(g.Ro)),i.type===sR){if((0,g.cy)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(i.type===lR){if(!(0,g.PK)(n,o[s]))return!1}else if(i.type===fR){if(!(0,g.PK)(n,o[s],!0,!1))return!1}else if(i.type===cR){if(!(0,g.PK)(n,o[s],!1,!1))return!1}else if(i.type===uR&&!(0,g.PK)(n,o[s],!1,!0))return!1;return!0}const pR=function(e){let t,n,i;function r(e,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=VN,n=(t,n)=>VN(e(t),n),i=(t,n)=>e(t)-n):(t=e===VN||e===KN?e:QN,n=e,i=e),{left:r,center:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=r(e,t,n,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length)-1);return o>n&&i(e[o-1],t)>-i(e[o],t)?o-1:o},right:function(e,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}(aR),gR=pR.left,mR=pR.right;var yR={[`${oR}_union`]:function(){const e=new BT.v;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},[`${oR}_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 BT.v(e),n=n.map(JN);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,g.Ro)(t[0]),i=(0,g.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,g.Ro)(t[0]),i=(0,g.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 vR(e,t,n,i){t[0].type!==UO.uS&&(0,g.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,g.se)(t).value)!==tR||(0,g.mQ)(i,a)||(i[a]=n.getData(r).indataRef(n,o)),(0,g.mQ)(i,s)||(i[s]=n.getData(r).tuplesRef())}function bR(e){const t=this.context.data[e];return t?t.values.value:[]}const xR=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},_R=xR("format"),wR=xR("timeFormat"),kR=xR("utcFormat"),$R=xR("timeParse"),ER=xR("utcParse"),AR=new Date(2e3,0,1);function SR(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(AR.setYear(2e3),AR.setMonth(e),AR.setDate(t),wR.call(this,AR,n)):""}const DR="%",CR="$";function MR(e,t,n,i){t[0].type!==UO.uS&&(0,g.z3)("First argument to data functions must be a string literal.");const r=t[0].value,o=":"+r;if(!(0,g.mQ)(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(a){}}function FR(e,t,n,i){if(t[0].type===UO.uS)OR(n,i,t[0].value);else for(e in n.scales)OR(n,i,e)}function OR(e,t,n){const i=DR+n;if(!(0,g.mQ)(t,i))try{t[i]=e.scaleRef(n)}catch(r){}}function TR(e,t){if((0,g.Tn)(e))return e;if((0,g.Kg)(e)){const n=t.scales[e];return n&&pf(n.value)?n.value:void 0}}function zR(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=FR,n._range=FR,n._scale=FR;const i=t=>"_["+(t.type===UO.uS?(0,g.r$)(DR+t.value):(0,g.r$)(DR)+"+"+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 NR(e,t){return function(n,i,r){if(n){const t=TR(n,(r||this).context);return t&&t.path[e](i)}return t(i)}}const RR=NR("area",KO),BR=NR("bounds",$T),PR=NR("centroid",RT);function LR(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function IR(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function jR(e){const t=(0,Vc.Qh)(e);return.2126*IR(t.r)+.7152*IR(t.g)+.0722*IR(t.b)}function UR(e,t){return e===t||e!==e&&t!==t||((0,g.cy)(e)?!(!(0,g.cy)(t)||e.length!==t.length)&&function(e,t){for(let n=0,i=e.length;n<i;++n)if(!UR(e[n],t[n]))return!1;return!0}(e,t):!(!(0,g.Gv)(e)||!(0,g.Gv)(t))&&qR(e,t))}function qR(e,t){for(const n in e)if(!UR(e[n],t[n]))return!1;return!0}function GR(e){return t=>qR(e,t)}const WR={};function YR(e){return(0,g.cy)(e)||ArrayBuffer.isView(e)?e:null}function HR(e){return YR(e)||((0,g.Kg)(e)?e:null)}const XR=e=>e.data;function VR(e,t){const n=bR.call(t,e);return n.root&&n.root.lookup||{}}const KR=()=>"undefined"!==typeof window&&window||null;function QR(e,t,n){if(!e)return[];const[i,r]=e,o=(new Vd).set(i[0],i[1],r[0],r[1]);return wm(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=(0,g.YO)(e.marktype),i=(0,g.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 JR={random:()=>Xr(),cumulativeNormal:oo,cumulativeLogNormal:fo,cumulativeUniform:vo,densityNormal:ro,densityLogNormal:uo,densityUniform:yo,quantileNormal:ao,quantileLogNormal:ho,quantileUniform:bo,sampleNormal:io,sampleLogNormal:co,sampleUniform:mo,isArray:g.cy,isBoolean:g.Lm,isDate:g.$P,isDefined:e=>void 0!==e,isNumber:g.Et,isObject:g.Gv,isRegExp:g.gd,isString:g.Kg,isTuple:tr,isValid:e=>null!=e&&e===e,toBoolean:g.G4,toDate:e=>(0,g.ay)(e),toNumber:g.Ro,toString:g.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 HR(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 YR(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 HR(e).lastIndexOf(...n)},replace:function(e,t,n){return(0,g.Tn)(n)&&(0,g.z3)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return YR(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 HR(e).slice(...n)},flush:g.bX,lerp:g.Cc,merge:function(){const e=[].slice.call(arguments);return e.unshift({}),(0,g.X$)(...e)},pad:g.eV,peek:g.se,pluck:function(e,t){const n=WR[t]||(WR[t]=(0,g.ZZ)(t));return(0,g.cy)(e)?e.map(n):n(e)},span:g.Ln,inrange:g.PK,truncate:g.xv,rgb:Vc.Qh,lab:uu,hcl:yu,hsl:Vc.KI,luminance:jR,contrast:function(e,t){const n=jR(e),i=jR(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:qo.A,format:_R,utcFormat:kR,utcParse:ER,utcOffset:mt,utcSequence:bt,timeFormat:wR,timeParse:$R,timeOffset:gt,timeSequence:vt,timeUnitSpecifier:je,monthFormat:function(e){return SR.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return SR.call(this,e,1,"%b")},dayFormat:function(e){return SR.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return SR.call(this,0,2+e,"%a")},quarter:g.$G,utcquarter:g.vu,week:We,utcweek:Qe,dayofyear:Ge,utcdayofyear:Ke,warn:function(){return LR(this.context.dataflow,"warn",arguments)},info:function(){return LR(this.context.dataflow,"info",arguments)},debug:function(){return LR(this.context.dataflow,"debug",arguments)},extent:e=>(0,g.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:QR,clampRange:g.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=KR();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=KR();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return Pu(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(g.vN).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?_d(n,t=t||ud(e)):e}},panLinear:g.VC,panLog:g.KH,panPow:g.co,panSymlog:g.zy,zoomLinear:g.lL,zoomLog:g.oV,zoomPow:g.SW,zoomSymlog:g.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,c=a.stamp();let u,f,d=s.changes;if(!1===a._trigger||!(l.value.length||t||i))return 0;if((!d||d.stamp<c)&&(s.changes=d=a.changeset(),d.stamp=c,a.runAfter((()=>{s.modified=!0,a.pulse(l,d).run()}),!0,1)),n&&(u=!0===n?g.vN:(0,g.cy)(n)||tr(n)?n:GR(n),d.remove(u)),t&&d.insert(t),i&&(u=GR(i),l.value.some(u)?d.remove(u):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,g.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,g.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 Vd).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),QR([[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,c]=n[r];c>t!=s>t&&e<(a-l)*(t-c)/(s-c)+l&&i++}return 1&i}(e.x,e.y,t)))}},ZR=["view","item","group","xy","x","y"],eB="this.",tB={},nB={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${(0,g.r$)(CR+e)}]`,functions:function(e){const t=(0,UO.Cn)(e);ZR.forEach((e=>t[e]="event.vega."+e));for(const n in JR)t[n]=eB+n;return(0,g.X$)(t,zR(e,JR,tB)),t},constants:UO.AA,visitors:tB},iB=(0,UO.Se)(nB);function rB(e,t,n){return 1===arguments.length?JR[e]:(JR[e]=t,n&&(tB[e]=n),iB&&(iB.functions[e]=eB+e),this)}function oB(e,t){const n={};let i;try{e=(0,g.Kg)(e)?e:(0,g.r$)(e)+"",i=(0,UO.YK)(e)}catch(o){(0,g.z3)("Expression parse error: "+e)}i.visit((e=>{if(e.type!==UO.DG)return;const i=e.callee.name,r=nB.visitors[i];r&&r(i,e.arguments,t,n)}));const r=iB(i);return r.globals.forEach((e=>{const i=CR+e;!(0,g.mQ)(n,i)&&t.getSignal(e)&&(n[i]=t.signalRef(e))})),{$expr:(0,g.X$)({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}rB("bandwidth",(function(e,t){const n=TR(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),FR),rB("copy",(function(e,t){const n=TR(e,(t||this).context);return n?n.copy():void 0}),FR),rB("domain",(function(e,t){const n=TR(e,(t||this).context);return n?n.domain():[]}),FR),rB("range",(function(e,t){const n=TR(e,(t||this).context);return n&&n.range?n.range():[]}),FR),rB("invert",(function(e,t,n){const i=TR(e,(n||this).context);return i?(0,g.cy)(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}),FR),rB("scale",(function(e,t,n){const i=TR(e,(n||this).context);return i?i(t):void 0}),FR),rB("gradient",(function(e,t,n,i,r){e=TR(e,(r||this).context);const o=nd(t,n);let a=e.domain(),s=a[0],l=(0,g.se)(a),c=g.D_;return l-s?c=kf(e,s,l):e=(e.interpolator?gf("sequential")().interpolator(e.interpolator()):gf("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,g.se)(a)&&a.push(l)),a.forEach((t=>o.stop(c(t),e(t)))),o}),FR),rB("geoArea",RR,FR),rB("geoBounds",BR,FR),rB("geoCentroid",PR,FR),rB("geoShape",(function(e,t,n){const i=TR(e,(n||this).context);return function(e){return i?i.path.context(e)(t):""}}),FR),rB("geoScale",(function(e,t){const n=TR(e,(t||this).context);return n&&n.scale()}),FR),rB("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!==UO.uS&&(0,g.z3)("First argument to indata must be a string literal."),t[1].type!==UO.uS&&(0,g.z3)("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,a="@"+o;(0,g.mQ)(a,i)||(i[a]=n.getData(r).indataRef(n,o))})),rB("data",bR,MR),rB("treePath",(function(e,t,n){const i=VR(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(XR):void 0}),MR),rB("treeAncestors",(function(e,t){const n=VR(e,this)[t];return n?n.ancestors().map(XR):void 0}),MR),rB("vlSelectionTest",(function(e,t,n){for(var i,r,o,a,s,l=this.context.data[e],c=l?l.values.value:[],u=l?l[dR]&&l[dR].value:void 0,f=n===tR,d=c.length,h=0;h<d;++h)if(i=c[h],u&&f){if(-1===(o=(r=r||{})[a=i.unit]||0))continue;if(s=hR(t,i),r[a]=s?-1:++o,s&&1===u.size)return!0;if(!s&&o===u.get(a).count)return!1}else if(f^(s=hR(t,i)))return s;return d&&f}),vR),rB("vlSelectionIdTest",(function(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[dR]&&i[dR].value:void 0,a=n===tR,s=aR(t),l=gR(r,s);if(l===r.length)return!1;if(aR(r[l])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(mR(r,s)-l<o.size)return!1}return!0}),vR),rB("vlSelectionResolve",(function(e,t,n,i){for(var r,o,a,s,l,c,u,f,d,h,p,m,y=this.context.data[e],v=y?y.values.value:[],b={},x={},_={},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,m=o.length;p<m;++p)l=o[p],f=(u=b[l.field]||(b[l.field]={}))[s]||(u[s]=[]),_[l.field]=d=l.type.charAt(0),h=yR[`${d}_union`],u[s]=h(f,(0,g.YO)(a[p]));n&&(f=x[s]||(x[s]=[])).push((0,g.YO)(a).reduce(((e,t,n)=>(e[o[n].field]=t,e)),{}))}else l=oR,c=aR(r),(f=(u=b[l]||(b[l]={}))[s]||(u[s]=[])).push(c),n&&(f=x[s]||(x[s]=[])).push({[oR]:c});if(t=t||nR,b[oR]?b[oR]=yR[`${oR}_${t}`](...Object.values(b[oR])):Object.keys(b).forEach((e=>{b[e]=Object.keys(b[e]).map((t=>b[e][t])).reduce(((n,i)=>void 0===n?i:yR[`${_[e]}_${t}`](n,i)))})),v=Object.keys(x),n&&v.length){b[i?"vlPoint":"vlMulti"]=t===nR?{[iR]:v.reduce(((e,t)=>(e.push(...x[t]),e)),[])}:{[rR]:v.map((e=>({[iR]:x[e]})))}}return b}),vR),rB("vlSelectionTuples",(function(e,t){return e.map((e=>(0,g.X$)(t.fields?{values:t.fields.map((t=>eR(t)(e.datum)))}:{[oR]:aR(e.datum)},t)))}));var aB=n(60646);const sB="linear",lB="log",cB="pow",uB="sqrt",fB="symlog",dB="time",hB="utc",pB="sequential",gB="diverging",mB="quantile",yB="quantize",vB="threshold",bB="continuous",xB="discrete",_B="discretizing",wB="interpolating",kB="temporal";function $B(){const e=(0,Oc.A)().unknown(void 0),t=e.domain,n=e.range;let i,r,o=[0,1],a=!1,s=0,l=0,c=.5;function u(){const e=t().length,u=o[1]<o[0],f=o[1-u],d=function(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}(e,s,l);let h=o[u-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(e-s))*c,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=(0,qo.A)(e).map((e=>h+i*e));return n(u?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),u()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],u()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,u()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(a=!!e,u()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,u()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),u()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},e.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),u()):c},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,c,u,f=+e[0],d=+e[1];return f!==f||d!==d||(d<f&&(u=f,f=d,d=u),d<a[0]||f>o[1-i])?void 0:(l=Math.max(0,(0,Gl.Jj)(a,f)-1),c=f===d?l:(0,Gl.Jj)(a,d)-1,f-a[l]>r+1e-10&&++l,i&&(u=l,l=s-c,c=s-u),l>c?void 0:t().slice(l,c+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return $B().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(c)},u()}function EB(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return EB(t())},e}var AB=Array.prototype.map;const SB=Array.prototype.slice;const DB=new Map,CB=Symbol("vega_scale");function MB(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],c=-1;for(l<s&&(r=s,s=l,l=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=l&&(c<0&&(c=o),i=o);if(!(c<0))return s=e.invertExtent(n[c]),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,function(e){return e[CB]=!0,e}(n)};return i.metadata=(0,g.M1)((0,g.YO)(n)),i}function FB(e,t,n){return arguments.length>1?(DB.set(e,MB(e,t,n)),this):OB(e)?DB.get(e):void 0}function OB(e){return DB.has(e)}function TB(e,t){const n=DB.get(e);return n&&n.metadata[t]}function zB(e){return TB(e,xB)}function NB(e){return TB(e,_B)}function RB(e){return TB(e,mB)}FB("identity",Hl),FB(sB,Wl.A,bB),FB(lB,Xl.A,[bB,lB]),FB(cB,Vl.Ay,bB),FB(uB,Vl.RZ,bB),FB(fB,tc,bB),FB(dB,fc,[bB,kB]),FB(hB,dc,[bB,kB]),FB(pB,yc,[bB,wB]),FB(`${pB}-${sB}`,yc,[bB,wB]),FB(`${pB}-${lB}`,vc,[bB,wB,lB]),FB(`${pB}-${cB}`,xc,[bB,wB]),FB(`${pB}-${uB}`,_c,[bB,wB]),FB(`${pB}-${fB}`,bc,[bB,wB]),FB(`${gB}-${sB}`,$c,[bB,wB]),FB(`${gB}-${lB}`,Ec,[bB,wB,lB]),FB(`${gB}-${cB}`,Sc,[bB,wB]),FB(`${gB}-${uB}`,Dc,[bB,wB]),FB(`${gB}-${fB}`,Ac,[bB,wB]),FB(mB,Cc.A,[_B,mB]),FB(yB,Mc.A,_B),FB(vB,Fc.A,_B),FB("bin-ordinal",(function e(){let t=[],n=[];function i(e){return null==e||e!==e?void 0:n[((0,Gl.Ay)(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return AB.call(e,g.Ro)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=SB.call(e),i):n.slice()},i.tickFormat=function(e,n){return(0,Tc.A)(t[0],(0,g.se)(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[xB,_B]),FB("ordinal",Oc.A,xB),FB("band",$B,xB),FB("point",(function(){return EB($B().paddingInner(1))}),xB);function BB(e,t,n){return wc(function(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}(t||"rgb",n),e)}function PB(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 LB(e,t){for(const n in e)jB(n,t(e[n]))}const IB={};function jB(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(IB[e]=t,this):IB[e]}LB({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},PB),LB({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=>BB(PB(e))));function UB(e){return(0,g.Gv)(e)?e:{type:e||"pad"}}const qB=e=>+e||0,GB=e=>({top:e,bottom:e,left:e,right:e});function WB(e){return(0,g.Gv)(e)?e.signal?e:{top:qB(e.top),bottom:qB(e.bottom),left:qB(e.left),right:qB(e.right)}:GB(qB(e))}const YB=e=>(0,g.Gv)(e)&&!(0,g.cy)(e)?(0,g.X$)({},e):{value:e};function HB(e,t,n,i){if(null!=n){return(0,g.Gv)(n)&&!(0,g.cy)(n)||(0,g.cy)(n)&&n.length&&(0,g.Gv)(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1}return 0}function XB(e,t,n){for(const i in t)HB(e,i,t[i]);for(const i in n)HB(e,i,n[i],"update")}function VB(e,t,n){for(const i in t)n&&(0,g.mQ)(n,i)||(e[i]=(0,g.X$)(e[i]||{},t[i]));return e}function KB(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const QB="mark",JB="frame",ZB="scope",eP="axis",tP="axis-domain",nP="axis-grid",iP="axis-label",rP="axis-tick",oP="axis-title",aP="legend",sP="legend-band",lP="legend-entry",cP="legend-gradient",uP="legend-label",fP="legend-symbol",dP="legend-title",hP="title",pP="title-text",gP="title-subtitle";function mP(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const yP=e=>(0,g.Kg)(e)?(0,g.r$)(e):e.signal?`(${e.signal})`:_P(e);function vP(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:(0,g.r$)(e)));for(;t.length&&null==(0,g.se)(t);)t.pop();return t.unshift(yP(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?bP("hcl",e.h,e.c,e.l):e.h||e.s?bP("hsl",e.h,e.s,e.l):e.l||e.a?bP("lab",e.l,e.a,e.b):e.r||e.g||e.b?bP("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?_P(e.field):void 0!==e.value?(0,g.r$)(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=yP(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?"":"*"+xP(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},${xP(e.exponent)})`),null!=e.mult&&(t+=`*${xP(e.mult)}`),null!=e.offset&&(t+=`+${xP(e.offset)}`),e.round&&(t=`round(${t})`),t}const bP=(e,t,n,i)=>`(${e}(${[t,n,i].map(vP).join(",")})+'')`;function xP(e){return(0,g.Gv)(e)?"("+vP(e)+")":e}function _P(e){return wP((0,g.Gv)(e)?e:{datum:e})}function wP(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,g.z3)("Invalid field reference: "+(0,g.r$)(e));return e.signal||(i=(0,g.Kg)(i)?(0,g.iv)(i).map(g.r$).join("]["):wP(i)),t+"["+i+"]"}function kP(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,c,u;for(l in l="lineBreak","text"!==t||null==r[l]||KB(l,e)||mP(o,l,r[l]),("legend"==n||String(n).startsWith("axis"))&&(n=null),u=n===JB?r.group:n===QB?(0,g.X$)({},r.mark,r[t]):null,u)c=KB(l,e)||("fill"===l||"stroke"===l)&&(KB("fill",e)||KB("stroke",e)),c||mP(o,l,u[l]);for(l in(0,g.YO)(i).forEach((t=>{const n=r.style&&r.style[t];for(const i in n)KB(i,e)||mP(o,i,n[i])})),e=(0,g.X$)({},e),o)u=o[l],u.signal?(s=s||{})[l]=u:a[l]=u;return e.enter=(0,g.X$)(a,e.enter),s&&(e.update=(0,g.X$)(s,e.update)),e}(e,t,n,i,r.config);for(const s in e)a[s]=$P(e[s],t,o,r);return o}function $P(e,t,n,i){const r={},o={};for(const s in e)null!=e[s]&&(r[s]=EP((a=e[s],(0,g.cy)(a)?function(e){let t="";return e.forEach((e=>{const n=vP(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===(0,g.se)(t)&&(t+="null"),t}(a):vP(a)),i,n,o));var a;return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function EP(e,t,n,i){const r=oB(e,t);return r.$fields.forEach((e=>i[e]=1)),(0,g.X$)(n,r.$params),r.$expr}const AP="outer",SP=["value","update","init","react","bind"];function DP(e,t){(0,g.z3)(e+' for "outer" push: '+(0,g.r$)(t))}function CP(e,t){const n=e.name;if(e.push===AP)t.signals[n]||DP("No prior signal definition",n),SP.forEach((t=>{void 0!==e[t]&&DP("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 MP(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function FP(e,t,n,i){return new MP(e,t,n,i)}function OP(e,t){return FP("operator",e,t)}function TP(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function zP(e,t){return t?{$field:e,$name:t}:{$field:e}}const NP=zP("key");function RP(e,t){return{$compare:e,$order:t}}const BP="descending";function PP(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const LP="scope",IP="view";function jP(e){return e&&e.signal}function UP(e){if(jP(e))return!0;if((0,g.Gv)(e))for(const t in e)if(UP(e[t]))return!0;return!1}function qP(e,t){return null!=e?e:t}function GP(e){return e&&e.signal||e}const WP="timer";function YP(e,t){return(e.merge?HP:e.stream?XP:e.type?VP:(0,g.z3)("Invalid stream specification: "+(0,g.r$)(e)))(e,t)}function HP(e,t){const n=e.merge.map((e=>YP(e,t))),i=KP({merge:n},e,t);return t.addStream(i).id}function XP(e,t){const n=KP({stream:YP(e.stream,t)},e,t);return t.addStream(n).id}function VP(e,t){let n;e.type===WP?(n=t.event(WP,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function(e){return e===LP?IP:e||IP}(e.source),e.type);const i=KP({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function KP(e,t,n){let i=t.between;return i&&(2!==i.length&&(0,g.z3)('Stream "between" parameter must have 2 entries: '+(0,g.r$)(t)),e.between=[YP(i[0],n),YP(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===LP&&i.push("inScope(event.item)"),i.length&&(e.filter=oB("("+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 QP={code:"_.$value",ast:{type:"Identifier",value:"value"}};function JP(e,t,n){const i=e.encode,r={target:n};let o=e.events,a=e.update,s=[];o||(0,g.z3)("Signal update missing events specification."),(0,g.Kg)(o)&&(o=(0,aB.P)(o,t.isSubscope()?LP:IP)),o=(0,g.YO)(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[ZP(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=i&&(a&&(0,g.z3)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,g.r$)(i)+")"),r.update=(0,g.Kg)(a)?oB(a,t):null!=a.expr?oB(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:QP,$params:{$value:t.signalRef(a.signal)}}:(0,g.z3)("Invalid signal update specification."),e.force&&(r.options={force:!0}),s.forEach((e=>t.addUpdate((0,g.X$)(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):YP(e,t)}}(e,t),r))))}function ZP(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const eL=e=>(t,n,i)=>FP(e,n,t||void 0,i),tL=eL("aggregate"),nL=eL("axisticks"),iL=eL("bound"),rL=eL("collect"),oL=eL("compare"),aL=eL("datajoin"),sL=eL("encode"),lL=eL("expression"),cL=eL("facet"),uL=eL("field"),fL=eL("key"),dL=eL("legendentries"),hL=eL("load"),pL=eL("mark"),gL=eL("multiextent"),mL=eL("multivalues"),yL=eL("overlap"),vL=eL("params"),bL=eL("prefacet"),xL=eL("projection"),_L=eL("proxy"),wL=eL("relay"),kL=eL("render"),$L=eL("scale"),EL=eL("sieve"),AL=eL("sortitems"),SL=eL("viewlayout"),DL=eL("values");let CL=0;const ML={min:"min",max:"max",count:"sum"};function FL(e,t){const n=t.getScale(e.name).params;let i;for(i in n.domain=NL(e.domain,e,t),null!=e.range&&(n.range=qL(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=OL(e.type||e),null!=e.gamma&&(t.interpolateGamma=OL(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e,t){return e.signal?t.signalRef(e.signal):(0,g.Gv)(e)?{interval:OL(e.interval),step:OL(e.step)}:OL(e)}(e.nice,t)),null!=e.bins&&(n.bins=function(e,t){return e.signal||(0,g.cy)(e)?TL(e,t):t.objectProperty(e)}(e.bins,t)),e)(0,g.mQ)(n,i)||"name"===i||(n[i]=OL(e[i],t))}function OL(e,t){return(0,g.Gv)(e)?e.signal?t.signalRef(e.signal):(0,g.z3)("Unsupported object: "+(0,g.r$)(e)):e}function TL(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>OL(e,t)))}function zL(e){(0,g.z3)("Can not find data set: "+(0,g.r$)(e))}function NL(e,t,n){if(e)return e.signal?n.signalRef(e.signal):((0,g.cy)(e)?RL:e.fields?PL:BL)(e,t,n);null==t.domainMin&&null==t.domainMax||(0,g.z3)("No scale domain defined for domainMin/domainMax to override.")}function RL(e,t,n){return e.map((e=>OL(e,n)))}function BL(e,t,n){const i=n.getData(e.data);return i||zL(e.data),zB(t.type)?i.valuesRef(n,e.field,IL(e.sort,!1)):RB(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function PL(e,t,n){const i=e.data,r=e.fields.reduce(((e,t)=>(t=(0,g.Kg)(t)?{data:i,field:t}:(0,g.cy)(t)||t.signal?function(e,t){const n="_:vega:_"+CL++,i=rL({});if((0,g.cy)(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+(0,g.r$)(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,EL({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(zB(t.type)?LL:RB(t.type)?jL:UL)(e,n,r)}function LL(e,t,n){const i=IL(e.sort,!0);let r,o;const a=n.map((e=>{const n=t.getData(e.data);return n||zL(e.data),n.countsRef(t,e.field,i)})),s={groupby:NP,pulse:a};i&&(r=i.op||"count",o=i.field?PP(r,i.field):"count",s.ops=[ML[r]],s.fields=[t.fieldRef(o)],s.as=[o]),r=t.add(tL(s));const l=t.add(rL({pulse:TP(r)}));return o=t.add(DL({field:NP,sort:t.sortRef(i),pulse:TP(l)})),TP(o)}function IL(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!ML[e.op]&&(0,g.z3)("Multiple domain scales can not be sorted using "+e.op):(0,g.z3)("No field provided for sort aggregate op: "+e.op):(0,g.Gv)(e)?e.field="key":e={field:"key"}),e}function jL(e,t,n){const i=n.map((e=>{const n=t.getData(e.data);return n||zL(e.data),n.domainRef(t,e.field)}));return TP(t.add(mL({values:i})))}function UL(e,t,n){const i=n.map((e=>{const n=t.getData(e.data);return n||zL(e.data),n.extentRef(t,e.field)}));return TP(t.add(gL({extents:i})))}function qL(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if((0,g.Kg)(r)){if(i&&(0,g.mQ)(i,r))return qL(e=(0,g.X$)({},e,{range:i[r]}),t,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=zB(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,g.z3)("Unrecognized scale range value: "+(0,g.r$)(r))}else{if(r.scheme)return n.scheme=(0,g.cy)(r.scheme)?TL(r.scheme,t):OL(r.scheme,t),r.extent&&(n.schemeExtent=TL(r.extent,t)),void(r.count&&(n.schemeCount=OL(r.count,t)));if(r.step)return void(n.rangeStep=OL(r.step,t));if(zB(e.type)&&!(0,g.cy)(r))return NL(r,e,t);(0,g.cy)(r)||(0,g.z3)("Unsupported range type: "+(0,g.r$)(r))}return r.map((e=>((0,g.cy)(e)?TL:OL)(e,t)))}function GL(e,t,n){return(0,g.cy)(e)?e.map((e=>GL(e,t,n))):(0,g.Gv)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:(0,g.z3)("Unsupported parameter object: "+(0,g.r$)(e)):e}const WL="top",YL="left",HL="right",XL="bottom",VL="center",KL="vertical",QL="start",JL="end",ZL="index",eI="label",tI="offset",nI="perc",iI="perc2",rI="value",oI="guide-label",aI="guide-title",sI="group-title",lI="group-subtitle",cI="symbol",uI="gradient",fI="discrete",dI="size",hI=[dI,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],pI={name:1,style:1,interactive:1},gI={value:0},mI={value:1},yI="group",vI="rect",bI="rule",xI="symbol",_I="text";function wI(e){return e.type=yI,e.interactive=e.interactive||!1,e}function kI(e,t){const n=(n,i)=>qP(e[n],qP(t[n],i));return n.isVertical=n=>KL===qP(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>qP(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>qP(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>qP(e.columns,qP(t.columns,+n.isVertical(!0))),n}function $I(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 EI(e,t,n){return`item.anchor === '${QL}' ? ${e} : item.anchor === '${JL}' ? ${t} : ${n}`}const AI=EI((0,g.r$)(YL),(0,g.r$)(HL),(0,g.r$)(VL));function SI(e,t){return t?e?(0,g.Gv)(e)?Object.assign({},e,{offset:SI(e.offset,t)}):{value:e,offset:t}:t:e}function DI(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=VB(e.encode,t,pI)):e.interactive=!1,e}function CI(e,t,n,i){const r=kI(e,n),o=r.isVertical(),a=r.gradientThickness(),s=r.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=a,d=s):(c=[0,0],u=[1,0],f=s,d=a);const h={enter:l={opacity:gI,x:gI,y:gI,width:YB(f),height:YB(d)},update:(0,g.X$)({},l,{opacity:mI,fill:{gradient:t,start:c,stop:u}}),exit:{opacity:gI}};return XB(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),DI({type:vI,role:cP,encode:h},i)}function MI(e,t,n,i,r){const o=kI(e,n),a=o.isVertical(),s=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";a?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:gI,fill:{scale:t,field:rI}};p[c]={signal:h+"datum."+nI,mult:l},p[u]=gI,p[f]={signal:h+"datum."+iI,mult:l},p[d]=YB(s);const m={enter:p,update:(0,g.X$)({},p,{opacity:mI}),exit:{opacity:gI}};return XB(m,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),DI({type:vI,role:sP,key:rI,from:r,encode:m},i)}const FI=`datum.${nI}<=0?"${YL}":datum.${nI}>=1?"${HL}":"${VL}"`,OI=`datum.${nI}<=0?"${XL}":datum.${nI}>=1?"${WL}":"middle"`;function TI(e,t,n,i){const r=kI(e,t),o=r.isVertical(),a=YB(r.gradientThickness()),s=r.gradientLength();let l,c,u,f,d=r("labelOverlap"),h="";const p={enter:l={opacity:gI},update:c={opacity:mI,text:{field:eI}},exit:{opacity:gI}};return XB(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:qP(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:OI},u="y",f="x",h="1-"):(l.align=c.align={signal:FI},l.baseline={value:"top"},u="x",f="y"),l[u]=c[u]={signal:h+"datum."+nI,mult:s},l[f]=c[f]=a,a.offset=qP(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:r("labelSeparation"),method:d,order:"datum."+ZL}:void 0,DI({type:_I,role:uP,style:oI,key:rI,from:i,encode:p,overlap:d},n)}function zI(e,t,n,i,r){const o=kI(e,t),a=n.entries,s=!(!a||!a.interactive),l=a?a.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${tI} : datum.${dI}`,h=c?YB(c):{field:dI},p=`datum.${ZL}`,g=`max(1, ${r})`;let m,y,v,b,x;h.mult=.5,m={enter:y={opacity:gI,x:{signal:d,mult:.5,offset:u},y:h},update:v={opacity:mI,x:y.x,y:y.y},exit:{opacity:gI}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),XB(m,{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")}),hI.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:rI})}));const k=DI({type:xI,role:fP,key:rI,from:f,clip:!!c||void 0,encode:m},n.symbols),$=YB(u);$.offset=o("labelOffset"),m={enter:y={opacity:gI,x:{signal:d,offset:$},y:h},update:v={opacity:mI,text:{field:eI},x:y.x,y:y.y},exit:{opacity:gI}},XB(m,{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=DI({type:_I,role:uP,style:oI,key:rI,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:gI,height:c?YB(c):gI,opacity:gI},exit:{opacity:gI},update:v={opacity:mI,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${r})?${v.column.signal}:${p}`,wI({role:ZB,from:i={facet:{data:i,name:"value",groupby:ZL}},encode:VB(m,a,pI),marks:[k,E],name:l,interactive:s,sort:x})}const NI='item.orient === "left"',RI='item.orient === "right"',BI=`(${NI} || ${RI})`,PI=`datum.vgrad && ${BI}`,LI=EI('"top"','"bottom"','"middle"'),II=`datum.vgrad && ${RI} ? (${EI('"right"','"left"','"center"')}) : (${BI} && !(datum.vgrad && ${NI})) ? "left" : ${AI}`,jI=`item._anchor || (${BI} ? "middle" : "start")`,UI=`${PI} ? (${NI} ? -90 : 90) : 0`,qI=`${BI} ? (datum.vgrad ? (${RI} ? "bottom" : "top") : ${LI}) : "top"`;function GI(e,t){let n;return(0,g.Gv)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+WI(e.path)+")":e.sphere&&(n="geoShape("+WI(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function WI(e){return(0,g.Gv)(e)&&e.signal?e.signal:(0,g.r$)(e)}function YI(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===yI?ZB:t||QB}function HI(e){return{marktype:e.type,name:e.name||void 0,role:e.role||YI(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function XI(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function VI(e,t){const n=Br(e.type);n||(0,g.z3)("Unrecognized transform type: "+(0,g.r$)(e.type));const i=FP(n.type.toLowerCase(),null,KI(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function KI(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const r=e.params[o];i[r.name]=QI(r,t,n)}return i}function QI(e,t,n){const i=e.type,r=t[e.name];return"index"===i?function(e,t,n){(0,g.Kg)(t.from)||(0,g.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,g.cy)(i)||(0,g.z3)("Expected an array of sub-parameters. Instead: "+(0,g.r$)(i)),i.map((t=>ZI(e,t,n)))):ZI(e,i,n)}(e,t,n):"projection"===i?n.projectionRef(t[e.name]):e.array&&!jP(r)?r.map((t=>JI(e,t,n))):JI(e,r,n):void(e.required&&(0,g.z3)("Missing required "+(0,g.r$)(t.type)+" parameter: "+(0,g.r$)(e.name)))}function JI(e,t,n){const i=e.type;if(jP(t))return ij(i)?(0,g.z3)("Expression references can not be signals."):rj(i)?n.fieldRef(t):oj(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||rj(i);return r&&ej(t)?n.exprRef(t.expr,t.as):r&&tj(t)?zP(t.field,t.as):ij(i)?oB(t,n):nj(i)?TP(n.getData(t).values):rj(i)?zP(t):oj(i)?n.compareRef(t):t}}function ZI(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,g.z3)("Unsupported parameter: "+(0,g.r$)(t));const o=(0,g.X$)(KI(r,t,n),r.key);return TP(n.add(vL(o)))}const ej=e=>e&&e.expr,tj=e=>e&&e.field,nj=e=>"data"===e,ij=e=>"expr"===e,rj=e=>"field"===e,oj=e=>"compare"===e;function aj(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:TP(t.getData(e.data).output)}function sj(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}function lj(e){return(0,g.Kg)(e)?e:null}function cj(e,t,n){const i=PP(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 uj(e,t,n,i,r,o,a){const s=t[n]||(t[n]={}),l=function(e){return(0,g.Gv)(e)?(e.order===BP?"-":"+")+PP(e.op,e.field):""}(o);let c,u,f=lj(r);if(null!=f&&(e=t.scope,f+=l?"|"+l:"",c=s[f]),!c){const n=o?{field:NP,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:TP(t.output)};l&&(n.sort=e.sortRef(o)),u=e.add(FP(i,void 0,n)),a&&(t.index[r]=u),c=TP(u),null!=f&&(s[f]=c)}return c}function fj(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,a=e.modify,s=e.values,l=t.add(OP()),c=oB("if("+e.trigger+',modify("'+n+'",'+[r,i,o,a,s].map((e=>null==e?"null":e)).join(",")+"),0)",t);l.update=c.$expr,l.params=c.$params}function dj(e,t){const n=YI(e),i=e.type===yI,r=e.from&&e.from.facet,o=e.overlap;let a,s,l,c,u,f,d,h=e.layout||n===ZB||n===JB;const p=n===QB||h||r,m=function(e,t,n){let i,r,o,a,s;return e?(i=e.facet)&&(t||(0,g.z3)("Only group marks can be faceted."),null!=i.field?a=s=aj(i,n):(e.data?s=TP(n.getData(e.data).aggregate):(o=VI((0,g.X$)({type:"aggregate",groupby:(0,g.YO)(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=aj(i,n),a=s=TP(n.add(o))),r=n.keyRef(i.groupby,!0))):a=TP(n.add(rL(null,[{}]))),a||(a=aj(e,n)),{key:r,pulse:a,parent:s}}(e.from,i,t);s=t.add(aL({key:m.key||(e.key?zP(e.key):void 0),pulse:m.pulse,clean:!i}));const y=TP(s);s=l=t.add(rL({pulse:y})),s=t.add(pL({markdef:HI(e),interactive:XI(e.interactive,t),clip:GI(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:TP(s)}));const v=TP(s);s=c=t.add(sL(kP(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=VI(e,t),i=n.metadata;(i.generates||i.changes)&&(0,g.z3)("Mark transforms should not generate new data."),i.nomod||(c.params.mod=!0),n.params.pulse=TP(s),t.add(s=n)})),e.sort&&(s=t.add(AL({sort:t.compareRef(e.sort),pulse:TP(s)})));const b=TP(s);(r||h)&&(h=t.add(SL({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:b})),f=TP(h));const x=t.add(iL({mark:v,pulse:f||b}));d=TP(x),i&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(b,f||d,y),r?function(e,t,n){const i=e.from.facet,r=i.name,o=aj(i,t);let a;i.name||(0,g.z3)("Facet must have a name: "+(0,g.r$)(i)),i.data||(0,g.z3)("Facet must reference a data set: "+(0,g.r$)(i)),i.field?a=t.add(bL({field:t.fieldRef(i.field),pulse:o})):i.groupby?a=t.add(cL({key:t.keyRef(i.groupby),group:TP(t.proxy(n.parent)),pulse:o})):(0,g.z3)("Facet must specify groupby or field: "+(0,g.r$)(i));const s=t.fork(),l=s.add(rL()),c=s.add(EL({pulse:TP(l)}));s.addData(r,new sj(s,l,l,c)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,m):p?function(e,t,n){const i=t.add(bL({pulse:n.pulse})),r=t.fork();r.add(EL()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}(e,t,m):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(x))),o&&(d=function(e,t,n){const i=e.method,r=e.bound,o=e.separation,a={separation:jP(o)?n.signalRef(o.signal):o,method:jP(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=jP(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(r.scale),a.boundOrient=r.orient}return TP(n.add(yL(a)))}(o,d,t));const _=t.add(kL({pulse:d})),w=t.add(EL({pulse:TP(_)},void 0,t.parent()));null!=e.name&&(u=e.name,t.addData(u,new sj(t,l,_,w)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&(0,g.z3)("Marks only support modify triggers."),fj(e,t,u)})))}function hj(e,t){const n=t.config.legend,i=e.encode||{},r=kI(e,n),o=i.legend||{},a=o.name||void 0,s=o.interactive,l=o.style,c={};let u,f,d,h=0;hI.forEach((t=>e[t]?(c[t]=e[t],h=h||e[t]):0)),h||(0,g.z3)("Missing valid scale for legend.");const p=function(e,t){let n=e.type||cI;e.type||1!==function(e){return hI.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=TB(t,bB)?uI:NB(t)?fI:cI);return n!==uI?n:NB(t)?fI:uI}(e,t.scaleType(h)),m={title:null!=e.title,scales:c,type:p,vgrad:"symbol"!==p&&r.isVertical()},y=TP(t.add(rL(null,[m]))),v=TP(t.add(dL(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===uI?(d=[CI(e,h,n,i.gradient),TI(e,n,i.labels,v)],f.count=f.count||t.signalRef(`max(2,2*floor((${GP(r.gradientLength())})/100))`)):p===fI?d=[MI(e,h,n,i.gradient,v),TI(e,n,i.labels,v)]:(u=function(e,t){const n=kI(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[zI(e,n,i,v,GP(u.columns))],f.size=function(e,t,n){const i=GP(gj("size",e,n)),r=GP(gj("strokeWidth",e,n)),o=GP(function(e,t,n){return $I("fontSize",e)||function(e,t,n){const i=t.config.style[n];return i&&i[e]}("fontSize",t,n)}(n[1].encode,t,oI));return oB(`max(ceil(sqrt(${i})+${r}),${o})`,t)}(e,t,d[0].marks)),d=[wI({role:lP,from:y,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:u,interactive:s})],m.title&&d.push(function(e,t,n,i){const r=kI(e,t),o={enter:{opacity:gI},update:{opacity:mI,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:gI}};return XB(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:jI},angle:{signal:UI},align:{signal:II},baseline:{signal:qI},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")}),DI({type:_I,role:dP,style:aI,from:i,encode:o},n)}(e,n,i.title,y)),dj(wI({role:aP,from:y,encode:VB(pj(r,e,n),o,pI),marks:d,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:s,style:l}),t)}function pj(e,t,n){const i={enter:{},update:{}};return XB(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 gj(e,t,n){return t[e]?`scale("${t[e]}",datum)`:$I(e,n[0].encode)}sj.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=TP(t[s-1]),e.add(t[s]),"aggregate"===t[s].type&&(a=t[s]);return new sj(e,o,r,i,a)},sj.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=lj(t);let a,s,l;return null!=o&&(e=i.scope,a=r[o]),a?n&&n.field&&cj(e,a.agg.params,n):(l={groupby:e.fieldRef(t,"key"),pulse:TP(i.output)},n&&n.field&&cj(e,l,n),s=e.add(tL(l)),a=e.add(rL({pulse:TP(s)})),a={agg:s,ref:TP(a)},null!=o&&(r[o]=a)),a.ref},tuplesRef(){return TP(this.values)},extentRef(e,t){return uj(e,this,"extent","extent",t,!1)},domainRef(e,t){return uj(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return uj(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return uj(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return uj(e,this,"indata","tupleindex",t,!0,!0)}};const mj=`item.orient==="${YL}"?-90:item.orient==="${HL}"?90:0`;function yj(e,t){const n=kI(e=(0,g.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=[],c=TP(t.add(rL(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 XB(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")}),DI({type:_I,role:pP,style:sI,from:i,encode:a},n)}(e,n,function(e){const t=e.encode;return t&&t.title||(0,g.X$)({name:e.name,interactive:e.interactive,style:e.style},t)}(e),c)),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 XB(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")}),DI({type:_I,role:gP,style:lI,from:i,encode:a},n)}(e,n,i.subtitle,c)),dj(wI({role:hP,from:c,encode:vj(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}function vj(e,t){const n={enter:{},update:{}};return XB(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:AI},angle:{signal:mj},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),VB(n,t,pI)}function bj(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(VI(e,t))})),e.on&&e.on.forEach((n=>{fj(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const i=[];let r,o,a,s,l,c=null,u=!1,f=!1;e.values?jP(e.values)||UP(e.format)?(i.push(_j(t,e)),i.push(c=xj())):i.push(c=xj({$ingest:e.values,$format:e.format})):e.url?UP(e.url)||UP(e.format)?(i.push(_j(t,e)),i.push(c=xj())):i.push(c=xj({$request:e.url,$format:e.format})):e.source&&(c=r=(0,g.YO)(e.source).map((e=>TP(t.getData(e).output))),i.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],l=s.metadata,c||l.source||i.push(c=xj()),i.push(s),l.generates&&(f=!0),l.modifies&&!f&&(u=!0),l.source?c=s:l.changes&&(c=null);r&&(a=r.length-1,i[0]=wL({derive:u,pulse:a?r:r[0]}),(u||a)&&i.splice(1,0,xj()));c||i.push(xj());return i.push(EL({})),i}(e,t,n))}function xj(e){const t=rL({},e);return t.metadata={source:!0},t}function _j(e,t){return hL({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 wj=e=>e===XL||e===WL,kj=(e,t,n)=>jP(e)?Mj(e.signal,t,n):e===YL||e===WL?t:n,$j=(e,t,n)=>jP(e)?Dj(e.signal,t,n):wj(e)?t:n,Ej=(e,t,n)=>jP(e)?Cj(e.signal,t,n):wj(e)?n:t,Aj=(e,t,n)=>jP(e)?Fj(e.signal,t,n):e===WL?{value:t}:{value:n},Sj=(e,t,n)=>jP(e)?Oj(e.signal,t,n):e===HL?{value:t}:{value:n},Dj=(e,t,n)=>Tj(`${e} === '${WL}' || ${e} === '${XL}'`,t,n),Cj=(e,t,n)=>Tj(`${e} !== '${WL}' && ${e} !== '${XL}'`,t,n),Mj=(e,t,n)=>Nj(`${e} === '${YL}' || ${e} === '${WL}'`,t,n),Fj=(e,t,n)=>Nj(`${e} === '${WL}'`,t,n),Oj=(e,t,n)=>Nj(`${e} === '${HL}'`,t,n),Tj=(e,t,n)=>(t=null!=t?YB(t):t,n=null!=n?YB(n):n,zj(t)&&zj(n)?{signal:`${e} ? (${t=t?t.signal||(0,g.r$)(t.value):null}) : (${n=n?n.signal||(0,g.r$)(n.value):null})`}:[(0,g.X$)({test:e},t)].concat(n||[])),zj=e=>null==e||1===Object.keys(e).length,Nj=(e,t,n)=>({signal:`${e} ? (${Bj(t)}) : (${Bj(n)})`}),Rj=(e,t,n,i,r)=>({signal:(null!=i?`${e} === '${YL}' ? (${Bj(i)}) : `:"")+(null!=n?`${e} === '${XL}' ? (${Bj(n)}) : `:"")+(null!=r?`${e} === '${HL}' ? (${Bj(r)}) : `:"")+(null!=t?`${e} === '${WL}' ? (${Bj(t)}) : `:"")+"(null)"}),Bj=e=>jP(e)?e.signal:null==e?null:(0,g.r$)(e),Pj=(e,t)=>0===t?0:jP(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Lj=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Ij(e,t,n,i){let r;if(t&&(0,g.mQ)(t,e))return t[e];if((0,g.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[aI][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[oI][r]}return null}function jj(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function Uj(e,t){return{scale:e.scale,range:t}}function qj(e,t,n,i,r){const o=kI(e,t),a=e.orient,s=e.gridScale,l=kj(a,1,-1),c=function(e,t){if(1===t);else if((0,g.Gv)(e)){let n=e=(0,g.X$)({},e);for(;null!=n.mult;){if(!(0,g.Gv)(n.mult))return n.mult=jP(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=(0,g.X$)({},n.mult)}n.mult=t}else e=jP(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,l);let u,f,d;const h={enter:u={opacity:gI},update:d={opacity:mI},exit:f={opacity:gI}};XB(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:rI,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},m=$j(a,{signal:"height"},{signal:"width"}),y=s?{scale:s,range:0,mult:l,offset:c}:{value:0,offset:c},v=s?{scale:s,range:1,mult:l,offset:c}:(0,g.X$)(m,{mult:l,offset:c});return u.x=d.x=$j(a,p,y),u.y=d.y=Ej(a,p,y),u.x2=d.x2=Ej(a,v),u.y2=d.y2=$j(a,v),f.x=$j(a,p),f.y=Ej(a,p),DI({type:bI,role:nP,key:rI,from:i,encode:h},n)}function Gj(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Wj(e,t,n,i){const r=kI(e,t),o=e.orient,a=kj(o,-1,1);let s,l;const c={enter:s={opacity:gI,anchor:YB(r("titleAnchor",null)),align:{signal:AI}},update:l=(0,g.X$)({},s,{opacity:mI,text:YB(e.title)}),exit:{opacity:gI}},u={signal:`lerp(range("${e.scale}"), ${EI(0,1,.5)})`};return l.x=$j(o,u),l.y=Ej(o,u),s.angle=$j(o,gI,Pj(a,90)),s.baseline=$j(o,Aj(o,XL,WL),{value:XL}),l.angle=s.angle,l.baseline=s.baseline,XB(c,{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]=Lj(YB(e),n.update[t]),!1):!KB(t,i),o=r(e("titleX"),"x"),a=r(e("titleY"),"y");n.enter.auto=a===o?YB(a):$j(t,YB(a),YB(o))}(r,o,c,n),c.update.align=Lj(c.update.align,s.align),c.update.angle=Lj(c.update.angle,s.angle),c.update.baseline=Lj(c.update.baseline,s.baseline),DI({type:_I,role:oP,style:aI,from:i,encode:c},n)}function Yj(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,c=e.orient;if(jP(c)){const e=jj([o.axisX,o.axisY]),t=jj([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(r of(n={},e))n[r]=$j(c,Ij(r,o.axisX,s,a),Ij(r,o.axisY,s,a));for(r of(i={},t))i[r]=Rj(c.signal,Ij(r,o.axisTop,s,a),Ij(r,o.axisBottom,s,a),Ij(r,o.axisLeft,s,a),Ij(r,o.axisRight,s,a))}else n=c===WL||c===XL?o.axisX:o.axisY,i=o["axis"+c[0].toUpperCase()+c.slice(1)];return n||i||l?(0,g.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=kI(e,n),c=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,g.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),u={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:null!=e.title},f=TP(t.add(rL({},[u]))),d=TP(t.add(nL({scale:t.scaleRef(e.scale),extra:t.property(c.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 u.grid&&h.push(qj(e,n,i.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(function(e,t,n,i,r,o){const a=kI(e,t),s=e.orient,l=kj(s,-1,1);let c,u,f;const d={enter:c={opacity:gI},update:f={opacity:mI},exit:u={opacity:gI}};XB(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=YB(r);h.mult=l;const p={scale:e.scale,field:rI,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=c.y=$j(s,gI,p),f.y2=c.y2=$j(s,h),u.x=$j(s,p),f.x=c.x=Ej(s,gI,p),f.x2=c.x2=Ej(s,h),u.y=Ej(s,p),DI({type:bI,role:rP,key:rI,from:i,encode:d},n)}(e,n,i.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(function(e,t,n,i,r,o){const a=kI(e,t),s=e.orient,l=e.scale,c=kj(s,-1,1),u=GP(a("labelFlush")),f=GP(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===u||!!u;const m=YB(r);m.mult=c,m.offset=YB(a("labelPadding")||0),m.offset.mult=c;const y={scale:l,field:rI,band:.5,offset:SI(o.offset,a("labelOffset"))},v=$j(s,g?Gj(l,u,'"left"','"right"','"center"'):{value:"center"},Sj(s,"left","right")),b=$j(s,Aj(s,"bottom","top"),g?Gj(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),x=Gj(l,u,`-(${f})`,f,0);g=g&&f;const _={opacity:gI,x:$j(s,y,m),y:Ej(s,y,m)},w={enter:_,update:p={opacity:mI,text:{field:eI},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:gI,x:_.x,y:_.y}};XB(w,{dx:!d&&g?$j(s,x):null,dy:!h&&g?Ej(s,x):null}),XB(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=Lj(p.align,v)),p.baseline!==b&&(p.baseline=Lj(p.baseline,b)),DI({type:_I,role:iP,style:oI,key:rI,from:i,encode:w,overlap:$},n)}(e,n,i.labels,d,p,c))),u.domain&&h.push(function(e,t,n,i){const r=kI(e,t),o=e.orient;let a,s;const l={enter:a={opacity:gI},update:s={opacity:mI},exit:{opacity:gI}};XB(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const c=Uj(e,0),u=Uj(e,1);return a.x=s.x=$j(o,c,gI),a.x2=s.x2=$j(o,u),a.y=s.y=Ej(o,c,gI),a.y2=s.y2=Ej(o,u),DI({type:bI,role:tP,from:i,encode:l},n)}(e,n,i.domain,f)),u.title&&h.push(Wj(e,n,i.title,f)),dj(wI({role:eP,from:f,encode:VB(Hj(l,e),r,pI),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:a,style:s}),t)}function Hj(e,t){const n={enter:{},update:{}};return XB(n,{orient:e("orient"),offset:e("offset")||0,position:qP(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 Xj(e,t,n){const i=(0,g.YO)(e.signals),r=(0,g.YO)(e.scales);return n||i.forEach((e=>CP(e,t))),(0,g.YO)(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},i={};for(const r in e)"name"!==r&&(i[r]=GL(e[r],r,t));for(const r in n)null==i[r]&&(i[r]=GL(n[r],r,t));t.addProjection(e.name,i)}(e,t))),r.forEach((e=>function(e,t){const n=e.type||"linear";OB(n)||(0,g.z3)("Unrecognized scale type: "+(0,g.r$)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),(0,g.YO)(e.data).forEach((e=>bj(e,t))),r.forEach((e=>FL(e,t))),(n||i).forEach((e=>function(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?(0,g.z3)("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=oB(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach((e=>JP(e,t,n.id)))}(e,t))),(0,g.YO)(e.axes).forEach((e=>Yj(e,t))),(0,g.YO)(e.marks).forEach((e=>dj(e,t))),(0,g.YO)(e.legends).forEach((e=>hj(e,t))),e.title&&yj(e.title,t),t.parseLambdas(),t}const Vj=e=>VB({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Kj(e,t){const n=t.config,i=TP(t.root=t.add(OP())),r=function(e,t){const n=n=>qP(e[n],t[n]),i=[Qj("background",n("background")),Qj("autosize",UB(n("autosize"))),Qj("padding",WB(n("padding"))),Qj("width",n("width")||0),Qj("height",n("height")||0)],r=i.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return(0,g.YO)(e.signals).forEach((e=>{(0,g.mQ)(r,e.name)?e=(0,g.X$)(r[e.name],e):i.push(e),o[e.name]=e})),(0,g.YO)(t.signals).forEach((e=>{(0,g.mQ)(o,e.name)||(0,g.mQ)(r,e.name)||i.push(e)})),i}(e,n);r.forEach((e=>CP(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(rL()),a=t.add(sL(kP(Vj(e.encode),yI,JB,e.style,t,{pulse:TP(o)}))),s=t.add(SL({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:TP(a)}));t.operators.pop(),t.pushState(TP(a),TP(s),null),Xj(e,t,r),t.operators.push(s);let l=t.add(iL({mark:i,pulse:TP(s)}));return l=t.add(kL({pulse:TP(l)})),l=t.add(EL({pulse:TP(l)})),t.addData("root",new sj(t,o,o,l)),t}function Qj(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Jj(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 Zj(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 eU(e){return((0,g.cy)(e)?tU:nU)(e)}function tU(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const t=e[i];n+=(i>0?",":"")+((0,g.Gv)(t)?t.signal||eU(t):(0,g.r$)(t))}return n+"]"}function nU(e){let t,n,i="{",r=0;for(t in e)n=e[t],i+=(++r>1?",":"")+(0,g.r$)(t)+":"+((0,g.Gv)(n)?n.signal||eU(n):(0,g.r$)(n));return i+"}"}function iU(e,t,n){return(0,g.Gv)(e)||(0,g.z3)("Input Vega specification must be an object."),t=(0,g.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),Kj(e,new Jj(t,n)).toRuntime()}Jj.prototype=Zj.prototype={parse(e){return Xj(e,this)},fork(){return new Zj(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 MP?TP(e):e;return this.add(_L({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(TP(this.add(EL({pulse:e})))),this._parent.push(t),this._lookup.push(n?TP(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return(0,g.se)(this._parent)},encode(){return(0,g.se)(this._encode)},lookup(){return(0,g.se)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if((0,g.Kg)(e))return zP(e,t);e.signal||(0,g.z3)("Unsupported field reference: "+(0,g.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=TP(this.add(uL(e)))}return i},compareRef(e){let t=!1;const n=e=>jP(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,i=(0,g.YO)(e.field).map(n),r=(0,g.YO)(e.order).map(n);return t?TP(this.add(oL({fields:i,orders:r}))):RP(i,r)},keyRef(e,t){let n=!1;const i=this.signals;return e=(0,g.YO)(e).map((e=>jP(e)?(n=!0,TP(i[e.signal])):e)),n?TP(this.add(fL({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=PP(e.op,e.field),n=e.order||"ascending";return n.signal?TP(this.add(oL({fields:t,orders:this.signalRef(n.signal)}))):RP(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,g.mQ)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&(0,g.z3)("Duplicate signal name: "+(0,g.r$)(e));const n=t instanceof MP?t:this.add(OP(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||(0,g.z3)("Unrecognized signal name: "+(0,g.r$)(e)),this.signals[e]},signalRef(e){return this.signals[e]?TP(this.signals[e]):((0,g.mQ)(this.lambdas,e)||(this.lambdas[e]=this.add(OP(null))),TP(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=oB(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,g.Gv)(e)?this.signalRef(e.signal||eU(e)):e},exprRef(e,t){const n={expr:oB(e,this)};return t&&(n.expr.$name=t),TP(this.add(lL(n)))},addBinding(e,t){this.bindings||(0,g.z3)("Nested signals do not support binding: "+(0,g.r$)(e)),this.bindings.push((0,g.X$)({signal:e},t))},addScaleProj(e,t){(0,g.mQ)(this.scales,e)&&(0,g.z3)("Duplicate scale or projection name: "+(0,g.r$)(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,$L(t))},addProjection(e,t){this.addScaleProj(e,xL(t))},getScale(e){return this.scales[e]||(0,g.z3)("Unrecognized scale name: "+(0,g.r$)(e)),this.scales[e]},scaleRef(e){return TP(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,g.mQ)(this.data,e)&&(0,g.z3)("Duplicate data set name: "+(0,g.r$)(e)),this.data[e]=t},getData(e){return this.data[e]||(0,g.z3)("Undefined data set name: "+(0,g.r$)(e)),this.data[e]},addDataPipeline(e,t){return(0,g.mQ)(this.data,e)&&(0,g.z3)("Duplicate data set name: "+(0,g.r$)(e)),this.addData(e,sj.fromEntries(this,t))}};var rU="5.28.0";(0,g.X$)(Rr,i,o,a,s,l,u,c,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,c,u,f,d,h,p,g,m,y,v,b;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&&(m=v.replace(t,(function(e,t){return t||e+" "}))).length<=p)return m;if(null!=o&&(n=JSON.parse(v),o=void 0),"object"===typeof n&&null!==n){if(g=a+i,u=[],c=0,Array.isArray(n))for(y="[",l="]",p=n.length;c<p;c++)u.push(e(n[c],g,c===p-1?0:1)||"null");else for(y="{",l="}",p=(h=Object.keys(n)).length;c<p;c++)f=h[c],d=JSON.stringify(f)+": ",void 0!==(b=e(n[f],g,d.length+(c===p-1?0:1)))&&u.push(d+b);if(u.length>0)return[y,i+u.join(",\n"+g),l].join("\n"+a)}return v}(e,"",0)}},83749:(e,t,n)=>{"use strict";n.d(t,{T:()=>c,I:()=>u});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,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*i)&&(n-=e*c,i-=t*c),(l=Math.sqrt(n*n+i*i))&&(n/=l,i/=l,c/=l),e*i<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*o,skewX:Math.atan(c)*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=[],c=[];return a=e(a),s=e(s),function(e,i,o,a,s,l){if(e!==o||i!==a){var c=s.push("translate(",null,t,null,n);l.push({i:c-4,x:(0,r.A)(e,o)},{i:c-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,c),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,c),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,c),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,c),a=s=null,function(e){for(var t,n=-1,i=c.length;++n<i;)l[(t=c[n]).i]=t.x(e);return l.join("")}}}var c=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)"),u=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:()=>m,O1:()=>y,tB:()=>p});var i,r,o=0,a=0,s=0,l=1e3,c=0,u=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 u||(h(g),u=d.now()+f)}function g(){u=0}function m(){this._call=this._time=this._next=null}function y(e,t,n){var i=new m;return i.restart(e,t,n),i}function v(){u=(c=d.now())+f,o=a=0;try{!function(){p(),++o;for(var e,t=i;t;)(e=u-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,x(o)}(),u=0}}function b(){var e=d.now(),t=e-c;t>l&&(f-=t,c=e)}function x(e){o||(a&&(a=clearTimeout(a)),e-u>24?(e<1/0&&(a=setTimeout(v,e-d.now()-f)),s&&(s=clearInterval(s))):(s||(c=d.now(),s=setInterval(b,l)),o=1,h(v)))}m.prototype=y.prototype={constructor:m,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,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}}}}]);