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

@hpcc-js/html

Package Overview
Dependencies
Maintainers
1
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hpcc-js/html - npm Package Compare versions

Comparing version 2.42.12 to 2.42.13

47

dist/index.es6.js

@@ -5,4 +5,4 @@ import { select, HTMLWidget, format } from '@hpcc-js/common';

var PKG_NAME = "@hpcc-js/html";
var PKG_VERSION = "2.42.12";
var BUILD_VERSION = "2.104.28";
var PKG_VERSION = "2.42.13";
var BUILD_VERSION = "2.104.30";

@@ -23,29 +23,34 @@ /******************************************************************************

***************************************************************************** */
/* global Reflect, Promise */
/* global Reflect, Promise, SuppressedError, Symbol */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var HTMLTooltip = /** @class */ (function (_super) {

@@ -607,3 +612,3 @@ __extends(HTMLTooltip, _super);

var n,l$1,u$1,t$1,o$1,r$1,f$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$1(l,f,t,o,null)}function d$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function k$1(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$1(n,l){if(null==l)return n.__?g$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?g$1(n):null}function m$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m$1(n)}}function w$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!x.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||r$1)(x);}function x(){var n,l,u,i,o,r,e,c;for(t$1.sort(f$1);n=t$1.shift();)n.__d&&(l=t$1.length,i=void 0,o=void 0,e=(r=(u=n).__v).__e,(c=u.__P)&&(i=[],(o=h$1({},r)).__v=r.__v+1,L(c,r,o,u.__n,void 0!==c.ownerSVGElement,null!=r.__h?[e]:null,i,null==e?g$1(r):e,r.__h),M(i,r),r.__e!=e&&m$1(r)),t$1.length>l&&t$1.sort(f$1));x.__r=0;}function P(n,l,u,i,t,o,r,f,e,a){var h,p,y,_,b,m,w,x=i&&i.__k||s$1,P=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _||"function"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?d$1(null,_,null,null,_):v$1(_)?d$1(k$1,{children:_},null,null,null):_.__b>0?d$1(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(y=x[h])||y&&_.key==y.key&&_.type===y.type)x[h]=void 0;else for(p=0;p<P;p++){if((y=x[p])&&_.key==y.key&&_.type===y.type){x[p]=void 0;break}y=null;}L(n,_,y=y||c$1,t,o,r,f,e,a),b=_.__e,(p=_.ref)&&y.ref!=p&&(w||(w=[]),y.ref&&w.push(y.ref,null,_),w.push(p,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===y.__k?_.__d=e=C(_,e,n):e=$(n,_,y,x,b,e),"function"==typeof u.type&&(u.__d=e)):e&&y.__e==e&&e.parentNode!=n&&(e=g$1(y));}for(u.__e=m,h=P;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=A(i).nextSibling),q(x[h],x[h]));if(w)for(h=0;h<w.length;h++)O(w[h],w[++h],w[++h]);}function C(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?C(i,l,u):$(u,i,i,t,i.__e,l));return l}function $(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function A(n){var l,u,i;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(l=n.__k.length-1;l>=0;l--)if((u=n.__k[l])&&(i=A(u)))return i;return null}function H(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||T$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||T$1(n,o,l[o],u[o],i);}function I(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function T$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||I(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||I(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?z$1:j$1,o):n.removeEventListener(l,o?z$1:j$1,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function j$1(n){return this.l[n.type+!1](l$1.event?l$1.event(n):n)}function z$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function L(n,u,i,t,o,r,f,e,c){var s,a,p,y,d,_,g,m,w,x,C,S,$,A,H,I=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l$1.__b)&&s(u);try{n:if("function"==typeof I){if(m=u.props,w=(s=I.contextType)&&t[s.__c],x=s?w?w.props.value:s.__:t,i.__c?g=(a=u.__c=i.__c).__=a.__E:("prototype"in I&&I.prototype.render?u.__c=a=new I(m,x):(u.__c=a=new b$1(m,x),a.constructor=I,a.render=B$1),w&&w.sub(a),a.props=m,a.state||(a.state={}),a.context=x,a.__n=t,p=a.__d=!0,a.__h=[],a._sb=[]),null==a.__s&&(a.__s=a.state),null!=I.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=h$1({},a.__s)),h$1(a.__s,I.getDerivedStateFromProps(m,a.__s))),y=a.props,d=a.state,a.__v=u,p)null==I.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else {if(null==I.getDerivedStateFromProps&&m!==y&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(m,x),!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(m,a.__s,x)||u.__v===i.__v){for(u.__v!==i.__v&&(a.props=m,a.state=a.__s,a.__d=!1),a.__e=!1,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<a._sb.length;C++)a.__h.push(a._sb[C]);a._sb=[],a.__h.length&&f.push(a);break n}null!=a.componentWillUpdate&&a.componentWillUpdate(m,a.__s,x),null!=a.componentDidUpdate&&a.__h.push(function(){a.componentDidUpdate(y,d,_);});}if(a.context=x,a.props=m,a.__P=n,S=l$1.__r,$=0,"prototype"in I&&I.prototype.render){for(a.state=a.__s,a.__d=!1,S&&S(u),s=a.render(a.props,a.state,a.context),A=0;A<a._sb.length;A++)a.__h.push(a._sb[A]);a._sb=[];}else do{a.__d=!1,S&&S(u),s=a.render(a.props,a.state,a.context),a.state=a.__s;}while(a.__d&&++$<25);a.state=a.__s,null!=a.getChildContext&&(t=h$1(h$1({},t),a.getChildContext())),p||null==a.getSnapshotBeforeUpdate||(_=a.getSnapshotBeforeUpdate(y,d)),P(n,v$1(H=null!=s&&s.type===k$1&&null==s.key?s.props.children:s)?H:[H],u,i,t,o,r,f,e,c),a.base=u.__e,u.__h=null,a.__h.length&&f.push(a),g&&(a.__E=a.__=null),a.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=N(i.__e,u,i,t,o,r,f,c);(s=l$1.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function M(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function N(l,u,i,t,o,r,f,e){var s,a,h,y=i.props,d=u.props,_=u.type,k=0;if("svg"===_&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!_&&(_?s.localName===_:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===_)return document.createTextNode(d);l=o?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),r=null,e=!1;}if(null===_)y===d||e&&l.data===d||(l.data=d);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||c$1).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!e){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(h||a)&&(h&&(a&&h.__html==a.__html||h.__html===l.innerHTML)||(l.innerHTML=h&&h.__html||""));}if(H(l,d,y,o,e),h)u.__k=[];else if(P(l,v$1(k=u.props.children)?k:[k],u,i,t,o&&"foreignObject"!==_,r,f,r?r[0]:i.__k&&g$1(i,0),e),null!=r)for(k=r.length;k--;)null!=r[k]&&p$1(r[k]);e||("value"in d&&void 0!==(k=d.value)&&(k!==l.value||"progress"===_&&!k||"option"===_&&k!==y.value)&&T$1(l,"value",k,y.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==l.checked&&T$1(l,"checked",k,y.checked,!1));}return l}function O(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function q(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||O(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&q(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function B$1(n,l,u){return this.constructor(n,u)}function D(u,i,t){var o,r,f;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],L(i,u=(!o&&t||i).__k=y(k$1,null,[u]),r||c$1,c$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),M(f,u);}n=s$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$1(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$1(this));},b$1.prototype.render=k$1,t$1=[],r$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0;
var n,l$1,u$1,i$1,o$1,r$1,f$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$1(l,f,i,o,null)}function d$1(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function k$1(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$1(n,l){if(null==l)return n.__?g$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__d||u.__e;return "function"==typeof n.type?g$1(n):null}function m$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m$1(n)}}function w$1(n){(!n.__d&&(n.__d=!0)&&i$1.push(n)&&!x.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||r$1)(x);}function x(){var n,l,u,t,o,r,e,c,s;for(i$1.sort(f$1);n=i$1.shift();)n.__d&&(l=i$1.length,t=void 0,o=void 0,r=void 0,c=(e=(u=n).__v).__e,(s=u.__P)&&(t=[],o=[],(r=h$1({},e)).__v=e.__v+1,z$1(s,e,r,u.__n,void 0!==s.ownerSVGElement,null!=e.__h?[c]:null,t,null==c?g$1(e):c,e.__h,o),L(t,e,o),e.__e!=c&&m$1(e)),i$1.length>l&&i$1.sort(f$1));x.__r=0;}function P(n,l,u,t,i,o,r,f,e,a,h){var p,y,_,b,m,w,x,P,C,D=0,H=t&&t.__k||s$1,I=H.length,T=I,j=l.length;for(u.__k=[],p=0;p<j;p++)null!=(b=u.__k[p]=null==(b=l[p])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d$1(null,b,null,null,b):v$1(b)?d$1(k$1,{children:b},null,null,null):b.__b>0?d$1(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=u,b.__b=u.__b+1,-1===(P=A(b,H,x=p+D,T))?_=c$1:(_=H[P]||c$1,H[P]=void 0,T--),z$1(n,b,_,i,o,r,f,e,a,h),m=b.__e,(y=b.ref)&&_.ref!=y&&(_.ref&&N(_.ref,null,b),h.push(y,b.__c||m,b)),null!=m&&(null==w&&(w=m),(C=_===c$1||null===_.__v)?-1==P&&D--:P!==x&&(P===x+1?D++:P>x?T>j-x?D+=P-x:D--:D=P<x&&P==x-1?P-x:0),x=p+D,"function"!=typeof b.type||P===x&&_.__k!==b.__k?"function"==typeof b.type||P===x&&!C?void 0!==b.__d?(e=b.__d,b.__d=void 0):e=m.nextSibling:e=S(n,m,e):e=$(b,e,n),"function"==typeof u.type&&(u.__d=e))):(_=H[p])&&null==_.key&&_.__e&&(_.__e==e&&(_.__=t,e=g$1(_)),O(_,_,!1),H[p]=null);for(u.__e=w,p=I;p--;)null!=H[p]&&("function"==typeof u.type&&null!=H[p].__e&&H[p].__e==u.__d&&(u.__d=H[p].__e.nextSibling),O(H[p],H[p]));}function $(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$(t,l,u):S(u,t.__e,l));return l}function S(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function A(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&i==e.key&&o===e.type)return r;r--;}if(f<l.length){if((e=l[f])&&i==e.key&&o===e.type)return f;f++;}}return -1}function D(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||I(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||I(n,o,l[o],u[o],t);}function H(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function I(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||H(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||H(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?j$1:T$1,o)):n.removeEventListener(l,o?j$1:T$1,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function T$1(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return}else n.t=Date.now();return u(l$1.event?l$1.event(n):n)}function j$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function z$1(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,g,m,w,x,$,C,S,A,D,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);n:if("function"==typeof I)try{if(w=u.props,x=(a=I.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(w,$):(u.__c=p=new b$1(w,$),p.constructor=I,p.render=q),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=$,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h$1({},p.__s)),h$1(p.__s,I.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else {if(null==I.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,$),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,$)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,$),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,g);});}if(p.context=$,p.props=w,p.__P=n,p.__e=!1,S=l$1.__r,A=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[];}else do{p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=h$1(h$1({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(d,_)),P(n,v$1(H=null!=a&&a.type===k$1&&null==a.key?a.props.children:a)?H:[H],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),m&&(p.__E=p.__=null);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,t);}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=M(t.__e,u,t,i,o,r,f,c,s);(a=l$1.diffed)&&a(u);}function L(n,u,t){for(var i=0;i<t.length;i++)N(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function M(l,u,t,i,o,r,f,e,s){var a,h,y,d=t.props,_=u.props,k=u.type,b=0;if("svg"===k&&(o=!0),null!=r)for(;b<r.length;b++)if((a=r[b])&&"setAttribute"in a==!!k&&(k?a.localName===k:3===a.nodeType)){l=a,r[b]=null;break}if(null==l){if(null===k)return document.createTextNode(_);l=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,_.is&&_),r=null,e=!1;}if(null===k)d===_||e&&l.data===_||(l.data=_);else {if(r=r&&n.call(l.childNodes),h=(d=t.props||c$1).dangerouslySetInnerHTML,y=_.dangerouslySetInnerHTML,!e){if(null!=r)for(d={},b=0;b<l.attributes.length;b++)d[l.attributes[b].name]=l.attributes[b].value;(y||h)&&(y&&(h&&y.__html==h.__html||y.__html===l.innerHTML)||(l.innerHTML=y&&y.__html||""));}if(D(l,_,d,o,e),y)u.__k=[];else if(P(l,v$1(b=u.props.children)?b:[b],u,t,i,o&&"foreignObject"!==k,r,f,r?r[0]:t.__k&&g$1(t,0),e,s),null!=r)for(b=r.length;b--;)null!=r[b]&&p$1(r[b]);e||("value"in _&&void 0!==(b=_.value)&&(b!==l.value||"progress"===k&&!b||"option"===k&&b!==d.value)&&I(l,"value",b,d.value,!1),"checked"in _&&void 0!==(b=_.checked)&&b!==l.checked&&I(l,"checked",b,d.checked,!1));}return l}function N(n,u,t){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,t);}}function O(n,u,t){var i,o;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null,n.__c=void 0;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&O(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function q(n,l,u){return this.constructor(n,u)}function B$1(u,t,i){var o,r,f,e;l$1.__&&l$1.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],z$1(t,u=(!o&&i||t).__k=y(k$1,null,[u]),r||c$1,c$1,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),L(f,u,e);}n=s$1.slice,l$1={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$1(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$1(this));},b$1.prototype.render=k$1,i$1=[],r$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0;

@@ -618,3 +623,3 @@ var r,u,i,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a&&a(n);var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[],0)),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w(n){var t=r;n.__c=n.__(),r=t;}

JSXWidget.prototype.jsxRender = function (jsx, domNode) {
this.rootNode = D(jsx, domNode, this.rootNode);
this.rootNode = B$1(jsx, domNode, this.rootNode);
};

@@ -621,0 +626,0 @@ JSXWidget.Component = b$1;

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common'), require('@hpcc-js/util')) :
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common', '@hpcc-js/util'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/html"] = {}, global["@hpcc-js/common"], global["@hpcc-js/util"]));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common'), require('@hpcc-js/util')) :
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common', '@hpcc-js/util'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/html"] = {}, global["@hpcc-js/common"], global["@hpcc-js/util"]));
})(this, (function (exports, common, util) { 'use strict';
var PKG_NAME = "@hpcc-js/html";
var PKG_VERSION = "2.42.12";
var BUILD_VERSION = "2.104.28";
var PKG_NAME = "@hpcc-js/html";
var PKG_VERSION = "2.42.13";
var BUILD_VERSION = "2.104.30";
/******************************************************************************
Copyright (c) Microsoft Corporation.
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
return to.concat(ar || Array.prototype.slice.call(from));
}
return to.concat(ar || Array.prototype.slice.call(from));
}
var HTMLTooltip = /** @class */ (function (_super) {
__extends(HTMLTooltip, _super);
function HTMLTooltip() {
var _this = _super.call(this) || this;
_this._tooltipHTMLCallback = function (data) { return "<b>_tooltipHTMLCallback is undefined</b>"; };
_this._logger = util.scopedLogger("html/HTMLTooltip");
_this._closing = false;
_this.visible(false);
return _this;
}
HTMLTooltip.prototype.tooltipHTML = function (_) {
this._tooltipHTMLCallback = _;
return this;
};
HTMLTooltip.prototype.tooltipContent = function (_) {
if (!arguments.length)
return this._contentNode;
this._contentNode = _;
return this;
};
HTMLTooltip.prototype.triggerElement = function (_) {
this._triggerElement = _;
return this;
};
HTMLTooltip.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
var body = common.select("body");
this._tooltipElement = body.append("div")
.attr("class", "tooltip-div")
.style("z-index", "2147483638")
.style("position", "fixed");
this._arrowElement = body.append("div")
.attr("class", "arrow-div")
.style("z-index", "2147483638")
.style("position", "fixed");
};
HTMLTooltip.prototype.update = function (domNode, element) {
var _this = this;
_super.prototype.update.call(this, domNode, element);
if (this._contentNode !== this._prevContentNode) {
var node = this._tooltipElement.node();
__spreadArray([], node.querySelectorAll("*"), true).map(function (n) { return n.__data__; })
.filter(function (n) { return n; })
.forEach(function (w) {
if (typeof w.target === "function") {
w.target(null);
}
if (typeof w.exit === "function") {
w.exit();
}
});
node.innerHTML = "";
node.appendChild(this._contentNode);
this._prevContentNode = this._contentNode;
}
if (this._contentNode) {
this.onShowContent(this._contentNode);
}
else {
this._tooltipElement
.html(function () {
return _this._tooltipHTMLCallback(_this.data());
});
}
if (this.fitContent()) {
this._tooltipElement
.style("width", "auto")
.style("height", "auto")
.style("padding", "0px")
.style("box-sizing", "content-box");
var rect = this._tooltipElement.node().getBoundingClientRect();
this.tooltipWidth_default(rect.width);
this.tooltipHeight_default(rect.height);
}
this._closing = false;
this._tooltipElement
.style("background-color", this.tooltipColor())
.style("color", this.fontColor())
.style("width", this.tooltipWidth() + "px")
.style("height", this.tooltipHeight() + "px")
.style("opacity", 1)
.style("padding", this.padding() + "px")
.style("pointer-events", this.enablePointerEvents() ? "all" : "none")
.style("box-sizing", "content-box");
this._arrowElement
.style("opacity", 1)
.style("pointer-events", "none");
this.updateTooltipPosition();
};
HTMLTooltip.prototype.onShowContent = function (node) {
};
HTMLTooltip.prototype.updateTooltipPosition = function () {
var bbox = this.calcReferenceBBox();
var direction = this.calcTooltipDirection(bbox);
var box = bbox[direction];
this._tooltipElement
.style("top", box.y + "px")
.style("left", box.x + "px");
this.setArrowPosition(box, direction);
return box;
};
HTMLTooltip.prototype.calcTooltipDirection = function (bbox) {
var directions = Object.keys(bbox);
var defaultDirection = this.direction();
directions.sort(function (a, b) { return a === defaultDirection ? -1 : 1; });
var windowRect = {
top: 0,
left: 0,
width: window.innerWidth,
height: window.innerHeight
};
for (var i = 0; i < directions.length; i++) {
var tooltipRect = {
top: bbox[directions[i]].y,
left: bbox[directions[i]].x,
width: this.tooltipWidth(),
height: this.tooltipHeight()
};
if (this.rectFits(tooltipRect, windowRect)) {
return directions[i];
}
}
this._logger.warning("Tooltip doesn't fit in the window for any of the directions. Defaulting to '".concat(defaultDirection, "'"));
this._logger.debug(windowRect);
this._logger.debug({
top: bbox[defaultDirection].y,
left: bbox[defaultDirection].x,
width: this.tooltipWidth(),
height: this.tooltipHeight()
});
return defaultDirection;
};
HTMLTooltip.prototype.rectFits = function (innerRect, outerRect) {
return (innerRect.top >= outerRect.top &&
innerRect.left >= outerRect.left &&
innerRect.width + innerRect.left <= outerRect.width + outerRect.left &&
innerRect.height + innerRect.top <= outerRect.height + outerRect.top);
};
HTMLTooltip.prototype.setArrowPosition = function (point, direction) {
var top;
var left;
var visibleBorderStyle = "border-top-color";
this._arrowElement
.style("border", "".concat(this.arrowHeight(), "px solid ").concat(this.tooltipColor()))
.style("border-top-color", "transparent")
.style("border-right-color", "transparent")
.style("border-bottom-color", "transparent")
.style("border-left-color", "transparent");
switch (direction) {
case "n":
top = point.y + this.tooltipHeight() + (this.padding() * 2);
left = point.x + (this.tooltipWidth() / 2) - (this.arrowWidth() / 2) + this.padding();
visibleBorderStyle = "border-top-color";
this._arrowElement
.style("border-top-width", "".concat(this.arrowHeight(), "px"))
.style("border-bottom-width", "0px")
.style("border-left-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-right-width", "".concat(this.arrowWidth() / 2, "px"));
break;
case "s":
top = point.y - this.arrowHeight();
left = point.x + this.padding() + (this.tooltipWidth() / 2) - (this.arrowWidth() / 2);
visibleBorderStyle = "border-bottom-color";
this._arrowElement
.style("border-top-width", "0px")
.style("border-bottom-width", "".concat(this.arrowHeight(), "px"))
.style("border-left-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-right-width", "".concat(this.arrowWidth() / 2, "px"));
break;
case "e":
top = point.y + (this.tooltipHeight() / 2) + this.padding() - (this.arrowWidth() / 2);
left = point.x - this.arrowHeight();
visibleBorderStyle = "border-right-color";
this._arrowElement
.style("border-top-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-bottom-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-left-width", "0px")
.style("border-right-width", "".concat(this.arrowHeight(), "px"));
break;
case "w":
top = point.y + (this.tooltipHeight() / 2) - (this.arrowWidth() / 2) + this.padding();
left = point.x + this.tooltipWidth() + (this.padding() * 2);
visibleBorderStyle = "border-left-color";
this._arrowElement
.style("border-top-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-bottom-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-left-width", "".concat(this.arrowHeight(), "px"))
.style("border-right-width", "0px");
break;
}
if (typeof top !== "undefined" && typeof left !== "undefined") {
this._arrowElement
.style("top", top + "px")
.style("left", left + "px")
.style(visibleBorderStyle, this.tooltipColor())
.style("opacity", 1);
}
else {
this._arrowElement
.style("opacity", 0);
}
return point;
};
HTMLTooltip.prototype.getReferenceNode = function () {
if (!this._triggerElement) {
return this.element().node().parentNode.parentNode;
}
return this._triggerElement.node();
};
HTMLTooltip.prototype.calcReferenceBBox = function () {
var node = this.getReferenceNode();
var _a = node.getBoundingClientRect(), top = _a.top, left = _a.left, width = _a.width, height = _a.height;
var wholeW = this.tooltipWidth();
var wholeH = this.tooltipHeight();
var halfW = wholeW / 2;
var halfH = wholeH / 2;
var arrowH = this.arrowHeight();
var p = this.padding();
var p2 = p * 2;
if (this.followCursor() && this._cursorLoc) {
left = this._cursorLoc[0];
top = this._cursorLoc[1];
width = 1;
height = 1;
}
var bbox = {
n: {
x: left + (width / 2) - halfW - p,
y: top - wholeH - arrowH - p2
},
e: {
x: left + width + arrowH,
y: top + (height / 2) - halfH - p
},
s: {
x: left + (width / 2) - halfW - p,
y: top + height + arrowH
},
w: {
x: left - wholeW - arrowH - p2,
y: top + (height / 2) - halfH - p
},
nw: {
x: left - wholeW - p2,
y: top - wholeH - p2
},
ne: {
x: left + width,
y: top - wholeH - p2
},
se: {
x: left + width,
y: top + height
},
sw: {
x: left - wholeW - p2,
y: top + height
}
};
return bbox;
};
HTMLTooltip.prototype.mouseout = function () {
var _this = this;
this._closing = true;
this._tooltipElement.on("mouseover", function () {
_this._closing = false;
});
this._tooltipElement.on("mouseout", function () {
_this.mouseout();
});
setTimeout(function () {
if (_this._closing) {
_this.visible(false);
}
}, this.closeDelay());
};
HTMLTooltip.prototype.visible = function (_) {
if (!arguments.length)
return _super.prototype.visible.call(this);
if (this._arrowElement) {
this._arrowElement.style("visibility", _ ? "visible" : "hidden");
this._tooltipElement.style("visibility", _ ? "visible" : "hidden");
}
_super.prototype.visible.call(this, _);
return this;
};
HTMLTooltip.prototype.exit = function (domNode, element) {
if (this._arrowElement) {
this._arrowElement.remove();
this._tooltipElement.remove();
}
_super.prototype.exit.call(this, domNode, element);
};
return HTMLTooltip;
}(common.HTMLWidget));
HTMLTooltip.prototype._class += " html_HTMLTooltip";
HTMLTooltip.prototype.publish("fitContent", false, "boolean", "If true, tooltip will grow to fit its html content");
HTMLTooltip.prototype.publish("followCursor", false, "boolean", "If true, tooltip will display relative to cursor location");
HTMLTooltip.prototype.publish("closeDelay", 400, "number", "Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)");
HTMLTooltip.prototype.publish("direction", "n", "set", "Direction in which to display the tooltip", ["n", "s", "e", "w", "ne", "nw", "se", "sw"]);
HTMLTooltip.prototype.publish("padding", 8, "number", "Padding (pixels)");
HTMLTooltip.prototype.publish("arrowWidth", 16, "number", "Width (or height depending on direction) of the tooltip arrow (pixels)");
HTMLTooltip.prototype.publish("arrowHeight", 8, "number", "Height (or width depending on direction) of the tooltip arrow (pixels)");
HTMLTooltip.prototype.publish("fontColor", "#FFF", "html-color", "The default font color for text in the tooltip");
HTMLTooltip.prototype.publish("tooltipColor", "#000000EE", "html-color", "Background color of the tooltip");
HTMLTooltip.prototype.publish("tooltipWidth", 200, "number", "Width of the tooltip (not including arrow) (pixels)");
HTMLTooltip.prototype.publish("tooltipHeight", 200, "number", "Height of the tooltip (not including arrow) (pixels)");
HTMLTooltip.prototype.publish("enablePointerEvents", false, "boolean", "If true, the 'pointer-events: all' style will be used");
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var SimpleTable = /** @class */ (function (_super) {
__extends(SimpleTable, _super);
function SimpleTable() {
return _super.call(this) || this;
}
SimpleTable.prototype.transformData = function () {
return this.data();
};
SimpleTable.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
this._table = element.append("table");
this._thead = this._table.append("thead");
this._theadRow = this._thead.append("tr");
this._tbody = this._table.append("tbody");
};
SimpleTable.prototype.update = function (domNode, element) {
_super.prototype.update.call(this, domNode, element);
this._table
.style("width", this.autoWidth() ? "auto" : "100%");
var theadTrSelection = this._theadRow.selectAll("th").data(this.columns());
theadTrSelection.enter()
.append("th")
.attr("class", function (n, i) { return "th-".concat(i); })
.merge(theadTrSelection)
.text(function (_d) { return (_d).toString(); });
theadTrSelection.exit().remove();
var trSelection = this._tbody.selectAll("tr").data(this.transformData());
trSelection.enter()
.append("tr")
.merge(trSelection)
.each(function (d) {
var tr = common.select(this);
var tdSelection = tr.selectAll("td").data(d);
tdSelection.enter()
.append("td")
.attr("class", function (n, i) { return "col-".concat(i); })
.merge(tdSelection)
.text(function (_d) { return (_d).toString(); });
tdSelection.exit().remove();
});
trSelection.exit().remove();
};
return SimpleTable;
}(common.HTMLWidget));
SimpleTable.prototype._class += " html_SimpleTable";
SimpleTable.prototype.publish("autoWidth", false, "boolean", "If true, table width will be set to 'auto'. If false, the width is set to '100%'");
var HTMLTooltip = /** @class */ (function (_super) {
__extends(HTMLTooltip, _super);
function HTMLTooltip() {
var _this = _super.call(this) || this;
_this._tooltipHTMLCallback = function (data) { return "<b>_tooltipHTMLCallback is undefined</b>"; };
_this._logger = util.scopedLogger("html/HTMLTooltip");
_this._closing = false;
_this.visible(false);
return _this;
}
HTMLTooltip.prototype.tooltipHTML = function (_) {
this._tooltipHTMLCallback = _;
return this;
};
HTMLTooltip.prototype.tooltipContent = function (_) {
if (!arguments.length)
return this._contentNode;
this._contentNode = _;
return this;
};
HTMLTooltip.prototype.triggerElement = function (_) {
this._triggerElement = _;
return this;
};
HTMLTooltip.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
var body = common.select("body");
this._tooltipElement = body.append("div")
.attr("class", "tooltip-div")
.style("z-index", "2147483638")
.style("position", "fixed");
this._arrowElement = body.append("div")
.attr("class", "arrow-div")
.style("z-index", "2147483638")
.style("position", "fixed");
};
HTMLTooltip.prototype.update = function (domNode, element) {
var _this = this;
_super.prototype.update.call(this, domNode, element);
if (this._contentNode !== this._prevContentNode) {
var node = this._tooltipElement.node();
__spreadArray([], node.querySelectorAll("*"), true).map(function (n) { return n.__data__; })
.filter(function (n) { return n; })
.forEach(function (w) {
if (typeof w.target === "function") {
w.target(null);
}
if (typeof w.exit === "function") {
w.exit();
}
});
node.innerHTML = "";
node.appendChild(this._contentNode);
this._prevContentNode = this._contentNode;
}
if (this._contentNode) {
this.onShowContent(this._contentNode);
}
else {
this._tooltipElement
.html(function () {
return _this._tooltipHTMLCallback(_this.data());
});
}
if (this.fitContent()) {
this._tooltipElement
.style("width", "auto")
.style("height", "auto")
.style("padding", "0px")
.style("box-sizing", "content-box");
var rect = this._tooltipElement.node().getBoundingClientRect();
this.tooltipWidth_default(rect.width);
this.tooltipHeight_default(rect.height);
}
this._closing = false;
this._tooltipElement
.style("background-color", this.tooltipColor())
.style("color", this.fontColor())
.style("width", this.tooltipWidth() + "px")
.style("height", this.tooltipHeight() + "px")
.style("opacity", 1)
.style("padding", this.padding() + "px")
.style("pointer-events", this.enablePointerEvents() ? "all" : "none")
.style("box-sizing", "content-box");
this._arrowElement
.style("opacity", 1)
.style("pointer-events", "none");
this.updateTooltipPosition();
};
HTMLTooltip.prototype.onShowContent = function (node) {
};
HTMLTooltip.prototype.updateTooltipPosition = function () {
var bbox = this.calcReferenceBBox();
var direction = this.calcTooltipDirection(bbox);
var box = bbox[direction];
this._tooltipElement
.style("top", box.y + "px")
.style("left", box.x + "px");
this.setArrowPosition(box, direction);
return box;
};
HTMLTooltip.prototype.calcTooltipDirection = function (bbox) {
var directions = Object.keys(bbox);
var defaultDirection = this.direction();
directions.sort(function (a, b) { return a === defaultDirection ? -1 : 1; });
var windowRect = {
top: 0,
left: 0,
width: window.innerWidth,
height: window.innerHeight
};
for (var i = 0; i < directions.length; i++) {
var tooltipRect = {
top: bbox[directions[i]].y,
left: bbox[directions[i]].x,
width: this.tooltipWidth(),
height: this.tooltipHeight()
};
if (this.rectFits(tooltipRect, windowRect)) {
return directions[i];
}
}
this._logger.warning("Tooltip doesn't fit in the window for any of the directions. Defaulting to '".concat(defaultDirection, "'"));
this._logger.debug(windowRect);
this._logger.debug({
top: bbox[defaultDirection].y,
left: bbox[defaultDirection].x,
width: this.tooltipWidth(),
height: this.tooltipHeight()
});
return defaultDirection;
};
HTMLTooltip.prototype.rectFits = function (innerRect, outerRect) {
return (innerRect.top >= outerRect.top &&
innerRect.left >= outerRect.left &&
innerRect.width + innerRect.left <= outerRect.width + outerRect.left &&
innerRect.height + innerRect.top <= outerRect.height + outerRect.top);
};
HTMLTooltip.prototype.setArrowPosition = function (point, direction) {
var top;
var left;
var visibleBorderStyle = "border-top-color";
this._arrowElement
.style("border", "".concat(this.arrowHeight(), "px solid ").concat(this.tooltipColor()))
.style("border-top-color", "transparent")
.style("border-right-color", "transparent")
.style("border-bottom-color", "transparent")
.style("border-left-color", "transparent");
switch (direction) {
case "n":
top = point.y + this.tooltipHeight() + (this.padding() * 2);
left = point.x + (this.tooltipWidth() / 2) - (this.arrowWidth() / 2) + this.padding();
visibleBorderStyle = "border-top-color";
this._arrowElement
.style("border-top-width", "".concat(this.arrowHeight(), "px"))
.style("border-bottom-width", "0px")
.style("border-left-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-right-width", "".concat(this.arrowWidth() / 2, "px"));
break;
case "s":
top = point.y - this.arrowHeight();
left = point.x + this.padding() + (this.tooltipWidth() / 2) - (this.arrowWidth() / 2);
visibleBorderStyle = "border-bottom-color";
this._arrowElement
.style("border-top-width", "0px")
.style("border-bottom-width", "".concat(this.arrowHeight(), "px"))
.style("border-left-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-right-width", "".concat(this.arrowWidth() / 2, "px"));
break;
case "e":
top = point.y + (this.tooltipHeight() / 2) + this.padding() - (this.arrowWidth() / 2);
left = point.x - this.arrowHeight();
visibleBorderStyle = "border-right-color";
this._arrowElement
.style("border-top-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-bottom-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-left-width", "0px")
.style("border-right-width", "".concat(this.arrowHeight(), "px"));
break;
case "w":
top = point.y + (this.tooltipHeight() / 2) - (this.arrowWidth() / 2) + this.padding();
left = point.x + this.tooltipWidth() + (this.padding() * 2);
visibleBorderStyle = "border-left-color";
this._arrowElement
.style("border-top-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-bottom-width", "".concat(this.arrowWidth() / 2, "px"))
.style("border-left-width", "".concat(this.arrowHeight(), "px"))
.style("border-right-width", "0px");
break;
}
if (typeof top !== "undefined" && typeof left !== "undefined") {
this._arrowElement
.style("top", top + "px")
.style("left", left + "px")
.style(visibleBorderStyle, this.tooltipColor())
.style("opacity", 1);
}
else {
this._arrowElement
.style("opacity", 0);
}
return point;
};
HTMLTooltip.prototype.getReferenceNode = function () {
if (!this._triggerElement) {
return this.element().node().parentNode.parentNode;
}
return this._triggerElement.node();
};
HTMLTooltip.prototype.calcReferenceBBox = function () {
var node = this.getReferenceNode();
var _a = node.getBoundingClientRect(), top = _a.top, left = _a.left, width = _a.width, height = _a.height;
var wholeW = this.tooltipWidth();
var wholeH = this.tooltipHeight();
var halfW = wholeW / 2;
var halfH = wholeH / 2;
var arrowH = this.arrowHeight();
var p = this.padding();
var p2 = p * 2;
if (this.followCursor() && this._cursorLoc) {
left = this._cursorLoc[0];
top = this._cursorLoc[1];
width = 1;
height = 1;
}
var bbox = {
n: {
x: left + (width / 2) - halfW - p,
y: top - wholeH - arrowH - p2
},
e: {
x: left + width + arrowH,
y: top + (height / 2) - halfH - p
},
s: {
x: left + (width / 2) - halfW - p,
y: top + height + arrowH
},
w: {
x: left - wholeW - arrowH - p2,
y: top + (height / 2) - halfH - p
},
nw: {
x: left - wholeW - p2,
y: top - wholeH - p2
},
ne: {
x: left + width,
y: top - wholeH - p2
},
se: {
x: left + width,
y: top + height
},
sw: {
x: left - wholeW - p2,
y: top + height
}
};
return bbox;
};
HTMLTooltip.prototype.mouseout = function () {
var _this = this;
this._closing = true;
this._tooltipElement.on("mouseover", function () {
_this._closing = false;
});
this._tooltipElement.on("mouseout", function () {
_this.mouseout();
});
setTimeout(function () {
if (_this._closing) {
_this.visible(false);
}
}, this.closeDelay());
};
HTMLTooltip.prototype.visible = function (_) {
if (!arguments.length)
return _super.prototype.visible.call(this);
if (this._arrowElement) {
this._arrowElement.style("visibility", _ ? "visible" : "hidden");
this._tooltipElement.style("visibility", _ ? "visible" : "hidden");
}
_super.prototype.visible.call(this, _);
return this;
};
HTMLTooltip.prototype.exit = function (domNode, element) {
if (this._arrowElement) {
this._arrowElement.remove();
this._tooltipElement.remove();
}
_super.prototype.exit.call(this, domNode, element);
};
return HTMLTooltip;
}(common.HTMLWidget));
HTMLTooltip.prototype._class += " html_HTMLTooltip";
HTMLTooltip.prototype.publish("fitContent", false, "boolean", "If true, tooltip will grow to fit its html content");
HTMLTooltip.prototype.publish("followCursor", false, "boolean", "If true, tooltip will display relative to cursor location");
HTMLTooltip.prototype.publish("closeDelay", 400, "number", "Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)");
HTMLTooltip.prototype.publish("direction", "n", "set", "Direction in which to display the tooltip", ["n", "s", "e", "w", "ne", "nw", "se", "sw"]);
HTMLTooltip.prototype.publish("padding", 8, "number", "Padding (pixels)");
HTMLTooltip.prototype.publish("arrowWidth", 16, "number", "Width (or height depending on direction) of the tooltip arrow (pixels)");
HTMLTooltip.prototype.publish("arrowHeight", 8, "number", "Height (or width depending on direction) of the tooltip arrow (pixels)");
HTMLTooltip.prototype.publish("fontColor", "#FFF", "html-color", "The default font color for text in the tooltip");
HTMLTooltip.prototype.publish("tooltipColor", "#000000EE", "html-color", "Background color of the tooltip");
HTMLTooltip.prototype.publish("tooltipWidth", 200, "number", "Width of the tooltip (not including arrow) (pixels)");
HTMLTooltip.prototype.publish("tooltipHeight", 200, "number", "Height of the tooltip (not including arrow) (pixels)");
HTMLTooltip.prototype.publish("enablePointerEvents", false, "boolean", "If true, the 'pointer-events: all' style will be used");
var StyledTable = /** @class */ (function (_super) {
__extends(StyledTable, _super);
function StyledTable() {
return _super.call(this) || this;
}
StyledTable.prototype.applyStyleObject = function (selection, styleObject) {
Object.keys(styleObject).forEach(function (styleName) {
selection.style(styleName, styleObject[styleName]);
});
};
StyledTable.prototype.update = function (domNode, element) {
var _this = this;
_super.prototype.update.call(this, domNode, element);
element.selectAll("tr,th,td")
.attr("style", "")
.style("font-family", this.fontFamily())
.style("color", this.fontColor());
this.theadColumnStyles().forEach(function (styleObj, i) {
_this.applyStyleObject(element.select(".th-".concat(i)), styleObj);
});
this.tbodyColumnStyles().forEach(function (styleObj, i) {
_this.applyStyleObject(element.selectAll(".col-".concat(i)), styleObj);
});
var evenRowStylesExist = Object.keys(this.evenRowStyles()).length > 0;
var lastRowStylesExist = Object.keys(this.lastRowStyles()).length > 0;
var tbodyRows = element.selectAll("tbody > tr");
if (evenRowStylesExist) {
var tbodyEvenRows = tbodyRows.select(function (d, i) { return i % 2 ? this : null; });
this.applyStyleObject(tbodyEvenRows, this.evenRowStyles());
}
if (lastRowStylesExist) {
var tbodyLastRow = tbodyRows.select(function (d, i, arr) { return i === arr.length - 1 ? this : null; });
this.applyStyleObject(tbodyLastRow, this.lastRowStyles());
}
};
return StyledTable;
}(SimpleTable));
StyledTable.prototype._class += " html_StyledTable";
StyledTable.prototype.publish("fontFamily", "Verdana", "string", "Base font-family used within the table");
StyledTable.prototype.publish("fontColor", "#333", "string", "Base font color used within the table");
StyledTable.prototype.publish("theadColumnStyles", [], "array", 'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])');
StyledTable.prototype.publish("tbodyColumnStyles", [], "array", 'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])');
StyledTable.prototype.publish("lastRowStyles", {}, "object", 'Object containing styles for the last row (ex: {"color":"red"})');
StyledTable.prototype.publish("evenRowStyles", {}, "object", 'Object containing styles for even rows (ex: {"background-color":"#AAA"})');
var SimpleTable = /** @class */ (function (_super) {
__extends(SimpleTable, _super);
function SimpleTable() {
return _super.call(this) || this;
}
SimpleTable.prototype.transformData = function () {
return this.data();
};
SimpleTable.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
this._table = element.append("table");
this._thead = this._table.append("thead");
this._theadRow = this._thead.append("tr");
this._tbody = this._table.append("tbody");
};
SimpleTable.prototype.update = function (domNode, element) {
_super.prototype.update.call(this, domNode, element);
this._table
.style("width", this.autoWidth() ? "auto" : "100%");
var theadTrSelection = this._theadRow.selectAll("th").data(this.columns());
theadTrSelection.enter()
.append("th")
.attr("class", function (n, i) { return "th-".concat(i); })
.merge(theadTrSelection)
.text(function (_d) { return (_d).toString(); });
theadTrSelection.exit().remove();
var trSelection = this._tbody.selectAll("tr").data(this.transformData());
trSelection.enter()
.append("tr")
.merge(trSelection)
.each(function (d) {
var tr = common.select(this);
var tdSelection = tr.selectAll("td").data(d);
tdSelection.enter()
.append("td")
.attr("class", function (n, i) { return "col-".concat(i); })
.merge(tdSelection)
.text(function (_d) { return (_d).toString(); });
tdSelection.exit().remove();
});
trSelection.exit().remove();
};
return SimpleTable;
}(common.HTMLWidget));
SimpleTable.prototype._class += " html_SimpleTable";
SimpleTable.prototype.publish("autoWidth", false, "boolean", "If true, table width will be set to 'auto'. If false, the width is set to '100%'");
var BreakdownTable = /** @class */ (function (_super) {
__extends(BreakdownTable, _super);
function BreakdownTable() {
return _super.call(this) || this;
}
BreakdownTable.prototype.transformData = function () {
var rowCount = this.useCalculatedRowCount() ? this.calculateRowCount() : this.rowCount();
return this.breakdownData(rowCount);
};
BreakdownTable.prototype.breakdownData = function (limit) {
var len = this.data().length;
var sum = this.data().reduce(function (acc, row) { return acc + row[1]; }, 0);
var data = [];
var percSum = 0;
this.data().sort(function (a, b) { return a[1] > b[1] ? -1 : 1; });
var hiddenRowCount = len - limit;
var showOther = hiddenRowCount > 0;
this.data()
.filter(function (_, i) { return showOther ? i < limit - 1 : true; })
.forEach(function (row) {
var perc = Math.round((row[1] / sum) * 100);
percSum += perc;
data.push([row[0], perc + "%"]);
});
if (showOther) {
var otherLabel = "".concat(this.otherLabel(), " (").concat(len - limit + 1, ")");
var otherPercentage = "~" + (100 - percSum) + "%";
data.push([otherLabel, otherPercentage]);
}
return data;
};
BreakdownTable.prototype.calculateRowCount = function () {
var theadRowHeight = this.columns().length > 0 ? this.thFontSize() + 5 : 0;
var tbodyRowHeight = this.fontSize() + 5;
var tbodyAvailableHeight = this.height() - theadRowHeight;
var rowCount = Math.floor(tbodyAvailableHeight / tbodyRowHeight);
return rowCount;
};
BreakdownTable.prototype.enter = function (domNode, element) {
var _this = this;
_super.prototype.enter.call(this, domNode, element);
this._tooltip = new HTMLTooltip()
.target(domNode);
this._tooltip
.tooltipHTML(function (data) {
var rowCount = _this.useCalculatedRowCount() ? _this.calculateRowCount() : _this.rowCount();
var rowHeight = _this.fontSize();
var widestLabel = Math.max.apply(Math, data.map(function (row) { return _this.textSize(row[0], "Verdana", _this.fontSize()).width; }));
var widestPerc = 30;
var colCount = 2;
var w = colCount * (widestLabel + widestPerc) + (_this._tooltip.padding() * 2);
var h = rowHeight * Math.ceil((data.length - rowCount) / colCount) + (_this._tooltip.padding() * 2);
_this._tooltip.tooltipWidth(w);
_this._tooltip.tooltipHeight(h);
var otherData = _this.breakdownData(_this.data().length).slice(rowCount - 1);
return "<div style=\"\n width: 100%;\n height: 100%;\n font-size: ".concat(_this.fontSize(), "px\n \">").concat(otherData.map(function (row) { return "<div style=\"\n float:left;\n width:".concat(Math.floor(99 / colCount), "%;\n \">").concat(row[0], ": ").concat(row[1], "</div>"); }).join(""), "</div>");
});
};
BreakdownTable.prototype.update = function (domNode, element) {
this.theadColumnStyles_default([
{
"color": this.thFirstColor(),
"font-size": this.thFontSize() + "px",
"font-weight": this.thFontWeight(),
"text-align": this.labelAlignment(),
"width": "auto",
"padding": "0px"
},
{
"width": "1%",
"font-size": this.thFontSize() + "px",
"font-weight": this.thFontWeight(),
"text-align": this.percentageAlignment(),
"padding": "0px"
}
]);
this.tbodyColumnStyles_default([
{
"color": this.topLabelColor(),
"font-size": this.fontSize() + "px",
"font-weight": "normal",
"text-align": this.labelAlignment(),
"width": "auto",
"padding": "0px"
},
{
"color": this.topPercentageColor(),
"font-size": this.fontSize() + "px",
"font-weight": "normal",
"text-align": this.percentageAlignment(),
"width": "1%",
"padding": "0px"
}
]);
this.lastRowStyles_default([
{
"color": this.otherLabelColor(),
"font-size": this.fontSize() + "px",
"font-weight": this.otherLabelBold() ? "bold" : "normal",
"text-align": this.labelAlignment(),
"width": "auto",
"padding": "0px"
},
{
"color": this.otherLabelColor(),
"font-size": this.fontSize() + "px",
"font-weight": this.otherPercentageBold() ? "bold" : "normal",
"text-align": this.percentageAlignment(),
"width": "1%",
"padding": "0px"
}
]);
_super.prototype.update.call(this, domNode, element);
var rowCount = this.useCalculatedRowCount() ? this.calculateRowCount() : this.rowCount();
if (rowCount < this.data().length) {
var lastRow_1 = element.select("tbody > tr:last-child");
var context_1 = this;
lastRow_1
.on("mouseout.tooltip", function (d) {
context_1._tooltip._triggerElement = lastRow_1;
context_1._tooltip
.visible(false)
.render();
})
.on("mouseenter.tooltip", function (d) {
context_1._tooltip._triggerElement = lastRow_1;
context_1._tooltip
.direction("n")
.data(context_1.data())
.visible(true)
.render();
});
}
};
return BreakdownTable;
}(StyledTable));
BreakdownTable.prototype._class += " html_BreakdownTable";
BreakdownTable.prototype.publish("useCalculatedRowCount", true, "boolean", "If true, rowCount will be calculated and its default will be overwritten");
BreakdownTable.prototype.publish("rowCount", 5, "number", "Number of total rows to display (including the 'other' row)", undefined, { disable: function (w) { return w.useCalculatedRowCount(); } });
BreakdownTable.prototype.publish("fontSize", 14, "number", "Font size (pixels)");
BreakdownTable.prototype.publish("labelAlignment", "left", "set", "Alignment of the label column text", ["left", "center", "right"]);
BreakdownTable.prototype.publish("percentageAlignment", "center", "set", "Alignment of the percentage column text", ["left", "center", "right"]);
BreakdownTable.prototype.publish("topLabelColor", "#333", "html-color", "Color of displayed 'top' labels");
BreakdownTable.prototype.publish("topPercentageColor", "#1A99D5", "html-color", "Color of displayed 'top' percentages");
BreakdownTable.prototype.publish("topPercentageBold", true, "html-color", "If true, the 'top' percentages will be bold");
BreakdownTable.prototype.publish("otherLabel", "Other", "string", "Label text for the 'other' row");
BreakdownTable.prototype.publish("otherLabelColor", "#AAA", "html-color", "Color of the 'other' label");
BreakdownTable.prototype.publish("otherLabelBold", false, "html-color", "If true, the 'other' label will be bold");
BreakdownTable.prototype.publish("otherPercentageColor", "#AAA", "html-color", "Color of the 'other' percentage");
BreakdownTable.prototype.publish("otherPercentageBold", false, "html-color", "If true, the 'other' percentage will be bold");
BreakdownTable.prototype.publish("thFontWeight", "bold", "string", "Font weight for th elements");
BreakdownTable.prototype.publish("thFontSize", 26, "number", "Font size for th elements");
BreakdownTable.prototype.publish("thFirstColor", "#333", "html-color", "Text color of the first th element");
BreakdownTable.prototype.publish("thLastColor", "#333", "html-color", "Text color of the last th element");
var StyledTable = /** @class */ (function (_super) {
__extends(StyledTable, _super);
function StyledTable() {
return _super.call(this) || this;
}
StyledTable.prototype.applyStyleObject = function (selection, styleObject) {
Object.keys(styleObject).forEach(function (styleName) {
selection.style(styleName, styleObject[styleName]);
});
};
StyledTable.prototype.update = function (domNode, element) {
var _this = this;
_super.prototype.update.call(this, domNode, element);
element.selectAll("tr,th,td")
.attr("style", "")
.style("font-family", this.fontFamily())
.style("color", this.fontColor());
this.theadColumnStyles().forEach(function (styleObj, i) {
_this.applyStyleObject(element.select(".th-".concat(i)), styleObj);
});
this.tbodyColumnStyles().forEach(function (styleObj, i) {
_this.applyStyleObject(element.selectAll(".col-".concat(i)), styleObj);
});
var evenRowStylesExist = Object.keys(this.evenRowStyles()).length > 0;
var lastRowStylesExist = Object.keys(this.lastRowStyles()).length > 0;
var tbodyRows = element.selectAll("tbody > tr");
if (evenRowStylesExist) {
var tbodyEvenRows = tbodyRows.select(function (d, i) { return i % 2 ? this : null; });
this.applyStyleObject(tbodyEvenRows, this.evenRowStyles());
}
if (lastRowStylesExist) {
var tbodyLastRow = tbodyRows.select(function (d, i, arr) { return i === arr.length - 1 ? this : null; });
this.applyStyleObject(tbodyLastRow, this.lastRowStyles());
}
};
return StyledTable;
}(SimpleTable));
StyledTable.prototype._class += " html_StyledTable";
StyledTable.prototype.publish("fontFamily", "Verdana", "string", "Base font-family used within the table");
StyledTable.prototype.publish("fontColor", "#333", "string", "Base font color used within the table");
StyledTable.prototype.publish("theadColumnStyles", [], "array", 'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])');
StyledTable.prototype.publish("tbodyColumnStyles", [], "array", 'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])');
StyledTable.prototype.publish("lastRowStyles", {}, "object", 'Object containing styles for the last row (ex: {"color":"red"})');
StyledTable.prototype.publish("evenRowStyles", {}, "object", 'Object containing styles for even rows (ex: {"background-color":"#AAA"})');
var n,l$1,u$1,t$1,o$1,r$1,f$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$1(l,f,t,o,null)}function d$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function k$1(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$1(n,l){if(null==l)return n.__?g$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?g$1(n):null}function m$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m$1(n)}}function w$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!x.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||r$1)(x);}function x(){var n,l,u,i,o,r,e,c;for(t$1.sort(f$1);n=t$1.shift();)n.__d&&(l=t$1.length,i=void 0,o=void 0,e=(r=(u=n).__v).__e,(c=u.__P)&&(i=[],(o=h$1({},r)).__v=r.__v+1,L(c,r,o,u.__n,void 0!==c.ownerSVGElement,null!=r.__h?[e]:null,i,null==e?g$1(r):e,r.__h),M(i,r),r.__e!=e&&m$1(r)),t$1.length>l&&t$1.sort(f$1));x.__r=0;}function P(n,l,u,i,t,o,r,f,e,a){var h,p,y,_,b,m,w,x=i&&i.__k||s$1,P=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _||"function"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?d$1(null,_,null,null,_):v$1(_)?d$1(k$1,{children:_},null,null,null):_.__b>0?d$1(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(y=x[h])||y&&_.key==y.key&&_.type===y.type)x[h]=void 0;else for(p=0;p<P;p++){if((y=x[p])&&_.key==y.key&&_.type===y.type){x[p]=void 0;break}y=null;}L(n,_,y=y||c$1,t,o,r,f,e,a),b=_.__e,(p=_.ref)&&y.ref!=p&&(w||(w=[]),y.ref&&w.push(y.ref,null,_),w.push(p,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===y.__k?_.__d=e=C(_,e,n):e=$(n,_,y,x,b,e),"function"==typeof u.type&&(u.__d=e)):e&&y.__e==e&&e.parentNode!=n&&(e=g$1(y));}for(u.__e=m,h=P;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=A(i).nextSibling),q(x[h],x[h]));if(w)for(h=0;h<w.length;h++)O(w[h],w[++h],w[++h]);}function C(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?C(i,l,u):$(u,i,i,t,i.__e,l));return l}function $(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function A(n){var l,u,i;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(l=n.__k.length-1;l>=0;l--)if((u=n.__k[l])&&(i=A(u)))return i;return null}function H(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||T$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||T$1(n,o,l[o],u[o],i);}function I(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function T$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||I(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||I(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?z$1:j$1,o):n.removeEventListener(l,o?z$1:j$1,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function j$1(n){return this.l[n.type+!1](l$1.event?l$1.event(n):n)}function z$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function L(n,u,i,t,o,r,f,e,c){var s,a,p,y,d,_,g,m,w,x,C,S,$,A,H,I=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l$1.__b)&&s(u);try{n:if("function"==typeof I){if(m=u.props,w=(s=I.contextType)&&t[s.__c],x=s?w?w.props.value:s.__:t,i.__c?g=(a=u.__c=i.__c).__=a.__E:("prototype"in I&&I.prototype.render?u.__c=a=new I(m,x):(u.__c=a=new b$1(m,x),a.constructor=I,a.render=B$1),w&&w.sub(a),a.props=m,a.state||(a.state={}),a.context=x,a.__n=t,p=a.__d=!0,a.__h=[],a._sb=[]),null==a.__s&&(a.__s=a.state),null!=I.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=h$1({},a.__s)),h$1(a.__s,I.getDerivedStateFromProps(m,a.__s))),y=a.props,d=a.state,a.__v=u,p)null==I.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else {if(null==I.getDerivedStateFromProps&&m!==y&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(m,x),!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(m,a.__s,x)||u.__v===i.__v){for(u.__v!==i.__v&&(a.props=m,a.state=a.__s,a.__d=!1),a.__e=!1,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<a._sb.length;C++)a.__h.push(a._sb[C]);a._sb=[],a.__h.length&&f.push(a);break n}null!=a.componentWillUpdate&&a.componentWillUpdate(m,a.__s,x),null!=a.componentDidUpdate&&a.__h.push(function(){a.componentDidUpdate(y,d,_);});}if(a.context=x,a.props=m,a.__P=n,S=l$1.__r,$=0,"prototype"in I&&I.prototype.render){for(a.state=a.__s,a.__d=!1,S&&S(u),s=a.render(a.props,a.state,a.context),A=0;A<a._sb.length;A++)a.__h.push(a._sb[A]);a._sb=[];}else do{a.__d=!1,S&&S(u),s=a.render(a.props,a.state,a.context),a.state=a.__s;}while(a.__d&&++$<25);a.state=a.__s,null!=a.getChildContext&&(t=h$1(h$1({},t),a.getChildContext())),p||null==a.getSnapshotBeforeUpdate||(_=a.getSnapshotBeforeUpdate(y,d)),P(n,v$1(H=null!=s&&s.type===k$1&&null==s.key?s.props.children:s)?H:[H],u,i,t,o,r,f,e,c),a.base=u.__e,u.__h=null,a.__h.length&&f.push(a),g&&(a.__E=a.__=null),a.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=N(i.__e,u,i,t,o,r,f,c);(s=l$1.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function M(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function N(l,u,i,t,o,r,f,e){var s,a,h,y=i.props,d=u.props,_=u.type,k=0;if("svg"===_&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!_&&(_?s.localName===_:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===_)return document.createTextNode(d);l=o?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),r=null,e=!1;}if(null===_)y===d||e&&l.data===d||(l.data=d);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||c$1).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!e){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(h||a)&&(h&&(a&&h.__html==a.__html||h.__html===l.innerHTML)||(l.innerHTML=h&&h.__html||""));}if(H(l,d,y,o,e),h)u.__k=[];else if(P(l,v$1(k=u.props.children)?k:[k],u,i,t,o&&"foreignObject"!==_,r,f,r?r[0]:i.__k&&g$1(i,0),e),null!=r)for(k=r.length;k--;)null!=r[k]&&p$1(r[k]);e||("value"in d&&void 0!==(k=d.value)&&(k!==l.value||"progress"===_&&!k||"option"===_&&k!==y.value)&&T$1(l,"value",k,y.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==l.checked&&T$1(l,"checked",k,y.checked,!1));}return l}function O(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function q(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||O(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&q(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function B$1(n,l,u){return this.constructor(n,u)}function D(u,i,t){var o,r,f;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],L(i,u=(!o&&t||i).__k=y(k$1,null,[u]),r||c$1,c$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),M(f,u);}n=s$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$1(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$1(this));},b$1.prototype.render=k$1,t$1=[],r$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0;
var BreakdownTable = /** @class */ (function (_super) {
__extends(BreakdownTable, _super);
function BreakdownTable() {
return _super.call(this) || this;
}
BreakdownTable.prototype.transformData = function () {
var rowCount = this.useCalculatedRowCount() ? this.calculateRowCount() : this.rowCount();
return this.breakdownData(rowCount);
};
BreakdownTable.prototype.breakdownData = function (limit) {
var len = this.data().length;
var sum = this.data().reduce(function (acc, row) { return acc + row[1]; }, 0);
var data = [];
var percSum = 0;
this.data().sort(function (a, b) { return a[1] > b[1] ? -1 : 1; });
var hiddenRowCount = len - limit;
var showOther = hiddenRowCount > 0;
this.data()
.filter(function (_, i) { return showOther ? i < limit - 1 : true; })
.forEach(function (row) {
var perc = Math.round((row[1] / sum) * 100);
percSum += perc;
data.push([row[0], perc + "%"]);
});
if (showOther) {
var otherLabel = "".concat(this.otherLabel(), " (").concat(len - limit + 1, ")");
var otherPercentage = "~" + (100 - percSum) + "%";
data.push([otherLabel, otherPercentage]);
}
return data;
};
BreakdownTable.prototype.calculateRowCount = function () {
var theadRowHeight = this.columns().length > 0 ? this.thFontSize() + 5 : 0;
var tbodyRowHeight = this.fontSize() + 5;
var tbodyAvailableHeight = this.height() - theadRowHeight;
var rowCount = Math.floor(tbodyAvailableHeight / tbodyRowHeight);
return rowCount;
};
BreakdownTable.prototype.enter = function (domNode, element) {
var _this = this;
_super.prototype.enter.call(this, domNode, element);
this._tooltip = new HTMLTooltip()
.target(domNode);
this._tooltip
.tooltipHTML(function (data) {
var rowCount = _this.useCalculatedRowCount() ? _this.calculateRowCount() : _this.rowCount();
var rowHeight = _this.fontSize();
var widestLabel = Math.max.apply(Math, data.map(function (row) { return _this.textSize(row[0], "Verdana", _this.fontSize()).width; }));
var widestPerc = 30;
var colCount = 2;
var w = colCount * (widestLabel + widestPerc) + (_this._tooltip.padding() * 2);
var h = rowHeight * Math.ceil((data.length - rowCount) / colCount) + (_this._tooltip.padding() * 2);
_this._tooltip.tooltipWidth(w);
_this._tooltip.tooltipHeight(h);
var otherData = _this.breakdownData(_this.data().length).slice(rowCount - 1);
return "<div style=\"\n width: 100%;\n height: 100%;\n font-size: ".concat(_this.fontSize(), "px\n \">").concat(otherData.map(function (row) { return "<div style=\"\n float:left;\n width:".concat(Math.floor(99 / colCount), "%;\n \">").concat(row[0], ": ").concat(row[1], "</div>"); }).join(""), "</div>");
});
};
BreakdownTable.prototype.update = function (domNode, element) {
this.theadColumnStyles_default([
{
"color": this.thFirstColor(),
"font-size": this.thFontSize() + "px",
"font-weight": this.thFontWeight(),
"text-align": this.labelAlignment(),
"width": "auto",
"padding": "0px"
},
{
"width": "1%",
"font-size": this.thFontSize() + "px",
"font-weight": this.thFontWeight(),
"text-align": this.percentageAlignment(),
"padding": "0px"
}
]);
this.tbodyColumnStyles_default([
{
"color": this.topLabelColor(),
"font-size": this.fontSize() + "px",
"font-weight": "normal",
"text-align": this.labelAlignment(),
"width": "auto",
"padding": "0px"
},
{
"color": this.topPercentageColor(),
"font-size": this.fontSize() + "px",
"font-weight": "normal",
"text-align": this.percentageAlignment(),
"width": "1%",
"padding": "0px"
}
]);
this.lastRowStyles_default([
{
"color": this.otherLabelColor(),
"font-size": this.fontSize() + "px",
"font-weight": this.otherLabelBold() ? "bold" : "normal",
"text-align": this.labelAlignment(),
"width": "auto",
"padding": "0px"
},
{
"color": this.otherLabelColor(),
"font-size": this.fontSize() + "px",
"font-weight": this.otherPercentageBold() ? "bold" : "normal",
"text-align": this.percentageAlignment(),
"width": "1%",
"padding": "0px"
}
]);
_super.prototype.update.call(this, domNode, element);
var rowCount = this.useCalculatedRowCount() ? this.calculateRowCount() : this.rowCount();
if (rowCount < this.data().length) {
var lastRow_1 = element.select("tbody > tr:last-child");
var context_1 = this;
lastRow_1
.on("mouseout.tooltip", function (d) {
context_1._tooltip._triggerElement = lastRow_1;
context_1._tooltip
.visible(false)
.render();
})
.on("mouseenter.tooltip", function (d) {
context_1._tooltip._triggerElement = lastRow_1;
context_1._tooltip
.direction("n")
.data(context_1.data())
.visible(true)
.render();
});
}
};
return BreakdownTable;
}(StyledTable));
BreakdownTable.prototype._class += " html_BreakdownTable";
BreakdownTable.prototype.publish("useCalculatedRowCount", true, "boolean", "If true, rowCount will be calculated and its default will be overwritten");
BreakdownTable.prototype.publish("rowCount", 5, "number", "Number of total rows to display (including the 'other' row)", undefined, { disable: function (w) { return w.useCalculatedRowCount(); } });
BreakdownTable.prototype.publish("fontSize", 14, "number", "Font size (pixels)");
BreakdownTable.prototype.publish("labelAlignment", "left", "set", "Alignment of the label column text", ["left", "center", "right"]);
BreakdownTable.prototype.publish("percentageAlignment", "center", "set", "Alignment of the percentage column text", ["left", "center", "right"]);
BreakdownTable.prototype.publish("topLabelColor", "#333", "html-color", "Color of displayed 'top' labels");
BreakdownTable.prototype.publish("topPercentageColor", "#1A99D5", "html-color", "Color of displayed 'top' percentages");
BreakdownTable.prototype.publish("topPercentageBold", true, "html-color", "If true, the 'top' percentages will be bold");
BreakdownTable.prototype.publish("otherLabel", "Other", "string", "Label text for the 'other' row");
BreakdownTable.prototype.publish("otherLabelColor", "#AAA", "html-color", "Color of the 'other' label");
BreakdownTable.prototype.publish("otherLabelBold", false, "html-color", "If true, the 'other' label will be bold");
BreakdownTable.prototype.publish("otherPercentageColor", "#AAA", "html-color", "Color of the 'other' percentage");
BreakdownTable.prototype.publish("otherPercentageBold", false, "html-color", "If true, the 'other' percentage will be bold");
BreakdownTable.prototype.publish("thFontWeight", "bold", "string", "Font weight for th elements");
BreakdownTable.prototype.publish("thFontSize", 26, "number", "Font size for th elements");
BreakdownTable.prototype.publish("thFirstColor", "#333", "html-color", "Text color of the first th element");
BreakdownTable.prototype.publish("thLastColor", "#333", "html-color", "Text color of the last th element");
var r,u,i,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a&&a(n);var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[],0)),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w(n){var t=r;n.__c=n.__(),r=t;}
var n,l$1,u$1,i$1,o$1,r$1,f$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$1(l,f,i,o,null)}function d$1(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function k$1(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$1(n,l){if(null==l)return n.__?g$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__d||u.__e;return "function"==typeof n.type?g$1(n):null}function m$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m$1(n)}}function w$1(n){(!n.__d&&(n.__d=!0)&&i$1.push(n)&&!x.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||r$1)(x);}function x(){var n,l,u,t,o,r,e,c,s;for(i$1.sort(f$1);n=i$1.shift();)n.__d&&(l=i$1.length,t=void 0,o=void 0,r=void 0,c=(e=(u=n).__v).__e,(s=u.__P)&&(t=[],o=[],(r=h$1({},e)).__v=e.__v+1,z$1(s,e,r,u.__n,void 0!==s.ownerSVGElement,null!=e.__h?[c]:null,t,null==c?g$1(e):c,e.__h,o),L(t,e,o),e.__e!=c&&m$1(e)),i$1.length>l&&i$1.sort(f$1));x.__r=0;}function P(n,l,u,t,i,o,r,f,e,a,h){var p,y,_,b,m,w,x,P,C,D=0,H=t&&t.__k||s$1,I=H.length,T=I,j=l.length;for(u.__k=[],p=0;p<j;p++)null!=(b=u.__k[p]=null==(b=l[p])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d$1(null,b,null,null,b):v$1(b)?d$1(k$1,{children:b},null,null,null):b.__b>0?d$1(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=u,b.__b=u.__b+1,-1===(P=A(b,H,x=p+D,T))?_=c$1:(_=H[P]||c$1,H[P]=void 0,T--),z$1(n,b,_,i,o,r,f,e,a,h),m=b.__e,(y=b.ref)&&_.ref!=y&&(_.ref&&N(_.ref,null,b),h.push(y,b.__c||m,b)),null!=m&&(null==w&&(w=m),(C=_===c$1||null===_.__v)?-1==P&&D--:P!==x&&(P===x+1?D++:P>x?T>j-x?D+=P-x:D--:D=P<x&&P==x-1?P-x:0),x=p+D,"function"!=typeof b.type||P===x&&_.__k!==b.__k?"function"==typeof b.type||P===x&&!C?void 0!==b.__d?(e=b.__d,b.__d=void 0):e=m.nextSibling:e=S(n,m,e):e=$(b,e,n),"function"==typeof u.type&&(u.__d=e))):(_=H[p])&&null==_.key&&_.__e&&(_.__e==e&&(_.__=t,e=g$1(_)),O(_,_,!1),H[p]=null);for(u.__e=w,p=I;p--;)null!=H[p]&&("function"==typeof u.type&&null!=H[p].__e&&H[p].__e==u.__d&&(u.__d=H[p].__e.nextSibling),O(H[p],H[p]));}function $(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$(t,l,u):S(u,t.__e,l));return l}function S(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function A(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&i==e.key&&o===e.type)return r;r--;}if(f<l.length){if((e=l[f])&&i==e.key&&o===e.type)return f;f++;}}return -1}function D(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||I(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||I(n,o,l[o],u[o],t);}function H(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function I(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||H(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||H(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?j$1:T$1,o)):n.removeEventListener(l,o?j$1:T$1,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function T$1(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return}else n.t=Date.now();return u(l$1.event?l$1.event(n):n)}function j$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function z$1(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,g,m,w,x,$,C,S,A,D,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);n:if("function"==typeof I)try{if(w=u.props,x=(a=I.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(w,$):(u.__c=p=new b$1(w,$),p.constructor=I,p.render=q),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=$,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h$1({},p.__s)),h$1(p.__s,I.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else {if(null==I.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,$),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,$)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,$),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,g);});}if(p.context=$,p.props=w,p.__P=n,p.__e=!1,S=l$1.__r,A=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[];}else do{p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=h$1(h$1({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(d,_)),P(n,v$1(H=null!=a&&a.type===k$1&&null==a.key?a.props.children:a)?H:[H],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),m&&(p.__E=p.__=null);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,t);}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=M(t.__e,u,t,i,o,r,f,c,s);(a=l$1.diffed)&&a(u);}function L(n,u,t){for(var i=0;i<t.length;i++)N(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function M(l,u,t,i,o,r,f,e,s){var a,h,y,d=t.props,_=u.props,k=u.type,b=0;if("svg"===k&&(o=!0),null!=r)for(;b<r.length;b++)if((a=r[b])&&"setAttribute"in a==!!k&&(k?a.localName===k:3===a.nodeType)){l=a,r[b]=null;break}if(null==l){if(null===k)return document.createTextNode(_);l=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,_.is&&_),r=null,e=!1;}if(null===k)d===_||e&&l.data===_||(l.data=_);else {if(r=r&&n.call(l.childNodes),h=(d=t.props||c$1).dangerouslySetInnerHTML,y=_.dangerouslySetInnerHTML,!e){if(null!=r)for(d={},b=0;b<l.attributes.length;b++)d[l.attributes[b].name]=l.attributes[b].value;(y||h)&&(y&&(h&&y.__html==h.__html||y.__html===l.innerHTML)||(l.innerHTML=y&&y.__html||""));}if(D(l,_,d,o,e),y)u.__k=[];else if(P(l,v$1(b=u.props.children)?b:[b],u,t,i,o&&"foreignObject"!==k,r,f,r?r[0]:t.__k&&g$1(t,0),e,s),null!=r)for(b=r.length;b--;)null!=r[b]&&p$1(r[b]);e||("value"in _&&void 0!==(b=_.value)&&(b!==l.value||"progress"===k&&!b||"option"===k&&b!==d.value)&&I(l,"value",b,d.value,!1),"checked"in _&&void 0!==(b=_.checked)&&b!==l.checked&&I(l,"checked",b,d.checked,!1));}return l}function N(n,u,t){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,t);}}function O(n,u,t){var i,o;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null,n.__c=void 0;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&O(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function q(n,l,u){return this.constructor(n,u)}function B$1(u,t,i){var o,r,f,e;l$1.__&&l$1.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],z$1(t,u=(!o&&i||t).__k=y(k$1,null,[u]),r||c$1,c$1,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),L(f,u,e);}n=s$1.slice,l$1={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$1(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$1(this));},b$1.prototype.render=k$1,i$1=[],r$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0;
var JSXWidget = /** @class */ (function (_super) {
__extends(JSXWidget, _super);
function JSXWidget() {
return _super !== null && _super.apply(this, arguments) || this;
}
JSXWidget.prototype.jsxRender = function (jsx, domNode) {
this.rootNode = D(jsx, domNode, this.rootNode);
};
JSXWidget.Component = b$1;
JSXWidget.createElement = y;
return JSXWidget;
}(common.HTMLWidget));
JSXWidget.prototype._class += " html_JSXWidget";
var r,u,i,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a&&a(n);var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[],0)),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w(n){var t=r;n.__c=n.__(),r=t;}
var VNode = /** @class */ (function () {
function VNode(attrs, children) {
this._attrs = attrs;
this._children = children;
}
VNode.prototype.type = function () {
return "div";
};
VNode.prototype.attrs = function () {
return this._attrs;
};
VNode.prototype.attr = function (key) {
return this._attrs[key];
};
VNode.prototype.children = function () {
return this._children;
};
VNode.prototype.update = function (targetElement) {
for (var key in this._attrs) {
targetElement.attr(key, this._attrs[key]);
}
};
VNode.prototype.render = function (targetElement) {
var thisElement = targetElement.selectAll("".concat(targetElement.node().tagName, " > *")).data([this]);
thisElement.exit()
.remove();
return thisElement.enter().append(this.type())
.attr("reactd3", 0)
.merge(thisElement)
.each(function (d) {
var element = common.select(this);
d.update(element);
d.renderChildren(element);
});
};
VNode.prototype.renderChildren = function (targetElement) {
var thisElement = targetElement.selectAll("".concat(targetElement.node().tagName, " > *")).data(this._children);
thisElement.exit()
.remove();
return thisElement.enter().append(function (d) { return document.createElement(d.type()); })
.attr("reactd3", function (_d, i) { return i; })
.merge(thisElement)
.each(function (d) {
var element = common.select(this);
d.update(element);
d.renderChildren(element);
});
};
return VNode;
}());
var ConstVNode = /** @class */ (function (_super) {
__extends(ConstVNode, _super);
function ConstVNode(type, attrs, children) {
var _this = _super.call(this, attrs, children) || this;
_this._type = type;
return _this;
}
ConstVNode.prototype.type = function () {
return this._type;
};
return ConstVNode;
}(VNode));
var TextVNode = /** @class */ (function (_super) {
__extends(TextVNode, _super);
function TextVNode(text) {
var _this = _super.call(this, {}, []) || this;
_this._text = text;
return _this;
}
TextVNode.prototype.type = function () {
return "span";
};
TextVNode.prototype.update = function (targetElement) {
_super.prototype.update.call(this, targetElement);
targetElement.text(this._text);
};
return TextVNode;
}(VNode));
function isReactFn(_) {
return typeof _ === "function";
}
function isIVNode(_) {
return _.prototype && _.prototype instanceof VNode;
}
var ReactD3 = /** @class */ (function () {
function ReactD3() {
}
// static createElementXXX(type: string | ReactFn | IVNode, attrs: { [key: string]: string }, ...children: Array<string | VNode>): VNode {
ReactD3.createElement = function (type, attrs) {
var children = [];
for (var _i = 2; _i < arguments.length; _i++) {
children[_i - 2] = arguments[_i];
}
if (isIVNode(type)) {
return new type(attrs);
}
else if (isReactFn(type)) {
return type(attrs);
}
return new ConstVNode(type, attrs, children.map(function (child) {
if (typeof child === "string") {
return new TextVNode(child);
}
return child;
}));
};
ReactD3.render = function (vdom, targetElement) {
vdom.render(targetElement);
};
return ReactD3;
}());
var JSXWidget = /** @class */ (function (_super) {
__extends(JSXWidget, _super);
function JSXWidget() {
return _super !== null && _super.apply(this, arguments) || this;
}
JSXWidget.prototype.jsxRender = function (jsx, domNode) {
this.rootNode = B$1(jsx, domNode, this.rootNode);
};
JSXWidget.Component = b$1;
JSXWidget.createElement = y;
return JSXWidget;
}(common.HTMLWidget));
JSXWidget.prototype._class += " html_JSXWidget";
var VizComponent = /** @class */ (function (_super) {
__extends(VizComponent, _super);
function VizComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
VizComponent.prototype.refreshProps = function () {
for (var key in this.props) {
if (this.widget[key] && typeof this.widget[key] === "function") {
this.widget[key](this.props[key]);
}
}
};
VizComponent.prototype.componentDidMount = function () {
this.widget = new this.props.type()
.target(this.base);
this.refreshProps();
this.widget
.render();
};
VizComponent.prototype.componentWillUnmount = function () {
this.widget
.target(null)
.render();
};
VizComponent.prototype.render = function () {
return y("div", { style: this.props.style });
};
VizComponent.prototype.componentDidUpdate = function () {
this.refreshProps();
this.widget.render();
};
return VizComponent;
}(JSXWidget.Component));
var VNode = /** @class */ (function () {
function VNode(attrs, children) {
this._attrs = attrs;
this._children = children;
}
VNode.prototype.type = function () {
return "div";
};
VNode.prototype.attrs = function () {
return this._attrs;
};
VNode.prototype.attr = function (key) {
return this._attrs[key];
};
VNode.prototype.children = function () {
return this._children;
};
VNode.prototype.update = function (targetElement) {
for (var key in this._attrs) {
targetElement.attr(key, this._attrs[key]);
}
};
VNode.prototype.render = function (targetElement) {
var thisElement = targetElement.selectAll("".concat(targetElement.node().tagName, " > *")).data([this]);
thisElement.exit()
.remove();
return thisElement.enter().append(this.type())
.attr("reactd3", 0)
.merge(thisElement)
.each(function (d) {
var element = common.select(this);
d.update(element);
d.renderChildren(element);
});
};
VNode.prototype.renderChildren = function (targetElement) {
var thisElement = targetElement.selectAll("".concat(targetElement.node().tagName, " > *")).data(this._children);
thisElement.exit()
.remove();
return thisElement.enter().append(function (d) { return document.createElement(d.type()); })
.attr("reactd3", function (_d, i) { return i; })
.merge(thisElement)
.each(function (d) {
var element = common.select(this);
d.update(element);
d.renderChildren(element);
});
};
return VNode;
}());
var ConstVNode = /** @class */ (function (_super) {
__extends(ConstVNode, _super);
function ConstVNode(type, attrs, children) {
var _this = _super.call(this, attrs, children) || this;
_this._type = type;
return _this;
}
ConstVNode.prototype.type = function () {
return this._type;
};
return ConstVNode;
}(VNode));
var TextVNode = /** @class */ (function (_super) {
__extends(TextVNode, _super);
function TextVNode(text) {
var _this = _super.call(this, {}, []) || this;
_this._text = text;
return _this;
}
TextVNode.prototype.type = function () {
return "span";
};
TextVNode.prototype.update = function (targetElement) {
_super.prototype.update.call(this, targetElement);
targetElement.text(this._text);
};
return TextVNode;
}(VNode));
function isReactFn(_) {
return typeof _ === "function";
}
function isIVNode(_) {
return _.prototype && _.prototype instanceof VNode;
}
var ReactD3 = /** @class */ (function () {
function ReactD3() {
}
// static createElementXXX(type: string | ReactFn | IVNode, attrs: { [key: string]: string }, ...children: Array<string | VNode>): VNode {
ReactD3.createElement = function (type, attrs) {
var children = [];
for (var _i = 2; _i < arguments.length; _i++) {
children[_i - 2] = arguments[_i];
}
if (isIVNode(type)) {
return new type(attrs);
}
else if (isReactFn(type)) {
return type(attrs);
}
return new ConstVNode(type, attrs, children.map(function (child) {
if (typeof child === "string") {
return new TextVNode(child);
}
return child;
}));
};
ReactD3.render = function (vdom, targetElement) {
vdom.render(targetElement);
};
return ReactD3;
}());
var VizInstance = /** @class */ (function (_super) {
__extends(VizInstance, _super);
function VizInstance() {
return _super !== null && _super.apply(this, arguments) || this;
}
VizInstance.prototype.refreshProps = function () {
for (var key in this.props) {
if (this.widget[key] && typeof this.widget[key] === "function") {
this.widget[key](this.props[key]);
}
}
};
VizInstance.prototype.componentDidMount = function () {
this.widget = this.props.instance
.target(this.base);
this.refreshProps();
this.widget
.render();
};
VizInstance.prototype.componentWillUnmount = function () {
this.widget
.target(null)
.render();
};
VizInstance.prototype.render = function () {
return y("div", { style: this.props.style });
};
VizInstance.prototype.componentDidUpdate = function () {
this.refreshProps();
this.widget.render();
};
return VizInstance;
}(JSXWidget.Component));
var VizComponent = /** @class */ (function (_super) {
__extends(VizComponent, _super);
function VizComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
VizComponent.prototype.refreshProps = function () {
for (var key in this.props) {
if (this.widget[key] && typeof this.widget[key] === "function") {
this.widget[key](this.props[key]);
}
}
};
VizComponent.prototype.componentDidMount = function () {
this.widget = new this.props.type()
.target(this.base);
this.refreshProps();
this.widget
.render();
};
VizComponent.prototype.componentWillUnmount = function () {
this.widget
.target(null)
.render();
};
VizComponent.prototype.render = function () {
return y("div", { style: this.props.style });
};
VizComponent.prototype.componentDidUpdate = function () {
this.refreshProps();
this.widget.render();
};
return VizComponent;
}(JSXWidget.Component));
var StatsTable = /** @class */ (function (_super) {
__extends(StatsTable, _super);
function StatsTable() {
return _super !== null && _super.apply(this, arguments) || this;
}
StatsTable.prototype.transformData = function () {
var _this = this;
var totalRow = [["Total", 0, 0]];
var data = this.data();
data.forEach(function (row) {
totalRow[0][1] += row[1];
totalRow[0][2] += row[2];
});
return data
.concat(totalRow)
.map(function (row) {
return [
row[0],
_this.secondColumnFormat_exists() ? common.format(_this.secondColumnFormat())(row[1]) : row[1],
_this.thirdColumnFormat_exists() ? common.format(_this.thirdColumnFormat())(row[2]) : row[2]
];
});
};
StatsTable.prototype.update = function (domNode, element) {
this.tbodyColumnStyles_default([
{
"font-weight": "bold",
"width": this.firstColumnWidth(),
"text-align": "left"
},
{
"width": this.secondColumnWidth(),
"text-align": "right"
},
{
"width": this.thirdColumnWidth(),
"text-align": "right"
}
]);
this.evenRowStyles_default([
{
"font-weight": "bold",
"width": this.firstColumnWidth(),
"text-align": "left",
"font-color": this.evenRowFontColor(),
"background-color": this.evenRowBackgroundColor()
},
{
"width": this.secondColumnWidth(),
"text-align": "right",
"font-color": this.evenRowFontColor(),
"background-color": this.evenRowBackgroundColor()
},
{
"width": this.thirdColumnWidth(),
"text-align": "right",
"font-color": this.evenRowFontColor(),
"background-color": this.evenRowBackgroundColor()
}
]);
this.lastRowStyles_default({
"font-weight": "bold"
});
_super.prototype.update.call(this, domNode, element);
};
return StatsTable;
}(StyledTable));
StatsTable.prototype._class += " html_StatsTable";
StatsTable.prototype.publish("labelColor", "#333", "html-color", "Color of the text in the first column");
StatsTable.prototype.publish("primaryValueColor", "#333", "html-color", "Color of the text in the second column");
StatsTable.prototype.publish("secondaryValueColor", "#333", "html-color", "Color of the text in the third column");
StatsTable.prototype.publish("evenRowBackgroundColor", "#333", "html-color", "Background color of the even rows");
StatsTable.prototype.publish("evenRowFontColor", "#333", "html-color", "Font color of the even rows");
StatsTable.prototype.publish("firstColumnWidth", "auto", "string", "CSS style applied as the 'width' for the first column (ex: 40px)");
StatsTable.prototype.publish("secondColumnWidth", "1%", "string", "CSS style applied as the 'width' for the second column (ex: 40px)");
StatsTable.prototype.publish("thirdColumnWidth", "1%", "string", "CSS style applied as the 'width' for the third column (ex: 40px)");
StatsTable.prototype.publish("secondColumnFormat", "$,.0f", "string", "d3-format specifier applied to the second column's values", undefined, { optional: true });
StatsTable.prototype.publish("thirdColumnFormat", null, "string", "d3-format specifier applied to the third column's values", undefined, { optional: true });
var VizInstance = /** @class */ (function (_super) {
__extends(VizInstance, _super);
function VizInstance() {
return _super !== null && _super.apply(this, arguments) || this;
}
VizInstance.prototype.refreshProps = function () {
for (var key in this.props) {
if (this.widget[key] && typeof this.widget[key] === "function") {
this.widget[key](this.props[key]);
}
}
};
VizInstance.prototype.componentDidMount = function () {
this.widget = this.props.instance
.target(this.base);
this.refreshProps();
this.widget
.render();
};
VizInstance.prototype.componentWillUnmount = function () {
this.widget
.target(null)
.render();
};
VizInstance.prototype.render = function () {
return y("div", { style: this.props.style });
};
VizInstance.prototype.componentDidUpdate = function () {
this.refreshProps();
this.widget.render();
};
return VizInstance;
}(JSXWidget.Component));
function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
var StatsTable = /** @class */ (function (_super) {
__extends(StatsTable, _super);
function StatsTable() {
return _super !== null && _super.apply(this, arguments) || this;
}
StatsTable.prototype.transformData = function () {
var _this = this;
var totalRow = [["Total", 0, 0]];
var data = this.data();
data.forEach(function (row) {
totalRow[0][1] += row[1];
totalRow[0][2] += row[2];
});
return data
.concat(totalRow)
.map(function (row) {
return [
row[0],
_this.secondColumnFormat_exists() ? common.format(_this.secondColumnFormat())(row[1]) : row[1],
_this.thirdColumnFormat_exists() ? common.format(_this.thirdColumnFormat())(row[2]) : row[2]
];
});
};
StatsTable.prototype.update = function (domNode, element) {
this.tbodyColumnStyles_default([
{
"font-weight": "bold",
"width": this.firstColumnWidth(),
"text-align": "left"
},
{
"width": this.secondColumnWidth(),
"text-align": "right"
},
{
"width": this.thirdColumnWidth(),
"text-align": "right"
}
]);
this.evenRowStyles_default([
{
"font-weight": "bold",
"width": this.firstColumnWidth(),
"text-align": "left",
"font-color": this.evenRowFontColor(),
"background-color": this.evenRowBackgroundColor()
},
{
"width": this.secondColumnWidth(),
"text-align": "right",
"font-color": this.evenRowFontColor(),
"background-color": this.evenRowBackgroundColor()
},
{
"width": this.thirdColumnWidth(),
"text-align": "right",
"font-color": this.evenRowFontColor(),
"background-color": this.evenRowBackgroundColor()
}
]);
this.lastRowStyles_default({
"font-weight": "bold"
});
_super.prototype.update.call(this, domNode, element);
};
return StatsTable;
}(StyledTable));
StatsTable.prototype._class += " html_StatsTable";
StatsTable.prototype.publish("labelColor", "#333", "html-color", "Color of the text in the first column");
StatsTable.prototype.publish("primaryValueColor", "#333", "html-color", "Color of the text in the second column");
StatsTable.prototype.publish("secondaryValueColor", "#333", "html-color", "Color of the text in the third column");
StatsTable.prototype.publish("evenRowBackgroundColor", "#333", "html-color", "Background color of the even rows");
StatsTable.prototype.publish("evenRowFontColor", "#333", "html-color", "Font color of the even rows");
StatsTable.prototype.publish("firstColumnWidth", "auto", "string", "CSS style applied as the 'width' for the first column (ex: 40px)");
StatsTable.prototype.publish("secondColumnWidth", "1%", "string", "CSS style applied as the 'width' for the second column (ex: 40px)");
StatsTable.prototype.publish("thirdColumnWidth", "1%", "string", "CSS style applied as the 'width' for the third column (ex: 40px)");
StatsTable.prototype.publish("secondColumnFormat", "$,.0f", "string", "d3-format specifier applied to the second column's values", undefined, { optional: true });
StatsTable.prototype.publish("thirdColumnFormat", null, "string", "d3-format specifier applied to the third column's values", undefined, { optional: true });
if (!css || typeof document === 'undefined') { return; }
function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (!css || typeof document === 'undefined') { return; }
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var css_248z = "#wrap{width:100%}#left,#right{padding:5px}#left{background-color:red;display:block;overflow:hidden;text-align:left;text-overflow:ellipsis}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{display:block;width:100%}.html_TitleBar .title{display:block;font-size:20px;font-weight:700;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.html_TitleBar .icon-bar{float:right;line-height:28px;padding:4px;text-align:right;white-space:nowrap}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{color:#a9a9a9;padding-bottom:4px;padding-top:4px;text-align:center;transition:all .3s ease}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{color:none;padding-bottom:0;padding-left:8px;padding-top:2px;text-align:center}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}";
styleInject(css_248z);
var css_248z = "#wrap{width:100%}#left,#right{padding:5px}#left{background-color:red;display:block;overflow:hidden;text-align:left;text-overflow:ellipsis}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{display:block;width:100%}.html_TitleBar .title{display:block;font-size:20px;font-weight:700;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.html_TitleBar .icon-bar{float:right;line-height:28px;padding:4px;text-align:right;white-space:nowrap}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{color:#a9a9a9;padding-bottom:4px;padding-top:4px;text-align:center;transition:all .3s ease}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{color:none;padding-bottom:0;padding-left:8px;padding-top:2px;text-align:center}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}";
styleInject(css_248z);
var Item = /** @class */ (function (_super) {
__extends(Item, _super);
function Item(owner) {
var _this = _super.call(this) || this;
_this._owner = owner;
_this._tag = "a";
return _this;
}
return Item;
}(common.HTMLWidget));
var Button = /** @class */ (function (_super) {
__extends(Button, _super);
function Button(owner, icon) {
var _this = _super.call(this, owner) || this;
_this._icon = icon;
return _this;
}
Button.prototype.icon = function () {
return this._icon;
};
Button.prototype.enter = function (domNode, element) {
var _this = this;
_super.prototype.enter.call(this, domNode, element);
element
.attr("href", "#")
.on("click", function (d, idx, groups) { return _this._owner.titleBarClick(_this, d, idx, groups); })
.append("i")
.attr("class", "fa ".concat(this._icon, " fa-lg fa-fw"));
};
return Button;
}(Item));
var ToggleButton = /** @class */ (function (_super) {
__extends(ToggleButton, _super);
function ToggleButton() {
return _super !== null && _super.apply(this, arguments) || this;
}
ToggleButton.prototype.enter = function (domNode, element) {
var _this = this;
element.on("click.sel", function (d, idx, groups) {
_this.selected(!_this.selected());
_this.render();
});
_super.prototype.enter.call(this, domNode, element);
};
ToggleButton.prototype.update = function (domNode, element) {
_super.prototype.update.call(this, domNode, element);
this._element.classed("selected", this.selected());
};
return ToggleButton;
}(Button));
ToggleButton.prototype.publish("selected", false, "boolean");
var Spacer = /** @class */ (function (_super) {
__extends(Spacer, _super);
function Spacer() {
return _super !== null && _super.apply(this, arguments) || this;
}
Spacer.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
element
.attr("class", "spacer")
.attr("href", "#")
.append("i");
};
return Spacer;
}(Item));
var TitleBar = /** @class */ (function (_super) {
__extends(TitleBar, _super);
function TitleBar() {
return _super.call(this) || this;
}
TitleBar.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
this._divMain = element.append("div")
.attr("class", "main");
this._divIconBar = this._divMain.append("div")
.attr("class", "icon-bar");
this._divTitle = this._divMain.append("div")
.attr("class", "title");
};
TitleBar.prototype.update = function (domNode, element) {
_super.prototype.update.call(this, domNode, element);
this._divTitle.text(this.title());
var icons = this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());
icons.enter().append("div")
.attr("class", "icon-bar-item")
.each(function (d) {
d.target(this);
})
.merge(icons)
.each(function (d) {
d.render();
});
icons.exit()
.each(function (d) {
d.target(null);
})
.remove();
icons.order();
};
return TitleBar;
}(JSXWidget));
TitleBar.prototype._class += " html_TitleBar";
TitleBar.prototype.publish("title", "", "string");
TitleBar.prototype.publish("buttons", [], "widgetArray");
var Item = /** @class */ (function (_super) {
__extends(Item, _super);
function Item(owner) {
var _this = _super.call(this) || this;
_this._owner = owner;
_this._tag = "a";
return _this;
}
return Item;
}(common.HTMLWidget));
var Button = /** @class */ (function (_super) {
__extends(Button, _super);
function Button(owner, icon) {
var _this = _super.call(this, owner) || this;
_this._icon = icon;
return _this;
}
Button.prototype.icon = function () {
return this._icon;
};
Button.prototype.enter = function (domNode, element) {
var _this = this;
_super.prototype.enter.call(this, domNode, element);
element
.attr("href", "#")
.on("click", function (d, idx, groups) { return _this._owner.titleBarClick(_this, d, idx, groups); })
.append("i")
.attr("class", "fa ".concat(this._icon, " fa-lg fa-fw"));
};
return Button;
}(Item));
var ToggleButton = /** @class */ (function (_super) {
__extends(ToggleButton, _super);
function ToggleButton() {
return _super !== null && _super.apply(this, arguments) || this;
}
ToggleButton.prototype.enter = function (domNode, element) {
var _this = this;
element.on("click.sel", function (d, idx, groups) {
_this.selected(!_this.selected());
_this.render();
});
_super.prototype.enter.call(this, domNode, element);
};
ToggleButton.prototype.update = function (domNode, element) {
_super.prototype.update.call(this, domNode, element);
this._element.classed("selected", this.selected());
};
return ToggleButton;
}(Button));
ToggleButton.prototype.publish("selected", false, "boolean");
var Spacer = /** @class */ (function (_super) {
__extends(Spacer, _super);
function Spacer() {
return _super !== null && _super.apply(this, arguments) || this;
}
Spacer.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
element
.attr("class", "spacer")
.attr("href", "#")
.append("i");
};
return Spacer;
}(Item));
var TitleBar = /** @class */ (function (_super) {
__extends(TitleBar, _super);
function TitleBar() {
return _super.call(this) || this;
}
TitleBar.prototype.enter = function (domNode, element) {
_super.prototype.enter.call(this, domNode, element);
this._divMain = element.append("div")
.attr("class", "main");
this._divIconBar = this._divMain.append("div")
.attr("class", "icon-bar");
this._divTitle = this._divMain.append("div")
.attr("class", "title");
};
TitleBar.prototype.update = function (domNode, element) {
_super.prototype.update.call(this, domNode, element);
this._divTitle.text(this.title());
var icons = this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());
icons.enter().append("div")
.attr("class", "icon-bar-item")
.each(function (d) {
d.target(this);
})
.merge(icons)
.each(function (d) {
d.render();
});
icons.exit()
.each(function (d) {
d.target(null);
})
.remove();
icons.order();
};
return TitleBar;
}(JSXWidget));
TitleBar.prototype._class += " html_TitleBar";
TitleBar.prototype.publish("title", "", "string");
TitleBar.prototype.publish("buttons", [], "widgetArray");
exports.BUILD_VERSION = BUILD_VERSION;
exports.BreakdownTable = BreakdownTable;
exports.Button = Button;
exports.HTMLTooltip = HTMLTooltip;
exports.Item = Item;
exports.JSXWidget = JSXWidget;
exports.PKG_NAME = PKG_NAME;
exports.PKG_VERSION = PKG_VERSION;
exports.ReactD3 = ReactD3;
exports.SimpleTable = SimpleTable;
exports.Spacer = Spacer;
exports.StatsTable = StatsTable;
exports.StyledTable = StyledTable;
exports.TitleBar = TitleBar;
exports.ToggleButton = ToggleButton;
exports.VNode = VNode;
exports.VizComponent = VizComponent;
exports.VizInstance = VizInstance;
exports.BUILD_VERSION = BUILD_VERSION;
exports.BreakdownTable = BreakdownTable;
exports.Button = Button;
exports.HTMLTooltip = HTMLTooltip;
exports.Item = Item;
exports.JSXWidget = JSXWidget;
exports.PKG_NAME = PKG_NAME;
exports.PKG_VERSION = PKG_VERSION;
exports.ReactD3 = ReactD3;
exports.SimpleTable = SimpleTable;
exports.Spacer = Spacer;
exports.StatsTable = StatsTable;
exports.StyledTable = StyledTable;
exports.TitleBar = TitleBar;
exports.ToggleButton = ToggleButton;
exports.VNode = VNode;
exports.VizComponent = VizComponent;
exports.VizInstance = VizInstance;
Object.defineProperty(exports, '__esModule', { value: true });
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=index.js.map

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/html"]={},t["@hpcc-js/common"],t["@hpcc-js/util"])}(this,(function(t,e,o){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},n(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var r=function(t){function n(){var e=t.call(this)||this;return e._tooltipHTMLCallback=function(t){return"<b>_tooltipHTMLCallback is undefined</b>"},e._logger=o.scopedLogger("html/HTMLTooltip"),e._closing=!1,e.visible(!1),e}return i(n,t),n.prototype.tooltipHTML=function(t){return this._tooltipHTMLCallback=t,this},n.prototype.tooltipContent=function(t){return arguments.length?(this._contentNode=t,this):this._contentNode},n.prototype.triggerElement=function(t){return this._triggerElement=t,this},n.prototype.enter=function(o,n){t.prototype.enter.call(this,o,n);var i=e.select("body");this._tooltipElement=i.append("div").attr("class","tooltip-div").style("z-index","2147483638").style("position","fixed"),this._arrowElement=i.append("div").attr("class","arrow-div").style("z-index","2147483638").style("position","fixed")},n.prototype.update=function(e,o){var n=this;if(t.prototype.update.call(this,e,o),this._contentNode!==this._prevContentNode){var i=this._tooltipElement.node();(function(t,e,o){if(o||2===arguments.length)for(var n,i=0,r=e.length;i<r;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))})([],i.querySelectorAll("*"),!0).map((function(t){return t.__data__})).filter((function(t){return t})).forEach((function(t){"function"==typeof t.target&&t.target(null),"function"==typeof t.exit&&t.exit()})),i.innerHTML="",i.appendChild(this._contentNode),this._prevContentNode=this._contentNode}if(this._contentNode?this.onShowContent(this._contentNode):this._tooltipElement.html((function(){return n._tooltipHTMLCallback(n.data())})),this.fitContent()){this._tooltipElement.style("width","auto").style("height","auto").style("padding","0px").style("box-sizing","content-box");var r=this._tooltipElement.node().getBoundingClientRect();this.tooltipWidth_default(r.width),this.tooltipHeight_default(r.height)}this._closing=!1,this._tooltipElement.style("background-color",this.tooltipColor()).style("color",this.fontColor()).style("width",this.tooltipWidth()+"px").style("height",this.tooltipHeight()+"px").style("opacity",1).style("padding",this.padding()+"px").style("pointer-events",this.enablePointerEvents()?"all":"none").style("box-sizing","content-box"),this._arrowElement.style("opacity",1).style("pointer-events","none"),this.updateTooltipPosition()},n.prototype.onShowContent=function(t){},n.prototype.updateTooltipPosition=function(){var t=this.calcReferenceBBox(),e=this.calcTooltipDirection(t),o=t[e];return this._tooltipElement.style("top",o.y+"px").style("left",o.x+"px"),this.setArrowPosition(o,e),o},n.prototype.calcTooltipDirection=function(t){var e=Object.keys(t),o=this.direction();e.sort((function(t,e){return t===o?-1:1}));for(var n={top:0,left:0,width:window.innerWidth,height:window.innerHeight},i=0;i<e.length;i++){var r={top:t[e[i]].y,left:t[e[i]].x,width:this.tooltipWidth(),height:this.tooltipHeight()};if(this.rectFits(r,n))return e[i]}return this._logger.warning("Tooltip doesn't fit in the window for any of the directions. Defaulting to '".concat(o,"'")),this._logger.debug(n),this._logger.debug({top:t[o].y,left:t[o].x,width:this.tooltipWidth(),height:this.tooltipHeight()}),o},n.prototype.rectFits=function(t,e){return t.top>=e.top&&t.left>=e.left&&t.width+t.left<=e.width+e.left&&t.height+t.top<=e.height+e.top},n.prototype.setArrowPosition=function(t,e){var o,n,i="border-top-color";switch(this._arrowElement.style("border","".concat(this.arrowHeight(),"px solid ").concat(this.tooltipColor())).style("border-top-color","transparent").style("border-right-color","transparent").style("border-bottom-color","transparent").style("border-left-color","transparent"),e){case"n":o=t.y+this.tooltipHeight()+2*this.padding(),n=t.x+this.tooltipWidth()/2-this.arrowWidth()/2+this.padding(),i="border-top-color",this._arrowElement.style("border-top-width","".concat(this.arrowHeight(),"px")).style("border-bottom-width","0px").style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"s":o=t.y-this.arrowHeight(),n=t.x+this.padding()+this.tooltipWidth()/2-this.arrowWidth()/2,i="border-bottom-color",this._arrowElement.style("border-top-width","0px").style("border-bottom-width","".concat(this.arrowHeight(),"px")).style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"e":o=t.y+this.tooltipHeight()/2+this.padding()-this.arrowWidth()/2,n=t.x-this.arrowHeight(),i="border-right-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","0px").style("border-right-width","".concat(this.arrowHeight(),"px"));break;case"w":o=t.y+this.tooltipHeight()/2-this.arrowWidth()/2+this.padding(),n=t.x+this.tooltipWidth()+2*this.padding(),i="border-left-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","".concat(this.arrowHeight(),"px")).style("border-right-width","0px")}return void 0!==o&&void 0!==n?this._arrowElement.style("top",o+"px").style("left",n+"px").style(i,this.tooltipColor()).style("opacity",1):this._arrowElement.style("opacity",0),t},n.prototype.getReferenceNode=function(){return this._triggerElement?this._triggerElement.node():this.element().node().parentNode.parentNode},n.prototype.calcReferenceBBox=function(){var t=this.getReferenceNode().getBoundingClientRect(),e=t.top,o=t.left,n=t.width,i=t.height,r=this.tooltipWidth(),l=this.tooltipHeight(),s=r/2,p=l/2,h=this.arrowHeight(),a=this.padding(),c=2*a;return this.followCursor()&&this._cursorLoc&&(o=this._cursorLoc[0],e=this._cursorLoc[1],n=1,i=1),{n:{x:o+n/2-s-a,y:e-l-h-c},e:{x:o+n+h,y:e+i/2-p-a},s:{x:o+n/2-s-a,y:e+i+h},w:{x:o-r-h-c,y:e+i/2-p-a},nw:{x:o-r-c,y:e-l-c},ne:{x:o+n,y:e-l-c},se:{x:o+n,y:e+i},sw:{x:o-r-c,y:e+i}}},n.prototype.mouseout=function(){var t=this;this._closing=!0,this._tooltipElement.on("mouseover",(function(){t._closing=!1})),this._tooltipElement.on("mouseout",(function(){t.mouseout()})),setTimeout((function(){t._closing&&t.visible(!1)}),this.closeDelay())},n.prototype.visible=function(e){return arguments.length?(this._arrowElement&&(this._arrowElement.style("visibility",e?"visible":"hidden"),this._tooltipElement.style("visibility",e?"visible":"hidden")),t.prototype.visible.call(this,e),this):t.prototype.visible.call(this)},n.prototype.exit=function(e,o){this._arrowElement&&(this._arrowElement.remove(),this._tooltipElement.remove()),t.prototype.exit.call(this,e,o)},n}(e.HTMLWidget);r.prototype._class+=" html_HTMLTooltip",r.prototype.publish("fitContent",!1,"boolean","If true, tooltip will grow to fit its html content"),r.prototype.publish("followCursor",!1,"boolean","If true, tooltip will display relative to cursor location"),r.prototype.publish("closeDelay",400,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),r.prototype.publish("direction","n","set","Direction in which to display the tooltip",["n","s","e","w","ne","nw","se","sw"]),r.prototype.publish("padding",8,"number","Padding (pixels)"),r.prototype.publish("arrowWidth",16,"number","Width (or height depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("arrowHeight",8,"number","Height (or width depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("fontColor","#FFF","html-color","The default font color for text in the tooltip"),r.prototype.publish("tooltipColor","#000000EE","html-color","Background color of the tooltip"),r.prototype.publish("tooltipWidth",200,"number","Width of the tooltip (not including arrow) (pixels)"),r.prototype.publish("tooltipHeight",200,"number","Height of the tooltip (not including arrow) (pixels)"),r.prototype.publish("enablePointerEvents",!1,"boolean","If true, the 'pointer-events: all' style will be used");var l=function(t){function o(){return t.call(this)||this}return i(o,t),o.prototype.transformData=function(){return this.data()},o.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._table=o.append("table"),this._thead=this._table.append("thead"),this._theadRow=this._thead.append("tr"),this._tbody=this._table.append("tbody")},o.prototype.update=function(o,n){t.prototype.update.call(this,o,n),this._table.style("width",this.autoWidth()?"auto":"100%");var i=this._theadRow.selectAll("th").data(this.columns());i.enter().append("th").attr("class",(function(t,e){return"th-".concat(e)})).merge(i).text((function(t){return t.toString()})),i.exit().remove();var r=this._tbody.selectAll("tr").data(this.transformData());r.enter().append("tr").merge(r).each((function(t){var o=e.select(this).selectAll("td").data(t);o.enter().append("td").attr("class",(function(t,e){return"col-".concat(e)})).merge(o).text((function(t){return t.toString()})),o.exit().remove()})),r.exit().remove()},o}(e.HTMLWidget);l.prototype._class+=" html_SimpleTable",l.prototype.publish("autoWidth",!1,"boolean","If true, table width will be set to 'auto'. If false, the width is set to '100%'");var s=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.applyStyleObject=function(t,e){Object.keys(e).forEach((function(o){t.style(o,e[o])}))},e.prototype.update=function(e,o){var n=this;t.prototype.update.call(this,e,o),o.selectAll("tr,th,td").attr("style","").style("font-family",this.fontFamily()).style("color",this.fontColor()),this.theadColumnStyles().forEach((function(t,e){n.applyStyleObject(o.select(".th-".concat(e)),t)})),this.tbodyColumnStyles().forEach((function(t,e){n.applyStyleObject(o.selectAll(".col-".concat(e)),t)}));var i=Object.keys(this.evenRowStyles()).length>0,r=Object.keys(this.lastRowStyles()).length>0,l=o.selectAll("tbody > tr");if(i){var s=l.select((function(t,e){return e%2?this:null}));this.applyStyleObject(s,this.evenRowStyles())}if(r){var p=l.select((function(t,e,o){return e===o.length-1?this:null}));this.applyStyleObject(p,this.lastRowStyles())}},e}(l);s.prototype._class+=" html_StyledTable",s.prototype.publish("fontFamily","Verdana","string","Base font-family used within the table"),s.prototype.publish("fontColor","#333","string","Base font color used within the table"),s.prototype.publish("theadColumnStyles",[],"array",'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("tbodyColumnStyles",[],"array",'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("lastRowStyles",{},"object",'Object containing styles for the last row (ex: {"color":"red"})'),s.prototype.publish("evenRowStyles",{},"object",'Object containing styles for even rows (ex: {"background-color":"#AAA"})');var p=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.transformData=function(){var t=this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount();return this.breakdownData(t)},e.prototype.breakdownData=function(t){var e=this.data().length,o=this.data().reduce((function(t,e){return t+e[1]}),0),n=[],i=0;this.data().sort((function(t,e){return t[1]>e[1]?-1:1}));var r=e-t>0;if(this.data().filter((function(e,o){return!r||o<t-1})).forEach((function(t){var e=Math.round(t[1]/o*100);i+=e,n.push([t[0],e+"%"])})),r){var l="".concat(this.otherLabel()," (").concat(e-t+1,")"),s="~"+(100-i)+"%";n.push([l,s])}return n},e.prototype.calculateRowCount=function(){var t=this.columns().length>0?this.thFontSize()+5:0,e=this.fontSize()+5,o=this.height()-t;return Math.floor(o/e)},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),this._tooltip=(new r).target(e),this._tooltip.tooltipHTML((function(t){var e=n.useCalculatedRowCount()?n.calculateRowCount():n.rowCount(),o=n.fontSize(),i=Math.max.apply(Math,t.map((function(t){return n.textSize(t[0],"Verdana",n.fontSize()).width}))),r=2*(i+30)+2*n._tooltip.padding(),l=o*Math.ceil((t.length-e)/2)+2*n._tooltip.padding();n._tooltip.tooltipWidth(r),n._tooltip.tooltipHeight(l);var s=n.breakdownData(n.data().length).slice(e-1);return'<div style="\n width: 100%;\n height: 100%;\n font-size: '.concat(n.fontSize(),'px\n ">').concat(s.map((function(t){return'<div style="\n float:left;\n width:'.concat(Math.floor(49.5),'%;\n ">').concat(t[0],": ").concat(t[1],"</div>")})).join(""),"</div>")}))},e.prototype.update=function(e,o){if(this.theadColumnStyles_default([{color:this.thFirstColor(),"font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.labelAlignment(),width:"auto",padding:"0px"},{width:"1%","font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.percentageAlignment(),padding:"0px"}]),this.tbodyColumnStyles_default([{color:this.topLabelColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.topPercentageColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),this.lastRowStyles_default([{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherLabelBold()?"bold":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherPercentageBold()?"bold":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),t.prototype.update.call(this,e,o),(this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount())<this.data().length){var n=o.select("tbody > tr:last-child"),i=this;n.on("mouseout.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.visible(!1).render()})).on("mouseenter.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.direction("n").data(i.data()).visible(!0).render()}))}},e}(s);p.prototype._class+=" html_BreakdownTable",p.prototype.publish("useCalculatedRowCount",!0,"boolean","If true, rowCount will be calculated and its default will be overwritten"),p.prototype.publish("rowCount",5,"number","Number of total rows to display (including the 'other' row)",void 0,{disable:function(t){return t.useCalculatedRowCount()}}),p.prototype.publish("fontSize",14,"number","Font size (pixels)"),p.prototype.publish("labelAlignment","left","set","Alignment of the label column text",["left","center","right"]),p.prototype.publish("percentageAlignment","center","set","Alignment of the percentage column text",["left","center","right"]),p.prototype.publish("topLabelColor","#333","html-color","Color of displayed 'top' labels"),p.prototype.publish("topPercentageColor","#1A99D5","html-color","Color of displayed 'top' percentages"),p.prototype.publish("topPercentageBold",!0,"html-color","If true, the 'top' percentages will be bold"),p.prototype.publish("otherLabel","Other","string","Label text for the 'other' row"),p.prototype.publish("otherLabelColor","#AAA","html-color","Color of the 'other' label"),p.prototype.publish("otherLabelBold",!1,"html-color","If true, the 'other' label will be bold"),p.prototype.publish("otherPercentageColor","#AAA","html-color","Color of the 'other' percentage"),p.prototype.publish("otherPercentageBold",!1,"html-color","If true, the 'other' percentage will be bold"),p.prototype.publish("thFontWeight","bold","string","Font weight for th elements"),p.prototype.publish("thFontSize",26,"number","Font size for th elements"),p.prototype.publish("thFirstColor","#333","html-color","Text color of the first th element"),p.prototype.publish("thLastColor","#333","html-color","Text color of the last th element");var h,a,c,u,d,_,f,y={},g=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function v(t,e){for(var o in e)t[o]=e[o];return t}function w(t){var e=t.parentNode;e&&e.removeChild(t)}function x(t,e,o){var n,i,r,l={};for(r in e)"key"==r?n=e[r]:"ref"==r?i=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?h.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===l[r]&&(l[r]=t.defaultProps[r]);return C(t,l,n,i,null)}function C(t,e,o,n,i){var r={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++c:i};return null==i&&null!=a.vnode&&a.vnode(r),r}function k(t){return t.children}function S(t,e){this.props=t,this.context=e}function T(t,e){if(null==e)return t.__?T(t.__,t.__.__k.indexOf(t)+1):null;for(var o;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e)return o.__e;return"function"==typeof t.type?T(t):null}function E(t){var e,o;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e){t.__e=t.__c.base=o.__e;break}return E(t)}}function W(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!H.__r++||d!==a.debounceRendering)&&((d=a.debounceRendering)||_)(H)}function H(){var t,e,o,n,i,r,l,s;for(u.sort(f);t=u.shift();)t.__d&&(e=u.length,n=void 0,i=void 0,l=(r=(o=t).__v).__e,(s=o.__P)&&(n=[],(i=v({},r)).__v=r.__v+1,D(s,r,i,o.__n,void 0!==s.ownerSVGElement,null!=r.__h?[l]:null,n,null==l?T(r):l,r.__h),j(n,r),r.__e!=l&&E(r)),u.length>e&&u.sort(f));H.__r=0}function A(t,e,o,n,i,r,l,s,p,h){var a,c,u,d,_,f,m,v=n&&n.__k||g,w=v.length;for(o.__k=[],a=0;a<e.length;a++)if(null!=(d=o.__k[a]=null==(d=e[a])||"boolean"==typeof d||"function"==typeof d?null:"string"==typeof d||"number"==typeof d||"bigint"==typeof d?C(null,d,null,null,d):b(d)?C(k,{children:d},null,null,null):d.__b>0?C(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)){if(d.__=o,d.__b=o.__b+1,null===(u=v[a])||u&&d.key==u.key&&d.type===u.type)v[a]=void 0;else for(c=0;c<w;c++){if((u=v[c])&&d.key==u.key&&d.type===u.type){v[c]=void 0;break}u=null}D(t,d,u=u||y,i,r,l,s,p,h),_=d.__e,(c=d.ref)&&u.ref!=c&&(m||(m=[]),u.ref&&m.push(u.ref,null,d),m.push(c,d.__c||_,d)),null!=_?(null==f&&(f=_),"function"==typeof d.type&&d.__k===u.__k?d.__d=p=B(d,p,t):p=R(t,d,u,v,_,p),"function"==typeof o.type&&(o.__d=p)):p&&u.__e==p&&p.parentNode!=t&&(p=T(u))}for(o.__e=f,a=w;a--;)null!=v[a]&&("function"==typeof o.type&&null!=v[a].__e&&v[a].__e==o.__d&&(o.__d=F(n).nextSibling),I(v[a],v[a]));if(m)for(a=0;a<m.length;a++)O(m[a],m[++a],m[++a])}function B(t,e,o){for(var n,i=t.__k,r=0;i&&r<i.length;r++)(n=i[r])&&(n.__=t,e="function"==typeof n.type?B(n,e,o):R(o,n,n,i,n.__e,e));return e}function R(t,e,o,n,i,r){var l,s,p;if(void 0!==e.__d)l=e.__d,e.__d=void 0;else if(null==o||i!=r||null==i.parentNode)t:if(null==r||r.parentNode!==t)t.appendChild(i),l=null;else{for(s=r,p=0;(s=s.nextSibling)&&p<n.length;p+=1)if(s==i)break t;t.insertBefore(i,r),l=r}return void 0!==l?l:i.nextSibling}function F(t){var e,o,n;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((o=t.__k[e])&&(n=F(o)))return n;return null}function P(t,e,o){"-"===e[0]?t.setProperty(e,null==o?"":o):t[e]=null==o?"":"number"!=typeof o||m.test(e)?o:o+"px"}function L(t,e,o,n,i){var r;t:if("style"===e)if("string"==typeof o)t.style.cssText=o;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)o&&e in o||P(t.style,e,"");if(o)for(e in o)n&&o[e]===n[e]||P(t.style,e,o[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?n||t.addEventListener(e,r?M:N,r):t.removeEventListener(e,r?M:N,r);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&e in t)try{t[e]=null==o?"":o;break t}catch(t){}"function"==typeof o||(null==o||!1===o&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,o))}}function N(t){return this.l[t.type+!1](a.event?a.event(t):t)}function M(t){return this.l[t.type+!0](a.event?a.event(t):t)}function D(t,e,o,n,i,r,l,s,p){var h,c,u,d,_,f,y,g,m,w,x,C,T,E,W,H=e.type;if(void 0!==e.constructor)return null;null!=o.__h&&(p=o.__h,s=e.__e=o.__e,e.__h=null,r=[s]),(h=a.__b)&&h(e);try{t:if("function"==typeof H){if(g=e.props,m=(h=H.contextType)&&n[h.__c],w=h?m?m.props.value:h.__:n,o.__c?y=(c=e.__c=o.__c).__=c.__E:("prototype"in H&&H.prototype.render?e.__c=c=new H(g,w):(e.__c=c=new S(g,w),c.constructor=H,c.render=U),m&&m.sub(c),c.props=g,c.state||(c.state={}),c.context=w,c.__n=n,u=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=H.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=v({},c.__s)),v(c.__s,H.getDerivedStateFromProps(g,c.__s))),d=c.props,_=c.state,c.__v=e,u)null==H.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==H.getDerivedStateFromProps&&g!==d&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,w),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,w)||e.__v===o.__v){for(e.__v!==o.__v&&(c.props=g,c.state=c.__s,c.__d=!1),c.__e=!1,e.__e=o.__e,e.__k=o.__k,e.__k.forEach((function(t){t&&(t.__=e)})),x=0;x<c._sb.length;x++)c.__h.push(c._sb[x]);c._sb=[],c.__h.length&&l.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,w),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(d,_,f)}))}if(c.context=w,c.props=g,c.__P=t,C=a.__r,T=0,"prototype"in H&&H.prototype.render){for(c.state=c.__s,c.__d=!1,C&&C(e),h=c.render(c.props,c.state,c.context),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[]}else do{c.__d=!1,C&&C(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++T<25);c.state=c.__s,null!=c.getChildContext&&(n=v(v({},n),c.getChildContext())),u||null==c.getSnapshotBeforeUpdate||(f=c.getSnapshotBeforeUpdate(d,_)),A(t,b(W=null!=h&&h.type===k&&null==h.key?h.props.children:h)?W:[W],e,o,n,i,r,l,s,p),c.base=e.__e,e.__h=null,c.__h.length&&l.push(c),y&&(c.__E=c.__=null),c.__e=!1}else null==r&&e.__v===o.__v?(e.__k=o.__k,e.__e=o.__e):e.__e=z(o.__e,e,o,n,i,r,l,p);(h=a.diffed)&&h(e)}catch(t){e.__v=null,(p||null!=r)&&(e.__e=s,e.__h=!!p,r[r.indexOf(s)]=null),a.__e(t,e,o)}}function j(t,e){a.__c&&a.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){a.__e(t,e.__v)}}))}function z(t,e,o,n,i,r,l,s){var p,a,c,u=o.props,d=e.props,_=e.type,f=0;if("svg"===_&&(i=!0),null!=r)for(;f<r.length;f++)if((p=r[f])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){t=p,r[f]=null;break}if(null==t){if(null===_)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),r=null,s=!1}if(null===_)u===d||s&&t.data===d||(t.data=d);else{if(r=r&&h.call(t.childNodes),a=(u=o.props||y).dangerouslySetInnerHTML,c=d.dangerouslySetInnerHTML,!s){if(null!=r)for(u={},f=0;f<t.attributes.length;f++)u[t.attributes[f].name]=t.attributes[f].value;(c||a)&&(c&&(a&&c.__html==a.__html||c.__html===t.innerHTML)||(t.innerHTML=c&&c.__html||""))}if(function(t,e,o,n,i){var r;for(r in o)"children"===r||"key"===r||r in e||L(t,r,null,o[r],n);for(r in e)i&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||o[r]===e[r]||L(t,r,e[r],o[r],n)}(t,d,u,i,s),c)e.__k=[];else if(A(t,b(f=e.props.children)?f:[f],e,o,n,i&&"foreignObject"!==_,r,l,r?r[0]:o.__k&&T(o,0),s),null!=r)for(f=r.length;f--;)null!=r[f]&&w(r[f]);s||("value"in d&&void 0!==(f=d.value)&&(f!==t.value||"progress"===_&&!f||"option"===_&&f!==u.value)&&L(t,"value",f,u.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==t.checked&&L(t,"checked",f,u.checked,!1))}return t}function O(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){a.__e(t,o)}}function I(t,e,o){var n,i;if(a.unmount&&a.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||O(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){a.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&I(n[i],e,o||"function"!=typeof t.type);o||null==t.__e||w(t.__e),t.__=t.__e=t.__d=void 0}function U(t,e,o){return this.constructor(t,o)}h=g.slice,a={__e:function(t,e,o,n){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),l=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,n||{}),l=i.__d),l)return i.__E=i}catch(e){t=e}throw t}},c=0,S.prototype.setState=function(t,e){var o;o=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},o),this.props)),t&&v(o,t),null!=t&&this.__v&&(e&&this._sb.push(e),W(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),W(this))},S.prototype.render=k,u=[],_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(t,e){return t.__v.__b-e.__v.__b},H.__r=0;var V,q,G,$=[],J=[],K=a.__b,X=a.__r,Q=a.diffed,Y=a.__c,Z=a.unmount;function tt(){for(var t;t=$.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(nt),t.__H.__h.forEach(it),t.__H.__h=[]}catch(e){t.__H.__h=[],a.__e(e,t.__v)}}a.__b=function(t){V=null,K&&K(t)},a.__r=function(t){X&&X(t);var e=(V=t.__c).__H;e&&(q===V?(e.__h=[],V.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=J,t.__N=t.i=void 0}))):(e.__h.forEach(nt),e.__h.forEach(it),e.__h=[])),q=V},a.diffed=function(t){Q&&Q(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==$.push(e)&&G===a.requestAnimationFrame||((G=a.requestAnimationFrame)||ot)(tt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==J&&(t.__=t.__V),t.i=void 0,t.__V=J}))),q=V=null},a.__c=function(t,e){e.some((function(t){try{t.__h.forEach(nt),t.__h=t.__h.filter((function(t){return!t.__||it(t)}))}catch(o){e.some((function(t){t.__h&&(t.__h=[])})),e=[],a.__e(o,t.__v)}})),Y&&Y(t,e)},a.unmount=function(t){Z&&Z(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.forEach((function(t){try{nt(t)}catch(t){e=t}})),o.__H=void 0,e&&a.__e(e,o.__v))};var et="function"==typeof requestAnimationFrame;function ot(t){var e,o=function(){clearTimeout(n),et&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,100);et&&(e=requestAnimationFrame(o))}function nt(t){var e=V,o=t.__c;"function"==typeof o&&(t.__c=void 0,o()),V=e}function it(t){var e=V;t.__c=t.__(),V=e}var rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.jsxRender=function(t,e){this.rootNode=function(t,e,o){var n,i,r;a.__&&a.__(t,e),i=(n="function"==typeof o)?null:o&&o.__k||e.__k,r=[],D(e,t=(!n&&o||e).__k=x(k,null,[t]),i||y,y,void 0!==e.ownerSVGElement,!n&&o?[o]:i?null:e.firstChild?h.call(e.childNodes):null,r,!n&&o?o:i?i.__e:e.firstChild,n),j(r,t)}(t,e,this.rootNode)},e.Component=S,e.createElement=x,e}(e.HTMLWidget);rt.prototype._class+=" html_JSXWidget";var lt=function(){function t(t,e){this._attrs=t,this._children=e}return t.prototype.type=function(){return"div"},t.prototype.attrs=function(){return this._attrs},t.prototype.attr=function(t){return this._attrs[t]},t.prototype.children=function(){return this._children},t.prototype.update=function(t){for(var e in this._attrs)t.attr(e,this._attrs[e])},t.prototype.render=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data([this]);return o.exit().remove(),o.enter().append(this.type()).attr("reactd3",0).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t.prototype.renderChildren=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data(this._children);return o.exit().remove(),o.enter().append((function(t){return document.createElement(t.type())})).attr("reactd3",(function(t,e){return e})).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t}(),st=function(t){function e(e,o,n){var i=t.call(this,o,n)||this;return i._type=e,i}return i(e,t),e.prototype.type=function(){return this._type},e}(lt),pt=function(t){function e(e){var o=t.call(this,{},[])||this;return o._text=e,o}return i(e,t),e.prototype.type=function(){return"span"},e.prototype.update=function(e){t.prototype.update.call(this,e),e.text(this._text)},e}(lt);var ht=function(){function t(){}return t.createElement=function(t,e){for(var o,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return(o=t).prototype&&o.prototype instanceof lt?new t(e):function(t){return"function"==typeof t}(t)?t(e):new st(t,e,n.map((function(t){return"string"==typeof t?new pt(t):t})))},t.render=function(t,e){t.render(e)},t}(),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=(new this.props.type).target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(rt.Component),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=this.props.instance.target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(rt.Component),ut=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return i(o,t),o.prototype.transformData=function(){var t=this,o=[["Total",0,0]],n=this.data();return n.forEach((function(t){o[0][1]+=t[1],o[0][2]+=t[2]})),n.concat(o).map((function(o){return[o[0],t.secondColumnFormat_exists()?e.format(t.secondColumnFormat())(o[1]):o[1],t.thirdColumnFormat_exists()?e.format(t.thirdColumnFormat())(o[2]):o[2]]}))},o.prototype.update=function(e,o){this.tbodyColumnStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left"},{width:this.secondColumnWidth(),"text-align":"right"},{width:this.thirdColumnWidth(),"text-align":"right"}]),this.evenRowStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.secondColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.thirdColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()}]),this.lastRowStyles_default({"font-weight":"bold"}),t.prototype.update.call(this,e,o)},o}(s);ut.prototype._class+=" html_StatsTable",ut.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),ut.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),ut.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),ut.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),ut.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),ut.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),ut.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),ut.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),ut.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),ut.prototype.publish("thirdColumnFormat",null,"string","d3-format specifier applied to the third column's values",void 0,{optional:!0});!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("#wrap{width:100%}#left,#right{padding:5px}#left{background-color:red;display:block;overflow:hidden;text-align:left;text-overflow:ellipsis}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{display:block;width:100%}.html_TitleBar .title{display:block;font-size:20px;font-weight:700;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.html_TitleBar .icon-bar{float:right;line-height:28px;padding:4px;text-align:right;white-space:nowrap}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{color:#a9a9a9;padding-bottom:4px;padding-top:4px;text-align:center;transition:all .3s ease}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{color:none;padding-bottom:0;padding-left:8px;padding-top:2px;text-align:center}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}");var dt=function(t){function e(e){var o=t.call(this)||this;return o._owner=e,o._tag="a",o}return i(e,t),e}(e.HTMLWidget),_t=function(t){function e(e,o){var n=t.call(this,e)||this;return n._icon=o,n}return i(e,t),e.prototype.icon=function(){return this._icon},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),o.attr("href","#").on("click",(function(t,e,o){return n._owner.titleBarClick(n,t,e,o)})).append("i").attr("class","fa ".concat(this._icon," fa-lg fa-fw"))},e}(dt),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){var n=this;o.on("click.sel",(function(t,e,o){n.selected(!n.selected()),n.render()})),t.prototype.enter.call(this,e,o)},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._element.classed("selected",this.selected())},e}(_t);ft.prototype.publish("selected",!1,"boolean");var yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),o.attr("class","spacer").attr("href","#").append("i")},e}(dt),gt=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._divMain=o.append("div").attr("class","main"),this._divIconBar=this._divMain.append("div").attr("class","icon-bar"),this._divTitle=this._divMain.append("div").attr("class","title")},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._divTitle.text(this.title());var n=this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());n.enter().append("div").attr("class","icon-bar-item").each((function(t){t.target(this)})).merge(n).each((function(t){t.render()})),n.exit().each((function(t){t.target(null)})).remove(),n.order()},e}(rt);gt.prototype._class+=" html_TitleBar",gt.prototype.publish("title","","string"),gt.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.104.28",t.BreakdownTable=p,t.Button=_t,t.HTMLTooltip=r,t.Item=dt,t.JSXWidget=rt,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.42.12",t.ReactD3=ht,t.SimpleTable=l,t.Spacer=yt,t.StatsTable=ut,t.StyledTable=s,t.TitleBar=gt,t.ToggleButton=ft,t.VNode=lt,t.VizComponent=at,t.VizInstance=ct,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/html"]={},t["@hpcc-js/common"],t["@hpcc-js/util"])}(this,(function(t,e,o){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},n(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}"function"==typeof SuppressedError&&SuppressedError;var r=function(t){function n(){var e=t.call(this)||this;return e._tooltipHTMLCallback=function(t){return"<b>_tooltipHTMLCallback is undefined</b>"},e._logger=o.scopedLogger("html/HTMLTooltip"),e._closing=!1,e.visible(!1),e}return i(n,t),n.prototype.tooltipHTML=function(t){return this._tooltipHTMLCallback=t,this},n.prototype.tooltipContent=function(t){return arguments.length?(this._contentNode=t,this):this._contentNode},n.prototype.triggerElement=function(t){return this._triggerElement=t,this},n.prototype.enter=function(o,n){t.prototype.enter.call(this,o,n);var i=e.select("body");this._tooltipElement=i.append("div").attr("class","tooltip-div").style("z-index","2147483638").style("position","fixed"),this._arrowElement=i.append("div").attr("class","arrow-div").style("z-index","2147483638").style("position","fixed")},n.prototype.update=function(e,o){var n=this;if(t.prototype.update.call(this,e,o),this._contentNode!==this._prevContentNode){var i=this._tooltipElement.node();(function(t,e,o){if(o||2===arguments.length)for(var n,i=0,r=e.length;i<r;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))})([],i.querySelectorAll("*"),!0).map((function(t){return t.__data__})).filter((function(t){return t})).forEach((function(t){"function"==typeof t.target&&t.target(null),"function"==typeof t.exit&&t.exit()})),i.innerHTML="",i.appendChild(this._contentNode),this._prevContentNode=this._contentNode}if(this._contentNode?this.onShowContent(this._contentNode):this._tooltipElement.html((function(){return n._tooltipHTMLCallback(n.data())})),this.fitContent()){this._tooltipElement.style("width","auto").style("height","auto").style("padding","0px").style("box-sizing","content-box");var r=this._tooltipElement.node().getBoundingClientRect();this.tooltipWidth_default(r.width),this.tooltipHeight_default(r.height)}this._closing=!1,this._tooltipElement.style("background-color",this.tooltipColor()).style("color",this.fontColor()).style("width",this.tooltipWidth()+"px").style("height",this.tooltipHeight()+"px").style("opacity",1).style("padding",this.padding()+"px").style("pointer-events",this.enablePointerEvents()?"all":"none").style("box-sizing","content-box"),this._arrowElement.style("opacity",1).style("pointer-events","none"),this.updateTooltipPosition()},n.prototype.onShowContent=function(t){},n.prototype.updateTooltipPosition=function(){var t=this.calcReferenceBBox(),e=this.calcTooltipDirection(t),o=t[e];return this._tooltipElement.style("top",o.y+"px").style("left",o.x+"px"),this.setArrowPosition(o,e),o},n.prototype.calcTooltipDirection=function(t){var e=Object.keys(t),o=this.direction();e.sort((function(t,e){return t===o?-1:1}));for(var n={top:0,left:0,width:window.innerWidth,height:window.innerHeight},i=0;i<e.length;i++){var r={top:t[e[i]].y,left:t[e[i]].x,width:this.tooltipWidth(),height:this.tooltipHeight()};if(this.rectFits(r,n))return e[i]}return this._logger.warning("Tooltip doesn't fit in the window for any of the directions. Defaulting to '".concat(o,"'")),this._logger.debug(n),this._logger.debug({top:t[o].y,left:t[o].x,width:this.tooltipWidth(),height:this.tooltipHeight()}),o},n.prototype.rectFits=function(t,e){return t.top>=e.top&&t.left>=e.left&&t.width+t.left<=e.width+e.left&&t.height+t.top<=e.height+e.top},n.prototype.setArrowPosition=function(t,e){var o,n,i="border-top-color";switch(this._arrowElement.style("border","".concat(this.arrowHeight(),"px solid ").concat(this.tooltipColor())).style("border-top-color","transparent").style("border-right-color","transparent").style("border-bottom-color","transparent").style("border-left-color","transparent"),e){case"n":o=t.y+this.tooltipHeight()+2*this.padding(),n=t.x+this.tooltipWidth()/2-this.arrowWidth()/2+this.padding(),i="border-top-color",this._arrowElement.style("border-top-width","".concat(this.arrowHeight(),"px")).style("border-bottom-width","0px").style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"s":o=t.y-this.arrowHeight(),n=t.x+this.padding()+this.tooltipWidth()/2-this.arrowWidth()/2,i="border-bottom-color",this._arrowElement.style("border-top-width","0px").style("border-bottom-width","".concat(this.arrowHeight(),"px")).style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"e":o=t.y+this.tooltipHeight()/2+this.padding()-this.arrowWidth()/2,n=t.x-this.arrowHeight(),i="border-right-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","0px").style("border-right-width","".concat(this.arrowHeight(),"px"));break;case"w":o=t.y+this.tooltipHeight()/2-this.arrowWidth()/2+this.padding(),n=t.x+this.tooltipWidth()+2*this.padding(),i="border-left-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","".concat(this.arrowHeight(),"px")).style("border-right-width","0px")}return void 0!==o&&void 0!==n?this._arrowElement.style("top",o+"px").style("left",n+"px").style(i,this.tooltipColor()).style("opacity",1):this._arrowElement.style("opacity",0),t},n.prototype.getReferenceNode=function(){return this._triggerElement?this._triggerElement.node():this.element().node().parentNode.parentNode},n.prototype.calcReferenceBBox=function(){var t=this.getReferenceNode().getBoundingClientRect(),e=t.top,o=t.left,n=t.width,i=t.height,r=this.tooltipWidth(),l=this.tooltipHeight(),s=r/2,p=l/2,a=this.arrowHeight(),h=this.padding(),c=2*h;return this.followCursor()&&this._cursorLoc&&(o=this._cursorLoc[0],e=this._cursorLoc[1],n=1,i=1),{n:{x:o+n/2-s-h,y:e-l-a-c},e:{x:o+n+a,y:e+i/2-p-h},s:{x:o+n/2-s-h,y:e+i+a},w:{x:o-r-a-c,y:e+i/2-p-h},nw:{x:o-r-c,y:e-l-c},ne:{x:o+n,y:e-l-c},se:{x:o+n,y:e+i},sw:{x:o-r-c,y:e+i}}},n.prototype.mouseout=function(){var t=this;this._closing=!0,this._tooltipElement.on("mouseover",(function(){t._closing=!1})),this._tooltipElement.on("mouseout",(function(){t.mouseout()})),setTimeout((function(){t._closing&&t.visible(!1)}),this.closeDelay())},n.prototype.visible=function(e){return arguments.length?(this._arrowElement&&(this._arrowElement.style("visibility",e?"visible":"hidden"),this._tooltipElement.style("visibility",e?"visible":"hidden")),t.prototype.visible.call(this,e),this):t.prototype.visible.call(this)},n.prototype.exit=function(e,o){this._arrowElement&&(this._arrowElement.remove(),this._tooltipElement.remove()),t.prototype.exit.call(this,e,o)},n}(e.HTMLWidget);r.prototype._class+=" html_HTMLTooltip",r.prototype.publish("fitContent",!1,"boolean","If true, tooltip will grow to fit its html content"),r.prototype.publish("followCursor",!1,"boolean","If true, tooltip will display relative to cursor location"),r.prototype.publish("closeDelay",400,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),r.prototype.publish("direction","n","set","Direction in which to display the tooltip",["n","s","e","w","ne","nw","se","sw"]),r.prototype.publish("padding",8,"number","Padding (pixels)"),r.prototype.publish("arrowWidth",16,"number","Width (or height depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("arrowHeight",8,"number","Height (or width depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("fontColor","#FFF","html-color","The default font color for text in the tooltip"),r.prototype.publish("tooltipColor","#000000EE","html-color","Background color of the tooltip"),r.prototype.publish("tooltipWidth",200,"number","Width of the tooltip (not including arrow) (pixels)"),r.prototype.publish("tooltipHeight",200,"number","Height of the tooltip (not including arrow) (pixels)"),r.prototype.publish("enablePointerEvents",!1,"boolean","If true, the 'pointer-events: all' style will be used");var l=function(t){function o(){return t.call(this)||this}return i(o,t),o.prototype.transformData=function(){return this.data()},o.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._table=o.append("table"),this._thead=this._table.append("thead"),this._theadRow=this._thead.append("tr"),this._tbody=this._table.append("tbody")},o.prototype.update=function(o,n){t.prototype.update.call(this,o,n),this._table.style("width",this.autoWidth()?"auto":"100%");var i=this._theadRow.selectAll("th").data(this.columns());i.enter().append("th").attr("class",(function(t,e){return"th-".concat(e)})).merge(i).text((function(t){return t.toString()})),i.exit().remove();var r=this._tbody.selectAll("tr").data(this.transformData());r.enter().append("tr").merge(r).each((function(t){var o=e.select(this).selectAll("td").data(t);o.enter().append("td").attr("class",(function(t,e){return"col-".concat(e)})).merge(o).text((function(t){return t.toString()})),o.exit().remove()})),r.exit().remove()},o}(e.HTMLWidget);l.prototype._class+=" html_SimpleTable",l.prototype.publish("autoWidth",!1,"boolean","If true, table width will be set to 'auto'. If false, the width is set to '100%'");var s=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.applyStyleObject=function(t,e){Object.keys(e).forEach((function(o){t.style(o,e[o])}))},e.prototype.update=function(e,o){var n=this;t.prototype.update.call(this,e,o),o.selectAll("tr,th,td").attr("style","").style("font-family",this.fontFamily()).style("color",this.fontColor()),this.theadColumnStyles().forEach((function(t,e){n.applyStyleObject(o.select(".th-".concat(e)),t)})),this.tbodyColumnStyles().forEach((function(t,e){n.applyStyleObject(o.selectAll(".col-".concat(e)),t)}));var i=Object.keys(this.evenRowStyles()).length>0,r=Object.keys(this.lastRowStyles()).length>0,l=o.selectAll("tbody > tr");if(i){var s=l.select((function(t,e){return e%2?this:null}));this.applyStyleObject(s,this.evenRowStyles())}if(r){var p=l.select((function(t,e,o){return e===o.length-1?this:null}));this.applyStyleObject(p,this.lastRowStyles())}},e}(l);s.prototype._class+=" html_StyledTable",s.prototype.publish("fontFamily","Verdana","string","Base font-family used within the table"),s.prototype.publish("fontColor","#333","string","Base font color used within the table"),s.prototype.publish("theadColumnStyles",[],"array",'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("tbodyColumnStyles",[],"array",'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("lastRowStyles",{},"object",'Object containing styles for the last row (ex: {"color":"red"})'),s.prototype.publish("evenRowStyles",{},"object",'Object containing styles for even rows (ex: {"background-color":"#AAA"})');var p=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.transformData=function(){var t=this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount();return this.breakdownData(t)},e.prototype.breakdownData=function(t){var e=this.data().length,o=this.data().reduce((function(t,e){return t+e[1]}),0),n=[],i=0;this.data().sort((function(t,e){return t[1]>e[1]?-1:1}));var r=e-t>0;if(this.data().filter((function(e,o){return!r||o<t-1})).forEach((function(t){var e=Math.round(t[1]/o*100);i+=e,n.push([t[0],e+"%"])})),r){var l="".concat(this.otherLabel()," (").concat(e-t+1,")"),s="~"+(100-i)+"%";n.push([l,s])}return n},e.prototype.calculateRowCount=function(){var t=this.columns().length>0?this.thFontSize()+5:0,e=this.fontSize()+5,o=this.height()-t;return Math.floor(o/e)},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),this._tooltip=(new r).target(e),this._tooltip.tooltipHTML((function(t){var e=n.useCalculatedRowCount()?n.calculateRowCount():n.rowCount(),o=n.fontSize(),i=Math.max.apply(Math,t.map((function(t){return n.textSize(t[0],"Verdana",n.fontSize()).width}))),r=2*(i+30)+2*n._tooltip.padding(),l=o*Math.ceil((t.length-e)/2)+2*n._tooltip.padding();n._tooltip.tooltipWidth(r),n._tooltip.tooltipHeight(l);var s=n.breakdownData(n.data().length).slice(e-1);return'<div style="\n width: 100%;\n height: 100%;\n font-size: '.concat(n.fontSize(),'px\n ">').concat(s.map((function(t){return'<div style="\n float:left;\n width:'.concat(Math.floor(49.5),'%;\n ">').concat(t[0],": ").concat(t[1],"</div>")})).join(""),"</div>")}))},e.prototype.update=function(e,o){if(this.theadColumnStyles_default([{color:this.thFirstColor(),"font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.labelAlignment(),width:"auto",padding:"0px"},{width:"1%","font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.percentageAlignment(),padding:"0px"}]),this.tbodyColumnStyles_default([{color:this.topLabelColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.topPercentageColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),this.lastRowStyles_default([{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherLabelBold()?"bold":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherPercentageBold()?"bold":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),t.prototype.update.call(this,e,o),(this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount())<this.data().length){var n=o.select("tbody > tr:last-child"),i=this;n.on("mouseout.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.visible(!1).render()})).on("mouseenter.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.direction("n").data(i.data()).visible(!0).render()}))}},e}(s);p.prototype._class+=" html_BreakdownTable",p.prototype.publish("useCalculatedRowCount",!0,"boolean","If true, rowCount will be calculated and its default will be overwritten"),p.prototype.publish("rowCount",5,"number","Number of total rows to display (including the 'other' row)",void 0,{disable:function(t){return t.useCalculatedRowCount()}}),p.prototype.publish("fontSize",14,"number","Font size (pixels)"),p.prototype.publish("labelAlignment","left","set","Alignment of the label column text",["left","center","right"]),p.prototype.publish("percentageAlignment","center","set","Alignment of the percentage column text",["left","center","right"]),p.prototype.publish("topLabelColor","#333","html-color","Color of displayed 'top' labels"),p.prototype.publish("topPercentageColor","#1A99D5","html-color","Color of displayed 'top' percentages"),p.prototype.publish("topPercentageBold",!0,"html-color","If true, the 'top' percentages will be bold"),p.prototype.publish("otherLabel","Other","string","Label text for the 'other' row"),p.prototype.publish("otherLabelColor","#AAA","html-color","Color of the 'other' label"),p.prototype.publish("otherLabelBold",!1,"html-color","If true, the 'other' label will be bold"),p.prototype.publish("otherPercentageColor","#AAA","html-color","Color of the 'other' percentage"),p.prototype.publish("otherPercentageBold",!1,"html-color","If true, the 'other' percentage will be bold"),p.prototype.publish("thFontWeight","bold","string","Font weight for th elements"),p.prototype.publish("thFontSize",26,"number","Font size for th elements"),p.prototype.publish("thFirstColor","#333","html-color","Text color of the first th element"),p.prototype.publish("thLastColor","#333","html-color","Text color of the last th element");var a,h,c,u,d,_,f,y={},g=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function v(t,e){for(var o in e)t[o]=e[o];return t}function w(t){var e=t.parentNode;e&&e.removeChild(t)}function x(t,e,o){var n,i,r,l={};for(r in e)"key"==r?n=e[r]:"ref"==r?i=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?a.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===l[r]&&(l[r]=t.defaultProps[r]);return C(t,l,n,i,null)}function C(t,e,o,n,i){var r={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++c:i};return null==i&&null!=h.vnode&&h.vnode(r),r}function k(t){return t.children}function S(t,e){this.props=t,this.context=e}function E(t,e){if(null==e)return t.__?E(t.__,t.__.__k.indexOf(t)+1):null;for(var o;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e)return o.__d||o.__e;return"function"==typeof t.type?E(t):null}function T(t){var e,o;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e){t.__e=t.__c.base=o.__e;break}return T(t)}}function W(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!H.__r++||d!==h.debounceRendering)&&((d=h.debounceRendering)||_)(H)}function H(){var t,e,o,n,i,r,l,s,p;for(u.sort(f);t=u.shift();)t.__d&&(e=u.length,n=void 0,i=void 0,r=void 0,s=(l=(o=t).__v).__e,(p=o.__P)&&(n=[],i=[],(r=v({},l)).__v=l.__v+1,D(p,l,r,o.__n,void 0!==p.ownerSVGElement,null!=l.__h?[s]:null,n,null==s?E(l):s,l.__h,i),j(n,l,i),l.__e!=s&&T(l)),u.length>e&&u.sort(f));H.__r=0}function A(t,e,o,n,i,r,l,s,p,a,h){var c,u,d,_,f,m,v,w,x,S=0,T=n&&n.__k||g,W=T.length,H=W,A=e.length;for(o.__k=[],c=0;c<A;c++)null!=(_=o.__k[c]=null==(_=e[c])||"boolean"==typeof _||"function"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?C(null,_,null,null,_):b(_)?C(k,{children:_},null,null,null):_.__b>0?C(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)?(_.__=o,_.__b=o.__b+1,-1===(w=R(_,T,v=c+S,H))?d=y:(d=T[w]||y,T[w]=void 0,H--),D(t,_,d,i,r,l,s,p,a,h),f=_.__e,(u=_.ref)&&d.ref!=u&&(d.ref&&O(d.ref,null,_),h.push(u,_.__c||f,_)),null!=f&&(null==m&&(m=f),(x=d===y||null===d.__v)?-1==w&&S--:w!==v&&(w===v+1?S++:w>v?H>A-v?S+=w-v:S--:S=w<v&&w==v-1?w-v:0),v=c+S,"function"!=typeof _.type||w===v&&d.__k!==_.__k?"function"==typeof _.type||w===v&&!x?void 0!==_.__d?(p=_.__d,_.__d=void 0):p=f.nextSibling:p=P(t,f,p):p=B(_,p,t),"function"==typeof o.type&&(o.__d=p))):(d=T[c])&&null==d.key&&d.__e&&(d.__e==p&&(d.__=n,p=E(d)),I(d,d,!1),T[c]=null);for(o.__e=m,c=W;c--;)null!=T[c]&&("function"==typeof o.type&&null!=T[c].__e&&T[c].__e==o.__d&&(o.__d=T[c].__e.nextSibling),I(T[c],T[c]))}function B(t,e,o){for(var n,i=t.__k,r=0;i&&r<i.length;r++)(n=i[r])&&(n.__=t,e="function"==typeof n.type?B(n,e,o):P(o,n.__e,e));return e}function P(t,e,o){return null==o||o.parentNode!==t?t.insertBefore(e,null):e==o&&null!=e.parentNode||t.insertBefore(e,o),e.nextSibling}function R(t,e,o,n){var i=t.key,r=t.type,l=o-1,s=o+1,p=e[o];if(null===p||p&&i==p.key&&r===p.type)return o;if(n>(null!=p?1:0))for(;l>=0||s<e.length;){if(l>=0){if((p=e[l])&&i==p.key&&r===p.type)return l;l--}if(s<e.length){if((p=e[s])&&i==p.key&&r===p.type)return s;s++}}return-1}function F(t,e,o){"-"===e[0]?t.setProperty(e,null==o?"":o):t[e]=null==o?"":"number"!=typeof o||m.test(e)?o:o+"px"}function L(t,e,o,n,i){var r;t:if("style"===e)if("string"==typeof o)t.style.cssText=o;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)o&&e in o||F(t.style,e,"");if(o)for(e in o)n&&o[e]===n[e]||F(t.style,e,o[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?n?o.u=n.u:(o.u=Date.now(),t.addEventListener(e,r?M:N,r)):t.removeEventListener(e,r?M:N,r);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==o?"":o;break t}catch(t){}"function"==typeof o||(null==o||!1===o&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,o))}}function N(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(h.event?h.event(t):t)}function M(t){return this.l[t.type+!0](h.event?h.event(t):t)}function D(t,e,o,n,i,r,l,s,p,a){var c,u,d,_,f,y,g,m,w,x,C,E,T,W,H,B=e.type;if(void 0!==e.constructor)return null;null!=o.__h&&(p=o.__h,s=e.__e=o.__e,e.__h=null,r=[s]),(c=h.__b)&&c(e);t:if("function"==typeof B)try{if(m=e.props,w=(c=B.contextType)&&n[c.__c],x=c?w?w.props.value:c.__:n,o.__c?g=(u=e.__c=o.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B(m,x):(e.__c=u=new S(m,x),u.constructor=B,u.render=U),w&&w.sub(u),u.props=m,u.state||(u.state={}),u.context=x,u.__n=n,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=B.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=v({},u.__s)),v(u.__s,B.getDerivedStateFromProps(m,u.__s))),_=u.props,f=u.state,u.__v=e,d)null==B.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==B.getDerivedStateFromProps&&m!==_&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)||e.__v===o.__v)){for(e.__v!==o.__v&&(u.props=m,u.state=u.__s,u.__d=!1),e.__e=o.__e,e.__k=o.__k,e.__k.forEach((function(t){t&&(t.__=e)})),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&l.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(_,f,y)}))}if(u.context=x,u.props=m,u.__P=t,u.__e=!1,E=h.__r,T=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,E&&E(e),c=u.render(u.props,u.state,u.context),W=0;W<u._sb.length;W++)u.__h.push(u._sb[W]);u._sb=[]}else do{u.__d=!1,E&&E(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++T<25);u.state=u.__s,null!=u.getChildContext&&(n=v(v({},n),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(y=u.getSnapshotBeforeUpdate(_,f)),A(t,b(H=null!=c&&c.type===k&&null==c.key?c.props.children:c)?H:[H],e,o,n,i,r,l,s,p,a),u.base=e.__e,e.__h=null,u.__h.length&&l.push(u),g&&(u.__E=u.__=null)}catch(t){e.__v=null,(p||null!=r)&&(e.__e=s,e.__h=!!p,r[r.indexOf(s)]=null),h.__e(t,e,o)}else null==r&&e.__v===o.__v?(e.__k=o.__k,e.__e=o.__e):e.__e=z(o.__e,e,o,n,i,r,l,p,a);(c=h.diffed)&&c(e)}function j(t,e,o){for(var n=0;n<o.length;n++)O(o[n],o[++n],o[++n]);h.__c&&h.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){h.__e(t,e.__v)}}))}function z(t,e,o,n,i,r,l,s,p){var h,c,u,d=o.props,_=e.props,f=e.type,g=0;if("svg"===f&&(i=!0),null!=r)for(;g<r.length;g++)if((h=r[g])&&"setAttribute"in h==!!f&&(f?h.localName===f:3===h.nodeType)){t=h,r[g]=null;break}if(null==t){if(null===f)return document.createTextNode(_);t=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,_.is&&_),r=null,s=!1}if(null===f)d===_||s&&t.data===_||(t.data=_);else{if(r=r&&a.call(t.childNodes),c=(d=o.props||y).dangerouslySetInnerHTML,u=_.dangerouslySetInnerHTML,!s){if(null!=r)for(d={},g=0;g<t.attributes.length;g++)d[t.attributes[g].name]=t.attributes[g].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(function(t,e,o,n,i){var r;for(r in o)"children"===r||"key"===r||r in e||L(t,r,null,o[r],n);for(r in e)i&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||o[r]===e[r]||L(t,r,e[r],o[r],n)}(t,_,d,i,s),u)e.__k=[];else if(A(t,b(g=e.props.children)?g:[g],e,o,n,i&&"foreignObject"!==f,r,l,r?r[0]:o.__k&&E(o,0),s,p),null!=r)for(g=r.length;g--;)null!=r[g]&&w(r[g]);s||("value"in _&&void 0!==(g=_.value)&&(g!==t.value||"progress"===f&&!g||"option"===f&&g!==d.value)&&L(t,"value",g,d.value,!1),"checked"in _&&void 0!==(g=_.checked)&&g!==t.checked&&L(t,"checked",g,d.checked,!1))}return t}function O(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){h.__e(t,o)}}function I(t,e,o){var n,i;if(h.unmount&&h.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||O(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){h.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&I(n[i],e,o||"function"!=typeof t.type);o||null==t.__e||w(t.__e),t.__=t.__e=t.__d=void 0}function U(t,e,o){return this.constructor(t,o)}a=g.slice,h={__e:function(t,e,o,n){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),l=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,n||{}),l=i.__d),l)return i.__E=i}catch(e){t=e}throw t}},c=0,S.prototype.setState=function(t,e){var o;o=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},o),this.props)),t&&v(o,t),null!=t&&this.__v&&(e&&this._sb.push(e),W(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),W(this))},S.prototype.render=k,u=[],_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(t,e){return t.__v.__b-e.__v.__b},H.__r=0;var V,q,$,G=[],J=[],K=h.__b,X=h.__r,Q=h.diffed,Y=h.__c,Z=h.unmount;function tt(){for(var t;t=G.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(nt),t.__H.__h.forEach(it),t.__H.__h=[]}catch(e){t.__H.__h=[],h.__e(e,t.__v)}}h.__b=function(t){V=null,K&&K(t)},h.__r=function(t){X&&X(t);var e=(V=t.__c).__H;e&&(q===V?(e.__h=[],V.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=J,t.__N=t.i=void 0}))):(e.__h.forEach(nt),e.__h.forEach(it),e.__h=[])),q=V},h.diffed=function(t){Q&&Q(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==G.push(e)&&$===h.requestAnimationFrame||(($=h.requestAnimationFrame)||ot)(tt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==J&&(t.__=t.__V),t.i=void 0,t.__V=J}))),q=V=null},h.__c=function(t,e){e.some((function(t){try{t.__h.forEach(nt),t.__h=t.__h.filter((function(t){return!t.__||it(t)}))}catch(o){e.some((function(t){t.__h&&(t.__h=[])})),e=[],h.__e(o,t.__v)}})),Y&&Y(t,e)},h.unmount=function(t){Z&&Z(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.forEach((function(t){try{nt(t)}catch(t){e=t}})),o.__H=void 0,e&&h.__e(e,o.__v))};var et="function"==typeof requestAnimationFrame;function ot(t){var e,o=function(){clearTimeout(n),et&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,100);et&&(e=requestAnimationFrame(o))}function nt(t){var e=V,o=t.__c;"function"==typeof o&&(t.__c=void 0,o()),V=e}function it(t){var e=V;t.__c=t.__(),V=e}var rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.jsxRender=function(t,e){this.rootNode=function(t,e,o){var n,i,r,l;h.__&&h.__(t,e),i=(n="function"==typeof o)?null:o&&o.__k||e.__k,r=[],l=[],D(e,t=(!n&&o||e).__k=x(k,null,[t]),i||y,y,void 0!==e.ownerSVGElement,!n&&o?[o]:i?null:e.firstChild?a.call(e.childNodes):null,r,!n&&o?o:i?i.__e:e.firstChild,n,l),j(r,t,l)}(t,e,this.rootNode)},e.Component=S,e.createElement=x,e}(e.HTMLWidget);rt.prototype._class+=" html_JSXWidget";var lt=function(){function t(t,e){this._attrs=t,this._children=e}return t.prototype.type=function(){return"div"},t.prototype.attrs=function(){return this._attrs},t.prototype.attr=function(t){return this._attrs[t]},t.prototype.children=function(){return this._children},t.prototype.update=function(t){for(var e in this._attrs)t.attr(e,this._attrs[e])},t.prototype.render=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data([this]);return o.exit().remove(),o.enter().append(this.type()).attr("reactd3",0).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t.prototype.renderChildren=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data(this._children);return o.exit().remove(),o.enter().append((function(t){return document.createElement(t.type())})).attr("reactd3",(function(t,e){return e})).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t}(),st=function(t){function e(e,o,n){var i=t.call(this,o,n)||this;return i._type=e,i}return i(e,t),e.prototype.type=function(){return this._type},e}(lt),pt=function(t){function e(e){var o=t.call(this,{},[])||this;return o._text=e,o}return i(e,t),e.prototype.type=function(){return"span"},e.prototype.update=function(e){t.prototype.update.call(this,e),e.text(this._text)},e}(lt);var at=function(){function t(){}return t.createElement=function(t,e){for(var o,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return(o=t).prototype&&o.prototype instanceof lt?new t(e):function(t){return"function"==typeof t}(t)?t(e):new st(t,e,n.map((function(t){return"string"==typeof t?new pt(t):t})))},t.render=function(t,e){t.render(e)},t}(),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=(new this.props.type).target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(rt.Component),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=this.props.instance.target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(rt.Component),ut=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return i(o,t),o.prototype.transformData=function(){var t=this,o=[["Total",0,0]],n=this.data();return n.forEach((function(t){o[0][1]+=t[1],o[0][2]+=t[2]})),n.concat(o).map((function(o){return[o[0],t.secondColumnFormat_exists()?e.format(t.secondColumnFormat())(o[1]):o[1],t.thirdColumnFormat_exists()?e.format(t.thirdColumnFormat())(o[2]):o[2]]}))},o.prototype.update=function(e,o){this.tbodyColumnStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left"},{width:this.secondColumnWidth(),"text-align":"right"},{width:this.thirdColumnWidth(),"text-align":"right"}]),this.evenRowStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.secondColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.thirdColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()}]),this.lastRowStyles_default({"font-weight":"bold"}),t.prototype.update.call(this,e,o)},o}(s);ut.prototype._class+=" html_StatsTable",ut.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),ut.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),ut.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),ut.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),ut.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),ut.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),ut.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),ut.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),ut.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),ut.prototype.publish("thirdColumnFormat",null,"string","d3-format specifier applied to the third column's values",void 0,{optional:!0});!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("#wrap{width:100%}#left,#right{padding:5px}#left{background-color:red;display:block;overflow:hidden;text-align:left;text-overflow:ellipsis}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{display:block;width:100%}.html_TitleBar .title{display:block;font-size:20px;font-weight:700;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.html_TitleBar .icon-bar{float:right;line-height:28px;padding:4px;text-align:right;white-space:nowrap}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{color:#a9a9a9;padding-bottom:4px;padding-top:4px;text-align:center;transition:all .3s ease}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{color:none;padding-bottom:0;padding-left:8px;padding-top:2px;text-align:center}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}");var dt=function(t){function e(e){var o=t.call(this)||this;return o._owner=e,o._tag="a",o}return i(e,t),e}(e.HTMLWidget),_t=function(t){function e(e,o){var n=t.call(this,e)||this;return n._icon=o,n}return i(e,t),e.prototype.icon=function(){return this._icon},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),o.attr("href","#").on("click",(function(t,e,o){return n._owner.titleBarClick(n,t,e,o)})).append("i").attr("class","fa ".concat(this._icon," fa-lg fa-fw"))},e}(dt),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){var n=this;o.on("click.sel",(function(t,e,o){n.selected(!n.selected()),n.render()})),t.prototype.enter.call(this,e,o)},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._element.classed("selected",this.selected())},e}(_t);ft.prototype.publish("selected",!1,"boolean");var yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),o.attr("class","spacer").attr("href","#").append("i")},e}(dt),gt=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._divMain=o.append("div").attr("class","main"),this._divIconBar=this._divMain.append("div").attr("class","icon-bar"),this._divTitle=this._divMain.append("div").attr("class","title")},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._divTitle.text(this.title());var n=this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());n.enter().append("div").attr("class","icon-bar-item").each((function(t){t.target(this)})).merge(n).each((function(t){t.render()})),n.exit().each((function(t){t.target(null)})).remove(),n.order()},e}(rt);gt.prototype._class+=" html_TitleBar",gt.prototype.publish("title","","string"),gt.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.104.30",t.BreakdownTable=p,t.Button=_t,t.HTMLTooltip=r,t.Item=dt,t.JSXWidget=rt,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.42.13",t.ReactD3=at,t.SimpleTable=l,t.Spacer=yt,t.StatsTable=ut,t.StyledTable=s,t.TitleBar=gt,t.ToggleButton=ft,t.VNode=lt,t.VizComponent=ht,t.VizInstance=ct,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.min.js.map
{
"name": "@hpcc-js/html",
"version": "2.42.12",
"version": "2.42.13",
"description": "hpcc-js - Viz HTML",

@@ -41,5 +41,5 @@ "main": "dist/index.js",

"dependencies": {
"@hpcc-js/common": "^2.71.11",
"@hpcc-js/preact-shim": "^2.16.6",
"@hpcc-js/util": "^2.50.5"
"@hpcc-js/common": "^2.71.12",
"@hpcc-js/preact-shim": "^2.16.7",
"@hpcc-js/util": "^2.50.6"
},

@@ -50,3 +50,3 @@ "devDependencies": {

"d3-selection": "^1",
"tslib": "2.4.1"
"tslib": "2.6.2"
},

@@ -64,3 +64,3 @@ "repository": {

"homepage": "https://github.com/hpcc-systems/Visualization",
"gitHead": "69e26ec0934dcedd4a35f4639b248851d53d4bb5"
"gitHead": "da5c25f62dbf166f05e669efd3e74fe590f94c61"
}
export const PKG_NAME = "@hpcc-js/html";
export const PKG_VERSION = "2.42.12";
export const BUILD_VERSION = "2.104.28";
export const PKG_VERSION = "2.42.13";
export const BUILD_VERSION = "2.104.30";
export declare const PKG_NAME = "@hpcc-js/html";
export declare const PKG_VERSION = "2.42.12";
export declare const BUILD_VERSION = "2.104.28";
export declare const PKG_VERSION = "2.42.13";
export declare const BUILD_VERSION = "2.104.30";
//# sourceMappingURL=__package__.d.ts.map
export declare const PKG_NAME = "@hpcc-js/html";
export declare const PKG_VERSION = "2.42.12";
export declare const BUILD_VERSION = "2.104.28";
export declare const PKG_VERSION = "2.42.13";
export declare const BUILD_VERSION = "2.104.30";
//# sourceMappingURL=__package__.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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