@flourish/ui-styles 7.0.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 7.0.1
2
+ * Fix vertical alignment of text in SVG downloads
3
+
1
4
  # 7.0.0
2
5
  * Add shared searchbox styling support
3
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flourish/ui-styles",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "private": false,
5
5
  "description": "Flourish module for styling UI elements",
6
6
  "main": "ui-styles.js",
@@ -9,8 +9,8 @@
9
9
  "license": "LicenseRef-LICENSE",
10
10
  "dependencies": {
11
11
  "d3-selection": "^1.4.0",
12
- "@flourish/pocket-knife": "^2.3.1",
13
- "@flourish/utils-color": "^2.0.0"
12
+ "@flourish/utils-color": "^2.0.0",
13
+ "@flourish/pocket-knife": "^2.3.2"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@babel/core": "^7.23.6",
package/ui-styles.js CHANGED
@@ -629,6 +629,9 @@
629
629
  each: proto.each
630
630
  };
631
631
 
632
+ const ascent_descent_canvas = document.createElement("canvas");
633
+ ascent_descent_canvas.getContext("2d");
634
+
632
635
  // This is an exception because mocha doesn't run in a browser context, so some
633
636
  // browser methods aren't available.
634
637
  const is_browser =
package/ui-styles.min.js CHANGED
@@ -1 +1 @@
1
- (function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):(t=typeof globalThis!=="undefined"?globalThis:t||self,e(t["ui-styles"]={}))})(this,function(t){"use strict";function r(){this.declarations=[];return this}r.prototype.select=function(t){if(!t)return this;var e=new s(t);e.parent=this;this.addDeclaration(e);return e};r.prototype.addDeclaration=function(t){this.declarations.push(t);return this};r.prototype.print=function(){var e="";this.declarations.forEach(function(t){e+=t.selector+" {\n";t.styles.forEach(function(t){e+="\t"+t[0]+": "+t[1]+";\n"});e+="}\n\n"});return e};r.prototype.clear=function(){this.declarations=[];return this};function s(t){this.selector=t;this.styles=[];return this}s.prototype.style=function(t,e){var s=typeof value_=="function"?e():e;if(s!==""&&s!==null&&s!==undefined)this.styles.push([t,s]);return this};s.prototype.select=function(t){return this.parent.select(this.selector+" "+t)};var O=Object.freeze({font_size:1,font_weight:"bold",height:2});function n(t,e,s){this._state=t;for(var n in O){if(this._state[n]===undefined)this._state[n]=O[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}n.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-controls";document.head.appendChild(this._stylesheet)};n.prototype.update=function(){this._styles.clear();this._styles.select(this._selector+".hidden").style("display","none");this._styles.select(this._selector).style("vertical-align","middle").style("position","relative").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight);this._styles.select(".fl-controls-title").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight).style("vertical-align","middle");this._styles.select(this._selector+".fl-control .button").style("height",this._state.height+"rem").style("padding","0 0.5em");this._styles.select(this._selector+"-dropdown select").style("height",this._state.height+"rem").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight).style("padding",0+" "+this._state.height*.1+"rem");this._styles.select(this._selector+"-slider .slider-end-labels").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight);this._styles.select(this._selector+"-slider").style("height",this._state.height+"rem");this._stylesheet.innerHTML=this._styles.print()};function e(t,e,s){t.prototype=e.prototype=s;s.constructor=t}function R(t,e){var s=Object.create(t.prototype);for(var n in e)s[n]=e[n];return s}function h(){}var i=.7;var o=1/i;var l="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q=/^#([0-9a-f]{3,8})$/,j=new RegExp(`^rgb\\(${l},${l},${l}\\)$`),D=new RegExp(`^rgb\\(${c},${c},${c}\\)$`),P=new RegExp(`^rgba\\(${l},${l},${l},${a}\\)$`),W=new RegExp(`^rgba\\(${c},${c},${c},${a}\\)$`),G=new RegExp(`^hsl\\(${a},${c},${c}\\)$`),I=new RegExp(`^hsla\\(${a},${c},${c},${a}\\)$`);var V={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};e(h,u,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:X,formatHex:X,formatHex8:U,formatHsl:F,formatRgb:Y,toString:Y});function X(){return this.rgb().formatHex()}function U(){return this.rgb().formatHex8()}function F(){return nt(this).formatHsl()}function Y(){return this.rgb().formatRgb()}function u(t){var e,s;t=(t+"").trim().toLowerCase();return(e=q.exec(t))?(s=e[1].length,e=parseInt(e[1],16),s===6?J(e):s===3?new d(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):s===8?f(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):s===4?f(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=j.exec(t))?new d(e[1],e[2],e[3],1):(e=D.exec(t))?new d(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=P.exec(t))?f(e[1],e[2],e[3],e[4]):(e=W.exec(t))?f(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=G.exec(t))?st(e[1],e[2]/100,e[3]/100,1):(e=I.exec(t))?st(e[1],e[2]/100,e[3]/100,e[4]):V.hasOwnProperty(t)?J(V[t]):t==="transparent"?new d(NaN,NaN,NaN,0):null}function J(t){return new d(t>>16&255,t>>8&255,t&255,1)}function f(t,e,s,n){if(n<=0)t=e=s=NaN;return new d(t,e,s,n)}function K(t){if(!(t instanceof h))t=u(t);if(!t)return new d;t=t.rgb();return new d(t.r,t.g,t.b,t.opacity)}function Q(t,e,s,n){return arguments.length===1?K(t):new d(t,e,s,n==null?1:n)}function d(t,e,s,n){this.r=+t;this.g=+e;this.b=+s;this.opacity=+n}e(d,Q,R(h,{brighter(t){t=t==null?o:Math.pow(o,t);return new d(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){t=t==null?i:Math.pow(i,t);return new d(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new d(p(this.r),p(this.g),p(this.b),y(this.opacity))},displayable(){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:Z,formatHex:Z,formatHex8:tt,formatRgb:et,toString:et}));function Z(){return`#${_(this.r)}${_(this.g)}${_(this.b)}`}function tt(){return`#${_(this.r)}${_(this.g)}${_(this.b)}${_((isNaN(this.opacity)?1:this.opacity)*255)}`}function et(){const t=y(this.opacity);return`${t===1?"rgb(":"rgba("}${p(this.r)}, ${p(this.g)}, ${p(this.b)}${t===1?")":`, ${t})`}`}function y(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function p(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _(t){t=p(t);return(t<16?"0":"")+t.toString(16)}function st(t,e,s,n){if(n<=0)t=e=s=NaN;else if(s<=0||s>=1)t=e=NaN;else if(e<=0)t=NaN;return new g(t,e,s,n)}function nt(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(!(t instanceof h))t=u(t);if(!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,s=t.g/255,n=t.b/255,r=Math.min(e,s,n),i=Math.max(e,s,n),o=NaN,l=i-r,a=(i+r)/2;if(l){if(e===i)o=(s-n)/l+(s<n)*6;else if(s===i)o=(n-e)/l+2;else o=(e-s)/l+4;l/=a<.5?i+r:2-i-r;o*=60}else{l=a>0&&a<1?0:o}return new g(o,l,a,t.opacity)}function rt(t,e,s,n){return arguments.length===1?nt(t):new g(t,e,s,n==null?1:n)}function g(t,e,s,n){this.h=+t;this.s=+e;this.l=+s;this.opacity=+n}e(g,rt,R(h,{brighter(t){t=t==null?o:Math.pow(o,t);return new g(this.h,this.s,this.l*t,this.opacity)},darker(t){t=t==null?i:Math.pow(i,t);return new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,n=s+(s<.5?s:1-s)*e,r=2*s-n;return new d(b(t>=240?t-240:t+120,r,n),b(t,r,n),b(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new g(it(this.h),m(this.s),m(this.l),y(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){const t=y(this.opacity);return`${t===1?"hsl(":"hsla("}${it(this.h)}, ${m(this.s)*100}%, ${m(this.l)*100}%${t===1?")":`, ${t})`}`}}));function it(t){t=(t||0)%360;return t<0?t+360:t}function m(t){return Math.max(0,Math.min(1,t||0))}function b(t,e,s){return(t<60?e+(s-e)*t/60:t<180?s:t<240?e+(s-e)*(240-t)/60:e)*255}var w="$";function v(){}v.prototype=ot.prototype={constructor:v,has:function(t){return w+t in this},get:function(t){return this[w+t]},set:function(t,e){this[w+t]=e;return this},remove:function(t){var e=w+t;return e in this&&delete this[e]},clear:function(){for(var t in this)if(t[0]===w)delete this[t]},keys:function(){var t=[];for(var e in this)if(e[0]===w)t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)if(e[0]===w)t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)if(e[0]===w)t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)if(e[0]===w)++t;return t},empty:function(){for(var t in this)if(t[0]===w)return false;return true},each:function(t){for(var e in this)if(e[0]===w)t(this[e],e.slice(1),this)}};function ot(t,e){var s=new v;if(t instanceof v)t.each(function(t,e){s.set(e,t)});else if(Array.isArray(t)){var n=-1,r=t.length,i;if(e==null)while(++n<r)s.set(n,t[n]);else while(++n<r)s.set(e(i=t[n],n,t),i)}else if(t)for(var o in t)s.set(o,t[o]);return s}function lt(){}var x=ot.prototype;lt.prototype={constructor:lt,has:x.has,add:function(t){t+="";this[w+t]=t;return this},remove:x.remove,clear:x.clear,values:x.keys,size:x.size,empty:x.empty,each:x.each};const at=typeof window!=="undefined"&&typeof document!=="undefined"&&typeof document.createElement==="function"&&typeof document.body?.appendChild==="function"&&typeof HTMLElement!=="undefined";const k=document.createElement("canvas");const N=k.getContext("2d");const $=document.createElementNS("http://www.w3.org/2000/svg","svg");const C=document.createElementNS("http://www.w3.org/2000/svg","text");$.appendChild(C);if(at){k.style.position="fixed";k.style.left="1000vw";$.style.position="fixed";$.style.left="1000vw";document.body.appendChild(k);document.body.appendChild($)}let S=null;function ht(){return window.getComputedStyle(document.body).direction||"ltr"}function ct(t,e){if(typeof t!="string")return false;var s=u(t);s.opacity=e!==undefined?e:1;return s}function z(t,e){var s=ct(t,e);return s?s.toString():false}function ut(){const t="0123456789.,£";const e=document.createElement("canvas");const s=document.createElement("canvas");const n=e.getContext("2d");const r=s.getContext("2d");e.setAttribute("style","font-feature-settings: normal; font-variant-numeric: normal; position: fixed; left: 1000vw;");s.setAttribute("style",'font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; position: fixed; left: 1000vw;');n.font=r.font=N.font;document.body.appendChild(e);document.body.appendChild(s);const i=n.measureText(t).width;const o=r.measureText(t).width;S=i!==o;document.body.removeChild(e);document.body.removeChild(s);return S}N.measureTextWithTnums=function(t){if(!at)return N.measureText(t);const e=window.getComputedStyle(this.canvas);const s=(e.fontFeatureSettings||"").includes("tnum")||(e.fontVariantNumeric||"").includes("tabular-nums");if(!s)return this.measureText(t);if(S===null)ut();if(S)return this.measureText(t);C.textContent=t;C.setAttribute("style",`font: ${N.font}; font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; position: fixed; left: 1000vw;`);let n=C.getBBox().width;const r=this.measureText(t);return{...r,width:n}};var ft=Object.freeze({background:null,font_color:null,background_selected:"#333333",font_color_selected:"#ffffff",background_hover:null,font_color_hover:null,border_width:1,border_transparency:.25,border_color:null,border_radius:3});function M(t,e,s){this._state=t;for(var n in ft){if(this._state[n]===undefined)this._state[n]=ft[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}M.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-button";document.head.appendChild(this._stylesheet)};M.prototype.update=function(){this._styles.clear();var t=this._state.background||(this._layout.background_color_enabled?this._layout.background_color||"#ffffff":"#ffffff");var e=this._state.font_color||this._layout.font_color||"#333333";var s=z(this._state.border_color||e,this._state.border_transparency);var n=ht();this._styles.select(this._selector+".fl-control.hidden").style("display","none");this._styles.select(this._selector+".fl-control .button").style("overflow","hidden").style("white-space","nowrap").style("margin","0 2px 0 0 !important").style("background-color",t).style("color",e).style("border",this._state.border_width+"px solid "+s).style("border-radius",this._state.border_radius+"px");this._styles.select(this._selector+".fl-control .button:hover").style("background-color",this._state.background_hover||t).style("color",this._state.font_color_hover||e);this._styles.select(this._selector+".fl-control .button.selected").style("background-color",this._state.background_selected).style("color",this._state.font_color_selected);this._styles.select(this._selector+".grouped.fl-control .button").style("border-right","none").style("border-radius","0").style("margin","0");var r=n==="rtl";var i=r?":last-child":":first-child";var o=r?":first-child":":last-child";this._styles.select(this._selector+".grouped.fl-control .button"+i).style("border-radius",this._state.border_radius+"px 0 0 "+this._state.border_radius+"px");this._styles.select(this._selector+".grouped.fl-control .button"+o).style("border-radius","0 "+this._state.border_radius+"px "+this._state.border_radius+"px 0").style("border-right",this._state.border_width+"px solid "+s);this._styles.select(this._selector+".grouped.fl-control.fixed-width:not(.hidden)").style("width",this._state.grouped_width+"%");this._stylesheet.innerHTML=this._styles.print()};var dt=Object.freeze({background:null,font_color:null,border_style:"bottom",border_width:1,border_color:null,border_transparency:.25,border_radius:3});function A(t,e,s){this._state=t;for(var n in dt){if(this._state[n]===undefined)this._state[n]=dt[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}A.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-dropdown";document.head.appendChild(this._stylesheet)};A.prototype.update=function(){this._styles.clear();const t=this._state.background||"transparent";const e=this._state.font_color||this._layout.font_color;const s=e||"inherit";let n;if(this._state.border_color){n=z(this._state.border_color,this._state.border_transparency)}else if(e){n=z(e,this._state.border_transparency)}else{n="currentColor"}this._styles.select(this._selector+" .heading").style("margin-bottom","0.4em");this._styles.select(this._selector).style("pointer-events","all");this._styles.select(this._selector+" select").style("display","inline-block").style("cursor","pointer").style("overflow","hidden").style("white-space","nowrap").style("position","relative").style("font-family","inherit").style("background-color",t).style("color",s).style("border",this._state.border_style=="bottom"?this._state.border_width+"px solid transparent":this._state.border_width+"px solid "+n).style("border-bottom",this._state.border_style=="bottom"?this._state.border_width+"px solid "+n:null).style("border-radius",this._state.border_style=="bottom"?null:this._state.border_radius+"px");this._styles.select(this._selector+":after").style("right",this._state.border_style=="bottom"?null:this._state.border_width+5+"px").style("color",s);this._styles.select(this._selector+" .main .current").style("line-height","1em").style("height","100%").style("max-width","88%").style("display","inline-block").style("overflow","hidden").style("vertical-align","top");this._styles.select(this._selector+" .list").style("top","2px").style("min-width","100%").style("padding","2px").style("display","none").style("max-height","200px").style("overflow-y","auto").style("box-shadow","0 1px 4px rgba(0, 0, 0, .1)").style("margin-top","2px").select(".list-item").style("line-height","1em").style("cursor","pointer").style("font-weight","normal").style("color",s);this._styles.select(this._selector+".open .list").style("display","block").style("border",this._state.border_width+"px solid "+n).style("background-color",t).style("z-index","1").style("animation","dropdown-out 200ms");this._styles.select(this._selector+" .list-item:hover").style("opacity","0.6");this._styles.select(this._selector+" .list-item.selected, "+this._selector+" .list-item.selected:hover").style("opacity","1").style("cursor","default");if(this._state.border_style=="bottom"){this._styles.select(this._selector+" .main").style("padding-left",0).style("padding-right","0.1rem")}this._stylesheet.innerHTML=this._styles.print()};function yt(t){return t*parseFloat(getComputedStyle(document.documentElement).fontSize)}var pt=Object.freeze({play_color:null,handle_color:null,font_color:null,track_color:null,handle_height:1,track_height:.2,margin:4.5,play_button:true});function E(t,e,s){this._state=t;for(var n in pt){if(this._state[n]===undefined)this._state[n]=pt[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}E.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-slider";document.head.appendChild(this._stylesheet)};E.prototype.update=function(){this._styles.clear();var t=this._state.track_color||"#dddddd";var e=this._state.font_color||this._layout.font_color||"currentColor";var s="currentColor";var n=this._state.handle_color||this._layout.font_color||"currentColor";var r=this._state.play_color||this._layout.font_color||"currentColor";var i=Math.round(yt(this._state.handle_height));var o=yt(this._state.track_height);this._styles.select(this._selector+" .fl-controls-slider").style("height",i*2+"px");this._styles.select(this._selector+" .slider-play").style("fill",r).style("width",i+"px").style("height",i+"px").style("display",this._state.play_button?null:"none");this._styles.select(this._selector+" .slider-label").style("padding-inline-start","0.3rem").style("box-sizing","content-box").style("color",e);this._styles.select(this._selector+" input[type=range]").style("-webkit-appearance","none").style("color",s).style("background-color","transparent");this._styles.select(this._selector+" input[type=range]::-webkit-slider-runnable-track").style("-webkit-appearance","none").style("background",t).style("border-radius","100px").style("height",o+"px");this._styles.select(this._selector+" input[type=range]::-webkit-slider-thumb").style("-webkit-appearance","none").style("width",i+"px").style("height",i+"px").style("border-radius","100px").style("background",n).style("margin-top",-i/2+o/2+"px");this._styles.select(this._selector+" input[type=range]::-moz-range-track").style("-webkit-appearance","none").style("background",t).style("border-radius","100px").style("height",o+"px");this._styles.select(this._selector+" input[type=range]::-moz-range-thumb").style("-webkit-appearance","none").style("width",i+"px").style("height",i+"px").style("border-radius","100px").style("border","none").style("background",n);this._stylesheet.innerHTML=this._styles.print()};var T="http://www.w3.org/1999/xhtml";var _t={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 gt(t){var e=t+="",s=e.indexOf(":");if(s>=0&&(e=t.slice(0,s))!=="xmlns")t=t.slice(s+1);return _t.hasOwnProperty(e)?{space:_t[e],local:t}:t}function mt(s){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===T&&t.documentElement.namespaceURI===T?t.createElement(s):t.createElementNS(e,s)}}function bt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function wt(t){var e=gt(t);return(e.local?bt:mt)(e)}function vt(){}function xt(t){return t==null?vt:function(){return this.querySelector(t)}}function kt(t){if(typeof t!=="function")t=xt(t);for(var e=this._groups,s=e.length,n=new Array(s),r=0;r<s;++r){for(var i=e[r],o=i.length,l=n[r]=new Array(o),a,h,c=0;c<o;++c){if((a=i[c])&&(h=t.call(a,a.__data__,c,i))){if("__data__"in a)h.__data__=a.__data__;l[c]=h}}}return new H(n,this._parents)}function Nt(){return[]}function $t(t){return t==null?Nt:function(){return this.querySelectorAll(t)}}function Ct(t){if(typeof t!=="function")t=$t(t);for(var e=this._groups,s=e.length,n=[],r=[],i=0;i<s;++i){for(var o=e[i],l=o.length,a,h=0;h<l;++h){if(a=o[h]){n.push(t.call(a,a.__data__,h,o));r.push(a)}}}return new H(n,r)}function St(t){return function(){return this.matches(t)}}function zt(t){if(typeof t!=="function")t=St(t);for(var e=this._groups,s=e.length,n=new Array(s),r=0;r<s;++r){for(var i=e[r],o=i.length,l=n[r]=[],a,h=0;h<o;++h){if((a=i[h])&&t.call(a,a.__data__,h,i)){l.push(a)}}}return new H(n,this._parents)}function Mt(t){return new Array(t.length)}function At(){return new H(this._enter||this._groups.map(Mt),this._parents)}function B(t,e){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=e}B.prototype={constructor:B,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 Et(t){return function(){return t}}var Tt="$";function Bt(t,e,s,n,r,i){var o=0,l,a=e.length,h=i.length;for(;o<h;++o){if(l=e[o]){l.__data__=i[o];n[o]=l}else{s[o]=new B(t,i[o])}}for(;o<a;++o){if(l=e[o]){r[o]=l}}}function Ht(t,e,s,n,r,i,o){var l,a,h={},c=e.length,u=i.length,f=new Array(c),d;for(l=0;l<c;++l){if(a=e[l]){f[l]=d=Tt+o.call(a,a.__data__,l,e);if(d in h){r[l]=a}else{h[d]=a}}}for(l=0;l<u;++l){d=Tt+o.call(t,i[l],l,i);if(a=h[d]){n[l]=a;a.__data__=i[l];h[d]=null}else{s[l]=new B(t,i[l])}}for(l=0;l<c;++l){if((a=e[l])&&h[f[l]]===a){r[l]=a}}}function Lt(t,e){if(!t){d=new Array(this.size()),h=-1;this.each(function(t){d[++h]=t});return d}var s=e?Ht:Bt,n=this._parents,r=this._groups;if(typeof t!=="function")t=Et(t);for(var i=r.length,o=new Array(i),l=new Array(i),a=new Array(i),h=0;h<i;++h){var c=n[h],u=r[h],f=u.length,d=t.call(c,c&&c.__data__,h,n),y=d.length,p=l[h]=new Array(y),_=o[h]=new Array(y),g=a[h]=new Array(f);s(c,u,p,_,g,d,e);for(var m=0,b=0,w,v;m<y;++m){if(w=p[m]){if(m>=b)b=m+1;while(!(v=_[b])&&++b<y);w._next=v||null}}}o=new H(o,n);o._enter=l;o._exit=a;return o}function Ot(){return new H(this._exit||this._groups.map(Mt),this._parents)}function Rt(t,e,s){var n=this.enter(),r=this,i=this.exit();n=typeof t==="function"?t(n):n.append(t+"");if(e!=null)r=e(r);if(s==null)i.remove();else s(i);return n&&r?n.merge(r).order():r}function qt(t){for(var e=this._groups,s=t._groups,n=e.length,r=s.length,i=Math.min(n,r),o=new Array(n),l=0;l<i;++l){for(var a=e[l],h=s[l],c=a.length,u=o[l]=new Array(c),f,d=0;d<c;++d){if(f=a[d]||h[d]){u[d]=f}}}for(;l<n;++l){o[l]=e[l]}return new H(o,this._parents)}function jt(){for(var t=this._groups,e=-1,s=t.length;++e<s;){for(var n=t[e],r=n.length-1,i=n[r],o;--r>=0;){if(o=n[r]){if(i&&o.compareDocumentPosition(i)^4)i.parentNode.insertBefore(o,i);i=o}}}return this}function Dt(s){if(!s)s=Pt;function t(t,e){return t&&e?s(t.__data__,e.__data__):!t-!e}for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var o=e[i],l=o.length,a=r[i]=new Array(l),h,c=0;c<l;++c){if(h=o[c]){a[c]=h}}a.sort(t)}return new H(r,this._parents).order()}function Pt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Wt(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this}function Gt(){var t=new Array(this.size()),e=-1;this.each(function(){t[++e]=this});return t}function It(){for(var t=this._groups,e=0,s=t.length;e<s;++e){for(var n=t[e],r=0,i=n.length;r<i;++r){var o=n[r];if(o)return o}}return null}function Vt(){var t=0;this.each(function(){++t});return t}function Xt(){return!this.node()}function Ut(t){for(var e=this._groups,s=0,n=e.length;s<n;++s){for(var r=e[s],i=0,o=r.length,l;i<o;++i){if(l=r[i])t.call(l,l.__data__,i,r)}}return this}function Ft(t){return function(){this.removeAttribute(t)}}function Yt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Jt(t,e){return function(){this.setAttribute(t,e)}}function Kt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Qt(e,s){return function(){var t=s.apply(this,arguments);if(t==null)this.removeAttribute(e);else this.setAttribute(e,t)}}function Zt(e,s){return function(){var t=s.apply(this,arguments);if(t==null)this.removeAttributeNS(e.space,e.local);else this.setAttributeNS(e.space,e.local,t)}}function te(t,e){var s=gt(t);if(arguments.length<2){var n=this.node();return s.local?n.getAttributeNS(s.space,s.local):n.getAttribute(s)}return this.each((e==null?s.local?Yt:Ft:typeof e==="function"?s.local?Zt:Qt:s.local?Kt:Jt)(s,e))}function ee(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function se(t){return function(){this.style.removeProperty(t)}}function ne(t,e,s){return function(){this.style.setProperty(t,e,s)}}function re(e,s,n){return function(){var t=s.apply(this,arguments);if(t==null)this.style.removeProperty(e);else this.style.setProperty(e,t,n)}}function ie(t,e,s){return arguments.length>1?this.each((e==null?se:typeof e==="function"?re:ne)(t,e,s==null?"":s)):oe(this.node(),t)}function oe(t,e){return t.style.getPropertyValue(e)||ee(t).getComputedStyle(t,null).getPropertyValue(e)}function le(t){return function(){delete this[t]}}function ae(t,e){return function(){this[t]=e}}function he(e,s){return function(){var t=s.apply(this,arguments);if(t==null)delete this[e];else this[e]=t}}function ce(t,e){return arguments.length>1?this.each((e==null?le:typeof e==="function"?he:ae)(t,e)):this.node()[t]}function ue(t){return t.trim().split(/^|\s+/)}function fe(t){return t.classList||new de(t)}function de(t){this._node=t;this._names=ue(t.getAttribute("class")||"")}de.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 ye(t,e){var s=fe(t),n=-1,r=e.length;while(++n<r)s.add(e[n])}function pe(t,e){var s=fe(t),n=-1,r=e.length;while(++n<r)s.remove(e[n])}function _e(t){return function(){ye(this,t)}}function ge(t){return function(){pe(this,t)}}function me(t,e){return function(){(e.apply(this,arguments)?ye:pe)(this,t)}}function be(t,e){var s=ue(t+"");if(arguments.length<2){var n=fe(this.node()),r=-1,i=s.length;while(++r<i)if(!n.contains(s[r]))return false;return true}return this.each((typeof e==="function"?me:e?_e:ge)(s,e))}function we(){this.textContent=""}function ve(t){return function(){this.textContent=t}}function xe(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function ke(t){return arguments.length?this.each(t==null?we:(typeof t==="function"?xe:ve)(t)):this.node().textContent}function Ne(){this.innerHTML=""}function $e(t){return function(){this.innerHTML=t}}function Ce(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function Se(t){return arguments.length?this.each(t==null?Ne:(typeof t==="function"?Ce:$e)(t)):this.node().innerHTML}function ze(){if(this.nextSibling)this.parentNode.appendChild(this)}function Me(){return this.each(ze)}function Ae(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ee(){return this.each(Ae)}function Te(t){var e=typeof t==="function"?t:wt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Be(){return null}function He(t,e){var s=typeof t==="function"?t:wt(t),n=e==null?Be:typeof e==="function"?e:xt(e);return this.select(function(){return this.insertBefore(s.apply(this,arguments),n.apply(this,arguments)||null)})}function Le(){var t=this.parentNode;if(t)t.removeChild(this)}function Oe(){return this.each(Le)}function Re(){var t=this.cloneNode(false),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function qe(){var t=this.cloneNode(true),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function je(t){return this.select(t?qe:Re)}function De(t){return arguments.length?this.property("__data__",t):this.node().__data__}var Pe={};if(typeof document!=="undefined"){var We=document.documentElement;if(!("onmouseenter"in We)){Pe={mouseenter:"mouseover",mouseleave:"mouseout"}}}function Ge(s,t,e){s=Ie(s,t,e);return function(t){var e=t.relatedTarget;if(!e||e!==this&&!(e.compareDocumentPosition(this)&8)){s.call(this,t)}}}function Ie(e,s,n){return function(t){try{e.call(this,this.__data__,s,n)}finally{}}}function Ve(t){return t.trim().split(/^|\s+/).map(function(t){var e="",s=t.indexOf(".");if(s>=0)e=t.slice(s+1),t=t.slice(0,s);return{type:t,name:e}})}function Xe(i){return function(){var t=this.__on;if(!t)return;for(var e=0,s=-1,n=t.length,r;e<n;++e){if(r=t[e],(!i.type||r.type===i.type)&&r.name===i.name){this.removeEventListener(r.type,r.listener,r.capture)}else{t[++s]=r}}if(++s)t.length=s;else delete this.__on}}function Ue(a,h,c){var u=Pe.hasOwnProperty(a.type)?Ge:Ie;return function(t,e,s){var n=this.__on,r,i=u(h,e,s);if(n)for(var o=0,l=n.length;o<l;++o){if((r=n[o]).type===a.type&&r.name===a.name){this.removeEventListener(r.type,r.listener,r.capture);this.addEventListener(r.type,r.listener=i,r.capture=c);r.value=h;return}}this.addEventListener(a.type,i,c);r={type:a.type,name:a.name,value:h,listener:i,capture:c};if(!n)this.__on=[r];else n.push(r)}}function Fe(t,e,s){var n=Ve(t+""),r,i=n.length,o;if(arguments.length<2){var l=this.node().__on;if(l)for(var a=0,h=l.length,c;a<h;++a){for(r=0,c=l[a];r<i;++r){if((o=n[r]).type===c.type&&o.name===c.name){return c.value}}}return}l=e?Ue:Xe;if(s==null)s=false;for(r=0;r<i;++r)this.each(l(n[r],e,s));return this}function Ye(t,e,s){var n=ee(t),r=n.CustomEvent;if(typeof r==="function"){r=new r(e,s)}else{r=n.document.createEvent("Event");if(s)r.initEvent(e,s.bubbles,s.cancelable),r.detail=s.detail;else r.initEvent(e,false,false)}t.dispatchEvent(r)}function Je(t,e){return function(){return Ye(this,t,e)}}function Ke(t,e){return function(){return Ye(this,t,e.apply(this,arguments))}}function Qe(t,e){return this.each((typeof e==="function"?Ke:Je)(t,e))}var Ze=[null];function H(t,e){this._groups=t;this._parents=e}H.prototype={constructor:H,select:kt,selectAll:Ct,filter:zt,data:Lt,enter:At,exit:Ot,join:Rt,merge:qt,order:jt,sort:Dt,call:Wt,nodes:Gt,node:It,size:Vt,empty:Xt,each:Ut,attr:te,style:ie,property:ce,classed:be,text:ke,html:Se,raise:Me,lower:Ee,append:Te,insert:He,remove:Oe,clone:je,datum:De,on:Fe,dispatch:Qe};function ts(t){return typeof t==="string"?new H([[document.querySelector(t)]],[document.documentElement]):new H([[t]],Ze)}const L={mainTRC:2.4,sRco:.2126729,sGco:.7151522,sBco:.072175,normBG:.56,normTXT:.57,revTXT:.62,revBG:.65,blkThrs:.022,blkClmp:1.414,scaleBoW:1.14,scaleWoB:1.14,loBoWoffset:.027,loWoBoffset:.027,deltaYmin:5e-4,loClip:.1};function es(t,e,s=-1){const n=[0,1.1];if(isNaN(t)||isNaN(e)||Math.min(t,e)<n[0]||Math.max(t,e)>n[1]){return 0}let r=0;let i=0;let o="BoW";t=t>L.blkThrs?t:t+Math.pow(L.blkThrs-t,L.blkClmp);e=e>L.blkThrs?e:e+Math.pow(L.blkThrs-e,L.blkClmp);if(Math.abs(e-t)<L.deltaYmin){return 0}if(e>t){r=(Math.pow(e,L.normBG)-Math.pow(t,L.normTXT))*L.scaleBoW;i=r<L.loClip?0:r-L.loBoWoffset}else{o="WoB";r=(Math.pow(e,L.revBG)-Math.pow(t,L.revTXT))*L.scaleWoB;i=r>-.1?0:r+L.loWoBoffset}if(s<0){return i*100}else if(s==0){return Math.round(Math.abs(i)*100)+"<sub>"+o+"</sub>"}else if(Number.isInteger(s)){return(i*100).toFixed(s)}else{return 0}}function ss(t=[0,0,0]){function e(t){return Math.pow(t/255,L.mainTRC)}return L.sRco*e(t[0])+L.sGco*e(t[1])+L.sBco*e(t[2])}function ns(t,e){if(typeof t!="string")return false;var s=u(t);s.opacity=1;return s}function rs(t,e){if(!t||!e){console.warn("No valid color",t,e);return}const s=ss(Object.values(ns(t)));const n=ss(Object.values(ns(e)));return Math.abs(es(s,n))}function is(t){if(!t){console.warn("No valid color",t);return}const e=rs("#000000",t);const s=rs("#ffffff",t);return s<e?true:false}const os=Object.freeze({searchbox_input_expanded:false,searchbox_size:2,searchbox_width:12,search_bg_color:null,search_bg_opacity:.9,searchbox_stroke:.1,searchbox_color:null,searchbox_radius:4});function ls(t,e,s){this._state=t;for(const n in os){if(this._state[n]===undefined)this._state[n]=os[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}ls.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-searchbox";document.head.appendChild(this._stylesheet)};ls.prototype.update=function(){this._styles.clear();const t=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;const e=this._state.search_bg_color||this._layout.background_color;const s=e?z(e,this._state.search_bg_opacity):"transparent";const n=this._state.searchbox_color||this._layout.font_color;const r=n||"inherit";const i=n?z(n,(this._state.searchbox_stroke+1)/2):"currentColor";const o=n?z(n,this._state.searchbox_stroke):"currentColor";const l=.55;const a=.45;this._styles.select(this._selector).style("display","inline-block").style("width",this._state.searchbox_size+this._state.searchbox_width+"rem").style("max-width","calc(100% - 2px)").style("box-sizing","border-box");ts(this._selector).attr("data-pale-background",is(s));this._styles.select(this._selector+" input").style("border","2px solid "+o).style("border-radius",this._state.searchbox_radius+"px").style("background-color",s).style("color",r).style("font-family","inherit").style("cursor",this._state.searchbox_input_expanded?"text":"pointer").style("position","relative").style("opacity",this._state.search_bg_opacity).style("transition",t?"none":"200ms width").style("display","block").style("box-sizing","border-box").style("padding","0 0 0 calc("+this._state.searchbox_size+"rem - 4px)").style("font-size",this._state.searchbox_size*l+"rem");this._styles.select(this._selector+".expanded input").style("cursor","text");if(this._state.searchbox_input_expanded){this._styles.select(this._selector+" input").style("width","100%").style("height",this._state.searchbox_size+"rem")}else{this._styles.select(this._selector+" input").style("width",this._state.searchbox_size+"rem").style("height",this._state.searchbox_size+"rem")}this._styles.select(this._selector+" .search-icon").style("position","absolute").style("pointer-events","none").style("width",this._state.searchbox_size*a+"rem").style("height",this._state.searchbox_size*a+"rem").style("left",this._state.searchbox_size*Math.pow(1-a,2)+"rem").style("top",this._state.searchbox_size*Math.pow(1-a,2)+"rem");this._styles.select(this._selector+" .search-icon svg").style("width","100%").style("height","100%").select("path").style("fill",r);const h=this._state.search_bg_color||this._layout.background_color;this._styles.select(this._selector+" .search-list").style("display","none").style("opacity","0").style("margin-top","1px").style("min-width","100%").style("max-height","50vh").style("overflow","auto").style("position","absolute").style("box-shadow","0 1px 3px rgba(0,0,0,0.2)").style("color",r).style("border-radius","3px").style("font-size",this._state.searchbox_size*l+"rem").style("z-index","1000");this._styles.select(this._selector+" .search-list.visible").style("opacity",1).style("visibility","visible").style("pointer-events","auto");ts(this._selector+" .search-list").attr("data-pale-background",is(h||s));this._styles.select(this._selector+" .search-list .search-item").style("height",this._state.searchbox_size*l+1+"rem").style("background-color",h||"transparent").style("opacity",this._state.search_bg_opacity).style("padding","0.5rem").style("cursor","pointer").style("position","relative").select("p").style("margin","0").style("line-height","1.2em").style("display","block").style("white-space","nowrap").style("font-weight","normal").style("overflow","hidden").style("text-overflow","ellipsis").style("pointer-events","none");this._styles.select(this._selector+" .search-list[data-pale-background='true'] .search-item:hover").style("outline","2px solid black").style("outline-offset","-2px");this._styles.select(this._selector+" .search-list[data-pale-background='true'] .search-item.selected").style("outline","2px solid black").style("outline-offset","-2px").style("cursor","default");this._styles.select(this._selector+" .search-list[data-pale-background='true'] .search-item:focus-visible").style("outline","2px solid black").style("outline-offset","-2px");this._styles.select(this._selector+" .search-list[data-pale-background='false'] .search-item:hover").style("outline","2px solid white").style("outline-offset","-2px");this._styles.select(this._selector+" .search-list[data-pale-background='false'] .search-item.selected").style("outline","2px solid white").style("outline-offset","-2px").style("cursor","default");this._styles.select(this._selector+" .search-list[data-pale-background='false'] .search-item:focus-visible").style("outline","2px solid white").style("outline-offset","-2px");this._styles.select(this._selector+".active .search-list").style("display","block");this._styles.select(this._selector+".expanded input").style("width","100% !important");this._styles.select(this._selector+" input::placeholder").style("color",i);this._stylesheet.innerHTML=this._styles.print()};function as(t,e,s){return new n(t,e,s)}function hs(t,e,s){return new M(t,e,s)}function cs(t,e,s){return new A(t,e,s)}function us(t,e,s){return new E(t,e,s)}function fs(t,e,s){return new ls(t,e,s)}t.createButtonStyle=hs;t.createDropdownStyle=cs;t.createGeneralControlsStyle=as;t.createSearchboxStyle=fs;t.createSliderStyle=us});
1
+ (function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):(t=typeof globalThis!=="undefined"?globalThis:t||self,e(t["ui-styles"]={}))})(this,function(t){"use strict";function r(){this.declarations=[];return this}r.prototype.select=function(t){if(!t)return this;var e=new s(t);e.parent=this;this.addDeclaration(e);return e};r.prototype.addDeclaration=function(t){this.declarations.push(t);return this};r.prototype.print=function(){var e="";this.declarations.forEach(function(t){e+=t.selector+" {\n";t.styles.forEach(function(t){e+="\t"+t[0]+": "+t[1]+";\n"});e+="}\n\n"});return e};r.prototype.clear=function(){this.declarations=[];return this};function s(t){this.selector=t;this.styles=[];return this}s.prototype.style=function(t,e){var s=typeof value_=="function"?e():e;if(s!==""&&s!==null&&s!==undefined)this.styles.push([t,s]);return this};s.prototype.select=function(t){return this.parent.select(this.selector+" "+t)};var O=Object.freeze({font_size:1,font_weight:"bold",height:2});function n(t,e,s){this._state=t;for(var n in O){if(this._state[n]===undefined)this._state[n]=O[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}n.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-controls";document.head.appendChild(this._stylesheet)};n.prototype.update=function(){this._styles.clear();this._styles.select(this._selector+".hidden").style("display","none");this._styles.select(this._selector).style("vertical-align","middle").style("position","relative").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight);this._styles.select(".fl-controls-title").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight).style("vertical-align","middle");this._styles.select(this._selector+".fl-control .button").style("height",this._state.height+"rem").style("padding","0 0.5em");this._styles.select(this._selector+"-dropdown select").style("height",this._state.height+"rem").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight).style("padding",0+" "+this._state.height*.1+"rem");this._styles.select(this._selector+"-slider .slider-end-labels").style("font-size",this._state.font_size+"rem").style("font-weight",this._state.font_weight);this._styles.select(this._selector+"-slider").style("height",this._state.height+"rem");this._stylesheet.innerHTML=this._styles.print()};function e(t,e,s){t.prototype=e.prototype=s;s.constructor=t}function R(t,e){var s=Object.create(t.prototype);for(var n in e)s[n]=e[n];return s}function h(){}var i=.7;var o=1/i;var l="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q=/^#([0-9a-f]{3,8})$/,j=new RegExp(`^rgb\\(${l},${l},${l}\\)$`),D=new RegExp(`^rgb\\(${c},${c},${c}\\)$`),P=new RegExp(`^rgba\\(${l},${l},${l},${a}\\)$`),W=new RegExp(`^rgba\\(${c},${c},${c},${a}\\)$`),G=new RegExp(`^hsl\\(${a},${c},${c}\\)$`),I=new RegExp(`^hsla\\(${a},${c},${c},${a}\\)$`);var V={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};e(h,u,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:X,formatHex:X,formatHex8:U,formatHsl:F,formatRgb:Y,toString:Y});function X(){return this.rgb().formatHex()}function U(){return this.rgb().formatHex8()}function F(){return nt(this).formatHsl()}function Y(){return this.rgb().formatRgb()}function u(t){var e,s;t=(t+"").trim().toLowerCase();return(e=q.exec(t))?(s=e[1].length,e=parseInt(e[1],16),s===6?J(e):s===3?new d(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):s===8?f(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):s===4?f(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=j.exec(t))?new d(e[1],e[2],e[3],1):(e=D.exec(t))?new d(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=P.exec(t))?f(e[1],e[2],e[3],e[4]):(e=W.exec(t))?f(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=G.exec(t))?st(e[1],e[2]/100,e[3]/100,1):(e=I.exec(t))?st(e[1],e[2]/100,e[3]/100,e[4]):V.hasOwnProperty(t)?J(V[t]):t==="transparent"?new d(NaN,NaN,NaN,0):null}function J(t){return new d(t>>16&255,t>>8&255,t&255,1)}function f(t,e,s,n){if(n<=0)t=e=s=NaN;return new d(t,e,s,n)}function K(t){if(!(t instanceof h))t=u(t);if(!t)return new d;t=t.rgb();return new d(t.r,t.g,t.b,t.opacity)}function Q(t,e,s,n){return arguments.length===1?K(t):new d(t,e,s,n==null?1:n)}function d(t,e,s,n){this.r=+t;this.g=+e;this.b=+s;this.opacity=+n}e(d,Q,R(h,{brighter(t){t=t==null?o:Math.pow(o,t);return new d(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){t=t==null?i:Math.pow(i,t);return new d(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new d(p(this.r),p(this.g),p(this.b),y(this.opacity))},displayable(){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:Z,formatHex:Z,formatHex8:tt,formatRgb:et,toString:et}));function Z(){return`#${_(this.r)}${_(this.g)}${_(this.b)}`}function tt(){return`#${_(this.r)}${_(this.g)}${_(this.b)}${_((isNaN(this.opacity)?1:this.opacity)*255)}`}function et(){const t=y(this.opacity);return`${t===1?"rgb(":"rgba("}${p(this.r)}, ${p(this.g)}, ${p(this.b)}${t===1?")":`, ${t})`}`}function y(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function p(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _(t){t=p(t);return(t<16?"0":"")+t.toString(16)}function st(t,e,s,n){if(n<=0)t=e=s=NaN;else if(s<=0||s>=1)t=e=NaN;else if(e<=0)t=NaN;return new g(t,e,s,n)}function nt(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(!(t instanceof h))t=u(t);if(!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,s=t.g/255,n=t.b/255,r=Math.min(e,s,n),i=Math.max(e,s,n),o=NaN,l=i-r,a=(i+r)/2;if(l){if(e===i)o=(s-n)/l+(s<n)*6;else if(s===i)o=(n-e)/l+2;else o=(e-s)/l+4;l/=a<.5?i+r:2-i-r;o*=60}else{l=a>0&&a<1?0:o}return new g(o,l,a,t.opacity)}function rt(t,e,s,n){return arguments.length===1?nt(t):new g(t,e,s,n==null?1:n)}function g(t,e,s,n){this.h=+t;this.s=+e;this.l=+s;this.opacity=+n}e(g,rt,R(h,{brighter(t){t=t==null?o:Math.pow(o,t);return new g(this.h,this.s,this.l*t,this.opacity)},darker(t){t=t==null?i:Math.pow(i,t);return new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,n=s+(s<.5?s:1-s)*e,r=2*s-n;return new d(b(t>=240?t-240:t+120,r,n),b(t,r,n),b(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new g(it(this.h),m(this.s),m(this.l),y(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){const t=y(this.opacity);return`${t===1?"hsl(":"hsla("}${it(this.h)}, ${m(this.s)*100}%, ${m(this.l)*100}%${t===1?")":`, ${t})`}`}}));function it(t){t=(t||0)%360;return t<0?t+360:t}function m(t){return Math.max(0,Math.min(1,t||0))}function b(t,e,s){return(t<60?e+(s-e)*t/60:t<180?s:t<240?e+(s-e)*(240-t)/60:e)*255}var w="$";function v(){}v.prototype=ot.prototype={constructor:v,has:function(t){return w+t in this},get:function(t){return this[w+t]},set:function(t,e){this[w+t]=e;return this},remove:function(t){var e=w+t;return e in this&&delete this[e]},clear:function(){for(var t in this)if(t[0]===w)delete this[t]},keys:function(){var t=[];for(var e in this)if(e[0]===w)t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)if(e[0]===w)t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)if(e[0]===w)t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)if(e[0]===w)++t;return t},empty:function(){for(var t in this)if(t[0]===w)return false;return true},each:function(t){for(var e in this)if(e[0]===w)t(this[e],e.slice(1),this)}};function ot(t,e){var s=new v;if(t instanceof v)t.each(function(t,e){s.set(e,t)});else if(Array.isArray(t)){var n=-1,r=t.length,i;if(e==null)while(++n<r)s.set(n,t[n]);else while(++n<r)s.set(e(i=t[n],n,t),i)}else if(t)for(var o in t)s.set(o,t[o]);return s}function lt(){}var x=ot.prototype;lt.prototype={constructor:lt,has:x.has,add:function(t){t+="";this[w+t]=t;return this},remove:x.remove,clear:x.clear,values:x.keys,size:x.size,empty:x.empty,each:x.each};const at=document.createElement("canvas");at.getContext("2d");const ht=typeof window!=="undefined"&&typeof document!=="undefined"&&typeof document.createElement==="function"&&typeof document.body?.appendChild==="function"&&typeof HTMLElement!=="undefined";const k=document.createElement("canvas");const N=k.getContext("2d");const $=document.createElementNS("http://www.w3.org/2000/svg","svg");const C=document.createElementNS("http://www.w3.org/2000/svg","text");$.appendChild(C);if(ht){k.style.position="fixed";k.style.left="1000vw";$.style.position="fixed";$.style.left="1000vw";document.body.appendChild(k);document.body.appendChild($)}let S=null;function ct(){return window.getComputedStyle(document.body).direction||"ltr"}function ut(t,e){if(typeof t!="string")return false;var s=u(t);s.opacity=e!==undefined?e:1;return s}function z(t,e){var s=ut(t,e);return s?s.toString():false}function ft(){const t="0123456789.,£";const e=document.createElement("canvas");const s=document.createElement("canvas");const n=e.getContext("2d");const r=s.getContext("2d");e.setAttribute("style","font-feature-settings: normal; font-variant-numeric: normal; position: fixed; left: 1000vw;");s.setAttribute("style",'font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; position: fixed; left: 1000vw;');n.font=r.font=N.font;document.body.appendChild(e);document.body.appendChild(s);const i=n.measureText(t).width;const o=r.measureText(t).width;S=i!==o;document.body.removeChild(e);document.body.removeChild(s);return S}N.measureTextWithTnums=function(t){if(!ht)return N.measureText(t);const e=window.getComputedStyle(this.canvas);const s=(e.fontFeatureSettings||"").includes("tnum")||(e.fontVariantNumeric||"").includes("tabular-nums");if(!s)return this.measureText(t);if(S===null)ft();if(S)return this.measureText(t);C.textContent=t;C.setAttribute("style",`font: ${N.font}; font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; position: fixed; left: 1000vw;`);let n=C.getBBox().width;const r=this.measureText(t);return{...r,width:n}};var dt=Object.freeze({background:null,font_color:null,background_selected:"#333333",font_color_selected:"#ffffff",background_hover:null,font_color_hover:null,border_width:1,border_transparency:.25,border_color:null,border_radius:3});function M(t,e,s){this._state=t;for(var n in dt){if(this._state[n]===undefined)this._state[n]=dt[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}M.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-button";document.head.appendChild(this._stylesheet)};M.prototype.update=function(){this._styles.clear();var t=this._state.background||(this._layout.background_color_enabled?this._layout.background_color||"#ffffff":"#ffffff");var e=this._state.font_color||this._layout.font_color||"#333333";var s=z(this._state.border_color||e,this._state.border_transparency);var n=ct();this._styles.select(this._selector+".fl-control.hidden").style("display","none");this._styles.select(this._selector+".fl-control .button").style("overflow","hidden").style("white-space","nowrap").style("margin","0 2px 0 0 !important").style("background-color",t).style("color",e).style("border",this._state.border_width+"px solid "+s).style("border-radius",this._state.border_radius+"px");this._styles.select(this._selector+".fl-control .button:hover").style("background-color",this._state.background_hover||t).style("color",this._state.font_color_hover||e);this._styles.select(this._selector+".fl-control .button.selected").style("background-color",this._state.background_selected).style("color",this._state.font_color_selected);this._styles.select(this._selector+".grouped.fl-control .button").style("border-right","none").style("border-radius","0").style("margin","0");var r=n==="rtl";var i=r?":last-child":":first-child";var o=r?":first-child":":last-child";this._styles.select(this._selector+".grouped.fl-control .button"+i).style("border-radius",this._state.border_radius+"px 0 0 "+this._state.border_radius+"px");this._styles.select(this._selector+".grouped.fl-control .button"+o).style("border-radius","0 "+this._state.border_radius+"px "+this._state.border_radius+"px 0").style("border-right",this._state.border_width+"px solid "+s);this._styles.select(this._selector+".grouped.fl-control.fixed-width:not(.hidden)").style("width",this._state.grouped_width+"%");this._stylesheet.innerHTML=this._styles.print()};var yt=Object.freeze({background:null,font_color:null,border_style:"bottom",border_width:1,border_color:null,border_transparency:.25,border_radius:3});function E(t,e,s){this._state=t;for(var n in yt){if(this._state[n]===undefined)this._state[n]=yt[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}E.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-dropdown";document.head.appendChild(this._stylesheet)};E.prototype.update=function(){this._styles.clear();const t=this._state.background||"transparent";const e=this._state.font_color||this._layout.font_color;const s=e||"inherit";let n;if(this._state.border_color){n=z(this._state.border_color,this._state.border_transparency)}else if(e){n=z(e,this._state.border_transparency)}else{n="currentColor"}this._styles.select(this._selector+" .heading").style("margin-bottom","0.4em");this._styles.select(this._selector).style("pointer-events","all");this._styles.select(this._selector+" select").style("display","inline-block").style("cursor","pointer").style("overflow","hidden").style("white-space","nowrap").style("position","relative").style("font-family","inherit").style("background-color",t).style("color",s).style("border",this._state.border_style=="bottom"?this._state.border_width+"px solid transparent":this._state.border_width+"px solid "+n).style("border-bottom",this._state.border_style=="bottom"?this._state.border_width+"px solid "+n:null).style("border-radius",this._state.border_style=="bottom"?null:this._state.border_radius+"px");this._styles.select(this._selector+":after").style("right",this._state.border_style=="bottom"?null:this._state.border_width+5+"px").style("color",s);this._styles.select(this._selector+" .main .current").style("line-height","1em").style("height","100%").style("max-width","88%").style("display","inline-block").style("overflow","hidden").style("vertical-align","top");this._styles.select(this._selector+" .list").style("top","2px").style("min-width","100%").style("padding","2px").style("display","none").style("max-height","200px").style("overflow-y","auto").style("box-shadow","0 1px 4px rgba(0, 0, 0, .1)").style("margin-top","2px").select(".list-item").style("line-height","1em").style("cursor","pointer").style("font-weight","normal").style("color",s);this._styles.select(this._selector+".open .list").style("display","block").style("border",this._state.border_width+"px solid "+n).style("background-color",t).style("z-index","1").style("animation","dropdown-out 200ms");this._styles.select(this._selector+" .list-item:hover").style("opacity","0.6");this._styles.select(this._selector+" .list-item.selected, "+this._selector+" .list-item.selected:hover").style("opacity","1").style("cursor","default");if(this._state.border_style=="bottom"){this._styles.select(this._selector+" .main").style("padding-left",0).style("padding-right","0.1rem")}this._stylesheet.innerHTML=this._styles.print()};function pt(t){return t*parseFloat(getComputedStyle(document.documentElement).fontSize)}var _t=Object.freeze({play_color:null,handle_color:null,font_color:null,track_color:null,handle_height:1,track_height:.2,margin:4.5,play_button:true});function A(t,e,s){this._state=t;for(var n in _t){if(this._state[n]===undefined)this._state[n]=_t[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}A.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-slider";document.head.appendChild(this._stylesheet)};A.prototype.update=function(){this._styles.clear();var t=this._state.track_color||"#dddddd";var e=this._state.font_color||this._layout.font_color||"currentColor";var s="currentColor";var n=this._state.handle_color||this._layout.font_color||"currentColor";var r=this._state.play_color||this._layout.font_color||"currentColor";var i=Math.round(pt(this._state.handle_height));var o=pt(this._state.track_height);this._styles.select(this._selector+" .fl-controls-slider").style("height",i*2+"px");this._styles.select(this._selector+" .slider-play").style("fill",r).style("width",i+"px").style("height",i+"px").style("display",this._state.play_button?null:"none");this._styles.select(this._selector+" .slider-label").style("padding-inline-start","0.3rem").style("box-sizing","content-box").style("color",e);this._styles.select(this._selector+" input[type=range]").style("-webkit-appearance","none").style("color",s).style("background-color","transparent");this._styles.select(this._selector+" input[type=range]::-webkit-slider-runnable-track").style("-webkit-appearance","none").style("background",t).style("border-radius","100px").style("height",o+"px");this._styles.select(this._selector+" input[type=range]::-webkit-slider-thumb").style("-webkit-appearance","none").style("width",i+"px").style("height",i+"px").style("border-radius","100px").style("background",n).style("margin-top",-i/2+o/2+"px");this._styles.select(this._selector+" input[type=range]::-moz-range-track").style("-webkit-appearance","none").style("background",t).style("border-radius","100px").style("height",o+"px");this._styles.select(this._selector+" input[type=range]::-moz-range-thumb").style("-webkit-appearance","none").style("width",i+"px").style("height",i+"px").style("border-radius","100px").style("border","none").style("background",n);this._stylesheet.innerHTML=this._styles.print()};var T="http://www.w3.org/1999/xhtml";var gt={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 mt(t){var e=t+="",s=e.indexOf(":");if(s>=0&&(e=t.slice(0,s))!=="xmlns")t=t.slice(s+1);return gt.hasOwnProperty(e)?{space:gt[e],local:t}:t}function bt(s){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===T&&t.documentElement.namespaceURI===T?t.createElement(s):t.createElementNS(e,s)}}function wt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vt(t){var e=mt(t);return(e.local?wt:bt)(e)}function xt(){}function kt(t){return t==null?xt:function(){return this.querySelector(t)}}function Nt(t){if(typeof t!=="function")t=kt(t);for(var e=this._groups,s=e.length,n=new Array(s),r=0;r<s;++r){for(var i=e[r],o=i.length,l=n[r]=new Array(o),a,h,c=0;c<o;++c){if((a=i[c])&&(h=t.call(a,a.__data__,c,i))){if("__data__"in a)h.__data__=a.__data__;l[c]=h}}}return new H(n,this._parents)}function $t(){return[]}function Ct(t){return t==null?$t:function(){return this.querySelectorAll(t)}}function St(t){if(typeof t!=="function")t=Ct(t);for(var e=this._groups,s=e.length,n=[],r=[],i=0;i<s;++i){for(var o=e[i],l=o.length,a,h=0;h<l;++h){if(a=o[h]){n.push(t.call(a,a.__data__,h,o));r.push(a)}}}return new H(n,r)}function zt(t){return function(){return this.matches(t)}}function Mt(t){if(typeof t!=="function")t=zt(t);for(var e=this._groups,s=e.length,n=new Array(s),r=0;r<s;++r){for(var i=e[r],o=i.length,l=n[r]=[],a,h=0;h<o;++h){if((a=i[h])&&t.call(a,a.__data__,h,i)){l.push(a)}}}return new H(n,this._parents)}function Et(t){return new Array(t.length)}function At(){return new H(this._enter||this._groups.map(Et),this._parents)}function B(t,e){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=e}B.prototype={constructor:B,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 Tt(t){return function(){return t}}var Bt="$";function Ht(t,e,s,n,r,i){var o=0,l,a=e.length,h=i.length;for(;o<h;++o){if(l=e[o]){l.__data__=i[o];n[o]=l}else{s[o]=new B(t,i[o])}}for(;o<a;++o){if(l=e[o]){r[o]=l}}}function Lt(t,e,s,n,r,i,o){var l,a,h={},c=e.length,u=i.length,f=new Array(c),d;for(l=0;l<c;++l){if(a=e[l]){f[l]=d=Bt+o.call(a,a.__data__,l,e);if(d in h){r[l]=a}else{h[d]=a}}}for(l=0;l<u;++l){d=Bt+o.call(t,i[l],l,i);if(a=h[d]){n[l]=a;a.__data__=i[l];h[d]=null}else{s[l]=new B(t,i[l])}}for(l=0;l<c;++l){if((a=e[l])&&h[f[l]]===a){r[l]=a}}}function Ot(t,e){if(!t){d=new Array(this.size()),h=-1;this.each(function(t){d[++h]=t});return d}var s=e?Lt:Ht,n=this._parents,r=this._groups;if(typeof t!=="function")t=Tt(t);for(var i=r.length,o=new Array(i),l=new Array(i),a=new Array(i),h=0;h<i;++h){var c=n[h],u=r[h],f=u.length,d=t.call(c,c&&c.__data__,h,n),y=d.length,p=l[h]=new Array(y),_=o[h]=new Array(y),g=a[h]=new Array(f);s(c,u,p,_,g,d,e);for(var m=0,b=0,w,v;m<y;++m){if(w=p[m]){if(m>=b)b=m+1;while(!(v=_[b])&&++b<y);w._next=v||null}}}o=new H(o,n);o._enter=l;o._exit=a;return o}function Rt(){return new H(this._exit||this._groups.map(Et),this._parents)}function qt(t,e,s){var n=this.enter(),r=this,i=this.exit();n=typeof t==="function"?t(n):n.append(t+"");if(e!=null)r=e(r);if(s==null)i.remove();else s(i);return n&&r?n.merge(r).order():r}function jt(t){for(var e=this._groups,s=t._groups,n=e.length,r=s.length,i=Math.min(n,r),o=new Array(n),l=0;l<i;++l){for(var a=e[l],h=s[l],c=a.length,u=o[l]=new Array(c),f,d=0;d<c;++d){if(f=a[d]||h[d]){u[d]=f}}}for(;l<n;++l){o[l]=e[l]}return new H(o,this._parents)}function Dt(){for(var t=this._groups,e=-1,s=t.length;++e<s;){for(var n=t[e],r=n.length-1,i=n[r],o;--r>=0;){if(o=n[r]){if(i&&o.compareDocumentPosition(i)^4)i.parentNode.insertBefore(o,i);i=o}}}return this}function Pt(s){if(!s)s=Wt;function t(t,e){return t&&e?s(t.__data__,e.__data__):!t-!e}for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i){for(var o=e[i],l=o.length,a=r[i]=new Array(l),h,c=0;c<l;++c){if(h=o[c]){a[c]=h}}a.sort(t)}return new H(r,this._parents).order()}function Wt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Gt(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this}function It(){var t=new Array(this.size()),e=-1;this.each(function(){t[++e]=this});return t}function Vt(){for(var t=this._groups,e=0,s=t.length;e<s;++e){for(var n=t[e],r=0,i=n.length;r<i;++r){var o=n[r];if(o)return o}}return null}function Xt(){var t=0;this.each(function(){++t});return t}function Ut(){return!this.node()}function Ft(t){for(var e=this._groups,s=0,n=e.length;s<n;++s){for(var r=e[s],i=0,o=r.length,l;i<o;++i){if(l=r[i])t.call(l,l.__data__,i,r)}}return this}function Yt(t){return function(){this.removeAttribute(t)}}function Jt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Kt(t,e){return function(){this.setAttribute(t,e)}}function Qt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Zt(e,s){return function(){var t=s.apply(this,arguments);if(t==null)this.removeAttribute(e);else this.setAttribute(e,t)}}function te(e,s){return function(){var t=s.apply(this,arguments);if(t==null)this.removeAttributeNS(e.space,e.local);else this.setAttributeNS(e.space,e.local,t)}}function ee(t,e){var s=mt(t);if(arguments.length<2){var n=this.node();return s.local?n.getAttributeNS(s.space,s.local):n.getAttribute(s)}return this.each((e==null?s.local?Jt:Yt:typeof e==="function"?s.local?te:Zt:s.local?Qt:Kt)(s,e))}function se(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ne(t){return function(){this.style.removeProperty(t)}}function re(t,e,s){return function(){this.style.setProperty(t,e,s)}}function ie(e,s,n){return function(){var t=s.apply(this,arguments);if(t==null)this.style.removeProperty(e);else this.style.setProperty(e,t,n)}}function oe(t,e,s){return arguments.length>1?this.each((e==null?ne:typeof e==="function"?ie:re)(t,e,s==null?"":s)):le(this.node(),t)}function le(t,e){return t.style.getPropertyValue(e)||se(t).getComputedStyle(t,null).getPropertyValue(e)}function ae(t){return function(){delete this[t]}}function he(t,e){return function(){this[t]=e}}function ce(e,s){return function(){var t=s.apply(this,arguments);if(t==null)delete this[e];else this[e]=t}}function ue(t,e){return arguments.length>1?this.each((e==null?ae:typeof e==="function"?ce:he)(t,e)):this.node()[t]}function fe(t){return t.trim().split(/^|\s+/)}function de(t){return t.classList||new ye(t)}function ye(t){this._node=t;this._names=fe(t.getAttribute("class")||"")}ye.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 pe(t,e){var s=de(t),n=-1,r=e.length;while(++n<r)s.add(e[n])}function _e(t,e){var s=de(t),n=-1,r=e.length;while(++n<r)s.remove(e[n])}function ge(t){return function(){pe(this,t)}}function me(t){return function(){_e(this,t)}}function be(t,e){return function(){(e.apply(this,arguments)?pe:_e)(this,t)}}function we(t,e){var s=fe(t+"");if(arguments.length<2){var n=de(this.node()),r=-1,i=s.length;while(++r<i)if(!n.contains(s[r]))return false;return true}return this.each((typeof e==="function"?be:e?ge:me)(s,e))}function ve(){this.textContent=""}function xe(t){return function(){this.textContent=t}}function ke(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function Ne(t){return arguments.length?this.each(t==null?ve:(typeof t==="function"?ke:xe)(t)):this.node().textContent}function $e(){this.innerHTML=""}function Ce(t){return function(){this.innerHTML=t}}function Se(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function ze(t){return arguments.length?this.each(t==null?$e:(typeof t==="function"?Se:Ce)(t)):this.node().innerHTML}function Me(){if(this.nextSibling)this.parentNode.appendChild(this)}function Ee(){return this.each(Me)}function Ae(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Te(){return this.each(Ae)}function Be(t){var e=typeof t==="function"?t:vt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function He(){return null}function Le(t,e){var s=typeof t==="function"?t:vt(t),n=e==null?He:typeof e==="function"?e:kt(e);return this.select(function(){return this.insertBefore(s.apply(this,arguments),n.apply(this,arguments)||null)})}function Oe(){var t=this.parentNode;if(t)t.removeChild(this)}function Re(){return this.each(Oe)}function qe(){var t=this.cloneNode(false),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function je(){var t=this.cloneNode(true),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function De(t){return this.select(t?je:qe)}function Pe(t){return arguments.length?this.property("__data__",t):this.node().__data__}var We={};if(typeof document!=="undefined"){var Ge=document.documentElement;if(!("onmouseenter"in Ge)){We={mouseenter:"mouseover",mouseleave:"mouseout"}}}function Ie(s,t,e){s=Ve(s,t,e);return function(t){var e=t.relatedTarget;if(!e||e!==this&&!(e.compareDocumentPosition(this)&8)){s.call(this,t)}}}function Ve(e,s,n){return function(t){try{e.call(this,this.__data__,s,n)}finally{}}}function Xe(t){return t.trim().split(/^|\s+/).map(function(t){var e="",s=t.indexOf(".");if(s>=0)e=t.slice(s+1),t=t.slice(0,s);return{type:t,name:e}})}function Ue(i){return function(){var t=this.__on;if(!t)return;for(var e=0,s=-1,n=t.length,r;e<n;++e){if(r=t[e],(!i.type||r.type===i.type)&&r.name===i.name){this.removeEventListener(r.type,r.listener,r.capture)}else{t[++s]=r}}if(++s)t.length=s;else delete this.__on}}function Fe(a,h,c){var u=We.hasOwnProperty(a.type)?Ie:Ve;return function(t,e,s){var n=this.__on,r,i=u(h,e,s);if(n)for(var o=0,l=n.length;o<l;++o){if((r=n[o]).type===a.type&&r.name===a.name){this.removeEventListener(r.type,r.listener,r.capture);this.addEventListener(r.type,r.listener=i,r.capture=c);r.value=h;return}}this.addEventListener(a.type,i,c);r={type:a.type,name:a.name,value:h,listener:i,capture:c};if(!n)this.__on=[r];else n.push(r)}}function Ye(t,e,s){var n=Xe(t+""),r,i=n.length,o;if(arguments.length<2){var l=this.node().__on;if(l)for(var a=0,h=l.length,c;a<h;++a){for(r=0,c=l[a];r<i;++r){if((o=n[r]).type===c.type&&o.name===c.name){return c.value}}}return}l=e?Fe:Ue;if(s==null)s=false;for(r=0;r<i;++r)this.each(l(n[r],e,s));return this}function Je(t,e,s){var n=se(t),r=n.CustomEvent;if(typeof r==="function"){r=new r(e,s)}else{r=n.document.createEvent("Event");if(s)r.initEvent(e,s.bubbles,s.cancelable),r.detail=s.detail;else r.initEvent(e,false,false)}t.dispatchEvent(r)}function Ke(t,e){return function(){return Je(this,t,e)}}function Qe(t,e){return function(){return Je(this,t,e.apply(this,arguments))}}function Ze(t,e){return this.each((typeof e==="function"?Qe:Ke)(t,e))}var ts=[null];function H(t,e){this._groups=t;this._parents=e}H.prototype={constructor:H,select:Nt,selectAll:St,filter:Mt,data:Ot,enter:At,exit:Rt,join:qt,merge:jt,order:Dt,sort:Pt,call:Gt,nodes:It,node:Vt,size:Xt,empty:Ut,each:Ft,attr:ee,style:oe,property:ue,classed:we,text:Ne,html:ze,raise:Ee,lower:Te,append:Be,insert:Le,remove:Re,clone:De,datum:Pe,on:Ye,dispatch:Ze};function es(t){return typeof t==="string"?new H([[document.querySelector(t)]],[document.documentElement]):new H([[t]],ts)}const L={mainTRC:2.4,sRco:.2126729,sGco:.7151522,sBco:.072175,normBG:.56,normTXT:.57,revTXT:.62,revBG:.65,blkThrs:.022,blkClmp:1.414,scaleBoW:1.14,scaleWoB:1.14,loBoWoffset:.027,loWoBoffset:.027,deltaYmin:5e-4,loClip:.1};function ss(t,e,s=-1){const n=[0,1.1];if(isNaN(t)||isNaN(e)||Math.min(t,e)<n[0]||Math.max(t,e)>n[1]){return 0}let r=0;let i=0;let o="BoW";t=t>L.blkThrs?t:t+Math.pow(L.blkThrs-t,L.blkClmp);e=e>L.blkThrs?e:e+Math.pow(L.blkThrs-e,L.blkClmp);if(Math.abs(e-t)<L.deltaYmin){return 0}if(e>t){r=(Math.pow(e,L.normBG)-Math.pow(t,L.normTXT))*L.scaleBoW;i=r<L.loClip?0:r-L.loBoWoffset}else{o="WoB";r=(Math.pow(e,L.revBG)-Math.pow(t,L.revTXT))*L.scaleWoB;i=r>-.1?0:r+L.loWoBoffset}if(s<0){return i*100}else if(s==0){return Math.round(Math.abs(i)*100)+"<sub>"+o+"</sub>"}else if(Number.isInteger(s)){return(i*100).toFixed(s)}else{return 0}}function ns(t=[0,0,0]){function e(t){return Math.pow(t/255,L.mainTRC)}return L.sRco*e(t[0])+L.sGco*e(t[1])+L.sBco*e(t[2])}function rs(t,e){if(typeof t!="string")return false;var s=u(t);s.opacity=1;return s}function is(t,e){if(!t||!e){console.warn("No valid color",t,e);return}const s=ns(Object.values(rs(t)));const n=ns(Object.values(rs(e)));return Math.abs(ss(s,n))}function os(t){if(!t){console.warn("No valid color",t);return}const e=is("#000000",t);const s=is("#ffffff",t);return s<e?true:false}const ls=Object.freeze({searchbox_input_expanded:false,searchbox_size:2,searchbox_width:12,search_bg_color:null,search_bg_opacity:.9,searchbox_stroke:.1,searchbox_color:null,searchbox_radius:4});function as(t,e,s){this._state=t;for(const n in ls){if(this._state[n]===undefined)this._state[n]=ls[n]}this._layout=s||{};this._styles=new r;this._selector=e;this._createStylesheet();return this}as.prototype._createStylesheet=function(){this._stylesheet=document.createElement("style");this._stylesheet.className="fl-ui-styles-searchbox";document.head.appendChild(this._stylesheet)};as.prototype.update=function(){this._styles.clear();const t=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;const e=this._state.search_bg_color||this._layout.background_color;const s=e?z(e,this._state.search_bg_opacity):"transparent";const n=this._state.searchbox_color||this._layout.font_color;const r=n||"inherit";const i=n?z(n,(this._state.searchbox_stroke+1)/2):"currentColor";const o=n?z(n,this._state.searchbox_stroke):"currentColor";const l=.55;const a=.45;this._styles.select(this._selector).style("display","inline-block").style("width",this._state.searchbox_size+this._state.searchbox_width+"rem").style("max-width","calc(100% - 2px)").style("box-sizing","border-box");es(this._selector).attr("data-pale-background",os(s));this._styles.select(this._selector+" input").style("border","2px solid "+o).style("border-radius",this._state.searchbox_radius+"px").style("background-color",s).style("color",r).style("font-family","inherit").style("cursor",this._state.searchbox_input_expanded?"text":"pointer").style("position","relative").style("opacity",this._state.search_bg_opacity).style("transition",t?"none":"200ms width").style("display","block").style("box-sizing","border-box").style("padding","0 0 0 calc("+this._state.searchbox_size+"rem - 4px)").style("font-size",this._state.searchbox_size*l+"rem");this._styles.select(this._selector+".expanded input").style("cursor","text");if(this._state.searchbox_input_expanded){this._styles.select(this._selector+" input").style("width","100%").style("height",this._state.searchbox_size+"rem")}else{this._styles.select(this._selector+" input").style("width",this._state.searchbox_size+"rem").style("height",this._state.searchbox_size+"rem")}this._styles.select(this._selector+" .search-icon").style("position","absolute").style("pointer-events","none").style("width",this._state.searchbox_size*a+"rem").style("height",this._state.searchbox_size*a+"rem").style("left",this._state.searchbox_size*Math.pow(1-a,2)+"rem").style("top",this._state.searchbox_size*Math.pow(1-a,2)+"rem");this._styles.select(this._selector+" .search-icon svg").style("width","100%").style("height","100%").select("path").style("fill",r);const h=this._state.search_bg_color||this._layout.background_color;this._styles.select(this._selector+" .search-list").style("display","none").style("opacity","0").style("margin-top","1px").style("min-width","100%").style("max-height","50vh").style("overflow","auto").style("position","absolute").style("box-shadow","0 1px 3px rgba(0,0,0,0.2)").style("color",r).style("border-radius","3px").style("font-size",this._state.searchbox_size*l+"rem").style("z-index","1000");this._styles.select(this._selector+" .search-list.visible").style("opacity",1).style("visibility","visible").style("pointer-events","auto");es(this._selector+" .search-list").attr("data-pale-background",os(h||s));this._styles.select(this._selector+" .search-list .search-item").style("height",this._state.searchbox_size*l+1+"rem").style("background-color",h||"transparent").style("opacity",this._state.search_bg_opacity).style("padding","0.5rem").style("cursor","pointer").style("position","relative").select("p").style("margin","0").style("line-height","1.2em").style("display","block").style("white-space","nowrap").style("font-weight","normal").style("overflow","hidden").style("text-overflow","ellipsis").style("pointer-events","none");this._styles.select(this._selector+" .search-list[data-pale-background='true'] .search-item:hover").style("outline","2px solid black").style("outline-offset","-2px");this._styles.select(this._selector+" .search-list[data-pale-background='true'] .search-item.selected").style("outline","2px solid black").style("outline-offset","-2px").style("cursor","default");this._styles.select(this._selector+" .search-list[data-pale-background='true'] .search-item:focus-visible").style("outline","2px solid black").style("outline-offset","-2px");this._styles.select(this._selector+" .search-list[data-pale-background='false'] .search-item:hover").style("outline","2px solid white").style("outline-offset","-2px");this._styles.select(this._selector+" .search-list[data-pale-background='false'] .search-item.selected").style("outline","2px solid white").style("outline-offset","-2px").style("cursor","default");this._styles.select(this._selector+" .search-list[data-pale-background='false'] .search-item:focus-visible").style("outline","2px solid white").style("outline-offset","-2px");this._styles.select(this._selector+".active .search-list").style("display","block");this._styles.select(this._selector+".expanded input").style("width","100% !important");this._styles.select(this._selector+" input::placeholder").style("color",i);this._stylesheet.innerHTML=this._styles.print()};function hs(t,e,s){return new n(t,e,s)}function cs(t,e,s){return new M(t,e,s)}function us(t,e,s){return new E(t,e,s)}function fs(t,e,s){return new A(t,e,s)}function ds(t,e,s){return new as(t,e,s)}t.createButtonStyle=cs;t.createDropdownStyle=us;t.createGeneralControlsStyle=hs;t.createSearchboxStyle=ds;t.createSliderStyle=fs});