UNPKG

@antv/t8

Version:

T8 is a text visualization solution for unstructured data within the AntV technology stack, and it is a declarative T8 markdown syntax that can be used to describe the content of data interpretation reports.

1 lines 57.8 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).T8={})}(this,function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};function r(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function o(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var i,a,l,u,c,s,_,p,f,h,d,v,m={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function x(t,e){for(var n in e)t[n]=e[n];return t}function k(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function w(t,e,n){var r,o,a,l={};for(a in e)"key"==a?r=e[a]:"ref"==a?o=e[a]:l[a]=e[a];if(arguments.length>2&&(l.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===l[a]&&(l[a]=t.defaultProps[a]);return T(t,l,r,o,null)}function T(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++l:o,__i:-1,__u:0};return null==o&&null!=a.vnode&&a.vnode(i),i}function E(t){return t.children}function M(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function P(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return P(t)}}function N(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!C.__r++||c!=a.debounceRendering)&&((c=a.debounceRendering)||s)(C)}function C(){for(var t,e,n,r,o,i,l,c=1;u.length;)u.length>c&&u.sort(_),t=u.shift(),c=u.length,t.__d&&(n=void 0,o=(r=(e=t).__v).__e,i=[],l=[],e.__P&&((n=x({},r)).__v=r.__v+1,a.vnode&&a.vnode(n),U(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?S(r):o,!!(32&r.__u),l),n.__v=r.__v,n.__.__k[n.__i]=n,I(i,n,l),n.__e!=o&&P(n)));C.__r=0}function H(t,e,n,r,o,i,a,l,u,c,s){var _,p,f,h,d,v,g,x=r&&r.__k||y,k=e.length;for(u=function(t,e,n,r,o){var i,a,l,u,c,s=n.length,_=s,p=0;for(t.__k=new Array(o),i=0;i<o;i++)null!=(a=e[i])&&"boolean"!=typeof a&&"function"!=typeof a?(u=i+p,(a=t.__k[i]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?T(null,a,null,null,null):b(a)?T(E,{children:a},null,null,null):null==a.constructor&&a.__b>0?T(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,l=null,-1!=(c=a.__i=D(a,n,u,_))&&(_--,(l=n[c])&&(l.__u|=2)),null==l||null==l.__v?(-1==c&&(o>s?p--:o<s&&p++),"function"!=typeof a.type&&(a.__u|=4)):c!=u&&(c==u-1?p--:c==u+1?p++:(c>u?p--:p++,a.__u|=4))):t.__k[i]=null;if(_)for(i=0;i<s;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==r&&(r=S(l)),V(l,l));return r}(n,e,x,u,k),_=0;_<k;_++)null!=(f=n.__k[_])&&(p=-1==f.__i?m:x[f.__i]||m,f.__i=_,v=U(t,f,p,o,i,a,l,u,c,s),h=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&z(p.ref,null,f),s.push(f.ref,f.__c||h,f)),null==d&&null!=h&&(d=h),(g=!!(4&f.__u))||p.__k===f.__k?u=A(f,u,t,g):"function"==typeof f.type&&void 0!==v?u=v:h&&(u=h.nextSibling),f.__u&=-7);return n.__e=d,u}function A(t,e,n,r){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=A(o[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=S(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function F(t,e){return e=e||[],null==t||"boolean"==typeof t||(b(t)?t.some(function(t){F(t,e)}):e.push(t)),e}function D(t,e,n,r){var o,i,a,l=t.key,u=t.type,c=e[n],s=null!=c&&!(2&c.__u);if(null===c&&null==t.key||s&&l==c.key&&u==c.type)return n;if(r>(s?1:0))for(o=n-1,i=n+1;o>=0||i<e.length;)if(null!=(c=e[a=o>=0?o--:i++])&&!(2&c.__u)&&l==c.key&&u==c.type)return a;return-1}function L(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||g.test(e)?n:n+"px"}function O(t,e,n,r,o){var i,a;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||L(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||L(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])i=e!=(e=e.replace(p,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=f,t.addEventListener(e,i?d:h,i)):t.removeEventListener(e,i?d:h,i);else{if("http://www.w3.org/2000/svg"==o)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&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function B(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=f++;else if(e.t<n.u)return;return n(a.event?a.event(e):e)}}}function U(t,e,n,r,o,i,l,u,c,s){var _,p,f,h,d,v,m,y,g,w,T,S,P,N,C,A,F,D=e.type;if(null!=e.constructor)return null;128&n.__u&&(c=!!(32&n.__u),i=[u=e.__e=n.__e]),(_=a.__b)&&_(e);t:if("function"==typeof D)try{if(y=e.props,g="prototype"in D&&D.prototype.render,w=(_=D.contextType)&&r[_.__c],T=_?w?w.props.value:_.__:r,n.__c?m=(p=e.__c=n.__c).__=p.__E:(g?e.__c=p=new D(y,T):(e.__c=p=new M(y,T),p.constructor=D,p.render=$),w&&w.sub(p),p.props=y,p.state||(p.state={}),p.context=T,p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),g&&null==p.__s&&(p.__s=p.state),g&&null!=D.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=x({},p.__s)),x(p.__s,D.getDerivedStateFromProps(y,p.__s))),h=p.props,d=p.state,p.__v=e,f)g&&null==D.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),g&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(g&&null==D.getDerivedStateFromProps&&y!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(y,T),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(y,p.__s,T)||e.__v==n.__v){for(e.__v!=n.__v&&(p.props=y,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(y,p.__s,T),g&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(h,d,v)})}if(p.context=T,p.props=y,p.__P=t,p.__e=!1,P=a.__r,N=0,g){for(p.state=p.__s,p.__d=!1,P&&P(e),_=p.render(p.props,p.state,p.context),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[]}else do{p.__d=!1,P&&P(e),_=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++N<25);p.state=p.__s,null!=p.getChildContext&&(r=x(x({},r),p.getChildContext())),g&&!f&&null!=p.getSnapshotBeforeUpdate&&(v=p.getSnapshotBeforeUpdate(h,d)),A=_,null!=_&&_.type===E&&null==_.key&&(A=R(_.props.children)),u=H(t,b(A)?A:[A],e,n,r,o,i,l,u,c,s),p.base=e.__e,e.__u&=-161,p.__h.length&&l.push(p),m&&(p.__E=p.__=null)}catch(t){if(e.__v=null,c||null!=i)if(t.then){for(e.__u|=c?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;i[i.indexOf(u)]=null,e.__e=u}else{for(F=i.length;F--;)k(i[F]);W(e)}else e.__e=n.__e,e.__k=n.__k,t.then||W(e);a.__e(t,e,n)}else null==i&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=j(n.__e,e,n,r,o,i,l,c,s);return(_=a.diffed)&&_(e),128&e.__u?void 0:u}function W(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(W)}function I(t,e,n){for(var r=0;r<n.length;r++)z(n[r],n[++r],n[++r]);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 R(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:b(t)?t.map(R):x({},t)}function j(t,e,n,r,o,l,u,c,s){var _,p,f,h,d,v,y,g=n.props,x=e.props,w=e.type;if("svg"==w?o="http://www.w3.org/2000/svg":"math"==w?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=l)for(_=0;_<l.length;_++)if((d=l[_])&&"setAttribute"in d==!!w&&(w?d.localName==w:3==d.nodeType)){t=d,l[_]=null;break}if(null==t){if(null==w)return document.createTextNode(x);t=document.createElementNS(o,w,x.is&&x),c&&(a.__m&&a.__m(e,l),c=!1),l=null}if(null==w)g===x||c&&t.data==x||(t.data=x);else{if(l=l&&i.call(t.childNodes),g=n.props||m,!c&&null!=l)for(g={},_=0;_<t.attributes.length;_++)g[(d=t.attributes[_]).name]=d.value;for(_ in g)if(d=g[_],"children"==_);else if("dangerouslySetInnerHTML"==_)f=d;else if(!(_ in x)){if("value"==_&&"defaultValue"in x||"checked"==_&&"defaultChecked"in x)continue;O(t,_,null,d,o)}for(_ in x)d=x[_],"children"==_?h=d:"dangerouslySetInnerHTML"==_?p=d:"value"==_?v=d:"checked"==_?y=d:c&&"function"!=typeof d||g[_]===d||O(t,_,d,g[_],o);if(p)c||f&&(p.__html==f.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(f&&(t.innerHTML=""),H("template"==e.type?t.content:t,b(h)?h:[h],e,n,r,"foreignObject"==w?"http://www.w3.org/1999/xhtml":o,l,u,l?l[0]:n.__k&&S(n,0),c,s),null!=l)for(_=l.length;_--;)k(l[_]);c||(_="value","progress"==w&&null==v?t.removeAttribute("value"):null!=v&&(v!==t[_]||"progress"==w&&!v||"option"==w&&v!=g[_])&&O(t,_,v,g[_],o),_="checked",null!=y&&y!=t[_]&&O(t,_,y,g[_],o))}return t}function z(t,e,n){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){a.__e(t,n)}}function V(t,e,n){var r,o;if(a.unmount&&a.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||z(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){a.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&V(r[o],e,n||"function"!=typeof t.type);n||k(t.__e),t.__c=t.__=t.__e=void 0}function $(t,e,n){return this.constructor(t,n)}function X(t,e,n){var r,o,l;e==document&&(e=document.documentElement),a.__&&a.__(t,e),r=!1?null:e.__k,o=[],l=[],U(e,t=e.__k=w(E,null,[t]),r||m,m,e.namespaceURI,r?null:e.firstChild?i.call(e.childNodes):null,o,r?r.__e:e.firstChild,false,l),I(o,t,l)}function q(t){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,N(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+v++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}i=y.slice,a={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},l=0,M.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=x({},this.state),"function"==typeof t&&(t=t(x({},n),this.props)),t&&x(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),N(this))},M.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),N(this))},M.prototype.render=E,u=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_=function(t,e){return t.__v.__b-e.__v.__b},C.__r=0,p=/(PointerCapture)$|Capture$/i,f=0,h=B(!1),d=B(!0),v=0;var G=0;function Y(t,e,n,r,o,i){e||(e={});var l,u,c=e;if("ref"in c)for(u in c={},e)"ref"==u?l=e[u]:c[u]=e[u];var s={type:t,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--G,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof t&&(l=t.defaultProps))for(u in l)void 0===c[u]&&(c[u]=l[u]);return a.vnode&&a.vnode(s),s}const Z=[];for(let t=0;t<256;++t)Z.push((t+256).toString(16).slice(1));let J;const K=new Uint8Array(16);var Q,tt,et={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function nt(t,e,n){if(et.randomUUID&&!t)return et.randomUUID();const r=(t=t||{}).random??t.rng?.()??function(){if(!J){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");J=crypto.getRandomValues.bind(crypto)}return J(K)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(t,e=0){return(Z[t[e+0]]+Z[t[e+1]]+Z[t[e+2]]+Z[t[e+3]]+"-"+Z[t[e+4]]+Z[t[e+5]]+"-"+Z[t[e+6]]+Z[t[e+7]]+"-"+Z[t[e+8]]+Z[t[e+9]]+"-"+Z[t[e+10]]+Z[t[e+11]]+Z[t[e+12]]+Z[t[e+13]]+Z[t[e+14]]+Z[t[e+15]]).toLowerCase()}(r)}t.ParagraphType=void 0,(Q=t.ParagraphType||(t.ParagraphType={})).HEADING1="heading1",Q.HEADING2="heading2",Q.HEADING3="heading3",Q.HEADING4="heading4",Q.HEADING5="heading5",Q.HEADING6="heading6",Q.NORMAL="normal",Q.BULLETS="bullets",Q.HEADLINE="headline",t.PhraseType=void 0,(tt=t.PhraseType||(t.PhraseType={})).TEXT="text",tt.ENTITY="entity",tt.CUSTOM="custom";var rt=["metric_name","metric_value","other_metric_value","contribute_ratio","delta_value","ratio_value","trend_desc","dim_value","time_desc","proportion","rank","difference","anomaly","association","distribution","seasonality"];function ot(t){return"object"==typeof t}function it(t){return"function"==typeof t}function at(t){return"number"==typeof t}function lt(t,e){return function(t){return"function"==typeof t}(t)?t:function(){return void 0===t?e:t}}var ut=function(t){return"t8-".concat(t)},ct=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return e?"".concat(t," ").concat(e):t},"").trim()};function st(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(Array.isArray(t))return t.map(function(t){return st(t)});var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=st(t[n]));return e}var _t={headline:"h1",heading1:"h1",heading2:"h2",heading3:"h3",heading4:"h4",heading5:"h5",heading6:"h6"},pt=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.fontSizeMultiples[_t[t]])&&void 0!==n?n:1;return(null!==(r=null==e?void 0:e.fontSize)&&void 0!==r?r:12)*o};function ft(t){return!!t&&ot(t)&&"customType"in t}function ht(t){return ot(t)&&"customType"in t}function dt(t){return ot(t)&&"paragraphs"in t&&Array.isArray(null==t?void 0:t.paragraphs)}function vt(e){return ot(e)&&(null==e?void 0:e.type)===t.ParagraphType.NORMAL&&Array.isArray(null==e?void 0:e.phrases)}function mt(e){return ot(e)&&(null==e?void 0:e.type)===t.ParagraphType.BULLETS&&Array.isArray(null==e?void 0:e.bullets)}function yt(t){if(t&&ot(t)&&"type"in t&&"string"==typeof t.type){var e=kt(null==t?void 0:t.type);return t.type.startsWith("heading")&&!Number.isNaN(e)}return!1}function gt(e){var n;return e.type===t.PhraseType.CUSTOM&&!!(null===(n=null==e?void 0:e.metadata)||void 0===n?void 0:n.customType)}function bt(e){var n,r;return e.type===t.PhraseType.ENTITY&&!!(null===(n=null==e?void 0:e.metadata)||void 0===n?void 0:n.entityType)&&rt.includes(null===(r=null==e?void 0:e.metadata)||void 0===r?void 0:r.entityType)}function xt(e){return e.type===t.PhraseType.TEXT}function kt(t){if(null==t?void 0:t.startsWith("heading")){var e=Number(null==t?void 0:t.slice(-1));if(e>=1&&e<=6)return e}return NaN}var wt={fontFamily:"PingFangSC, sans-serif",borderColor:"rgb(199, 199, 199)",fontSize:14,lineHeight:24,fontSizeMultiples:{h1:2,h2:1.72,h3:1.4,h4:1.15,h5:1.08,h6:1.08},lineHeightMultiples:{h1:1.5,h2:1.3,h3:1.15,h4:1,h5:1,h6:1}},Tt={light:{colorBase:"rgba(0, 0, 0, 0.65)",colorEntityBase:"rgba(0, 0, 0, 0.65)",colorHeadingBase:"rgba(0, 0, 0, 0.85)",colorPositive:"#FA541C",colorNegative:"#13A8A8",colorConclusion:"#1F0352",colorDimensionValue:"rgba(0, 0, 0, 0.88)",colorMetricName:"rgba(0, 0, 0, 0.88)",colorMetricValue:"#1677FF",colorOtherValue:"rgba(0, 0, 0, 0.88)",colorProportionShadow:"#CDDDFD",colorProportionFill:"#3471F9",colorLineStroke:"#5B8FF9",colorLink:"#1677FF"},dark:{colorBase:"rgba(255, 255, 255, 0.65)",colorEntityBase:"rgba(255, 255, 255, 0.65)",colorHeadingBase:"rgba(255, 255, 255, 0.85)",colorPositive:"#FA541C",colorNegative:"#13A8A8",colorConclusion:"#D8C3F3",colorDimensionValue:"rgba(255, 255, 255, 0.88)",colorMetricName:"rgba(255, 255, 255, 0.88)",colorMetricValue:"#4B91FF",colorOtherValue:"rgba(255, 255, 255, 0.88)",colorProportionShadow:"#CDDDFD",colorProportionFill:"#3471F9",colorLineStroke:"#5B8FF9",colorLink:"#4B91FF"}},Et=n(n({},wt),Tt.light);function Mt(t){var e=t.element,o=t.factoryStyles,i=void 0===o?{}:o;return function(t){var o=t.children,a=t.style,l=t.theme,u=void 0===l?Et:l,c=t.forwardRef,s=r(t,["children","style","theme","forwardRef"]),_="function"==typeof i?i(u):i,p=n(n({},_),a),f=n(n({},s),{style:p,ref:c});return w(e,f,o)}}function St(t){return{fontFamily:t.fontFamily,color:t.colorBase,fontSize:t.fontSize}}var Pt,Nt,Ct,Ht,At=function(t){return n(n({},St(t)),{paddingLeft:"16px",marginBottom:"4px"})},Ft=Mt({element:"div",factoryStyles:At}),Dt=Mt({element:"li",factoryStyles:function(){return{listStyle:"inherit",lineHeight:"1.74"}}}),Lt=Mt({element:"ol",factoryStyles:function(t){return n(n({},At(t)),{listStyleType:"decimal"})}}),Ot=Mt({element:"ul",factoryStyles:function(t){return n(n({},At(t)),{listStyleType:"disc"})}}),Bt=Mt({element:"div",factoryStyles:function(t){return St(t)}}),Ut=Mt({element:"span",factoryStyles:function(t){return{display:"inline-block",alignItems:"center",boxSizing:"border-box",fontFamily:t.fontFamily,lineHeight:"1.5em",borderRadius:"2px",color:t.colorEntityBase,margin:"0 2px"}}}),Wt=function(t,e){var r={fontFamily:t.fontFamily,color:t.colorHeadingBase},o=t.fontSize,i=t.lineHeight;switch(e){case 1:return n(n({},r),{fontSize:"".concat(t.fontSizeMultiples.h1*o,"px"),lineHeight:"".concat(t.lineHeightMultiples.h1*i,"px"),margin:"26px 0 10px 0"});case 2:return n(n({},r),{fontSize:"".concat(t.fontSizeMultiples.h2*o,"px"),lineHeight:"".concat(t.lineHeightMultiples.h2*i,"px"),margin:"21px 0 5px 0"});case 3:return n(n({},r),{fontSize:"".concat(t.fontSizeMultiples.h3*o,"px"),lineHeight:"".concat(t.lineHeightMultiples.h3*i,"px"),margin:"16px 0 5px 0"});case 4:return n(n({},r),{fontSize:"".concat(t.fontSizeMultiples.h4*o,"px"),lineHeight:"".concat(t.lineHeightMultiples.h4*i,"px"),margin:"10px 0 5px 0"});case 5:return n(n({},r),{fontSize:"".concat(t.fontSizeMultiples.h5*o,"px"),lineHeight:"".concat(t.lineHeightMultiples.h5*i,"px"),margin:"8px 0 5px 0"});case 6:return n(n({},r),{fontSize:"".concat(t.fontSizeMultiples.h6*o,"px"),lineHeight:"".concat(t.lineHeightMultiples.h6*i,"px"),minHeight:"".concat(t.lineHeightMultiples.h6,"px"),letterSpacing:"0.008em",margin:"5px 0 5px 0"});default:return r}},It=Mt({element:"h1",factoryStyles:function(t){return n(n({},Wt(t,1)),{borderBottom:"1px solid ".concat(t.borderColor)})}}),Rt=Object.fromEntries([1,2,3,4,5,6].map(function(t){return["H".concat(t),Mt({element:"h"+t,factoryStyles:function(e){return Wt(e,t)}})]})),jt=Rt.H1,zt=Rt.H2,Vt=Rt.H3,$t=Rt.H4,Xt=Rt.H5,qt=Rt.H6,Gt=Mt({element:"strong"}),Yt=Mt({element:"em"}),Zt=Mt({element:"u"}),Jt=Mt({element:"p",factoryStyles:function(t){var e=t.lineHeight;return n(n({},St(t)),{minHeight:"".concat(e,"px"),lineHeight:"".concat(e,"px"),marginBottom:"4px"})}}),Kt=Object.freeze({__proto__:null,Bold:Gt,Bullet:Ft,Container:Bt,Entity:Ut,H1:jt,H2:zt,H3:Vt,H4:$t,H5:Xt,H6:qt,Headline:It,Italic:Yt,Li:Dt,Ol:Lt,P:Jt,Ul:Ot,Underline:Zt}),Qt=0,te=[],ee=a,ne=ee.__b,re=ee.__r,oe=ee.diffed,ie=ee.__c,ae=ee.unmount,le=ee.__;function ue(t,e){ee.__h&&ee.__h(Nt,t,Qt||e),Qt=0;var n=Nt.__H||(Nt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function ce(t){return Qt=1,function(t,e,n){var r=ue(Pt++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):be(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],n=r.t(e,t);e!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Nt,!Nt.__f)){var o=function(t,e,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter(function(t){return!!t.__c});if(o.every(function(t){return!t.__N}))return!i||i.call(this,t,e,n);var a=r.__c.props!==t;return o.forEach(function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}}),i&&i.call(this,t,e,n)||a};Nt.__f=!0;var i=Nt.shouldComponentUpdate,a=Nt.componentWillUpdate;Nt.componentWillUpdate=function(t,e,n){if(this.__e){var r=i;i=void 0,o(t,e,n),i=r}a&&a.call(this,t,e,n)},Nt.shouldComponentUpdate=o}return r.__N||r.__}(be,t)}function se(t,e){var n=ue(Pt++,3);!ee.__s&&ge(n.__H,e)&&(n.__=t,n.u=e,Nt.__H.__h.push(n))}function _e(t){return Qt=5,pe(function(){return{current:t}},[])}function pe(t,e){var n=ue(Pt++,7);return ge(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function fe(t){var e=Nt.context[t.__c],n=ue(Pt++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Nt)),e.props.value):t.__}function he(){for(var t;t=te.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(me),t.__H.__h.forEach(ye),t.__H.__h=[]}catch(e){t.__H.__h=[],ee.__e(e,t.__v)}}ee.__b=function(t){Nt=null,ne&&ne(t)},ee.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),le&&le(t,e)},ee.__r=function(t){re&&re(t),Pt=0;var e=(Nt=t.__c).__H;e&&(Ct===Nt?(e.__h=[],Nt.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(me),e.__h.forEach(ye),e.__h=[],Pt=0)),Ct=Nt},ee.diffed=function(t){oe&&oe(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==te.push(e)&&Ht===ee.requestAnimationFrame||((Ht=ee.requestAnimationFrame)||ve)(he)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Ct=Nt=null},ee.__c=function(t,e){e.some(function(t){try{t.__h.forEach(me),t.__h=t.__h.filter(function(t){return!t.__||ye(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],ee.__e(n,t.__v)}}),ie&&ie(t,e)},ee.unmount=function(t){ae&&ae(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(t){try{me(t)}catch(t){e=t}}),n.__H=void 0,e&&ee.__e(e,n.__v))};var de="function"==typeof requestAnimationFrame;function ve(t){var e,n=function(){clearTimeout(r),de&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);de&&(e=requestAnimationFrame(n))}function me(t){var e=Nt,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Nt=e}function ye(t){var e=Nt;t.__c=t.__(),Nt=e}function ge(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function be(t,e){return"function"==typeof e?e(t):e}function xe(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}function ke(t,e){this.props=t,this.context=e}(ke.prototype=new M).isPureReactComponent=!0,ke.prototype.shouldComponentUpdate=function(t,e){return xe(this.props,t)||xe(this.state,e)};var we=a.__b;a.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),we&&we(t)};var Te=a.__e;a.__e=function(t,e,n,r){if(t.then)for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Te(t,e,n,r)};var Ee=a.unmount;function Me(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(t){"function"==typeof t.__c&&t.__c()}),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return Me(t,e,n)})),t}function Se(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return Se(t,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Pe(){this.__u=0,this.o=null,this.__b=null}function Ne(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Ce(){this.i=null,this.l=null}a.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Ee&&Ee(t)},(Pe.prototype=new M).__c=function(t,e){var n=e.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=Ne(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(! --r.__u){if(r.state.__a){var t=r.state.__a;r.__v.__k[0]=Se(t,t.__c.__P,t.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.o.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},Pe.prototype.componentWillUnmount=function(){this.o=[]},Pe.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Me(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&w(E,null,t.fallback);return o&&(o.__u&=-33),[w(E,null,e.__a?null:t.children),o]};var He=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Ce.prototype=new M).__a=function(t){var e=this,n=Ne(e.__v),r=e.l.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),He(e,t,r)):o()};n?n(i):i()}},Ce.prototype.render=function(t){this.i=null,this.l=new Map;var e=F(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Ce.prototype.componentDidUpdate=Ce.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){He(t,n,e)})};var Ae="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Fe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,De=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Le=/[A-Z0-9]/g,Oe="undefined"!=typeof document,Be=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};M.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(M.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var Ue=a.event;function We(){}function Ie(){return this.cancelBubble}function Re(){return this.defaultPrevented}a.event=function(t){return Ue&&(t=Ue(t)),t.persist=We,t.isPropagationStopped=Ie,t.isDefaultPrevented=Re,t.nativeEvent=t};var je={enumerable:!1,configurable:!0,get:function(){return this.class}},ze=a.vnode;a.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,r={},o=-1===n.indexOf("-");for(var i in e){var a=e[i];if(!("value"===i&&"defaultValue"in e&&null==a||Oe&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||Be(e.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":De.test(i)&&(i=l):l=i="oninput":o&&Fe.test(i)?i=i.replace(Le,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[i=l]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=F(e.children).forEach(function(t){t.props.selected=-1!=r.value.indexOf(t.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=F(e.children).forEach(function(t){t.props.selected=r.multiple?-1!=r.defaultValue.indexOf(t.props.value):r.defaultValue==t.props.value})),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",je)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r}(t),t.$$typeof=Ae,ze&&ze(t)};var Ve=a.__r;a.__r=function(t){Ve&&Ve(t),t.__c};var $e=a.diffed;function Xe(t){var e=t.themeSeedToken,n=void 0===e?Et:e,r=t.children;return Y(qe.Provider,{value:n,children:r})}a.diffed=function(t){$e&&$e(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var qe=q(Et);function Ge(){return fe(qe)}var Ye=function(t,e,n){void 0===n&&(n="suffix");var r=document.createElement("span"),o=e;r.textContent=o;var i=void 0;return"string"==typeof t||"number"==typeof t?(i=document.createElement("span")).textContent=t.toString():i=t,i&&("suffix"===n?r.appendChild(i):r.insertBefore(i,r.firstChild)),r};var Ze=function(){function t(t){this.entities={},this.customPhrases={},this.customBlocks={},t&&this.registerAll(t)}return t.prototype.register=function(t){(function(t){return"isBlock"in t&&t.isBlock})(t)&&(this.customBlocks[t.key]=t),function(t){return"isEntity"in t&&t.isEntity}(t)&&(this.entities[t.key]=t),function(t){return"isEntity"in t&&!t.isEntity}(t)&&(this.customPhrases[t.key]=t)},t.prototype.registerAll=function(t){var e=this;t.forEach(function(t){return e.register(t)})},t.prototype.getEntityDescriptor=function(t){return this.entities[t]},t.prototype.getCustomPhraseDescriptor=function(t){return this.customPhrases[t]},t.prototype.getBlockDescriptor=function(t){return this.customBlocks[t]},t.prototype.getPhraseDescriptorBySpec=function(t){return gt(t)?this.getCustomPhraseDescriptor(t.metadata.customType):bt(t)?this.getEntityDescriptor(t.metadata.entityType):null},t}(),Je=function(t){return function(e){return n({isEntity:t,getText:function(t){return t}},e)}},Ke=function(t,e){return function(r,o){void 0===o&&(o="merge");var i=Je(!0),a=st(e);return r&&(a="overwrite"===o?r:function(t,e){var r=n(n({},t),e);return r.style=n(n({},(null==t?void 0:t.style)||{}),(null==e?void 0:e.style)||{}),r}(e,r)),i(n({key:t},a))}},Qe=Ke("metric_name",{style:function(t,e,n){return{fontWeight:500,color:n.colorMetricName}},tooltip:!1}),tn=Ke("metric_value",{style:function(t,e,n){return{color:n.colorMetricValue}},tooltip:{title:function(t,e){return at(e.origin)?"".concat(e.origin):null}}}),en=Ke("delta_value",{classNames:function(t,e){var n=e.assessment;return[ut("value-".concat(n))]},getText:an,render:function(t,e){var n=e.assessment;return Ye(on(n,["-","+"]),t,"prefix")},style:function(t,e,n){return{color:rn(e.assessment,n)}},tooltip:{title:function(t,e){return at(e.origin)?"".concat(e.origin):null}}}),nn=Ke("ratio_value",{classNames:function(t,e){var n=e.assessment;return[ut("value-".concat(n))]},getText:an,render:function(t,e,n,r){var o=e.assessment,i=pt(n,r),a=on(o,[ln("up",.8*i),ln("down",.8*i)]);return Ye(a,t,"prefix")},style:function(t,e,n){return{color:rn(e.assessment,n)}},tooltip:{title:function(t,e){return at(e.origin)?"".concat(e.origin):null}}});function rn(t,e){var n;return"positive"===t&&(n=e.colorPositive),"negative"===t&&(n=e.colorNegative),n}function on(t,e){var n=e[0],r=e[1],o=null;return"negative"===t&&(o=n),"positive"===t&&(o=r),o}function an(t,e){return"".concat("negative"===(null==e?void 0:e.assessment)?"-":"").concat(t)}function ln(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","".concat(e,"px")),n.setAttribute("height","".concat(e,"px")),n.setAttribute("viewBox","0 0 8 9"),n.style.marginRight="".concat(1,"px"),n.setAttribute("version","1.1");var r=document.createElementNS("http://www.w3.org/2000/svg","g");r.setAttribute("transform","translate(-2.000000, -2.000000)");var o=document.createElementNS("http://www.w3.org/2000/svg","polygon");o.setAttribute("fill","currentColor");var i="down"===t?"6 2 9.5 11 2.5 11":"6 11 9.5 2 2.5 2";return o.setAttribute("points",i),r.appendChild(o),n.appendChild(r),n}var un=Ke("other_metric_value",{style:function(t,e,n){return{fontWeight:"bold",color:n.colorOtherValue}},tooltip:{title:function(t,e){return at(e.origin)?"".concat(e.origin):null}}}),cn=Ke("contribute_ratio",{style:function(t,e,n){return{color:n.colorConclusion}},tooltip:{title:function(t,e){return at(e.origin)?"".concat(e.origin):null}}}),sn=Ke("dim_value",{style:function(t,e,n){return{color:n.colorDimensionValue}},tooltip:!1}),_n=function(){function t(t){this.elements=Array.isArray(t)?t:[t]}return t.select=function(e){return new t(document.querySelector(e)||[])},t.selectAll=function(e){var n=document.querySelectorAll(e);return new t(Array.from(n))},t.prototype.attr=function(t,e){return this.elements.forEach(function(n){n instanceof Element&&n.setAttribute(t,String(e))}),this},t.prototype.style=function(t,e){return this.elements.forEach(function(n){n instanceof Element&&n.style.setProperty(t,e)}),this},t.prototype.append=function(e){var n=[];return this.elements.forEach(function(t){var r=document.createElementNS("http://www.w3.org/2000/svg",e);t.appendChild(r),n.push(r)}),new t(n)},t.prototype.text=function(t){return this.elements.forEach(function(e){e.textContent=t}),this},t.prototype.on=function(t,e){return this.elements.forEach(function(n){n.addEventListener(t,e)}),this},t.prototype.node=function(){return this.elements[0]||null},t.prototype.nodes=function(){return o([],this.elements,!0)},t}(),pn=function(t,e){return function(n){var r=t[0],o=t[1],i=e[0],a=e[1];return r===o||i===a?i:i+(a-i)*(n-r)/(o-r)}},fn=function(t,e,n){return function(r){return r.length?r.map(function(r,o){return[t(o),n-e(r)]}).reduce(function(t,e,n){var r=e[0],o=e[1];return 0===n?"M".concat(r," ").concat(o):"".concat(t," L").concat(r," ").concat(o)},""):""}},hn=function(t,e,n,r){return void 0===n&&(n=2),void 0===r&&(r=2),function(o,i){var a=t(o.index),l=e(o.value),u=t(i.index),c=e(i.value),s=u-a,_=c-l,p=Math.atan2(_,s),f=u-n*Math.cos(p),h=c-n*Math.sin(p),d=f-r/2*Math.sin(p),v=h+r/2*Math.cos(p),m=f+r/2*Math.sin(p),y=h-r/2*Math.cos(p);return["M".concat(a," ").concat(l),"L".concat(f," ").concat(h),"M".concat(u," ").concat(c),"L".concat(d," ").concat(v),"L".concat(m," ").concat(y),"Z"].join(" ")}};var dn=function(t,e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.style.margin="0px 4px",r.style.transform="translate(0px, 0.125em)",r.setAttribute("height",String(n)),r.setAttribute("width",String(e)),t.appendChild(r),new _n(r)};function vn(t,e){if(!t||0===t.length)return[void 0,void 0];var n=t;return[Math.min.apply(Math,n),Math.max.apply(Math,n)]}function mn(t,e){if(t&&0!==t.length){var n=e?t.map(e):t,r=n.reduce(function(t,e){return t+e},0);return r/n.length}}var yn="#5B8FF9",gn="#FF8C00",bn="rgb(250, 84, 28)",xn="wsc-line-fill",kn=function(t,e,n,r){var i=e.data,a=void 0===i?[]:i;if(a.length){var l=pt(n,r),u=l,c=Math.max(2*l,2*a.length),s=dn(t,c,u),_=pn([0,(null==a?void 0:a.length)-1],[0,c]),p=[Math.min.apply(Math,a),Math.max.apply(Math,a)],f=pn([p[0],p[1]],[2,u-2]),h=s.append("defs").append("linearGradient").attr("id",xn).attr("x1","50%").attr("x2","50%").attr("y1","0%").attr("y2","122.389541%");h.append("stop").attr("offset","0%").attr("stop-color","#5B8FF9"),h.append("stop").attr("offset","100%").attr("stop-color","#FFFFFF").attr("stop-opacity","0");var d=fn(_,f,u)(a);d&&s.append("path").attr("d",d).attr("stroke","#5B8FF9").attr("fill","transparent");var v=function(t,e,n){return function(r){if(!r.length)return"";var i=r.map(function(r,o){return[t(o),n-e(r)]});return o(o([],i,!0),[[i[i.length-1][0],n],[i[0][0],n]],!1).reduce(function(t,e,n){var r=e[0],o=e[1];return 0===n?"M".concat(r," ").concat(o):"".concat(t," L").concat(r," ").concat(o)},"")}}(_,f,u)(a);v&&s.append("path").attr("d",v).attr("fill","url(#".concat(xn,")"))}},wn=function(t,e,n,r){var o=e.data,i=void 0===o?0:o,a=pt(n,r),l=Math.max(0,Math.min(1,i)),u=a/2,c=dn(t,a,a);c.append("circle").attr("cx",u).attr("cy",u).attr("r",u).attr("fill","#CDDDFD");var s,_=2*l*Math.PI,p=(s=u,function(t,e,n){var r=t+s*Math.sin(n),o=e-s*Math.cos(n),i=n<=Math.PI?0:1;return["M".concat(t," ").concat(e-s),"A".concat(s," ").concat(s," 0 ").concat(i," 1 ").concat(r," ").concat(o),"L".concat(t," ").concat(e),"Z"].join(" ")})(u,u,_);c.append("path").attr("d",p).attr("fill","#3471F9")},Tn=function(t,e,n,r){var o=e.data,i=void 0===o?[]:o,a=e.drawSvgCallback;if(i.length){var l=pt(n,r);t.innerHTML="";var u=l,c=2*l,s=function(t){return t.length<3?4:t.length>=3&&t.length<5?2:1}(i),_=(c-s*(i.length-1))/i.length,p=dn(t,c,u),f=pn([0,i.length-1],[0,c-_]),h=Math.max.apply(Math,i),d=Math.min.apply(Math,i),v=pn([d,h],[u-2,2]);i.forEach(function(t,e){var n=f(e),r=v(t);p.append("rect").attr("class","bar").attr("x",n).attr("y",r).attr("width",_).attr("height",u-r).attr("fill","#5B8FF9").style("cursor","pointer")}),null==a||a(p,f,v)}},En=function(t,e,n,r){var o=e.data,i=void 0===o?[]:o,a=e.range,l=void 0===a?[]:a;if(i.length&&l.every(function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<t[1]})){var u=pt(n,r),c=u,s=Math.max(2*u,2*i.length),_=dn(t,s,c),p=pn([0,(null==i?void 0:i.length)-1],[0,s]),f=function(t){var e=Math.min.apply(Math,t),n=Math.max.apply(Math,t);return e===n?[e-1,n+1]:[e,n]}(i),h=pn(f,[2,c-2]);l.forEach(function(t){var e=i.length-1;Math.max(0,t[0])>=Math.min(e,t[1])||_.append("rect").attr("x",p(t[0])).attr("y",2).attr("width",p(t[1])-p(t[0])-.5).attr("height",c).attr("fill",gn).attr("fill-opacity",.6)});var d=fn(p,h,c)(i);d&&_.append("path").attr("d",d).attr("stroke",yn).attr("fill","transparent")}},Mn=function(t,e,n,r){var o=e.data;var i=pt(n,r),a=i,l=2*i,u=1.5;t.innerHTML="";var c=vn(o);if(void 0===c[0])throw new Error("Input data is empty or invalid, cannot calculate value extent.");var s=pn(c,[u,l-u]),_=function(t,e){return function(n){return e.map(function(e){return[e,mn(n,function(n){return t(e-n)})]})}}(function(t){return function(e){return e/=t,Math.abs(e)<=1?.75*(1-e*e)/t:0}}(7),function(t,e){var n=t[0],r=t[1];if(n===r)return[n];for(var o=(r-n)/e,i=Math.floor(Math.log10(o)),a=Math.pow(10,i),l=[1,2,5,10],u=0,c=0,s=l;c<s.length;c++){var _=s[c];if(o<=_*a){u=_*a;break}}0===u&&(u=l[l.length-1]*a);for(var p=[],f=Math.floor(n/u)*u,h=Math.ceil(r/u)*u,d=f;d<=h;d+=u)d>=n&&d<=r&&p.push(d);return p}(c,40)),p=_(o),f=function(t,e){if(t&&0!==t.length){var n=e?t.map(e):t;return Math.max.apply(Math,n)}}(p,function(t){return t[1]}),h=pn([0,f],[a-u,u]),d=dn(t,l,a),v=function(t,e,n){if(!n||n.length<2)return"";var r=n.map(function(n){return[t(n[0]),e(n[1])]});return function(t){if(t.length<4){var e=t.map(function(t){return t.join(",")}).join("L");return"M".concat(e)}for(var n="M".concat(t[0][0],",").concat(t[0][1]),r=1;r<t.length-2;r++){var o=t[r-1],i=t[r],a=t[r+1],l=t[r+2],u=o[0],c=o[1],s=i[0],_=i[1],p=a[0],f=a[1],h=_+(f-c)/6,d=p-(l[0]-s)/6,v=f-(l[1]-_)/6;n+="C".concat(s+(p-u)/6,",").concat(h,",").concat(d,",").concat(v,",").concat(p,",").concat(f)}return n}(r)}(s,h,p);d.append("path").attr("class","mypath").attr("fill","none").attr("stroke",yn).attr("stroke-width",1).attr("stroke-linejoin","round").attr("d",v)},Sn=function(t,e,n,r){var o=e.data,i=void 0===o?[]:o;if(i.length){if(i.length<2)throw new Error("data must contain at least 2 points");var a=pt(n,r),l=a,u=2*a,c=dn(t,u,l),s=vn(i.map(function(t){return t.x})),_=vn(i.map(function(t){return t.y})),p=[s[0]>0?0:s[0],s[1]<0?0:s[1]],f=[_[0]>0?0:_[0],_[1]<0?0:_[1]],h=pn(p,[2,u-2]),d=pn(f,[l-2,2]),v=h(0),m=d(0),y=function(t){if(!t||t.length<2)throw new Error("Points array must contain at least two points for linear regression.");for(var e=t.length,n=0,r=0,o=0,i=t;o<i.length;o++)n+=(p=i[o]).x,r+=p.y;for(var a=n/e,l=r/e,u=0,c=0,s=0,_=t;s<_.length;s++){var p,f=(p=_[s]).x-a;u+=f*(p.y-l),c+=f*f}if(0===c)return{k:0,b:l};var h=u/c;return{k:h,b:l-h*a}}(i),g=i.map(function(t){var e=y.k*t.x+y.b;return{x:t.x,y:e}});c.append("line").attr("x1",v).attr("y1",0).attr("x2",v).attr("y2",l).attr("stroke",yn),c.append("line").attr("x1",0).attr("y1",m).attr("x2",u).attr("y2",m).attr("stroke",yn);var b=hn(h,d);c.append("path").attr("d",b({index:g[0].x,value:g[0].y},{index:g[g.length-1].x,value:g[g.length-1].y})).attr("stroke",bn).attr("fill",bn),i.forEach(function(t){c.append("circle").attr("cx",h(t.x)).attr("cy",d(t.y)).attr("r",1).attr("fill",gn)})}},Pn=Ke("proportion",{render:function(t,e,n,r){var o=e.origin,i=document.createElement("span");return wn(i,{data:Cn(t,o)},n,r),Ye(i,t,"suffix")},tooltip:{title:function(t,e){return at(e.origin)?"".concat(e.origin):null}}}),Nn=function(t){return Number.isNaN(t)};function Cn(t,e){if(e&&!Nn(e))return e;if(null==t?void 0:t.endsWith("%")){var n=null==t?void 0:t.replace(/%$/,"");if(!Nn(Number(n)))return Number(n)/100}return NaN}var Hn=Ke("time_desc",{style:function(t,e,n){return{color:n.colorDimensionValue}},tooltip:!1}),An=Ke("trend_desc",{render:function(t,e,n,r){var o=e.detail,i=document.createElement("span");return kn(i,{data:o},n,r),Ye(i,t,"suffix")},style:function(t,e,n){return{color:n.colorConclusion}},tooltip:!1}),Fn=Ke("rank",{render:function(t,e,n,r){var o=e.detail,i=document.createElement("span");return Tn(i,{data:o},n,r),Ye(i,t,"suffix")},tooltip:!1}),Dn=Ke("difference",{render:function(t,e,n,r){var o=e.detail,i=document.createElement("span");return function(t,e,n,r){var o=e.data,i=void 0===o?[]:o;i.length&&Tn(t,{data:i,drawSvgCallback:function(t,e,n){var r=hn(e,n);t.append("path").attr("d",r({index:.5,value:i[0]},{index:i.length-1+.5,value:i[i.length-1]})).attr("stroke",bn).attr("fill",bn)}},n,r)}(i,{data:o},n,r),Ye(i,t,"suffix")},tooltip:!1}),Ln={render:function(t,e,n,r){var o=e.detail,i=document.createElement("span");return function(t,e,n,r){var o=e.data,i=void 0===o?[]:o;if(i.length){var a=pt(n,r),l=a,u=Math.max(2*a,2*i.length),c=dn(t,u,l),s=pn([0,i.length-1],[2,u-2]),_=l/2;c.append("line").attr("x1",2).attr("y1",_).attr("x2",u-2).attr("y2",_).attr("stroke",yn).attr("stroke-width",1),i.forEach(function(t,e){var n=s(e);0!==t&&c.append("line").attr("x1",n).attr("y1",_-6).attr("x2",n).attr("y2",_+6).attr("stroke",gn).attr("stroke-width",1)})}}(i,{data:o},n,r),Ye(i,t,"suffix")},tooltip:!1},On=Ke("anomaly",Ln),Bn=Ke("association",{render:function(t,e,n,r){var o=e.detail,i=document.createElement("span");return Sn(i,{data:o},n,r),Ye(i,t,"suffix")},tooltip:!1}),Un=Ke("distribution",{render:function(t,e,n,r){var o=e.detail,i=document.createElement("span");return Mn(i,{data:o},n,r),Ye(i,t,"suffix")},tooltip:!1}),Wn=Ke("seasonality",{render:function(t,e,n,r){var o=e.detail,i=document.createElement("span"),a=o,l=a.data,u=a.range;return En(i,{data:l,range:u},n,r),Ye(i,t,"suffix")},tooltip:!1}),In=[Qe(),tn(),en(),nn(),un(),cn(),sn(),Pn(),Hn(),An(),Fn(),Dn(),On(),Bn(),Un(),Wn()],Rn=new Ze(In);function jn(t){var e=t.plugin,n=void 0===e?Rn:e,r=t.children;return Y(zn.Provider,{value:n,children:r})}var zn=q(Rn);function Vn(){return fe(zn)}function $n(t){var e=t.events,n=t.children;return Y(Xn.Provider,{value:e,children:n})}var Xn=q({});function qn(){return fe(Xn)}function Gn(t){var e=t.paragraphType,n=t.children;return Y(Yn.Provider,{value:{paragraphType:e},children:n})}var Yn=q({paragraphType:t.ParagraphType.NORMAL});var Zn=function(t){var e=t.plugin,n=void 0===e?Rn:e,r=t.themeSeedToken,o=void 0===r?Et:r,i=t.events;return Y(jn,{plugin:n,children:Y(Xe,{themeSeedToken:o,children:Y($n,{events:void 0===i?{}:i,children:t.children})})})},Jn="ntv-tooltip-container",Kn={position:"absolute",zIndex:1e3,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.75)",color:"#fff",borderRadius:"4px",fontSize:"12px",maxWidth:"300px",wordWrap:"break-word",boxShadow:"0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08)",fontFamily:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},Qn={position:"absolute",width:"0",height:"0",borderStyle:"solid",borderWidth:"4px"},tr=function(t){var e=t.title,r=t.visible,o=t.defaultVisible,i=void 0!==o&&o,a=t.children,l=t.placement,u=void 0===l?"top":l,c=t.trigger,s=void 0===c?"hover":c,_=t.style,p=t.className,f=t.showArrow,h=void 0===f||f,d=t.onVisibleChange,v=t.offset,m=void 0===v?"top"===u||"bottom"===u?4:8:v,y=t.mouseEnterDelay,g=void 0===y?100:y,b=t.mouseLeaveDelay,x=void 0===b?100:b,k=_e(null),w=_e(null),T=_e(null),E=_e(null),M=_e(null),S=_e(null),P=ce(i),N=P[0],C=P[1],H=void 0!==r?r:N;se(function(){return T.current||(T.current=function(){if(document.getElementById(Jn))return document.getElementById(Jn);var t=document.createElement("div");return t.className=ut("tooltip-container"),t.id=Jn,document.body.appendChild(t),t}()),function(){T.current&&T.current.parentElement===document.body&&(document.body.removeChild(T.current),T.current=null),E.current&&window.clearTimeout(E.current),M.current&&window.clearTimeout(M.current)}},[]),se(function(){O()},[H,e]),se(function(){if(H&&k.current&&w.current){var t=k.current.getBoundingClientRect(),e=w.current.getBoundingClientRect(),n=0,r=0,o={};switch(u){case"top":n=t.top-e.height-m,r=t.left+(t.width-e.width)/2,o={bottom:"-8px",left:"50%",transform:"translateX(-50%)",borderColor:"rgba(0, 0, 0, 0.75) transparent transparent transparent"};break;case"bottom":n=t.bottom+m,r=t.left+(t.width-e.width)/2,o={top:"-8px",left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent rgba(0, 0, 0, 0.75) transparent"};break;case"left":n=t.top+(t.height-e.height)/2,r=t.left-e.width-m,o={right:"-8px",top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.75)"};break;case"right":n=t.top+(t.height-e.height)/2,r=t.right+m,o={left:"-8px",top:"50%",transform:"translateY(-50%)",borderColor:"transparent rgba(0, 0, 0, 0.75) transparent transparent"}}if(w.current.style.top="".concat(n+window.scrollY,"px"),w.current.style.left="".concat(r+window.scrollX,"px"),h&&w.current.firstChild){var i=w.current.firstChild;Object.assign(i.style,o)}}},[H,u,m,h]);var A=function(t){void 0===r&&C(t),null==d||d(t)},F=function(){M.current&&(window.clearTimeout(M.current),M.current=null),H||(E.current=window.setTimeout(function(){A(!0)},g))},D=function(){E.current&&(window.clearTimeout(E.current),E.current=null),H&&(M.current=window.setTimeout(function(){A(!1)},x))},L={};"hover"===s?(L.onMouseEnter=F,L.onMouseLeave=D):"click"===s&&(L.onClick=function(){A(!H)}),L.ref=k,L.className=ut("tooltip-trigger");var O=function(){var t=T.current;X(H&&e?Y("div",{ref:w,className:"".concat(ut("tooltip")," ").concat(p||""),style:n(n({},Kn),_),onMouseEnter:F,onMouseLeave:D,children:[h&&Y("div",{className:ut("tooltip-arrow"),style:Qn}),Y("div",{className:ut("tooltip-inner"),id:"tooltip-inner",ref:S})]}):null,t),S.current&&H&&("string"==typeof e||"number"==typeof e?S.current.appendChild(document.createTextNode(String(e))):e instanceof HTMLElement&&S.current.appendChild(e))};return Y("span",n({},L,{children:a}))};function er(t,e,r,i,a){var l,u=t.value,c=void 0===u?"":u,s=t.metadata,_=void 0===s?{}:s,p=t.styles,f=void 0===p?{}:p,h=e||{},d=h.classNames,v=h.style,m=h.onHover,y=h.onClick,g=h.render,b=void 0===g?function(){return c}:g,x=h.tooltip,k=pe(function(){return lt(b,null)(c,_,a,r)},[c,_]),w={theme:r,style:n(n({},lt(v,{})(null==t?void 0:t.value,_,r)),f),className:ct.apply(void 0,o([ut("value"),bt(t)?ut((l=t.metadata.entityType,l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())):""],lt(d,[])(null==t?void 0:t.value,_),!1))},T=Y(Ut,n({},w,"string"==typeof k||"number"==typeof k?{children:k}:{dangerouslySetInnerHTML:{__html:k.outerHTML}})),E=it(i)||it(y)||it(m)?Y("span",{onClick:function(){null==y||y(null==t?void 0:t.value,_),null==i||i("phrase:click",t)},onMouseEnter:function(){null==m||m(null==t?void 0:t.value,_),null==i||i("phrase:mouseenter",t)},onMouseLeave:function(){null==i||i("phrase:mouseleave",t)},children:T}):T,M=x&&lt(x.title,null)(c,_);return null!=M?Y(tr,n({},x,{title:M,children:E})):E}var nr=function(t){var e,n=t.spec,r=qn().onEvent,o=Ge(),i=Vn(),a=fe(Yn).paragraphType,l=(e=r,(Array.isArray(e)?0===e.length:null==e||""===e)?Y(E,{children:n.value}):Y("span",{onClick:function(){null==r||r("phrase:click",n)},onMouseEnter:function(){null==r||r("phrase:mouseenter",n)},onMouseLeave:function(){null==r||r("phrase:mouseleave",n)},children:n.value}));if(xt(n))return n.bold&&(l=Y(Gt,{children:l})),n.italic&&(l=Y(Yt,{children:l})),n.underline&&(l=Y(Zt,{children:l})),n.url&&(l=Y("a",{target:"_blank",rel:"noreferrer",href:n.url,style:{color:o.colorLink,textDecoration:"underline"},children:l})),l;var u=null==i?void 0:i.getPhraseDescriptorBySpec(n);return u?Y(E,{children:er(n,u,o,r,a)}):l};function rr(t){var e=t.spec;return Y(E,{children:null==e?void 0:e.map(function(t,e){var n="".concat(e,"-").concat(t.value);return Y(nr,{spec:t},t.key||n)})})}function or(t){var e=t.spec,n=kt(e.type);if(isNaN(n))return null;var r=Kt["H".concat(n)],o=Ge();return Y(r,{className:ct(ut("h".concat(n)),e.className),style:e.styles,theme:o,children:Y(rr,{spec:e.phrases})})}function ir(t){var e=t.spec,n=Ge();return Y(Jt,{theme:n,className:ct(ut("p"),e.className),style:e.styles,children:Y(rr,{spec:e.phrases})})}function ar(t){var e,n=t.spec,r=qn().onEvent,o=null===(e=n.bullets)||void 0===e?void 0:e.map(function(t){return Y(Dt,{className:ct(ut("li"),t.className),style:t.styles,onClick:function(){null==r||r("paragraph:click",t)},onMouseEnter:function(){null==r||r("paragraph:mouseenter",t)},onMouseLeave:function(){null==r||r("paragraph:mouseleave",t)},children:[Y(rr,{spec:t.phrases}),(null==t?void 0:t.subBullet)?Y(ar,{spec:null==t?void 0:t.subBullet}):null]},n.key||nt())}),i=n.isOrder?"ol":"ul";return Y(n.isOrder?Lt:Ot,{as:i,theme:Ge(),className:ct(ut(i),n.className),style:n.styles,children:o})}function lr(e){var n=e.spec,r=qn().onEvent,o=Ge();return Y(Gn,{paragraphType:t.ParagraphType.HEADLINE,children:Y(It,{onClick:function(){null==r||r("paragraph:click",n)},onMouseEnter:function(){null==r||r("paragraph:mouseenter",n)},onMouseLeave:function(){null==r||r("paragraph:mouseleave",n)},className:ct(ut("headline"),n.className),style:n.styles,theme:o,children:Y(rr,{spec:n.phrases})})})}function ur(t){var e=t.spec,n=Vn(),r=qn().onEvent,o=funct