New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flourish/facets

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flourish/facets - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

map_layouts/london_boroughs.txt

2

facets.min.js

@@ -1,1 +0,1 @@

(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e():typeof define==="function"&&define.amd?define(e):(t=typeof globalThis!=="undefined"?globalThis:t||self,t.initFacets=e())})(this,(function(){"use strict";var t="http://www.w3.org/1999/xhtml";var e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function n(t){var n=t+="",r=n.indexOf(":");if(r>=0&&(n=t.slice(0,r))!=="xmlns")t=t.slice(r+1);return e.hasOwnProperty(n)?{space:e[n],local:t}:t}function r(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===t&&n.documentElement.namespaceURI===t?n.createElement(e):n.createElementNS(r,e)}}function i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t){var e=n(t);return(e.local?i:r)(e)}function o(){}function u(t){return t==null?o:function(){return this.querySelector(t)}}function s(t){if(typeof t!=="function")t=u(t);for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var a=e[i],o=a.length,s=r[i]=new Array(o),l,f,c=0;c<o;++c){if((l=a[c])&&(f=t.call(l,l.__data__,c,a))){if("__data__"in l)f.__data__=l.__data__;s[c]=f}}}return new Ht(r,this._parents)}function l(){return[]}function f(t){return t==null?l:function(){return this.querySelectorAll(t)}}function c(t){if(typeof t!=="function")t=f(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a){for(var o=e[a],u=o.length,s,l=0;l<u;++l){if(s=o[l]){r.push(t.call(s,s.__data__,l,o));i.push(s)}}}return new Ht(r,i)}function h(t){return function(){return this.matches(t)}}function p(t){if(typeof t!=="function")t=h(t);for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l){if((s=a[l])&&t.call(s,s.__data__,l,a)){u.push(s)}}}return new Ht(r,this._parents)}function _(t){return new Array(t.length)}function d(){return new Ht(this._enter||this._groups.map(_),this._parents)}function g(t,e){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=e}g.prototype={constructor:g,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function v(t){return function(){return t}}var m="$";function y(t,e,n,r,i,a){var o=0,u,s=e.length,l=a.length;for(;o<l;++o){if(u=e[o]){u.__data__=a[o];r[o]=u}else{n[o]=new g(t,a[o])}}for(;o<s;++o){if(u=e[o]){i[o]=u}}}function w(t,e,n,r,i,a,o){var u,s,l={},f=e.length,c=a.length,h=new Array(f),p;for(u=0;u<f;++u){if(s=e[u]){h[u]=p=m+o.call(s,s.__data__,u,e);if(p in l){i[u]=s}else{l[p]=s}}}for(u=0;u<c;++u){p=m+o.call(t,a[u],u,a);if(s=l[p]){r[u]=s;s.__data__=a[u];l[p]=null}else{n[u]=new g(t,a[u])}}for(u=0;u<f;++u){if((s=e[u])&&l[h[u]]===s){i[u]=s}}}function b(t,e){if(!t){p=new Array(this.size()),l=-1;this.each((function(t){p[++l]=t}));return p}var n=e?w:y,r=this._parents,i=this._groups;if(typeof t!=="function")t=v(t);for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,p=t.call(f,f&&f.__data__,l,r),_=p.length,d=u[l]=new Array(_),g=o[l]=new Array(_),m=s[l]=new Array(h);n(f,c,d,g,m,p,e);for(var b=0,x=0,A,N;b<_;++b){if(A=d[b]){if(b>=x)x=b+1;while(!(N=g[x])&&++x<_);A._next=N||null}}}o=new Ht(o,r);o._enter=u;o._exit=s;return o}function x(){return new Ht(this._exit||this._groups.map(_),this._parents)}function A(t,e,n){var r=this.enter(),i=this,a=this.exit();r=typeof t==="function"?t(r):r.append(t+"");if(e!=null)i=e(i);if(n==null)a.remove();else n(a);return r&&i?r.merge(i).order():i}function N(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u){for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,p=0;p<f;++p){if(h=s[p]||l[p]){c[p]=h}}}for(;u<r;++u){o[u]=e[u]}return new Ht(o,this._parents)}function k(){for(var t=this._groups,e=-1,n=t.length;++e<n;){for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;){if(o=r[i]){if(a&&o.compareDocumentPosition(a)^4)a.parentNode.insertBefore(o,a);a=o}}}return this}function M(t){if(!t)t=E;function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f){if(l=o[f]){s[f]=l}}s.sort(e)}return new Ht(i,this._parents).order()}function E(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function S(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this}function T(){var t=new Array(this.size()),e=-1;this.each((function(){t[++e]=this}));return t}function C(){for(var t=this._groups,e=0,n=t.length;e<n;++e){for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}}return null}function P(){var t=0;this.each((function(){++t}));return t}function q(){return!this.node()}function O(t){for(var e=this._groups,n=0,r=e.length;n<r;++n){for(var i=e[n],a=0,o=i.length,u;a<o;++a){if(u=i[a])t.call(u,u.__data__,a,i)}}return this}function I(t){return function(){this.removeAttribute(t)}}function R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function z(t,e){return function(){this.setAttribute(t,e)}}function X(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function j(t,e){return function(){var n=e.apply(this,arguments);if(n==null)this.removeAttribute(t);else this.setAttribute(t,n)}}function $(t,e){return function(){var n=e.apply(this,arguments);if(n==null)this.removeAttributeNS(t.space,t.local);else this.setAttributeNS(t.space,t.local,n)}}function H(t,e){var r=n(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((e==null?r.local?R:I:typeof e==="function"?r.local?$:j:r.local?X:z)(r,e))}function L(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function B(t){return function(){this.style.removeProperty(t)}}function D(t,e,n){return function(){this.style.setProperty(t,e,n)}}function V(t,e,n){return function(){var r=e.apply(this,arguments);if(r==null)this.style.removeProperty(t);else this.style.setProperty(t,r,n)}}function Y(t,e,n){return arguments.length>1?this.each((e==null?B:typeof e==="function"?V:D)(t,e,n==null?"":n)):F(this.node(),t)}function F(t,e){return t.style.getPropertyValue(e)||L(t).getComputedStyle(t,null).getPropertyValue(e)}function U(t){return function(){delete this[t]}}function W(t,e){return function(){this[t]=e}}function G(t,e){return function(){var n=e.apply(this,arguments);if(n==null)delete this[t];else this[t]=n}}function J(t,e){return arguments.length>1?this.each((e==null?U:typeof e==="function"?G:W)(t,e)):this.node()[t]}function K(t){return t.trim().split(/^|\s+/)}function Q(t){return t.classList||new Z(t)}function Z(t){this._node=t;this._names=K(t.getAttribute("class")||"")}Z.prototype={add:function(t){var e=this._names.indexOf(t);if(e<0){this._names.push(t);this._node.setAttribute("class",this._names.join(" "))}},remove:function(t){var e=this._names.indexOf(t);if(e>=0){this._names.splice(e,1);this._node.setAttribute("class",this._names.join(" "))}},contains:function(t){return this._names.indexOf(t)>=0}};function tt(t,e){var n=Q(t),r=-1,i=e.length;while(++r<i)n.add(e[r])}function et(t,e){var n=Q(t),r=-1,i=e.length;while(++r<i)n.remove(e[r])}function nt(t){return function(){tt(this,t)}}function rt(t){return function(){et(this,t)}}function it(t,e){return function(){(e.apply(this,arguments)?tt:et)(this,t)}}function at(t,e){var n=K(t+"");if(arguments.length<2){var r=Q(this.node()),i=-1,a=n.length;while(++i<a)if(!r.contains(n[i]))return false;return true}return this.each((typeof e==="function"?it:e?nt:rt)(n,e))}function ot(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function st(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function lt(t){return arguments.length?this.each(t==null?ot:(typeof t==="function"?st:ut)(t)):this.node().textContent}function ft(){this.innerHTML=""}function ct(t){return function(){this.innerHTML=t}}function ht(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function pt(t){return arguments.length?this.each(t==null?ft:(typeof t==="function"?ht:ct)(t)):this.node().innerHTML}function _t(){if(this.nextSibling)this.parentNode.appendChild(this)}function dt(){return this.each(_t)}function gt(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vt(){return this.each(gt)}function mt(t){var e=typeof t==="function"?t:a(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))}function yt(){return null}function wt(t,e){var n=typeof t==="function"?t:a(t),r=e==null?yt:typeof e==="function"?e:u(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))}function bt(){var t=this.parentNode;if(t)t.removeChild(this)}function xt(){return this.each(bt)}function At(){var t=this.cloneNode(false),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Nt(){var t=this.cloneNode(true),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function kt(t){return this.select(t?Nt:At)}function Mt(t){return arguments.length?this.property("__data__",t):this.node().__data__}var Et={};if(typeof document!=="undefined"){var St=document.documentElement;if(!("onmouseenter"in St)){Et={mouseenter:"mouseover",mouseleave:"mouseout"}}}function Tt(t,e,n){t=Ct(t,e,n);return function(e){var n=e.relatedTarget;if(!n||n!==this&&!(n.compareDocumentPosition(this)&8)){t.call(this,e)}}}function Ct(t,e,n){return function(r){try{t.call(this,this.__data__,e,n)}finally{}}}function Pt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0)e=t.slice(n+1),t=t.slice(0,n);return{type:t,name:e}}))}function qt(t){return function(){var e=this.__on;if(!e)return;for(var n=0,r=-1,i=e.length,a;n<i;++n){if(a=e[n],(!t.type||a.type===t.type)&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.capture)}else{e[++r]=a}}if(++r)e.length=r;else delete this.__on}}function Ot(t,e,n){var r=Et.hasOwnProperty(t.type)?Tt:Ct;return function(i,a,o){var u=this.__on,s,l=r(e,a,o);if(u)for(var f=0,c=u.length;f<c;++f){if((s=u[f]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.capture);this.addEventListener(s.type,s.listener=l,s.capture=n);s.value=e;return}}this.addEventListener(t.type,l,n);s={type:t.type,name:t.name,value:e,listener:l,capture:n};if(!u)this.__on=[s];else u.push(s)}}function It(t,e,n){var r=Pt(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u)for(var s=0,l=u.length,f;s<l;++s){for(i=0,f=u[s];i<a;++i){if((o=r[i]).type===f.type&&o.name===f.name){return f.value}}}return}u=e?Ot:qt;if(n==null)n=false;for(i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Rt(t,e,n){var r=L(t),i=r.CustomEvent;if(typeof i==="function"){i=new i(e,n)}else{i=r.document.createEvent("Event");if(n)i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail;else i.initEvent(e,false,false)}t.dispatchEvent(i)}function zt(t,e){return function(){return Rt(this,t,e)}}function Xt(t,e){return function(){return Rt(this,t,e.apply(this,arguments))}}function jt(t,e){return this.each((typeof e==="function"?Xt:zt)(t,e))}var $t=[null];function Ht(t,e){this._groups=t;this._parents=e}function Lt(){return new Ht([[document.documentElement]],$t)}Ht.prototype=Lt.prototype={constructor:Ht,select:s,selectAll:c,filter:p,data:b,enter:d,exit:x,join:A,merge:N,order:k,sort:M,call:S,nodes:T,node:C,size:P,empty:q,each:O,attr:H,style:Y,property:J,classed:at,text:lt,html:pt,raise:dt,lower:vt,append:mt,insert:wt,remove:xt,clone:kt,datum:Mt,on:It,dispatch:jt};function Bt(t){return typeof t==="string"?new Ht([[document.querySelector(t)]],[document.documentElement]):new Ht([[t]],$t)}var Dt="$";function Vt(){}Vt.prototype=Yt.prototype={constructor:Vt,has:function(t){return Dt+t in this},get:function(t){return this[Dt+t]},set:function(t,e){this[Dt+t]=e;return this},remove:function(t){var e=Dt+t;return e in this&&delete this[e]},clear:function(){for(var t in this)if(t[0]===Dt)delete this[t]},keys:function(){var t=[];for(var e in this)if(e[0]===Dt)t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)if(e[0]===Dt)t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)if(e[0]===Dt)t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)if(e[0]===Dt)++t;return t},empty:function(){for(var t in this)if(t[0]===Dt)return false;return true},each:function(t){for(var e in this)if(e[0]===Dt)t(this[e],e.slice(1),this)}};function Yt(t,e){var n=new Vt;if(t instanceof Vt)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r=-1,i=t.length,a;if(e==null)while(++r<i)n.set(r,t[r]);else while(++r<i)n.set(e(a=t[r],r,t),a)}else if(t)for(var o in t)n.set(o,t[o]);return n}function Ft(){}var Ut=Yt.prototype;Ft.prototype={constructor:Ft,has:Ut.has,add:function(t){t+="";this[Dt+t]=t;return this},remove:Ut.remove,clear:Ut.clear,values:Ut.keys,size:Ut.size,empty:Ut.empty,each:Ut.each};const Wt=document.createElement("canvas");const Gt=Wt.getContext("2d");function Jt(){return window.getComputedStyle(document.body).direction||"ltr"}function Kt(t,e,n,r,i=true){if(typeof t!=="string")t=String(t);const a=t=>Gt.measureText(t).width>r;const o=(t,e)=>{let n=Gt.measureText(t).width;if(n<=e){return t}let r=1;let i=t;do{i=t.substring(0,t.length-r)+"…";n=Gt.measureText(i).width}while(n>e&&++r<t.length);if(i.length<1)i=t.substring(0,1)+"…";return i};Gt.font=e;let u=[];Object.defineProperty(u,"widest_line",{value:0,enumerable:true,writable:true});Object.defineProperty(u,"has_truncated",{value:false,enumerable:true,writable:true});if(typeof t==="undefined"||Number.isInteger(n)&&n<=0)return u;if(t.length===0){u.push("");return u}if(r<=0){if(t.length>0){u.push(t.slice(0,1)+"…");u.widest_line=Gt.measureText(u[0]).width}return u}if(!t||t.length===0||n===0||r<=0)return u;const s=t.split(/\s+/g);if(!a(t)){u.push(t);u.widest_line=Gt.measureText(t).width;u.has_truncated=false;return u}let l=new String(s[0]);if(l&&a(l)){if(i){l=o(l,r)}else if(s.length>1){l+="…"}u.push(l);u.widest_line=Gt.measureText(l).width;u.has_truncated=true;return u}let f="";let c=false;s.forEach((t=>{if(c)return;if(a(f+(f?" ":"")+t)){if(f){const t=Gt.measureText(f).width;if(t>r){f=o(f,r);c=true}u.push(f);f=""}f=t}else{f+=(f?" ":"")+t}}));if(f&&!c){u.push(o(f,r))}if(u.length>n){const t=u.length>n;if(t&&Number.isInteger(n)){u.splice(n,u.length-n);let t=u[u.length-1];if(a(t+"…")){t=o(t,r-Gt.measureText("…").width)}if(t.slice(-1)!=="…"){t+="…"}u[u.length-1]=t;c=true}}u.widest_line=Math.max(...u.map((t=>Gt.measureText(t).width)));u.has_truncated=c;return u}var Qt={value:function(){}};function Zt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new te(n)}function te(t){this._=t}function ee(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0)n=t.slice(r+1),t=t.slice(0,r);if(t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}te.prototype=Zt.prototype={constructor:te,on:function(t,e){var n=this._,r=ee(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){while(++a<o)if((i=(t=r[a]).type)&&(i=ne(n[i],t.name)))return i;return}if(e!=null&&typeof e!=="function")throw new Error("invalid callback: "+e);while(++a<o){if(i=(t=r[a]).type)n[i]=re(n[i],t.name,e);else if(e==null)for(i in n)n[i]=re(n[i],t.name,null)}return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new te(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function ne(t,e){for(var n=0,r=t.length,i;n<r;++n){if((i=t[n]).name===e){return i.value}}}function re(t,e,n){for(var r=0,i=t.length;r<i;++r){if(t[r].name===e){t[r]=Qt,t=t.slice(0,r).concat(t.slice(r+1));break}}if(n!=null)t.push({name:e,value:n});return t}var ie=0,ae=0,oe=0,ue=1e3,se,le,fe=0,ce=0,he=0,pe=typeof performance==="object"&&performance.now?performance:Date,_e=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function de(){return ce||(_e(ge),ce=pe.now()+he)}function ge(){ce=0}function ve(){this._call=this._time=this._next=null}ve.prototype=me.prototype={constructor:ve,restart:function(t,e,n){if(typeof t!=="function")throw new TypeError("callback is not a function");n=(n==null?de():+n)+(e==null?0:+e);if(!this._next&&le!==this){if(le)le._next=this;else se=this;le=this}this._call=t;this._time=n;Ae()},stop:function(){if(this._call){this._call=null;this._time=Infinity;Ae()}}};function me(t,e,n){var r=new ve;r.restart(t,e,n);return r}function ye(){de();++ie;var t=se,e;while(t){if((e=ce-t._time)>=0)t._call.call(null,e);t=t._next}--ie}function we(){ce=(fe=pe.now())+he;ie=ae=0;try{ye()}finally{ie=0;xe();ce=0}}function be(){var t=pe.now(),e=t-fe;if(e>ue)he-=e,fe=t}function xe(){var t,e=se,n,r=Infinity;while(e){if(e._call){if(r>e._time)r=e._time;t=e,e=e._next}else{n=e._next,e._next=null;e=t?t._next=n:se=n}}le=t;Ae(r)}function Ae(t){if(ie)return;if(ae)ae=clearTimeout(ae);var e=t-ce;if(e>24){if(t<Infinity)ae=setTimeout(we,t-pe.now()-he);if(oe)oe=clearInterval(oe)}else{if(!oe)fe=pe.now(),oe=setInterval(be,ue);ie=1,_e(we)}}function Ne(t,e,n){var r=new ve;e=e==null?0:+e;r.restart((function(n){r.stop();t(n+e)}),e,n);return r}var ke=Zt("start","end","cancel","interrupt");var Me=[];var Ee=0;var Se=1;var Te=2;var Ce=3;var Pe=4;var qe=5;var Oe=6;function Ie(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;je(t,n,{name:e,index:r,group:i,on:ke,tween:Me,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Ee})}function Re(t,e){var n=Xe(t,e);if(n.state>Ee)throw new Error("too late; already scheduled");return n}function ze(t,e){var n=Xe(t,e);if(n.state>Ce)throw new Error("too late; already running");return n}function Xe(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function je(t,e,n){var r=t.__transition,i;r[e]=n;n.timer=me(a,0,n.time);function a(t){n.state=Se;n.timer.restart(o,n.delay,n.time);if(n.delay<=t)o(t-n.delay)}function o(a){var l,f,c,h;if(n.state!==Se)return s();for(l in r){h=r[l];if(h.name!==n.name)continue;if(h.state===Ce)return Ne(o);if(h.state===Pe){h.state=Oe;h.timer.stop();h.on.call("interrupt",t,t.__data__,h.index,h.group);delete r[l]}else if(+l<e){h.state=Oe;h.timer.stop();h.on.call("cancel",t,t.__data__,h.index,h.group);delete r[l]}}Ne((function(){if(n.state===Ce){n.state=Pe;n.timer.restart(u,n.delay,n.time);u(a)}}));n.state=Te;n.on.call("start",t,t.__data__,n.index,n.group);if(n.state!==Te)return;n.state=Ce;i=new Array(c=n.tween.length);for(l=0,f=-1;l<c;++l){if(h=n.tween[l].value.call(t,t.__data__,n.index,n.group)){i[++f]=h}}i.length=f+1}function u(e){var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=qe,1),a=-1,o=i.length;while(++a<o){i[a].call(t,r)}if(n.state===qe){n.on.call("end",t,t.__data__,n.index,n.group);s()}}function s(){n.state=Oe;n.timer.stop();delete r[e];for(var i in r)return;delete t.__transition}}function $e(t,e){var n=t.__transition,r,i,a=true,o;if(!n)return;e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=false;continue}i=r.state>Te&&r.state<qe;r.state=Oe;r.timer.stop();r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group);delete n[o]}if(a)delete t.__transition}function He(t){return this.each((function(){$e(this,t)}))}function Le(t,e,n){t.prototype=e.prototype=n;n.constructor=t}function Be(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function De(){}var Ve=.7;var Ye=1/Ve;var Fe="\\s*([+-]?\\d+)\\s*",Ue="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ge=/^#([0-9a-f]{3,8})$/,Je=new RegExp("^rgb\\("+[Fe,Fe,Fe]+"\\)$"),Ke=new RegExp("^rgb\\("+[We,We,We]+"\\)$"),Qe=new RegExp("^rgba\\("+[Fe,Fe,Fe,Ue]+"\\)$"),Ze=new RegExp("^rgba\\("+[We,We,We,Ue]+"\\)$"),tn=new RegExp("^hsl\\("+[Ue,We,We]+"\\)$"),en=new RegExp("^hsla\\("+[Ue,We,We,Ue]+"\\)$");var nn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Le(De,un,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:rn,formatHex:rn,formatHsl:an,formatRgb:on,toString:on});function rn(){return this.rgb().formatHex()}function an(){return vn(this).formatHsl()}function on(){return this.rgb().formatRgb()}function un(t){var e,n;t=(t+"").trim().toLowerCase();return(e=Ge.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?sn(e):n===3?new hn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ln(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ln(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Je.exec(t))?new hn(e[1],e[2],e[3],1):(e=Ke.exec(t))?new hn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qe.exec(t))?ln(e[1],e[2],e[3],e[4]):(e=Ze.exec(t))?ln(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tn.exec(t))?gn(e[1],e[2]/100,e[3]/100,1):(e=en.exec(t))?gn(e[1],e[2]/100,e[3]/100,e[4]):nn.hasOwnProperty(t)?sn(nn[t]):t==="transparent"?new hn(NaN,NaN,NaN,0):null}function sn(t){return new hn(t>>16&255,t>>8&255,t&255,1)}function ln(t,e,n,r){if(r<=0)t=e=n=NaN;return new hn(t,e,n,r)}function fn(t){if(!(t instanceof De))t=un(t);if(!t)return new hn;t=t.rgb();return new hn(t.r,t.g,t.b,t.opacity)}function cn(t,e,n,r){return arguments.length===1?fn(t):new hn(t,e,n,r==null?1:r)}function hn(t,e,n,r){this.r=+t;this.g=+e;this.b=+n;this.opacity=+r}Le(hn,cn,Be(De,{brighter:function(t){t=t==null?Ye:Math.pow(Ye,t);return new hn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){t=t==null?Ve:Math.pow(Ve,t);return new hn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&(-.5<=this.g&&this.g<255.5)&&(-.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:pn,formatHex:pn,formatRgb:_n,toString:_n}));function pn(){return"#"+dn(this.r)+dn(this.g)+dn(this.b)}function _n(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function dn(t){t=Math.max(0,Math.min(255,Math.round(t)||0));return(t<16?"0":"")+t.toString(16)}function gn(t,e,n,r){if(r<=0)t=e=n=NaN;else if(n<=0||n>=1)t=e=NaN;else if(e<=0)t=NaN;return new yn(t,e,n,r)}function vn(t){if(t instanceof yn)return new yn(t.h,t.s,t.l,t.opacity);if(!(t instanceof De))t=un(t);if(!t)return new yn;if(t instanceof yn)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;if(u){if(e===a)o=(n-r)/u+(n<r)*6;else if(n===a)o=(r-e)/u+2;else o=(e-n)/u+4;u/=s<.5?a+i:2-a-i;o*=60}else{u=s>0&&s<1?0:o}return new yn(o,u,s,t.opacity)}function mn(t,e,n,r){return arguments.length===1?vn(t):new yn(t,e,n,r==null?1:r)}function yn(t,e,n,r){this.h=+t;this.s=+e;this.l=+n;this.opacity=+r}Le(yn,mn,Be(De,{brighter:function(t){t=t==null?Ye:Math.pow(Ye,t);return new yn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){t=t==null?Ve:Math.pow(Ve,t);return new yn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new hn(wn(t>=240?t-240:t+120,i,r),wn(t,i,r),wn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl:function(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function wn(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function bn(t){return function(){return t}}function xn(t,e){return function(n){return t+n*e}}function An(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Nn(t){return(t=+t)===1?kn:function(e,n){return n-e?An(e,n,t):bn(isNaN(e)?n:e)}}function kn(t,e){var n=e-t;return n?xn(t,n):bn(isNaN(t)?e:t)}var Mn=function t(e){var n=Nn(e);function r(t,e){var r=n((t=cn(t)).r,(e=cn(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=kn(t.opacity,e.opacity);return function(e){t.r=r(e);t.g=i(e);t.b=a(e);t.opacity=o(e);return t+""}}r.gamma=t;return r}(1);function En(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Sn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tn=new RegExp(Sn.source,"g");function Cn(t){return function(){return t}}function Pn(t){return function(e){return t(e)+""}}function qn(t,e){var n=Sn.lastIndex=Tn.lastIndex=0,r,i,a,o=-1,u=[],s=[];t=t+"",e=e+"";while((r=Sn.exec(t))&&(i=Tn.exec(e))){if((a=i.index)>n){a=e.slice(n,a);if(u[o])u[o]+=a;else u[++o]=a}if((r=r[0])===(i=i[0])){if(u[o])u[o]+=i;else u[++o]=i}else{u[++o]=null;s.push({i:o,x:En(r,i)})}n=Tn.lastIndex}if(n<e.length){a=e.slice(n);if(u[o])u[o]+=a;else u[++o]=a}return u.length<2?s[0]?Pn(s[0].x):Cn(e):(e=s.length,function(t){for(var n=0,r;n<e;++n)u[(r=s[n]).i]=r.x(t);return u.join("")})}var On=180/Math.PI;var In={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rn(t,e,n,r,i,a){var o,u,s;if(o=Math.sqrt(t*t+e*e))t/=o,e/=o;if(s=t*n+e*r)n-=t*s,r-=e*s;if(u=Math.sqrt(n*n+r*r))n/=u,r/=u,s/=u;if(t*r<e*n)t=-t,e=-e,s=-s,o=-o;return{translateX:i,translateY:a,rotate:Math.atan2(e,t)*On,skewX:Math.atan(s)*On,scaleX:o,scaleY:u}}var zn,Xn,jn,$n;function Hn(t){if(t==="none")return In;if(!zn)zn=document.createElement("DIV"),Xn=document.documentElement,jn=document.defaultView;zn.style.transform=t;t=jn.getComputedStyle(Xn.appendChild(zn),null).getPropertyValue("transform");Xn.removeChild(zn);t=t.slice(7,-1).split(",");return Rn(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5])}function Ln(t){if(t==null)return In;if(!$n)$n=document.createElementNS("http://www.w3.org/2000/svg","g");$n.setAttribute("transform",t);if(!(t=$n.transform.baseVal.consolidate()))return In;t=t.matrix;return Rn(t.a,t.b,t.c,t.d,t.e,t.f)}function Bn(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}function a(t,r,i,a,o,u){if(t!==i||r!==a){var s=o.push("translate(",null,e,null,n);u.push({i:s-4,x:En(t,i)},{i:s-2,x:En(r,a)})}else if(i||a){o.push("translate("+i+e+a+n)}}function o(t,e,n,a){if(t!==e){if(t-e>180)e+=360;else if(e-t>180)t+=360;a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:En(t,e)})}else if(e){n.push(i(n)+"rotate("+e+r)}}function u(t,e,n,a){if(t!==e){a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:En(t,e)})}else if(e){n.push(i(n)+"skewX("+e+r)}}function s(t,e,n,r,a,o){if(t!==n||e!==r){var u=a.push(i(a)+"scale(",null,",",null,")");o.push({i:u-4,x:En(t,n)},{i:u-2,x:En(e,r)})}else if(n!==1||r!==1){a.push(i(a)+"scale("+n+","+r+")")}}return function(e,n){var r=[],i=[];e=t(e),n=t(n);a(e.translateX,e.translateY,n.translateX,n.translateY,r,i);o(e.rotate,n.rotate,r,i);u(e.skewX,n.skewX,r,i);s(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i);e=n=null;return function(t){var e=-1,n=i.length,a;while(++e<n)r[(a=i[e]).i]=a.x(t);return r.join("")}}}var Dn=Bn(Hn,"px, ","px)","deg)");var Vn=Bn(Ln,", ",")",")");function Yn(t,e){var n,r;return function(){var i=ze(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o){if(r[o].name===e){r=r.slice();r.splice(o,1);break}}}i.tween=r}}function Fn(t,e,n){var r,i;if(typeof n!=="function")throw new Error;return function(){var a=ze(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s){if(i[s].name===e){i[s]=u;break}}if(s===l)i.push(u)}a.tween=i}}function Un(t,e){var n=this._id;t+="";if(arguments.length<2){var r=Xe(this.node(),n).tween;for(var i=0,a=r.length,o;i<a;++i){if((o=r[i]).name===t){return o.value}}return null}return this.each((e==null?Yn:Fn)(n,t,e))}function Wn(t,e,n){var r=t._id;t.each((function(){var t=ze(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}));return function(t){return Xe(t,r).value[e]}}function Gn(t,e){var n;return(typeof e==="number"?En:e instanceof un?Mn:(n=un(e))?(e=n,Mn):qn)(t,e)}function Jn(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qn(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Zn(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function tr(t,e,n){var r,i,a;return function(){var o,u=n(this),s;if(u==null)return void this.removeAttribute(t);o=this.getAttribute(t);s=u+"";return o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function er(t,e,n){var r,i,a;return function(){var o,u=n(this),s;if(u==null)return void this.removeAttributeNS(t.space,t.local);o=this.getAttributeNS(t.space,t.local);s=u+"";return o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function nr(t,e){var r=n(t),i=r==="transform"?Vn:Gn;return this.attrTween(t,typeof e==="function"?(r.local?er:tr)(r,i,Wn(this,"attr."+t,e)):e==null?(r.local?Kn:Jn)(r):(r.local?Zn:Qn)(r,i,e))}function rr(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ir(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function ar(t,e){var n,r;function i(){var i=e.apply(this,arguments);if(i!==r)n=(r=i)&&ir(t,i);return n}i._value=e;return i}function or(t,e){var n,r;function i(){var i=e.apply(this,arguments);if(i!==r)n=(r=i)&&rr(t,i);return n}i._value=e;return i}function ur(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!=="function")throw new Error;var i=n(t);return this.tween(r,(i.local?ar:or)(i,e))}function sr(t,e){return function(){Re(this,t).delay=+e.apply(this,arguments)}}function lr(t,e){return e=+e,function(){Re(this,t).delay=e}}function fr(t){var e=this._id;return arguments.length?this.each((typeof t==="function"?sr:lr)(e,t)):Xe(this.node(),e).delay}function cr(t,e){return function(){ze(this,t).duration=+e.apply(this,arguments)}}function hr(t,e){return e=+e,function(){ze(this,t).duration=e}}function pr(t){var e=this._id;return arguments.length?this.each((typeof t==="function"?cr:hr)(e,t)):Xe(this.node(),e).duration}function _r(t,e){if(typeof e!=="function")throw new Error;return function(){ze(this,t).ease=e}}function dr(t){var e=this._id;return arguments.length?this.each(_r(e,t)):Xe(this.node(),e).ease}function gr(t){if(typeof t!=="function")t=h(t);for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l){if((s=a[l])&&t.call(s,s.__data__,l,a)){u.push(s)}}}return new Yr(r,this._parents,this._name,this._id)}function vr(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u){for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,p=0;p<f;++p){if(h=s[p]||l[p]){c[p]=h}}}for(;u<r;++u){o[u]=e[u]}return new Yr(o,this._parents,this._name,this._id)}function mr(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");if(e>=0)t=t.slice(0,e);return!t||t==="start"}))}function yr(t,e,n){var r,i,a=mr(e)?Re:ze;return function(){var o=a(this,t),u=o.on;if(u!==r)(i=(r=u).copy()).on(e,n);o.on=i}}function wr(t,e){var n=this._id;return arguments.length<2?Xe(this.node(),n).on.on(t):this.each(yr(n,t,e))}function br(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;if(e)e.removeChild(this)}}function xr(){return this.on("end.remove",br(this._id))}function Ar(t){var e=this._name,n=this._id;if(typeof t!=="function")t=u(t);for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o){for(var s=r[o],l=s.length,f=a[o]=new Array(l),c,h,p=0;p<l;++p){if((c=s[p])&&(h=t.call(c,c.__data__,p,s))){if("__data__"in c)h.__data__=c.__data__;f[p]=h;Ie(f[p],e,n,p,f,Xe(c,n))}}}return new Yr(a,this._parents,e,n)}function Nr(t){var e=this._name,n=this._id;if(typeof t!=="function")t=f(t);for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u){for(var s=r[u],l=s.length,c,h=0;h<l;++h){if(c=s[h]){for(var p=t.call(c,c.__data__,h,s),_,d=Xe(c,n),g=0,v=p.length;g<v;++g){if(_=p[g]){Ie(_,e,n,g,p,d)}}a.push(p);o.push(c)}}}return new Yr(a,o,e,n)}var kr=Lt.prototype.constructor;function Mr(){return new kr(this._groups,this._parents)}function Er(t,e){var n,r,i;return function(){var a=F(this,t),o=(this.style.removeProperty(t),F(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Sr(t){return function(){this.style.removeProperty(t)}}function Tr(t,e,n){var r,i=n+"",a;return function(){var o=F(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Cr(t,e,n){var r,i,a;return function(){var o=F(this,t),u=n(this),s=u+"";if(u==null)s=u=(this.style.removeProperty(t),F(this,t));return o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function Pr(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=ze(this,t),l=s.on,f=s.value[a]==null?u||(u=Sr(e)):undefined;if(l!==n||i!==f)(r=(n=l).copy()).on(o,i=f);s.on=r}}function qr(t,e,n){var r=(t+="")==="transform"?Dn:Gn;return e==null?this.styleTween(t,Er(t,r)).on("end.style."+t,Sr(t)):typeof e==="function"?this.styleTween(t,Cr(t,r,Wn(this,"style."+t,e))).each(Pr(this._id,t)):this.styleTween(t,Tr(t,r,e),n).on("end.style."+t,null)}function Or(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Ir(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);if(a!==i)r=(i=a)&&Or(t,a,n);return r}a._value=e;return a}function Rr(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!=="function")throw new Error;return this.tween(r,Ir(t,e,n==null?"":n))}function zr(t){return function(){this.textContent=t}}function Xr(t){return function(){var e=t(this);this.textContent=e==null?"":e}}function jr(t){return this.tween("text",typeof t==="function"?Xr(Wn(this,"text",t)):zr(t==null?"":t+""))}function $r(t){return function(e){this.textContent=t.call(this,e)}}function Hr(t){var e,n;function r(){var r=t.apply(this,arguments);if(r!==n)e=(n=r)&&$r(r);return e}r._value=t;return r}function Lr(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!=="function")throw new Error;return this.tween(e,Hr(t))}function Br(){var t=this._name,e=this._id,n=Fr();for(var r=this._groups,i=r.length,a=0;a<i;++a){for(var o=r[a],u=o.length,s,l=0;l<u;++l){if(s=o[l]){var f=Xe(s,e);Ie(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}}}return new Yr(r,this._parents,t,n)}function Dr(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(a,o){var u={value:o},s={value:function(){if(--i===0)a()}};n.each((function(){var n=ze(this,r),i=n.on;if(i!==t){e=(t=i).copy();e._.cancel.push(u);e._.interrupt.push(u);e._.end.push(s)}n.on=e}))}))}var Vr=0;function Yr(t,e,n,r){this._groups=t;this._parents=e;this._name=n;this._id=r}function Fr(){return++Vr}var Ur=Lt.prototype;Yr.prototype={constructor:Yr,select:Ar,selectAll:Nr,filter:gr,merge:vr,selection:Mr,transition:Br,call:Ur.call,nodes:Ur.nodes,node:Ur.node,size:Ur.size,empty:Ur.empty,each:Ur.each,on:wr,attr:nr,attrTween:ur,style:qr,styleTween:Rr,text:jr,textTween:Lr,remove:xr,tween:Un,delay:fr,duration:pr,ease:dr,end:Dr};function Wr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Gr={time:null,delay:0,duration:250,ease:Wr};function Jr(t,e){var n;while(!(n=t.__transition)||!(n=n[e])){if(!(t=t.parentNode)){return Gr.time=de(),Gr}}return n}function Kr(t){var e,n;if(t instanceof Yr){e=t._id,t=t._name}else{e=Fr(),(n=Gr).time=de(),t=t==null?null:t+""}for(var r=this._groups,i=r.length,a=0;a<i;++a){for(var o=r[a],u=o.length,s,l=0;l<u;++l){if(s=o[l]){Ie(s,t,e,l,o,n||Jr(s,e))}}}return new Yr(r,this._parents,t,e)}Lt.prototype.interrupt=He;Lt.prototype.transition=Kr;var Qr={gutter_w:1,gutter_h:1,min_width:300,max_width:null,columns_fixed:false,columns:2,titles:true,title_color_mode:"auto",title_color:null,title_size:1,title_unit:"rem",title_weight:600,title_padding_top:.25,title_padding_bottom:.25,title_align:"auto",title_bg:"none",title_bg_padding:.25,title_bg_mode:"fixed",title_bg_color:"#eeeeee",animation:"auto"};function Zr(t){for(var e in Qr){if(!(e in t))t[e]=Qr[e]}var n=document.createElementNS("http://www.w3.org/2000/svg","g");n.setAttribute("class","fl-facets");this._container=n;this._state=t;this._duration=1e3;this._width=window.innerWidth;this._height=window.innerHeight;this._facet_width=null;this._facet_aspect=null;this._facet_aspect_margin_top=0;this._facet_aspect_margin_right=0;this._facet_aspect_margin_bottom=0;this._facet_aspect_margin_left=0;this._facet_height=null;this._is_ragged=null;this._max=100;this._axis_space_top=0;this._axis_space_bottom=0;this._axis_space_left=0;this._axis_space_right=0;this._hide_title=null;this._titleColor=null;this._autoTitleAlign=function(){return"left"};this._computed_height=this._height;this._data=[];this._data_names=[];this._read_direction=null;return this}Zr.prototype.appendTo=function(t){t.appendChild(this._container);return this};Zr.prototype.width=function(t){this._width=t;return this};Zr.prototype.height=function(t){if(typeof t=="undefined")return this._computed_height;else this._height=t;if(t!==null){this._facet_aspect=null;this._facet_height=null}return this};Zr.prototype.facetHeight=function(t){this._facet_height=t;if(t!==null){this._facet_aspect=null;this._height=null}return this};Zr.prototype.facetAspect=function(t,e){this._facet_aspect=t;if(t!==null){this._facet_height=null;this._height=null;if(e){if("top"in e)this._facet_aspect_margin_top=e.top;if("right"in e)this._facet_aspect_margin_right=e.right;if("bottom"in e)this._facet_aspect_margin_bottom=e.bottom;if("left"in e)this._facet_aspect_margin_left=e.left}}return this};Zr.prototype.axisSpaceTop=function(t){this._axis_space_top=t;return this};Zr.prototype.axisSpaceBottom=function(t){this._axis_space_bottom=t;return this};Zr.prototype.axisSpaceLeft=function(t){this._axis_space_left=t;return this};Zr.prototype.axisSpaceRight=function(t){this._axis_space_right=t;return this};Zr.prototype.debug=function(t){this._debug=!!t;return this};Zr.prototype.data=function(t,e){this._data=t;this._data_names=e?t.map(e):t;return this};Zr.prototype.duration=function(t){this._duration=t;return this};Zr.prototype.autoTitleAlign=function(t){this._autoTitleAlign=t;return this};Zr.prototype.titleColor=function(t){this._titleColor=t;return this};Zr.prototype.hideTitle=function(t){this._hide_title=t;return this};Zr.prototype.readDirection=function(t){if(["ltr","rtl"].includes(t)){this._read_direction=t}else{console.warn('Read direction must be one of "ltr" or "rtl"')}return this};Zr.prototype.update=function(t){var e=this;var n=this._state;var r=this._duration;var i=this._data.slice(0,this._max);var a=this._data_names;var o=i.length;var u=ni(n.gutter_w);var s=ni(n.gutter_h);var l=this._axis_space_left;var f=this._axis_space_right;var c=this._axis_space_top;var h=this._axis_space_bottom;var p=this._width-l-f;var _=this._height==null?null:this._height-c-h;var d=this._facet_aspect;var g=this._facet_aspect_margin_right+this._facet_aspect_margin_left;var v=this._facet_aspect_margin_top+this._facet_aspect_margin_bottom;var m=this._facet_height;var y=n.titles&&!(o==1&&(a[0]==""||a[0]==this._hide_title));var w=this._read_direction||Jt();var b=ri(n.title_align!="auto"?n.title_align:this._autoTitleAlign(),w);var x,A;if(n.columns_fixed){x=o==1?1:Math.floor(n.columns);A=Math.ceil(o/x)}else{var N=Math.floor((p+u)/(n.min_width+u));x=Math.max(1,Math.min(N,o));A=Math.ceil(o/x);for(var k=x;k>0;k--){if(Math.ceil(o/(x-1))==A)x--;else break}}e._num_columns=x;e._num_rows=A;e._is_ragged=o%x!=0&&o>x;var M=n.max_width||Infinity;var E=u*(x-1);var S=Math.max(0,Math.min(M,(p-E)/x));var T=Math.max(0,p-S*x-E);e._facet_width=S;var C=n.title_unit=="rem"?ni(n.title_size):n.title_size*S/15;var P=getComputedStyle(this._container).fontFamily;var q=`${n.title_weight} ${C}px ${P}`;var O=n.title_bg=="none"?0:C*n.title_bg_padding;var I=S-O*2;var R=a.map((function(t){return Kt(t,q,5,I)}));var z=at();var X=Math.max(...Object.values(z));var j=ot(X);var $=100;if(_!=null){$=Math.max(0,(_-s*(A-1))/A);this._computed_height=this._height}else{if(m!=null)$=j+m;else if(d!=null)$=j+v+(S-g)/d;this._computed_height=$*A+s*(A-1)+c+h}var H=Bt(this._container).selectAll(".fl-facet").data(a,(function(t,e){if(n.animation=="name")return t;if(n.animation=="reuse")return e;return i.length==1?e:t}));var L=H.enter().append("g").attr("class","fl-facet").attr("transform",(function(t,e){return Z(e)}));L.append("rect").attr("class","fl-facet-rect").attr("width",S).attr("height",$);L.append("rect").attr("class","fl-facet-primary-rect").attr("width",S).attr("height",$);var B=ii(b,w);var D=L.append("g").attr("class","fl-facet-title");D.append("rect").attr("class","fl-facet-title-bg");D.append("text").attr("class","fl-facet-title-text").attr("font-size",C).attr("font-weight",n.title_weight).attr("fill",nt).each(ut).attr("transform",tt).attr("opacity",0).attr("text-anchor",B);L.select(".facet-title-bg").attr("height",j).attr("width",it).attr("fill",rt).attr("x",et).attr("opacity",0);L.append("g").attr("class","fl-facet-primary").attr("transform","translate(0, "+j+")");var V=H.merge(L);V.transition().duration(r).attr("transform",(function(t,e){return Z(e)})).each(G).attr("opacity",1).on("interrupt",(function(){Bt(this).attr("opacity",1)}));V.select(".fl-facet-rect").attr("width",S).attr("height",$).attr("fill",e._debug?"rgba(230, 100, 100, 0.33)":"none");V.select(".fl-facet-primary-rect").attr("width",S).attr("height",$-j).attr("y",j).attr("fill",e._debug?"rgba(230, 100, 100, 0.33)":"none");var Y=V.select(".fl-facet-title");Y.select(".fl-facet-title-text").attr("font-size",C).attr("font-weight",n.title_weight).attr("text-anchor",B).each(ut).transition().duration(r).attr("fill",nt).attr("transform",tt).attr("opacity",y?1:0);Y.select(".fl-facet-title-bg").transition().duration(r).attr("height",j).attr("width",it).attr("fill",rt).attr("x",et).attr("opacity",y?1:0);var F=Y.select(".fl-facet-title-text").selectAll("tspan").data((function(t,e){return R[e]}));var U=F.enter().append("tspan");F.merge(U).text((function(t){return t})).attr("x",0).attr("y",((t,e)=>e*C)).attr("dx",ai(b,O)).attr("text-anchor",B);F.exit().remove();V.select(".fl-facet-primary").each(J).transition().duration(r).attr("transform","translate(0, "+j+")");var W=H.exit();W.each(G).classed("fl-facet",false).transition().duration(r/2).attr("opacity",0).remove();W.select(".fl-facet-primary").transition().duration(r).attr("transform","translate(0, "+j+")");function G(t,e){var n=K(e),r=Q(e);this.__facet_outer__={node:this,name:t,width:S,height:$,x:n,y:r,cx:n+S/2,cy:r+$/2}}function J(e,n){var r=K(n);var a=Q(n)+j;var o=Math.max(0,$-j);this.__facet_inner__={node:this,data:i[n],name:e,width:S,height:o,x:r,y:a,cx:r+S/2,cy:a+o/2,row:Math.floor(n/x),column:Math.ceil(n%x)};if(t){var u=t.bind(this);u(this.__facet_inner__,n)}}function K(t){var e=Math.ceil(t%x);return l+(e*(S+u)+T/2)}function Q(t){var e=Math.floor(t/x);return c+e*($+s)}function Z(t){return"translate("+K(t)+", "+Q(t)+")"}function tt(t,e){let r=0;const i=(X-z[e])*C;const a=C*.8+C*n.title_padding_top+i;if(b=="center")r=S/2;if(b=="right")r=S;return`translate(${r}, ${a})`}function et(){if(n.title_bg=="full")return 0;if(b=="center")return S/2-this.parentNode.__title_width/2-O;if(b=="right")return S;return 0}function nt(t){if(n.title_color)return n.title_color;else if(e._titleColor)return e._titleColor(t);else return null}function rt(){return n.title_bg_color}function it(){if(n.title_bg=="none")return 0;else if(n.title_bg=="full")return S;return this.parentNode.__title_width+O*2}function at(){let t={};R.forEach((function(e,n){t[n]=e.length}));return t}function ot(t){return!y?0:C*t+C*(n.title_padding_top+n.title_padding_bottom)}function ut(){var t=this.getBBox().width;var e=parseFloat(this.getAttribute("font-size"));var n=C;this.parentNode.__title_width=t*n/e}this._facets=V.select(".fl-facet-primary").nodes().map((function(t){return t.__facet_inner__}));return this};Zr.prototype.facets=function(){return this._facets};Zr.prototype.facetWidth=function(){return this._facet_width};Zr.prototype.getFacet=function(t){var e=this._data_names.indexOf(t);return this._facets[e]};Zr.prototype.isRagged=function(){return this._is_ragged};Zr.prototype.numColumns=function(){return this._num_columns};Zr.prototype.numRows=function(){return this._num_rows};var ti,ei;function ni(t){if(window.innerWidth!==ti){ti=window.innerWidth;ei=parseFloat(getComputedStyle(document.documentElement).fontSize)}return t*ei}function ri(t,e){if(e==="rtl"){if(t==="left")return"right";if(t==="right")return"left"}return t}function ii(t,e){if(t==="center")return"middle";var n=e==="rtl";if(t==="left"){return n?"end":"start"}return n?"start":"end"}function ai(t,e){if(t==="left")return e;if(t==="right")return-e;else return 0}function oi(t,e){return new Zr(t)}return oi}));
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e():typeof define==="function"&&define.amd?define(e):(t=typeof globalThis!=="undefined"?globalThis:t||self,t.initFacets=e())})(this,(function(){"use strict";var t="http://www.w3.org/1999/xhtml";var e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function n(t){var n=t+="",r=n.indexOf(":");if(r>=0&&(n=t.slice(0,r))!=="xmlns")t=t.slice(r+1);return e.hasOwnProperty(n)?{space:e[n],local:t}:t}function r(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===t&&n.documentElement.namespaceURI===t?n.createElement(e):n.createElementNS(r,e)}}function i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t){var e=n(t);return(e.local?i:r)(e)}function o(){}function u(t){return t==null?o:function(){return this.querySelector(t)}}function s(t){if(typeof t!=="function")t=u(t);for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var a=e[i],o=a.length,s=r[i]=new Array(o),l,f,c=0;c<o;++c){if((l=a[c])&&(f=t.call(l,l.__data__,c,a))){if("__data__"in l)f.__data__=l.__data__;s[c]=f}}}return new Ht(r,this._parents)}function l(){return[]}function f(t){return t==null?l:function(){return this.querySelectorAll(t)}}function c(t){if(typeof t!=="function")t=f(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a){for(var o=e[a],u=o.length,s,l=0;l<u;++l){if(s=o[l]){r.push(t.call(s,s.__data__,l,o));i.push(s)}}}return new Ht(r,i)}function h(t){return function(){return this.matches(t)}}function p(t){if(typeof t!=="function")t=h(t);for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l){if((s=a[l])&&t.call(s,s.__data__,l,a)){u.push(s)}}}return new Ht(r,this._parents)}function _(t){return new Array(t.length)}function d(){return new Ht(this._enter||this._groups.map(_),this._parents)}function g(t,e){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=e}g.prototype={constructor:g,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function m(t){return function(){return t}}var v="$";function y(t,e,n,r,i,a){var o=0,u,s=e.length,l=a.length;for(;o<l;++o){if(u=e[o]){u.__data__=a[o];r[o]=u}else{n[o]=new g(t,a[o])}}for(;o<s;++o){if(u=e[o]){i[o]=u}}}function w(t,e,n,r,i,a,o){var u,s,l={},f=e.length,c=a.length,h=new Array(f),p;for(u=0;u<f;++u){if(s=e[u]){h[u]=p=v+o.call(s,s.__data__,u,e);if(p in l){i[u]=s}else{l[p]=s}}}for(u=0;u<c;++u){p=v+o.call(t,a[u],u,a);if(s=l[p]){r[u]=s;s.__data__=a[u];l[p]=null}else{n[u]=new g(t,a[u])}}for(u=0;u<f;++u){if((s=e[u])&&l[h[u]]===s){i[u]=s}}}function x(t,e){if(!t){p=new Array(this.size()),l=-1;this.each((function(t){p[++l]=t}));return p}var n=e?w:y,r=this._parents,i=this._groups;if(typeof t!=="function")t=m(t);for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,p=t.call(f,f&&f.__data__,l,r),_=p.length,d=u[l]=new Array(_),g=o[l]=new Array(_),v=s[l]=new Array(h);n(f,c,d,g,v,p,e);for(var x=0,b=0,A,N;x<_;++x){if(A=d[x]){if(x>=b)b=x+1;while(!(N=g[b])&&++b<_);A._next=N||null}}}o=new Ht(o,r);o._enter=u;o._exit=s;return o}function b(){return new Ht(this._exit||this._groups.map(_),this._parents)}function A(t,e,n){var r=this.enter(),i=this,a=this.exit();r=typeof t==="function"?t(r):r.append(t+"");if(e!=null)i=e(i);if(n==null)a.remove();else n(a);return r&&i?r.merge(i).order():i}function N(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u){for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,p=0;p<f;++p){if(h=s[p]||l[p]){c[p]=h}}}for(;u<r;++u){o[u]=e[u]}return new Ht(o,this._parents)}function M(){for(var t=this._groups,e=-1,n=t.length;++e<n;){for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;){if(o=r[i]){if(a&&o.compareDocumentPosition(a)^4)a.parentNode.insertBefore(o,a);a=o}}}return this}function k(t){if(!t)t=E;function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f){if(l=o[f]){s[f]=l}}s.sort(e)}return new Ht(i,this._parents).order()}function E(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function S(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this}function T(){var t=new Array(this.size()),e=-1;this.each((function(){t[++e]=this}));return t}function C(){for(var t=this._groups,e=0,n=t.length;e<n;++e){for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}}return null}function P(){var t=0;this.each((function(){++t}));return t}function q(){return!this.node()}function O(t){for(var e=this._groups,n=0,r=e.length;n<r;++n){for(var i=e[n],a=0,o=i.length,u;a<o;++a){if(u=i[a])t.call(u,u.__data__,a,i)}}return this}function I(t){return function(){this.removeAttribute(t)}}function R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function z(t,e){return function(){this.setAttribute(t,e)}}function $(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function X(t,e){return function(){var n=e.apply(this,arguments);if(n==null)this.removeAttribute(t);else this.setAttribute(t,n)}}function j(t,e){return function(){var n=e.apply(this,arguments);if(n==null)this.removeAttributeNS(t.space,t.local);else this.setAttributeNS(t.space,t.local,n)}}function H(t,e){var r=n(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((e==null?r.local?R:I:typeof e==="function"?r.local?j:X:r.local?$:z)(r,e))}function L(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function B(t){return function(){this.style.removeProperty(t)}}function D(t,e,n){return function(){this.style.setProperty(t,e,n)}}function F(t,e,n){return function(){var r=e.apply(this,arguments);if(r==null)this.style.removeProperty(t);else this.style.setProperty(t,r,n)}}function V(t,e,n){return arguments.length>1?this.each((e==null?B:typeof e==="function"?F:D)(t,e,n==null?"":n)):Y(this.node(),t)}function Y(t,e){return t.style.getPropertyValue(e)||L(t).getComputedStyle(t,null).getPropertyValue(e)}function U(t){return function(){delete this[t]}}function W(t,e){return function(){this[t]=e}}function G(t,e){return function(){var n=e.apply(this,arguments);if(n==null)delete this[t];else this[t]=n}}function J(t,e){return arguments.length>1?this.each((e==null?U:typeof e==="function"?G:W)(t,e)):this.node()[t]}function K(t){return t.trim().split(/^|\s+/)}function Q(t){return t.classList||new Z(t)}function Z(t){this._node=t;this._names=K(t.getAttribute("class")||"")}Z.prototype={add:function(t){var e=this._names.indexOf(t);if(e<0){this._names.push(t);this._node.setAttribute("class",this._names.join(" "))}},remove:function(t){var e=this._names.indexOf(t);if(e>=0){this._names.splice(e,1);this._node.setAttribute("class",this._names.join(" "))}},contains:function(t){return this._names.indexOf(t)>=0}};function tt(t,e){var n=Q(t),r=-1,i=e.length;while(++r<i)n.add(e[r])}function et(t,e){var n=Q(t),r=-1,i=e.length;while(++r<i)n.remove(e[r])}function nt(t){return function(){tt(this,t)}}function rt(t){return function(){et(this,t)}}function it(t,e){return function(){(e.apply(this,arguments)?tt:et)(this,t)}}function at(t,e){var n=K(t+"");if(arguments.length<2){var r=Q(this.node()),i=-1,a=n.length;while(++i<a)if(!r.contains(n[i]))return false;return true}return this.each((typeof e==="function"?it:e?nt:rt)(n,e))}function ot(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function st(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function lt(t){return arguments.length?this.each(t==null?ot:(typeof t==="function"?st:ut)(t)):this.node().textContent}function ft(){this.innerHTML=""}function ct(t){return function(){this.innerHTML=t}}function ht(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function pt(t){return arguments.length?this.each(t==null?ft:(typeof t==="function"?ht:ct)(t)):this.node().innerHTML}function _t(){if(this.nextSibling)this.parentNode.appendChild(this)}function dt(){return this.each(_t)}function gt(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mt(){return this.each(gt)}function vt(t){var e=typeof t==="function"?t:a(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))}function yt(){return null}function wt(t,e){var n=typeof t==="function"?t:a(t),r=e==null?yt:typeof e==="function"?e:u(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))}function xt(){var t=this.parentNode;if(t)t.removeChild(this)}function bt(){return this.each(xt)}function At(){var t=this.cloneNode(false),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Nt(){var t=this.cloneNode(true),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mt(t){return this.select(t?Nt:At)}function kt(t){return arguments.length?this.property("__data__",t):this.node().__data__}var Et={};if(typeof document!=="undefined"){var St=document.documentElement;if(!("onmouseenter"in St)){Et={mouseenter:"mouseover",mouseleave:"mouseout"}}}function Tt(t,e,n){t=Ct(t,e,n);return function(e){var n=e.relatedTarget;if(!n||n!==this&&!(n.compareDocumentPosition(this)&8)){t.call(this,e)}}}function Ct(t,e,n){return function(r){try{t.call(this,this.__data__,e,n)}finally{}}}function Pt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0)e=t.slice(n+1),t=t.slice(0,n);return{type:t,name:e}}))}function qt(t){return function(){var e=this.__on;if(!e)return;for(var n=0,r=-1,i=e.length,a;n<i;++n){if(a=e[n],(!t.type||a.type===t.type)&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.capture)}else{e[++r]=a}}if(++r)e.length=r;else delete this.__on}}function Ot(t,e,n){var r=Et.hasOwnProperty(t.type)?Tt:Ct;return function(i,a,o){var u=this.__on,s,l=r(e,a,o);if(u)for(var f=0,c=u.length;f<c;++f){if((s=u[f]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.capture);this.addEventListener(s.type,s.listener=l,s.capture=n);s.value=e;return}}this.addEventListener(t.type,l,n);s={type:t.type,name:t.name,value:e,listener:l,capture:n};if(!u)this.__on=[s];else u.push(s)}}function It(t,e,n){var r=Pt(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u)for(var s=0,l=u.length,f;s<l;++s){for(i=0,f=u[s];i<a;++i){if((o=r[i]).type===f.type&&o.name===f.name){return f.value}}}return}u=e?Ot:qt;if(n==null)n=false;for(i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Rt(t,e,n){var r=L(t),i=r.CustomEvent;if(typeof i==="function"){i=new i(e,n)}else{i=r.document.createEvent("Event");if(n)i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail;else i.initEvent(e,false,false)}t.dispatchEvent(i)}function zt(t,e){return function(){return Rt(this,t,e)}}function $t(t,e){return function(){return Rt(this,t,e.apply(this,arguments))}}function Xt(t,e){return this.each((typeof e==="function"?$t:zt)(t,e))}var jt=[null];function Ht(t,e){this._groups=t;this._parents=e}function Lt(){return new Ht([[document.documentElement]],jt)}Ht.prototype=Lt.prototype={constructor:Ht,select:s,selectAll:c,filter:p,data:x,enter:d,exit:b,join:A,merge:N,order:M,sort:k,call:S,nodes:T,node:C,size:P,empty:q,each:O,attr:H,style:V,property:J,classed:at,text:lt,html:pt,raise:dt,lower:mt,append:vt,insert:wt,remove:bt,clone:Mt,datum:kt,on:It,dispatch:Xt};function Bt(t){return typeof t==="string"?new Ht([[document.querySelector(t)]],[document.documentElement]):new Ht([[t]],jt)}var Dt="$";function Ft(){}Ft.prototype=Vt.prototype={constructor:Ft,has:function(t){return Dt+t in this},get:function(t){return this[Dt+t]},set:function(t,e){this[Dt+t]=e;return this},remove:function(t){var e=Dt+t;return e in this&&delete this[e]},clear:function(){for(var t in this)if(t[0]===Dt)delete this[t]},keys:function(){var t=[];for(var e in this)if(e[0]===Dt)t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)if(e[0]===Dt)t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)if(e[0]===Dt)t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)if(e[0]===Dt)++t;return t},empty:function(){for(var t in this)if(t[0]===Dt)return false;return true},each:function(t){for(var e in this)if(e[0]===Dt)t(this[e],e.slice(1),this)}};function Vt(t,e){var n=new Ft;if(t instanceof Ft)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r=-1,i=t.length,a;if(e==null)while(++r<i)n.set(r,t[r]);else while(++r<i)n.set(e(a=t[r],r,t),a)}else if(t)for(var o in t)n.set(o,t[o]);return n}function Yt(){}var Ut=Vt.prototype;Yt.prototype={constructor:Yt,has:Ut.has,add:function(t){t+="";this[Dt+t]=t;return this},remove:Ut.remove,clear:Ut.clear,values:Ut.keys,size:Ut.size,empty:Ut.empty,each:Ut.each};const Wt=document.createElement("canvas");const Gt=Wt.getContext("2d");function Jt(){return window.getComputedStyle(document.body).direction||"ltr"}function Kt(t,e,n,r,i=true){if(typeof t!=="string")t=String(t);const a=t=>Gt.measureText(t).width>r;const o=(t,e)=>{let n=Gt.measureText(t).width;if(n<=e){return t}let r=1;let i=t;do{i=t.substring(0,t.length-r)+"…";n=Gt.measureText(i).width}while(n>e&&++r<t.length);if(i.length<1)i=t.substring(0,1)+"…";return i};Gt.font=e;let u=[];Object.defineProperty(u,"widest_line",{value:0,enumerable:true,writable:true});Object.defineProperty(u,"has_truncated",{value:false,enumerable:true,writable:true});if(typeof t==="undefined"||Number.isInteger(n)&&n<=0)return u;if(t.length===0){u.push("");return u}if(r<=0){if(t.length>0){u.push(t.slice(0,1)+"…");u.widest_line=Gt.measureText(u[0]).width}return u}if(!t||t.length===0||n===0||r<=0)return u;const s=t.split(/\s+/g);if(!a(t)){u.push(t);u.widest_line=Gt.measureText(t).width;u.has_truncated=false;return u}let l=new String(s[0]);if(l&&a(l)){if(i){l=o(l,r)}else if(s.length>1){l+="…"}u.push(l);u.widest_line=Gt.measureText(l).width;u.has_truncated=true;return u}let f="";let c=false;s.forEach((t=>{if(c)return;if(a(f+(f?" ":"")+t)){if(f){const t=Gt.measureText(f).width;if(t>r){f=o(f,r);c=true}u.push(f);f=""}f=t}else{f+=(f?" ":"")+t}}));if(f&&!c){u.push(o(f,r))}if(u.length>n){const t=u.length>n;if(t&&Number.isInteger(n)){u.splice(n,u.length-n);let t=u[u.length-1];if(a(t+"…")){t=o(t,r-Gt.measureText("…").width)}if(t.slice(-1)!=="…"){t+="…"}u[u.length-1]=t;c=true}}u.widest_line=Math.max(...u.map((t=>Gt.measureText(t).width)));u.has_truncated=c;return u}var Qt={value:function(){}};function Zt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new te(n)}function te(t){this._=t}function ee(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0)n=t.slice(r+1),t=t.slice(0,r);if(t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}te.prototype=Zt.prototype={constructor:te,on:function(t,e){var n=this._,r=ee(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){while(++a<o)if((i=(t=r[a]).type)&&(i=ne(n[i],t.name)))return i;return}if(e!=null&&typeof e!=="function")throw new Error("invalid callback: "+e);while(++a<o){if(i=(t=r[a]).type)n[i]=re(n[i],t.name,e);else if(e==null)for(i in n)n[i]=re(n[i],t.name,null)}return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new te(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function ne(t,e){for(var n=0,r=t.length,i;n<r;++n){if((i=t[n]).name===e){return i.value}}}function re(t,e,n){for(var r=0,i=t.length;r<i;++r){if(t[r].name===e){t[r]=Qt,t=t.slice(0,r).concat(t.slice(r+1));break}}if(n!=null)t.push({name:e,value:n});return t}var ie=0,ae=0,oe=0,ue=1e3,se,le,fe=0,ce=0,he=0,pe=typeof performance==="object"&&performance.now?performance:Date,_e=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function de(){return ce||(_e(ge),ce=pe.now()+he)}function ge(){ce=0}function me(){this._call=this._time=this._next=null}me.prototype=ve.prototype={constructor:me,restart:function(t,e,n){if(typeof t!=="function")throw new TypeError("callback is not a function");n=(n==null?de():+n)+(e==null?0:+e);if(!this._next&&le!==this){if(le)le._next=this;else se=this;le=this}this._call=t;this._time=n;Ae()},stop:function(){if(this._call){this._call=null;this._time=Infinity;Ae()}}};function ve(t,e,n){var r=new me;r.restart(t,e,n);return r}function ye(){de();++ie;var t=se,e;while(t){if((e=ce-t._time)>=0)t._call.call(null,e);t=t._next}--ie}function we(){ce=(fe=pe.now())+he;ie=ae=0;try{ye()}finally{ie=0;be();ce=0}}function xe(){var t=pe.now(),e=t-fe;if(e>ue)he-=e,fe=t}function be(){var t,e=se,n,r=Infinity;while(e){if(e._call){if(r>e._time)r=e._time;t=e,e=e._next}else{n=e._next,e._next=null;e=t?t._next=n:se=n}}le=t;Ae(r)}function Ae(t){if(ie)return;if(ae)ae=clearTimeout(ae);var e=t-ce;if(e>24){if(t<Infinity)ae=setTimeout(we,t-pe.now()-he);if(oe)oe=clearInterval(oe)}else{if(!oe)fe=pe.now(),oe=setInterval(xe,ue);ie=1,_e(we)}}function Ne(t,e,n){var r=new me;e=e==null?0:+e;r.restart((function(n){r.stop();t(n+e)}),e,n);return r}var Me=Zt("start","end","cancel","interrupt");var ke=[];var Ee=0;var Se=1;var Te=2;var Ce=3;var Pe=4;var qe=5;var Oe=6;function Ie(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Xe(t,n,{name:e,index:r,group:i,on:Me,tween:ke,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Ee})}function Re(t,e){var n=$e(t,e);if(n.state>Ee)throw new Error("too late; already scheduled");return n}function ze(t,e){var n=$e(t,e);if(n.state>Ce)throw new Error("too late; already running");return n}function $e(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Xe(t,e,n){var r=t.__transition,i;r[e]=n;n.timer=ve(a,0,n.time);function a(t){n.state=Se;n.timer.restart(o,n.delay,n.time);if(n.delay<=t)o(t-n.delay)}function o(a){var l,f,c,h;if(n.state!==Se)return s();for(l in r){h=r[l];if(h.name!==n.name)continue;if(h.state===Ce)return Ne(o);if(h.state===Pe){h.state=Oe;h.timer.stop();h.on.call("interrupt",t,t.__data__,h.index,h.group);delete r[l]}else if(+l<e){h.state=Oe;h.timer.stop();h.on.call("cancel",t,t.__data__,h.index,h.group);delete r[l]}}Ne((function(){if(n.state===Ce){n.state=Pe;n.timer.restart(u,n.delay,n.time);u(a)}}));n.state=Te;n.on.call("start",t,t.__data__,n.index,n.group);if(n.state!==Te)return;n.state=Ce;i=new Array(c=n.tween.length);for(l=0,f=-1;l<c;++l){if(h=n.tween[l].value.call(t,t.__data__,n.index,n.group)){i[++f]=h}}i.length=f+1}function u(e){var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=qe,1),a=-1,o=i.length;while(++a<o){i[a].call(t,r)}if(n.state===qe){n.on.call("end",t,t.__data__,n.index,n.group);s()}}function s(){n.state=Oe;n.timer.stop();delete r[e];for(var i in r)return;delete t.__transition}}function je(t,e){var n=t.__transition,r,i,a=true,o;if(!n)return;e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=false;continue}i=r.state>Te&&r.state<qe;r.state=Oe;r.timer.stop();r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group);delete n[o]}if(a)delete t.__transition}function He(t){return this.each((function(){je(this,t)}))}function Le(t,e,n){t.prototype=e.prototype=n;n.constructor=t}function Be(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function De(){}var Fe=.7;var Ve=1/Fe;var Ye="\\s*([+-]?\\d+)\\s*",Ue="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ge=/^#([0-9a-f]{3,8})$/,Je=new RegExp("^rgb\\("+[Ye,Ye,Ye]+"\\)$"),Ke=new RegExp("^rgb\\("+[We,We,We]+"\\)$"),Qe=new RegExp("^rgba\\("+[Ye,Ye,Ye,Ue]+"\\)$"),Ze=new RegExp("^rgba\\("+[We,We,We,Ue]+"\\)$"),tn=new RegExp("^hsl\\("+[Ue,We,We]+"\\)$"),en=new RegExp("^hsla\\("+[Ue,We,We,Ue]+"\\)$");var nn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Le(De,un,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:rn,formatHex:rn,formatHsl:an,formatRgb:on,toString:on});function rn(){return this.rgb().formatHex()}function an(){return mn(this).formatHsl()}function on(){return this.rgb().formatRgb()}function un(t){var e,n;t=(t+"").trim().toLowerCase();return(e=Ge.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?sn(e):n===3?new hn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ln(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ln(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Je.exec(t))?new hn(e[1],e[2],e[3],1):(e=Ke.exec(t))?new hn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qe.exec(t))?ln(e[1],e[2],e[3],e[4]):(e=Ze.exec(t))?ln(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tn.exec(t))?gn(e[1],e[2]/100,e[3]/100,1):(e=en.exec(t))?gn(e[1],e[2]/100,e[3]/100,e[4]):nn.hasOwnProperty(t)?sn(nn[t]):t==="transparent"?new hn(NaN,NaN,NaN,0):null}function sn(t){return new hn(t>>16&255,t>>8&255,t&255,1)}function ln(t,e,n,r){if(r<=0)t=e=n=NaN;return new hn(t,e,n,r)}function fn(t){if(!(t instanceof De))t=un(t);if(!t)return new hn;t=t.rgb();return new hn(t.r,t.g,t.b,t.opacity)}function cn(t,e,n,r){return arguments.length===1?fn(t):new hn(t,e,n,r==null?1:r)}function hn(t,e,n,r){this.r=+t;this.g=+e;this.b=+n;this.opacity=+r}Le(hn,cn,Be(De,{brighter:function(t){t=t==null?Ve:Math.pow(Ve,t);return new hn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){t=t==null?Fe:Math.pow(Fe,t);return new hn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&(-.5<=this.g&&this.g<255.5)&&(-.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:pn,formatHex:pn,formatRgb:_n,toString:_n}));function pn(){return"#"+dn(this.r)+dn(this.g)+dn(this.b)}function _n(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function dn(t){t=Math.max(0,Math.min(255,Math.round(t)||0));return(t<16?"0":"")+t.toString(16)}function gn(t,e,n,r){if(r<=0)t=e=n=NaN;else if(n<=0||n>=1)t=e=NaN;else if(e<=0)t=NaN;return new yn(t,e,n,r)}function mn(t){if(t instanceof yn)return new yn(t.h,t.s,t.l,t.opacity);if(!(t instanceof De))t=un(t);if(!t)return new yn;if(t instanceof yn)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;if(u){if(e===a)o=(n-r)/u+(n<r)*6;else if(n===a)o=(r-e)/u+2;else o=(e-n)/u+4;u/=s<.5?a+i:2-a-i;o*=60}else{u=s>0&&s<1?0:o}return new yn(o,u,s,t.opacity)}function vn(t,e,n,r){return arguments.length===1?mn(t):new yn(t,e,n,r==null?1:r)}function yn(t,e,n,r){this.h=+t;this.s=+e;this.l=+n;this.opacity=+r}Le(yn,vn,Be(De,{brighter:function(t){t=t==null?Ve:Math.pow(Ve,t);return new yn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){t=t==null?Fe:Math.pow(Fe,t);return new yn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new hn(wn(t>=240?t-240:t+120,i,r),wn(t,i,r),wn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl:function(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function wn(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function xn(t){return function(){return t}}function bn(t,e){return function(n){return t+n*e}}function An(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Nn(t){return(t=+t)===1?Mn:function(e,n){return n-e?An(e,n,t):xn(isNaN(e)?n:e)}}function Mn(t,e){var n=e-t;return n?bn(t,n):xn(isNaN(t)?e:t)}var kn=function t(e){var n=Nn(e);function r(t,e){var r=n((t=cn(t)).r,(e=cn(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Mn(t.opacity,e.opacity);return function(e){t.r=r(e);t.g=i(e);t.b=a(e);t.opacity=o(e);return t+""}}r.gamma=t;return r}(1);function En(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Sn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tn=new RegExp(Sn.source,"g");function Cn(t){return function(){return t}}function Pn(t){return function(e){return t(e)+""}}function qn(t,e){var n=Sn.lastIndex=Tn.lastIndex=0,r,i,a,o=-1,u=[],s=[];t=t+"",e=e+"";while((r=Sn.exec(t))&&(i=Tn.exec(e))){if((a=i.index)>n){a=e.slice(n,a);if(u[o])u[o]+=a;else u[++o]=a}if((r=r[0])===(i=i[0])){if(u[o])u[o]+=i;else u[++o]=i}else{u[++o]=null;s.push({i:o,x:En(r,i)})}n=Tn.lastIndex}if(n<e.length){a=e.slice(n);if(u[o])u[o]+=a;else u[++o]=a}return u.length<2?s[0]?Pn(s[0].x):Cn(e):(e=s.length,function(t){for(var n=0,r;n<e;++n)u[(r=s[n]).i]=r.x(t);return u.join("")})}var On=180/Math.PI;var In={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rn(t,e,n,r,i,a){var o,u,s;if(o=Math.sqrt(t*t+e*e))t/=o,e/=o;if(s=t*n+e*r)n-=t*s,r-=e*s;if(u=Math.sqrt(n*n+r*r))n/=u,r/=u,s/=u;if(t*r<e*n)t=-t,e=-e,s=-s,o=-o;return{translateX:i,translateY:a,rotate:Math.atan2(e,t)*On,skewX:Math.atan(s)*On,scaleX:o,scaleY:u}}var zn,$n,Xn,jn;function Hn(t){if(t==="none")return In;if(!zn)zn=document.createElement("DIV"),$n=document.documentElement,Xn=document.defaultView;zn.style.transform=t;t=Xn.getComputedStyle($n.appendChild(zn),null).getPropertyValue("transform");$n.removeChild(zn);t=t.slice(7,-1).split(",");return Rn(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5])}function Ln(t){if(t==null)return In;if(!jn)jn=document.createElementNS("http://www.w3.org/2000/svg","g");jn.setAttribute("transform",t);if(!(t=jn.transform.baseVal.consolidate()))return In;t=t.matrix;return Rn(t.a,t.b,t.c,t.d,t.e,t.f)}function Bn(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}function a(t,r,i,a,o,u){if(t!==i||r!==a){var s=o.push("translate(",null,e,null,n);u.push({i:s-4,x:En(t,i)},{i:s-2,x:En(r,a)})}else if(i||a){o.push("translate("+i+e+a+n)}}function o(t,e,n,a){if(t!==e){if(t-e>180)e+=360;else if(e-t>180)t+=360;a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:En(t,e)})}else if(e){n.push(i(n)+"rotate("+e+r)}}function u(t,e,n,a){if(t!==e){a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:En(t,e)})}else if(e){n.push(i(n)+"skewX("+e+r)}}function s(t,e,n,r,a,o){if(t!==n||e!==r){var u=a.push(i(a)+"scale(",null,",",null,")");o.push({i:u-4,x:En(t,n)},{i:u-2,x:En(e,r)})}else if(n!==1||r!==1){a.push(i(a)+"scale("+n+","+r+")")}}return function(e,n){var r=[],i=[];e=t(e),n=t(n);a(e.translateX,e.translateY,n.translateX,n.translateY,r,i);o(e.rotate,n.rotate,r,i);u(e.skewX,n.skewX,r,i);s(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i);e=n=null;return function(t){var e=-1,n=i.length,a;while(++e<n)r[(a=i[e]).i]=a.x(t);return r.join("")}}}var Dn=Bn(Hn,"px, ","px)","deg)");var Fn=Bn(Ln,", ",")",")");function Vn(t,e){var n,r;return function(){var i=ze(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o){if(r[o].name===e){r=r.slice();r.splice(o,1);break}}}i.tween=r}}function Yn(t,e,n){var r,i;if(typeof n!=="function")throw new Error;return function(){var a=ze(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s){if(i[s].name===e){i[s]=u;break}}if(s===l)i.push(u)}a.tween=i}}function Un(t,e){var n=this._id;t+="";if(arguments.length<2){var r=$e(this.node(),n).tween;for(var i=0,a=r.length,o;i<a;++i){if((o=r[i]).name===t){return o.value}}return null}return this.each((e==null?Vn:Yn)(n,t,e))}function Wn(t,e,n){var r=t._id;t.each((function(){var t=ze(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}));return function(t){return $e(t,r).value[e]}}function Gn(t,e){var n;return(typeof e==="number"?En:e instanceof un?kn:(n=un(e))?(e=n,kn):qn)(t,e)}function Jn(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qn(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Zn(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function tr(t,e,n){var r,i,a;return function(){var o,u=n(this),s;if(u==null)return void this.removeAttribute(t);o=this.getAttribute(t);s=u+"";return o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function er(t,e,n){var r,i,a;return function(){var o,u=n(this),s;if(u==null)return void this.removeAttributeNS(t.space,t.local);o=this.getAttributeNS(t.space,t.local);s=u+"";return o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function nr(t,e){var r=n(t),i=r==="transform"?Fn:Gn;return this.attrTween(t,typeof e==="function"?(r.local?er:tr)(r,i,Wn(this,"attr."+t,e)):e==null?(r.local?Kn:Jn)(r):(r.local?Zn:Qn)(r,i,e))}function rr(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ir(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function ar(t,e){var n,r;function i(){var i=e.apply(this,arguments);if(i!==r)n=(r=i)&&ir(t,i);return n}i._value=e;return i}function or(t,e){var n,r;function i(){var i=e.apply(this,arguments);if(i!==r)n=(r=i)&&rr(t,i);return n}i._value=e;return i}function ur(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!=="function")throw new Error;var i=n(t);return this.tween(r,(i.local?ar:or)(i,e))}function sr(t,e){return function(){Re(this,t).delay=+e.apply(this,arguments)}}function lr(t,e){return e=+e,function(){Re(this,t).delay=e}}function fr(t){var e=this._id;return arguments.length?this.each((typeof t==="function"?sr:lr)(e,t)):$e(this.node(),e).delay}function cr(t,e){return function(){ze(this,t).duration=+e.apply(this,arguments)}}function hr(t,e){return e=+e,function(){ze(this,t).duration=e}}function pr(t){var e=this._id;return arguments.length?this.each((typeof t==="function"?cr:hr)(e,t)):$e(this.node(),e).duration}function _r(t,e){if(typeof e!=="function")throw new Error;return function(){ze(this,t).ease=e}}function dr(t){var e=this._id;return arguments.length?this.each(_r(e,t)):$e(this.node(),e).ease}function gr(t){if(typeof t!=="function")t=h(t);for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l){if((s=a[l])&&t.call(s,s.__data__,l,a)){u.push(s)}}}return new Vr(r,this._parents,this._name,this._id)}function mr(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u){for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,p=0;p<f;++p){if(h=s[p]||l[p]){c[p]=h}}}for(;u<r;++u){o[u]=e[u]}return new Vr(o,this._parents,this._name,this._id)}function vr(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");if(e>=0)t=t.slice(0,e);return!t||t==="start"}))}function yr(t,e,n){var r,i,a=vr(e)?Re:ze;return function(){var o=a(this,t),u=o.on;if(u!==r)(i=(r=u).copy()).on(e,n);o.on=i}}function wr(t,e){var n=this._id;return arguments.length<2?$e(this.node(),n).on.on(t):this.each(yr(n,t,e))}function xr(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;if(e)e.removeChild(this)}}function br(){return this.on("end.remove",xr(this._id))}function Ar(t){var e=this._name,n=this._id;if(typeof t!=="function")t=u(t);for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o){for(var s=r[o],l=s.length,f=a[o]=new Array(l),c,h,p=0;p<l;++p){if((c=s[p])&&(h=t.call(c,c.__data__,p,s))){if("__data__"in c)h.__data__=c.__data__;f[p]=h;Ie(f[p],e,n,p,f,$e(c,n))}}}return new Vr(a,this._parents,e,n)}function Nr(t){var e=this._name,n=this._id;if(typeof t!=="function")t=f(t);for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u){for(var s=r[u],l=s.length,c,h=0;h<l;++h){if(c=s[h]){for(var p=t.call(c,c.__data__,h,s),_,d=$e(c,n),g=0,m=p.length;g<m;++g){if(_=p[g]){Ie(_,e,n,g,p,d)}}a.push(p);o.push(c)}}}return new Vr(a,o,e,n)}var Mr=Lt.prototype.constructor;function kr(){return new Mr(this._groups,this._parents)}function Er(t,e){var n,r,i;return function(){var a=Y(this,t),o=(this.style.removeProperty(t),Y(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Sr(t){return function(){this.style.removeProperty(t)}}function Tr(t,e,n){var r,i=n+"",a;return function(){var o=Y(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Cr(t,e,n){var r,i,a;return function(){var o=Y(this,t),u=n(this),s=u+"";if(u==null)s=u=(this.style.removeProperty(t),Y(this,t));return o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function Pr(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=ze(this,t),l=s.on,f=s.value[a]==null?u||(u=Sr(e)):undefined;if(l!==n||i!==f)(r=(n=l).copy()).on(o,i=f);s.on=r}}function qr(t,e,n){var r=(t+="")==="transform"?Dn:Gn;return e==null?this.styleTween(t,Er(t,r)).on("end.style."+t,Sr(t)):typeof e==="function"?this.styleTween(t,Cr(t,r,Wn(this,"style."+t,e))).each(Pr(this._id,t)):this.styleTween(t,Tr(t,r,e),n).on("end.style."+t,null)}function Or(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Ir(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);if(a!==i)r=(i=a)&&Or(t,a,n);return r}a._value=e;return a}function Rr(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!=="function")throw new Error;return this.tween(r,Ir(t,e,n==null?"":n))}function zr(t){return function(){this.textContent=t}}function $r(t){return function(){var e=t(this);this.textContent=e==null?"":e}}function Xr(t){return this.tween("text",typeof t==="function"?$r(Wn(this,"text",t)):zr(t==null?"":t+""))}function jr(t){return function(e){this.textContent=t.call(this,e)}}function Hr(t){var e,n;function r(){var r=t.apply(this,arguments);if(r!==n)e=(n=r)&&jr(r);return e}r._value=t;return r}function Lr(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!=="function")throw new Error;return this.tween(e,Hr(t))}function Br(){var t=this._name,e=this._id,n=Yr();for(var r=this._groups,i=r.length,a=0;a<i;++a){for(var o=r[a],u=o.length,s,l=0;l<u;++l){if(s=o[l]){var f=$e(s,e);Ie(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}}}return new Vr(r,this._parents,t,n)}function Dr(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(a,o){var u={value:o},s={value:function(){if(--i===0)a()}};n.each((function(){var n=ze(this,r),i=n.on;if(i!==t){e=(t=i).copy();e._.cancel.push(u);e._.interrupt.push(u);e._.end.push(s)}n.on=e}))}))}var Fr=0;function Vr(t,e,n,r){this._groups=t;this._parents=e;this._name=n;this._id=r}function Yr(){return++Fr}var Ur=Lt.prototype;Vr.prototype={constructor:Vr,select:Ar,selectAll:Nr,filter:gr,merge:mr,selection:kr,transition:Br,call:Ur.call,nodes:Ur.nodes,node:Ur.node,size:Ur.size,empty:Ur.empty,each:Ur.each,on:wr,attr:nr,attrTween:ur,style:qr,styleTween:Rr,text:Xr,textTween:Lr,remove:br,tween:Un,delay:fr,duration:pr,ease:dr,end:Dr};function Wr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Gr={time:null,delay:0,duration:250,ease:Wr};function Jr(t,e){var n;while(!(n=t.__transition)||!(n=n[e])){if(!(t=t.parentNode)){return Gr.time=de(),Gr}}return n}function Kr(t){var e,n;if(t instanceof Vr){e=t._id,t=t._name}else{e=Yr(),(n=Gr).time=de(),t=t==null?null:t+""}for(var r=this._groups,i=r.length,a=0;a<i;++a){for(var o=r[a],u=o.length,s,l=0;l<u;++l){if(s=o[l]){Ie(s,t,e,l,o,n||Jr(s,e))}}}return new Vr(r,this._parents,t,e)}Lt.prototype.interrupt=He;Lt.prototype.transition=Kr;function Qr(t,e,n,r,i){let a,o;let u={};const s=t.columns_fixed?t.min_width_fixed:t.min_width;const l=Math.floor((r+i)/(s+i));if(t.columns_fixed){a=n==1?1:Math.floor(t.columns);o=Math.ceil(n/a);if(t.custom_grid){t.custom_positions.split(/\n/).forEach((function(t){if(!t.trim().length)return;const n=t.split(/:/);if(!n.length)return;const r=n[0].trim();const i=e.indexOf(r);if(i<0&&r.length){Flourish.warn(`No match for custom position for ${r}`);return}const o=n[1].split(/,/);const s=Math.max(1,+o[0]||1);const l=Math.max(1,+o[1]||1);if(l>50||s>50){Flourish.warn(`Grid is too large with over 50 ${l>50?"columns":"rows"}`)}u[i]={y:s-1,x:l-1};a=Math.max(a,l)}));o=1;e.forEach((function(t,e){o=Math.max(o,u[e]?u[e].y+1:Math.floor(e/a)+1)}))}if(a>l)u={}}if(!t.columns_fixed||a>l){a=Math.max(1,Math.min(l,n));o=Math.ceil(n/a);for(let t=a;t>0;t--){if(Math.ceil(n/(a-1))==o)a--;else break}}return{cols:a,rows:o,custom_positions:u}}var Zr={gutter_w:1,gutter_h:1,min_width:300,min_width_fixed:10,max_width:null,columns_fixed:false,columns:2,custom_grid:false,custom_positions:"",titles:true,title_color_mode:"auto",title_color:null,title_size:1,title_unit:"rem",title_weight:600,title_padding_top:.25,title_padding_bottom:.25,title_align:"auto",title_bg:"none",title_bg_padding:.25,title_bg_mode:"fixed",title_bg_color:"#eeeeee",animation:"auto"};function ti(t){for(var e in Zr){if(!(e in t))t[e]=Zr[e]}var n=document.createElementNS("http://www.w3.org/2000/svg","g");n.setAttribute("class","fl-facets");this._container=n;this._state=t;this._duration=1e3;this._width=window.innerWidth;this._height=window.innerHeight;this._facet_width=null;this._facet_aspect=null;this._facet_aspect_margin_top=0;this._facet_aspect_margin_right=0;this._facet_aspect_margin_bottom=0;this._facet_aspect_margin_left=0;this._facet_height=null;this._is_ragged=null;this._max=100;this._axis_space_top=0;this._axis_space_bottom=0;this._axis_space_left=0;this._axis_space_right=0;this._hide_title=null;this._titleColor=null;this._autoTitleAlign=function(){return"left"};this._computed_height=this._height;this._data=[];this._data_names=[];this._read_direction=null;return this}ti.prototype.appendTo=function(t){t.appendChild(this._container);return this};ti.prototype.width=function(t){this._width=t;return this};ti.prototype.height=function(t){if(typeof t=="undefined")return this._computed_height;else this._height=t;if(t!==null){this._facet_aspect=null;this._facet_height=null}return this};ti.prototype.facetHeight=function(t){this._facet_height=t;if(t!==null){this._facet_aspect=null;this._height=null}return this};ti.prototype.facetAspect=function(t,e){this._facet_aspect=t;if(t!==null){this._facet_height=null;this._height=null;if(e){if("top"in e)this._facet_aspect_margin_top=e.top;if("right"in e)this._facet_aspect_margin_right=e.right;if("bottom"in e)this._facet_aspect_margin_bottom=e.bottom;if("left"in e)this._facet_aspect_margin_left=e.left}}return this};ti.prototype.axisSpaceTop=function(t){this._axis_space_top=t;return this};ti.prototype.axisSpaceBottom=function(t){this._axis_space_bottom=t;return this};ti.prototype.axisSpaceLeft=function(t){this._axis_space_left=t;return this};ti.prototype.axisSpaceRight=function(t){this._axis_space_right=t;return this};ti.prototype.debug=function(t){this._debug=!!t;return this};ti.prototype.data=function(t,e){this._data=t;this._data_names=e?t.map(e):t;return this};ti.prototype.duration=function(t){this._duration=t;return this};ti.prototype.autoTitleAlign=function(t){this._autoTitleAlign=t;return this};ti.prototype.titleColor=function(t){this._titleColor=t;return this};ti.prototype.hideTitle=function(t){this._hide_title=t;return this};ti.prototype.readDirection=function(t){if(["ltr","rtl"].includes(t)){this._read_direction=t}else{console.warn('Read direction must be one of "ltr" or "rtl"')}return this};ti.prototype.update=function(t){var e=this;var n=this._state;var r=this._duration;var i=this._data.slice(0,this._max);var a=this._data_names;var o=i.length;var u=ri(n.gutter_w);var s=ri(n.gutter_h);var l=this._axis_space_left;var f=this._axis_space_right;var c=this._axis_space_top;var h=this._axis_space_bottom;var p=this._width-l-f;var _=this._height==null?null:this._height-c-h;var d=this._facet_aspect;var g=this._facet_aspect_margin_right+this._facet_aspect_margin_left;var m=this._facet_aspect_margin_top+this._facet_aspect_margin_bottom;var v=this._facet_height;var y=n.titles&&!(o==1&&(a[0]==""||a[0]==this._hide_title));var w=this._read_direction||Jt();var x=ii(n.title_align!="auto"?n.title_align:this._autoTitleAlign(),w);const{cols:b,rows:A,custom_positions:N}=Qr(n,a,o,p,u);e._num_columns=b;e._num_rows=A;e._is_ragged=n.columns_fixed&&n.custom_grid||o%b!=0&&o>b;var M=n.max_width||Infinity;var k=u*(b-1);var E=Math.max(0,Math.min(M,(p-k)/b));var S=Math.max(0,p-E*b-k);e._facet_width=E;var T=n.title_unit=="rem"?ri(n.title_size):n.title_size*E/15;var C=getComputedStyle(this._container).fontFamily;var P=`${n.title_weight} ${T}px ${C}`;var q=n.title_bg=="none"?0:T*n.title_bg_padding;var O=E-q*2;var I=a.map((function(t){return Kt(t,P,5,O)}));var R=it();var z=Math.max(...Object.values(R));var $=at(z);var X=100;if(_!=null){X=Math.max(0,(_-s*(A-1))/A);this._computed_height=this._height}else{if(v!=null)X=$+v;else if(d!=null)X=$+m+(E-g)/d;this._computed_height=X*A+s*(A-1)+c+h}var j=Bt(this._container).selectAll(".fl-facet").data(a,(function(t,e){if(n.animation=="name")return t;if(n.animation=="reuse")return e;return i.length==1?e:t}));var H=j.enter().append("g").attr("class","fl-facet").attr("transform",(function(t,e){return Q(e)}));H.append("rect").attr("class","fl-facet-rect").attr("width",E).attr("height",X);H.append("rect").attr("class","fl-facet-primary-rect").attr("width",E).attr("height",X);var L=ai(x,w);var B=H.append("g").attr("class","fl-facet-title");B.append("rect").attr("class","fl-facet-title-bg");B.append("text").attr("class","fl-facet-title-text").attr("font-size",T).attr("font-weight",n.title_weight).attr("fill",et).each(ot).attr("transform",Z).attr("opacity",0).attr("text-anchor",L);H.select(".facet-title-bg").attr("height",$).attr("width",rt).attr("fill",nt).attr("x",tt).attr("opacity",0);H.append("g").attr("class","fl-facet-primary").attr("transform","translate(0, "+$+")");var D=j.merge(H);D.transition().duration(r).attr("transform",(function(t,e){return Q(e)})).each(W).attr("opacity",1).on("interrupt",(function(){Bt(this).attr("opacity",1)}));D.select(".fl-facet-rect").attr("width",E).attr("height",X).attr("fill",e._debug?"rgba(230, 100, 100, 0.33)":"none");D.select(".fl-facet-primary-rect").attr("width",E).attr("height",Math.max(0,X-$)).attr("y",$).attr("fill",e._debug?"rgba(230, 100, 100, 0.33)":"none");var F=D.select(".fl-facet-title");F.select(".fl-facet-title-text").attr("font-size",T).attr("font-weight",n.title_weight).attr("text-anchor",L).each(ot).transition().duration(r).attr("fill",et).attr("transform",Z).attr("opacity",y?1:0);F.select(".fl-facet-title-bg").transition().duration(r).attr("height",$).attr("width",rt).attr("fill",nt).attr("x",tt).attr("opacity",y?1:0);var V=F.select(".fl-facet-title-text").selectAll("tspan").data((function(t,e){return I[e]}));var Y=V.enter().append("tspan");V.merge(Y).text((function(t){return t})).attr("x",0).attr("y",((t,e)=>e*T)).attr("dx",oi(x,q)).attr("text-anchor",L);V.exit().remove();D.select(".fl-facet-primary").each(G).transition().duration(r).attr("transform","translate(0, "+$+")");var U=j.exit();U.each(W).classed("fl-facet",false).transition().duration(r/2).attr("opacity",0).remove();U.select(".fl-facet-primary").transition().duration(r).attr("transform","translate(0, "+$+")");function W(t,e){var n=J(e),r=K(e);this.__facet_outer__={node:this,name:t,width:E,height:X,x:n,y:r,cx:n+E/2,cy:r+X/2}}function G(e,n){var r=J(n);var a=K(n)+$;var o=Math.max(0,X-$);this.__facet_inner__={node:this,data:i[n],name:e,width:E,height:o,x:r,y:a,cx:r+E/2,cy:a+o/2,row:Math.floor(n/b),column:Math.ceil(n%b)};if(t){var u=t.bind(this);u(this.__facet_inner__,n)}}function J(t){var e=Math.ceil(t%b);if(N[t])e=N[t].x;return l+(e*(E+u)+S/2)}function K(t){var e=Math.floor(t/b);if(N[t])e=N[t].y;return c+e*(X+s)}function Q(t){return"translate("+J(t)+", "+K(t)+")"}function Z(t,e){let r=0;const i=(z-R[e])*T;const a=T*.8+T*n.title_padding_top+i;if(x=="center")r=E/2;if(x=="right")r=E;return`translate(${r}, ${a})`}function tt(){if(n.title_bg=="full")return 0;if(x=="center")return E/2-this.parentNode.__title_width/2-q;if(x=="right")return E;return 0}function et(t){if(n.title_color)return n.title_color;else if(e._titleColor)return e._titleColor(t);else return null}function nt(){return n.title_bg_color}function rt(){if(n.title_bg=="none")return 0;else if(n.title_bg=="full")return E;return this.parentNode.__title_width+q*2}function it(){let t={};I.forEach((function(e,n){t[n]=e.length}));return t}function at(t){return!y?0:T*t+T*(n.title_padding_top+n.title_padding_bottom)}function ot(){var t=this.getBBox().width;var e=parseFloat(this.getAttribute("font-size"));var n=T;this.parentNode.__title_width=t*n/e}this._facets=D.select(".fl-facet-primary").nodes().map((function(t){return t.__facet_inner__}));return this};ti.prototype.facets=function(){return this._facets};ti.prototype.facetWidth=function(){return this._facet_width};ti.prototype.getFacet=function(t){var e=this._data_names.indexOf(t);return this._facets[e]};ti.prototype.isRagged=function(){return this._is_ragged};ti.prototype.numColumns=function(){return this._num_columns};ti.prototype.numRows=function(){return this._num_rows};var ei,ni;function ri(t){if(window.innerWidth!==ei){ei=window.innerWidth;ni=parseFloat(getComputedStyle(document.documentElement).fontSize)}return t*ni}function ii(t,e){if(e==="rtl"){if(t==="left")return"right";if(t==="right")return"left"}return t}function ai(t,e){if(t==="center")return"middle";var n=e==="rtl";if(t==="left"){return n?"end":"start"}return n?"start":"end"}function oi(t,e){if(t==="left")return e;if(t==="right")return-e;else return 0}function ui(t,e){return new ti(t)}return ui}));
{
"name": "@flourish/facets",
"version": "4.0.0",
"type": "module",
"version": "4.1.0",
"private": false,

@@ -15,6 +16,9 @@ "description": "Create small-multiple grid layouts",

"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"eslint": "^8.35.0",
"only-allow": "^1.2.1",
"rollup": "^4.6.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"terser": "^5.19.2"
"terser": "^5.19.2",
"mocha": "^10.2.0",
"@flourish/mocha-env": "^1.0.0"
},

@@ -29,8 +33,15 @@ "repository": {

"dependencies": {
"chai": "^5.1.1",
"d3-scale": "2.1.2",
"d3-selection": "^1.4.0",
"d3-transition": "^1.2.0",
"mocha": "^10.2.0",
"@flourish/pocket-knife": "^2.0.0"
},
"exports": "./src/index.js",
"mocha": {
"spec": "**/*.test.{js,cjs,mjs,ts}",
"recursive": true,
"require": "@flourish/mocha-env"
},
"scripts": {

@@ -40,4 +51,6 @@ "lint": "eslint .",

"minify": "terser -m -o facets.min.js facets.js",
"precommit": "lint-staged"
"precommit": "lint-staged",
"mocha": "mocha",
"test": "npm run mocha"
}
}

@@ -0,1 +1,4 @@

# 4.1.0
* Add support for custom grid positions
# 4.0.0

@@ -2,0 +5,0 @@ * Switch to preferring ESM by default on recent versions of Node.js by adding an `exports` field to `package.json`.

@@ -5,2 +5,3 @@ import { select } from "d3-selection";

import { getTextDirection } from "@flourish/pocket-knife";
import { computeGridMetrics } from "./grid_metrics.js";

@@ -11,2 +12,3 @@ var DEFAULTS = {

min_width: 300,
min_width_fixed: 10,
max_width: null,

@@ -16,2 +18,4 @@

columns: 2,
custom_grid: false,
custom_positions: "",

@@ -214,27 +218,8 @@ titles: true,

// **************************** //
// COMPUTE GRID METRICS //
// **************************** //
const { cols, rows, custom_positions } = computeGridMetrics(state, data_names, num_facets, grid_width, gutter_w);
// Calculate the number of rows and columns in the grid
var cols, rows;
if (state.columns_fixed) {
cols = num_facets == 1 ? 1 : Math.floor(state.columns);
rows = Math.ceil(num_facets/cols);
}
else {
var max_cols = Math.floor((grid_width + gutter_w)/(state.min_width + gutter_w));
cols = Math.max(1, Math.min(max_cols, num_facets));
rows = Math.ceil(num_facets/cols);
// Reduce the number of columns as much as possible without adding rows
for (var i = cols; i > 0; i--) {
if (Math.ceil(num_facets/(cols - 1)) == rows) cols--;
else break;
}
}
// Store/expose info about the grid
instance._num_columns = cols;
instance._num_rows = rows;
instance._is_ragged = num_facets % cols != 0 && num_facets > cols; // Whether the grid is incomplete
instance._is_ragged = (state.columns_fixed && state.custom_grid) || (num_facets % cols != 0 && num_facets > cols); // Whether the grid is incomplete

@@ -342,3 +327,3 @@ // Calculate the width of each facet

.attr("width", facet_w)
.attr("height", facet_h - max_title_height)
.attr("height", Math.max(0, facet_h - max_title_height))
.attr("y", max_title_height)

@@ -436,2 +421,3 @@ .attr("fill", instance._debug ? "rgba(230, 100, 100, 0.33)" : "none");

var col = Math.ceil(i % cols);
if (custom_positions[i]) col = custom_positions[i].x;
return axis_space_left + (col * (facet_w + gutter_w) + extra_space/2);

@@ -442,2 +428,3 @@ }

var row = Math.floor(i/cols);
if (custom_positions[i]) row = custom_positions[i].y;
return axis_space_top + (row * (facet_h + gutter_h));

@@ -444,0 +431,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc