realchart 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gauge.d.ts +6 -6
- package/gauge.js +2 -2
- package/gauge.mjs +2 -2
- package/heatmap.js +1 -1
- package/heatmap.mjs +1 -1
- package/index.d.ts +411 -67
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/realchart-style.css +112 -28
- package/split.d.ts +1 -1
- package/split.js +2 -2
- package/split.mjs +2 -2
- package/treemap.js +2 -2
- package/treemap.mjs +2 -2
- package/vector.js +1 -1
- package/vector.mjs +1 -1
- package/wordcloud.js +1 -1
- package/wordcloud.mjs +1 -1
package/split.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Split v1.4.
|
|
3
|
+
* RealChart Split v1.4.3
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartSplit={},t.RealChart)}(this,(function(t,e){"use strict";function s(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}})),e.default=t,Object.freeze(e)}var i=s(e);class r{constructor(t,e){this.row=t,this.col=e,this._axes=[]}sort(t,e){const s=e&&!t||!e&&t;this._axes.length>1&&(s?this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?e._index-t._index:s>0?t._index-e._index:t.row!==e.row?e.row-t.row:t.row<this.row?e._index-t._index:t._index-e._index:i-s})):this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?t._index-e._index:s>0?e._index-t._index:t.col!==e.col?t.col-t.col:t.col<this.col?t._index-e._index:e._index-t._index:s-i})))}}class n{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(t,e,s,i){this._doPrepare(t,e,s),this._matrix.forEach((t=>{t.forEach((t=>t.sort(this.isX,i)))}))}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}_buildTicks(t,e){const s=this.isX;this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{!i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))})),this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))}))}_calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{if(e<2||s){const r=s?i.options.col:i.options.row;i._calcPoints(t[r],e)}}))}))}))}}class o extends n{constructor(t){super(t,!0)}_doPrepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var s,r;const n=t.options.position;let o=t.row;"opposite"===n?(o++,t._runPos=n):o<e-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(s=i[o])||void 0===s?void 0:s[t.col])||void 0===r||r._axes.push(t)}))}}class h extends n{constructor(t){super(t,!1)}_doPrepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var e,r;const n=t.options.position;let o=t.col;"opposite"===n?(o++,t._runPos=n):t.col<s-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(e=i[t.row])||void 0===e?void 0:e[o])||void 0===r||r._axes.push(t)}))}}class a extends e.Body{constructor(t){super(t.chart),this.pane=t}contains(t){return t.col===this.pane.col||t.row===this.pane.row}}a.defaults=e.extend(e.Body.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class l extends e.Legend{constructor(t){super(t.chart),this.pane=t}_doPrepareRender(t){super._doPrepareRender(t),this._location="body"}_getLegendSources(){return this.options.visible?this.chart._getSeries().getLegendSources(this.pane.row,this.pane.col):[]}}class d extends e.ChartItem{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInitChildren(t){t.body=(this._body=new a(this)).init(),t.legend=(this._legend=new l(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class c extends e.ChartItem{constructor(t){super(t),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new o(t),this._yAxes=new h(t)}get count(){return this._rows*this._cols}get rowCount(){return this._rows}get colCount(){return this._cols}get paneCount(){return this._rows*this._cols}colSizes(){return this._colSizes}rowSizes(){return this._rowSizes}getPane(t,e){return this._panes[t][e]}getRow(t){return this._panes[t]}getColumn(t){return this._panes.map((e=>e[t]))}getAxisOf(t,e){var s,i;const r=this.chart,n=t.body;if(n){const o=n.pane;return e?r._getXAxes().get(t.options.xAxis)||this._xAxes.get(o.row,o.col)._axes[0]||(null===(s=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===s?void 0:s._xAxisObj):r._getXAxes().get(t.options.yAxis)||this._yAxes.get(n.pane.row,n.pane.col)._axes[0]||(null===(i=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===i?void 0:i._yAxisObj)}}isValidAxis(t){return t&&t.row<this._rows&&t.col<this._cols}_doLoadProp(t,e){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,e)}_doSetSimple(t){if(e.isArray(t)&&t.length>0){const s=e.maxv(1,+t[0]),i=e.maxv(1,e.pickNum(+t[1],s));return s>0&&i>0&&(this.$_parsePanes(s,i),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),e.isObject(t)&&(this.$_parsePanes(t.rows,t.cols),this._paneDic=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._panes=this.$_collectPanes(t),this._panes.forEach((t=>t.forEach((t=>t._prepareRender()))))}_calcSizes(t,s){const i=t.length,r=new Array(i);let n=0;if(i>1){let o=s,h=0;for(n=0;n<i;n++){const s=t[n];e.isNumber(s)?o-=r[n]=Math.max(0,Math.min(o,s)):h+=s.size}if(h>0)for(n=0;n<i;n++){const s=t[n];e.isNumber(s)||(r[n]=o*s.size/h)}}else r[n]=s;return r}getXLens(t){return this._calcSizes(this._colSizes,t)}getYLens(t){return this._calcSizes(this._rowSizes,t)}measureAxes(t,e,s,i){const r=this.getXLens(s?e:t),n=this.getYLens(s?t:e);this._xAxes._buildTicks(r,i),this._yAxes._buildTicks(n,i),this.$_calcAxesPoints(r,n,i)}$_calcAxesPoints(t,e,s){this._xAxes._calcPoints(t,s),this._yAxes._calcPoints(e,s)}completeAxesPoints(t,e){this.$_calcAxesPoints(t,e,101)}getBodyAnnotation(t){for(const e in this._paneDic){const s=this._paneDic[e].body.getAnnotation(t);if(s)return s}}prepareRender(t,e){const s=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(t,this._rows,this._cols,s),this._yAxes._prepare(e,this._rows,this._cols,s)}$_parseSizes(t){let s;return s=e.isArray(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],s.map((t=>{if(e.isString(t)){const s=t.trim();return{size:"*"===s?1:e.pickNum(parseFloat(s),1)}}return e.pickNum(+t,1)}))}$_parsePanes(t,e){this._colSizes=this.$_parseSizes(e),this._rowSizes=this.$_parseSizes(t),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(t){const s=this.chart,i=this._op.extendBody?s._body._config:void 0,r={};if(t=e.isArray(t)?t:e.isObject(t)?[t]:null,e.isArray(t)&&t.forEach((t=>{const e=+t.row||0,n=+t.col||0;if(n>=0&&n<this._cols&&e>=0&&e<this._rows){const o=new d(s,e,n);let h=t;o.init(),!i||t&&t.body&&!1===t.body.extended||(t?(h=Object.assign({},t),t.body?!1!==t.body.extended&&(h.body=Object.assign({},i,t.body)):h.body=i):h={body:i}),o._load(h),r[e+","+n]=o}})),i)for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const n=t+","+e;if(!r[n]){const o=new d(s,t,e);o.init(),o._load({body:i}),r[n]=o}}return r}$_collectPanes(t){const e=[];for(let s=0;s<this._rows;s++){const i=[];for(let e=0;e<this._cols;e++){const r=this._paneDic[s+","+e]||new d(t,s,e)._initObject();i.push(r)}e.push(i)}return e}}c.defaults=e.extend(e.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0});const _="http://www.w3.org/2000/svg",u=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},p=Array.isArray,g=function(t){return"string"==typeof t},m=Object.assign,f=Math.min,y=Math.max,w=Math.abs,v=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t};let x=0;class b{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(x++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class A extends b{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const E=Object.freeze({x:0,y:0,width:0,height:0});const S={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",N=S[C]||S[C="ko"];const k=void 0;function D(t){return t+"px"}function L(t){return null==t||Number.isNaN(t)||""===t}const T={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},B=function(t){const e=T[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return T[t]=e,e}return e};class M{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}const R=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class ${static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&$.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,$.month_days[$.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,a=e+Math.ceil((o+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===a?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!p(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!p(t))return m({},t)}static checkArray(t){return p(t)?t:void 0}static makeArray(t,e=!1){return null!=t?p(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return p(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(p(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return p(t)?t:null!=t?[t]:null}static copyArray(t){return p(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-R}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static parseTuples(t){if(p(t)){const e=[];let s=-1/0;return t.forEach(((i,r)=>{p(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||r!==t.length-1||e.push([1/0,+i])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=p(t)?[]:{};for(let s of Object.keys(t))e[s]=$.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),$.log(t,+new Date-s+"ms")}static clamp(t,e,s){return y(e,f(s,t))}static makeIntArray(t,e){const s=new Array(y(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=w(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}var P;$.LOGGING=!1,$.week_days=["일","월","화","수","목","금","토"],$.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],$.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],$.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}(),function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(P||(P={}));const z="$ProductVersion";class O extends b{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._domResize=!1,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||O.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),M.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){L(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){M.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(H.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(H.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}getBounds(){return this._bounds}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new F(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new G(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(g(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,H.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||((t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))})(N.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const n=this._svg=i.createElementNS(_,"svg");n.classList.add("rct-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=i.createElement("desc");o.textContent="Created by RealChart v"+z,n.appendChild(o);const h=this._defs=i.createElementNS(_,"defs");this._initDefs(i,h),n.appendChild(h),r.appendChild(n),this._root=new V(this),n.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),m(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(_,"filter");s.setAttribute("id",O.SHADOW_FILTER);const i=t.createElementNS(_,"feGaussianBlur");i.setAttribute("stdDeviation","1.5"),i.setAttribute("in","SourceAlpha"),s.appendChild(i);const r=t.createElementNS(_,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),s.appendChild(r);const n=t.createElementNS(_,"feFlood");n.setAttribute("flood-color","#000"),s.appendChild(n);const o=t.createElementNS(_,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),s.appendChild(o);const h=t.createElementNS(_,"feMerge"),a=t.createElementNS(_,"feMergeNode"),l=t.createElementNS(_,"feMergeNode");l.setAttribute("in","SourceGraphic"),h.appendChild(a),h.appendChild(l),s.appendChild(h),e.appendChild(s)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{$.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;m(this._htmlRoot.style,{left:D(e.left-t.left),top:D(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=M.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),$.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}O.CLASS_NAME="rct-control",O.SHADOW_FILTER="rr-chart-shadow-filter",O._animatable=!0;class H extends b{constructor(t,e,s=k){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(_,s||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(t,e){const s=t.createElementNS(_,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(_,e);return this._dom.insertBefore(i,s),i}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return L(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t=$.isValidNum(t)?t:this._tx,e=$.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=$.isValidNum(t)?t:this._tx,e=$.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transEx2(t,e,s=0,i=!0){const r=$.isValidNum(t)?t:this._tx,n=$.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const h=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&h.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&$.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&$.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){null!=this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(B(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(B(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(B(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(g(t))t&&this._dom.classList.add(t);else if(u(t)){const e=this.dom.style;for(let s in t)e.setProperty(B(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){g(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){g(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){g(t)?t&&this.addClass(t):u(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){var s,i;null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,(i="",void 0!==(s=e)?s:i))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==s||s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==e||e.addEventListener("finish",(()=>{delete this.hiding,this.setVis(!1)})),this.hiding=!0}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(H.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return H.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];($.isValidNum(e)||$.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+$.pick(this._originX,t.getAttribute("x"),0)+" "+$.pick(this._originY,t.getAttribute("y")||0)+")"),$.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=$.getNumber(this._scaleX,1),n=$.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}H.DEBUGGING=!1,H.TESTING=!1,H.ASSET_KEY="_asset_",H.TEMP_KEY="_temp_";class V extends H{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class I extends H{constructor(t){super(t,k,"clipPath");const e=this._id=$.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class F extends I{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const h=this._rect=new H(t,null,"rect");h.setAttr("fill","none"),n>0&&h.setAttr("rx",String(n)),o>0&&h.setAttr("ry",String(o)),isNaN(e)||h.setBounds(e,s,i,r),this.add(h)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class G extends I{constructor(t){super(t),this.add(this._circle=new H(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class j extends H{static create(t,e,s,i,r,n,o=0){return new j(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=k,s=k){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Y{static isBright(t){return new Y(t).isBright()}static getContrast(t,e,s){return new Y(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&($.startsWith(t,"rgb(")&&$.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):$.startsWith(t,"rgba(")&&$.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):$.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Y(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var X,W,q;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(X||(X={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(W||(W={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(q||(q={}));class U extends H{constructor(t,e=void 0){super(t,e,"text"),this._layout=W.TOP,this._overflow=q.WRAP,this._dirty=!0,this._text="",this.anchor=X.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case W.MIDDLE:i=Math.floor(s/2);break;case W.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=y(0,t),(e=f(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Y.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}class K{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new K(t,t,t,t):new K(t,t,e,e):new K(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new K(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=v(t.paddingLeft,0),this.right=v(t.paddingRight,0),this.top=v(t.paddingTop,0),this.bottom=v(t.paddingBottom,0),this}applyMargin(t){return this.left=v(t.marginLeft,0),this.right=v(t.marginRight,0),this.top=v(t.marginTop,0),this.bottom=v(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}}K.Empty=Object.freeze(new K),K.Temp=new K;class Z extends H{constructor(t,e=k){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Z.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Z.IGNORE_ATTRS={width:"",height:""};class J extends H{constructor(t,e=k){super(t,e,"g"),H.DEBUGGING&&(this.add(this._debugRect=new j(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),H.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new j(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Q extends J{constructor(t,e,s){super(t,e),this._margins=new K,this._paddings=new K,this.add(this._background=new j(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const h=this._doMeasure(t,e,s,i,r);if(h.width+=o.left+o.right,h.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=h.width+=t.left+t.right,this.mh=h.height+=t.top+t.bottom}return this.mw=h.width,this.mh=h.height,h}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class tt extends J{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new j(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new U(t,"rct-legend-item-label")),this._label.anchor=X.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const h=e.source;this._label.setBoolData("hidden",!h.visible),this._marker.setBoolData("hidden",!h.visible),this._label.setBoolData("empty",null===(n=h.isEmpty)||void 0===n?void 0:n.call(h)),this._marker.setBoolData("empty",null===(o=h.isEmpty)||void 0===o?void 0:o.call(h)),this._label.text=e.text()||"…";const a=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():E,l={width:(d=this._label.getBBox()).width,height:d.height};var d;return this._gap=v(e.legend.options.markerGap,0),{width:a.width+this._gap+l.width,height:y(a.height,l.height)}}_doLayout(t){const e=this._rMarker,s=v(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class et extends Q{constructor(t){super(t,et.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new A(this,tt)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,o=e.items(),h=this._vertical="vertical"===e.getLayout();return this._ipr=v(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?v(n.gap,0):0,h?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,h,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,h=this._margins,a=this._paddings,l=this._vertical,d=h.left+a.left,c=h.top+a.top;let _,u=d,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.top+h.bottom+a.top+a.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.left+h.right+a.left+a.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,h=e.items(),a=this._itemViews,l=o.itemGap||0,d=o.lineGap||0,c=e.getMarkerSize(),_=a.count,u=this._rowViews=[],p=this._sizes=[];let g,m,f,w;a.forEach(((e,s)=>{e.setMarker(h[s].source.legendMarker(t,c)),e.measure(t,h[s],r,n,1)}));let v=0,x=0;if(s){for(;v<_;)w=a.get(v),x%i==0?(u.push(f=[w]),m=w.mh,x++,v++):(m+=l+w.mh,m<=n?(f.push(w),x++,v++):x=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=y(s,t.mw),r=y(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=y(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=d*(u.length-1)}else{for(;v<_;)w=a.get(v),x%i==0?(u.push(f=[w]),g=w.mw,x++,v++):(g+=l+w.mw,g<=r?(f.push(w),x++,v++):x=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=y(s,t.mh)})),e+=l*(t.length-1),g=y(g,e),m+=s,p.push(s)})),m+=d*(u.length-1)}return{width:g,height:m}}}et.LEGEND_CLASS="rct-legend";class st extends e.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,s,i,r){const n=this.views,o=[];for(this.isX=i,r._axes.forEach((t=>{t.checkVisible()&&s.isValidAxis(t)&&o.push(t)}));n.length<o.length;){const s=new e.AxisView(t);this.add(s),n.push(s)}for(;n.length>o.length;)n.pop().remove();if(n.forEach(((t,e)=>{t.setModel(o[e])})),this.axes=o,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){const i=this.views,r=this.axes;i.forEach(((s,i)=>{const n=r[i];e.forEach((e=>{e.forEach((e=>{e.isConnected(n)&&s.setVis(this.visible)&&(s.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer),n._isHorz||(e._axes||(e._axes=[]),e._axes.push(n)))}))}))})),e.forEach((e=>{e.forEach((e=>{e._axes&&(e._gridRowContainer.addAll(t,e._axes),e._axes=[])}))}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).width})),{width:e,height:i}}}_doLayout(t){const e=this.views,s=this.width,i=this.height,r=e.length;let n=0,o=r-1;if(this.isHorz){let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()<1)break;t.trans(0,a),a+=t.mh}for(t=a,a=i;o>=0;o--){const t=e[o];if(t.model._posValue()>-1)break;a-=t.mh,t.trans(0,a)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mh;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(0,t),t+=i.mh}e.forEach((t=>{t.resize(s,t.mh),t.model._calcPoints(s,999),t.layout()}))}else{let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()>-1)break;t.trans(a,0),a+=t.mw}for(t=a,a=s;o>=0;o--){const t=e[o];if(t.model._posValue()<1)break;a-=t.mw,t.trans(a,0)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mw;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(t,0),t+=i.mw}e.forEach((t=>{t.resize(t.mw,i),t.model._calcPoints(i,999),t.layout()}))}}}class it extends e.SectionView{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((s,n)=>{this.isX?(s.row=i,s.col=n):(s.col=i,s.row=n),s.prepare(t,e,this.isX,r[n])}))}prepareGuides(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,n)=>{this.isX?(r.row=i,r.col=n):(r.col=i,r.row=n),r.prepareGuides(t,e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):this.sections.reduce(((i,r)=>Math.max(i,r.checkWidths(t,e,s))),0):0}checkHeights(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>Math.max(i,r.checkHeights(t,e,s))),0):this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,s,i,r,n){let o=0,h=0;return this._isHorz?this.sections.forEach((o=>{h=e.maxv(h,o.measure(t,s,i,r,n).height)})):this.sections.forEach((h=>{o=e.maxv(o,h.measure(t,s,i,r,n).width)})),{width:o,height:h}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height),e.trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]),e.trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class rt extends e.BodyView{constructor(t,e){super(t,e),this.row=0,this.col=0,this.add(this._legendView=new et(t))}getCol(){return this.col}getRow(){return this.row}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}prepareRender(t,s){const i=this.row,r=this.col,n=s._split.getPane(i,r).body;this._animatable=e.RcControl._animatable&&s.animatable(),this._prepareSeries(t,s,s._getSeries().getPaneSeries(i,r)),this._prepareGauges(t,s,s._getGauges().getPaneVisibles(i,r)),this._prepareAnnotations(t,n.getAnnotations().concat(s._getAnnotations().getPaneVisibles(i,r)))}_doMeasure(t,e,s,i,r){return this._legendView.setVis(e.pane.legend.visible)&&this._legendView.measure(t,e.pane.legend,s,i,r),super._doMeasure(t,e,s,i,r)}_doLayout(){super._doLayout();const t=this._legendView;if(t.visible){this._seriesViews.forEach((e=>{if(e.needDecoreateLegend()){const s=t.legendOfSeries(e.model);s&&e.decoreateLegend(s)}}));const e=t.model.options,s=e.align,i=e.verticalAlign;let r=0,n=0,o=+e.offsetX||0;switch(s){case"right":r+=this.width-t.mw-o;break;case"center":r+=(this.width-t.mw)/2+o;break;default:r+=o}switch(o=+e.offsetY||0,i){case"bottom":n+=this.height-t.mh-o;break;case"middle":n+=(this.height-t.mh)/2+o;break;default:n+=o}t.trans(r,n).resize(t.mw,t.mh),t.layout()}}}class nt extends e.PaneContainer{constructor(t,e){super(t,nt.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r){const n=e.chart,o=this._inverted=e.chart.isInverted(),h=e._xAxes,a=e._yAxes,l=s,d=i;this.$_prepareAxes(t,h,!0),this.$_prepareAxes(t,a,!1),e.measureAxes(s,i,o,r),o?(s-=this._xContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0),i-=this._yContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0)):(i-=this._xContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0),s-=this._yContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0)),e.measureAxes(s,i,o,r),this._xContainers.forEach((e=>e.measure(t,n,s,i,r))),this._yContainers.forEach((e=>e.measure(t,n,s,i,r))),s=l,i=d,o?(s-=this._xContainers.reduce(((t,e)=>t+e.mw),0),i-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(i-=this._xContainers.reduce(((t,e)=>t+e.mh),0),s-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),r++,e.measureAxes(s,i,o,r),this.$_prepareAxisGuides(t,h,!0),this.$_prepareAxisGuides(t,a,!1),this._xContainers.forEach((e=>{e.measure(t,n,s,i,r)})),this._yContainers.forEach((e=>{e.measure(t,n,s,i,r)}));const c=e.getXLens(o?i:s),_=e.getYLens(o?s:i);e.completeAxesPoints(c,_)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}getSeries(t){for(const e of this.bodies){const s=e.findSeries(t);if(s)return s}}legendByDom(t){for(const e of this.bodies){const s=e._legendView.legendByDom(t);if(s)return s}}$_init(t){this._back||(this.add(this._back=new e.RectElement(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new e.LayerElement(t,void 0)),this.add(this._axisContainer=new e.LayerElement(t,void 0)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount,r=e.rowCount,n=e.colCount,o=this._bodies,h=this._bodyMap=[];for(;o.length<i;){const e=new rt(t,this._owner);this._bodyContainer.add(e),o.push(e)}for(;o.length>i;)o.pop().remove();for(let t=0;t<r;t++){const e=[];for(let s=0;s<n;s++){const i=o[t*n+s];e.push(i),i.row=t,i.col=s}h.push(e)}o.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=this._model.chart,r=s?this._xContainers:this._yContainers,n=s?e.rows():e.cols();for(;r.length<n;){const e=new it(t,s);this._axisContainer.add(e),r.push(e)}for(;r.length>n;)r.pop().remove();r.forEach(((s,r)=>{s.prepare(t,i,e,r)}))}$_prepareAxisGuides(t,e,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=s.length,n=new Array(2*(r+1)),o=e-t.reduce(((t,e)=>t+e[i]),0),h=this._model._calcSizes(s,o);let a=0,l=0;for(l=0;l<r;l++)n[2*l]=a,n[2*l+1]=a+=t[l][i],a+=h[l];return n[2*l]=a,n[2*l+1]=a+t[l][i],n}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,e,t.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,s,t.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,s,t.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,e,t.colSizes(),"mw"))}$_layoutAxes(t,e,s,i){const r=this.control._padding,n=this._rowPoints,o=this._colPoints,h=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=o[1],e=o[o.length-2]-t;h.forEach(((t,s)=>{t.resize(t.mw,e),t.trans(n[2*s],i-o[o.length-2]),t.layout(o)}))}else{const t=n[1],e=n[n.length-2]-t;h.forEach(((s,h)=>{const a=s.sections;for(let t=0,e=a.length;t<e;t++){const s=a[t],i=0===t?r.left:0,o=t===e-1?r.right:0;let h=0,l=0;e>1&&(h=n[2*t+1]-n[2*t],l=n[2*(t+1)+1]-n[2*(t+1)],0===t?a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2:t===e-1?a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2:(a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2,a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2)),s.setMargins(i,h,l,o)}s.resize(e,s.mh),s.trans(t,i-o[2*h+1]),s.layout(n)}))}else if(e){const t=o[1];s=o[o.length-2]-t,h.forEach(((e,a)=>{const l=e.sections;for(let t=0,e=l.length;t<e;t++){const s=l[t],i=0===a?r.left:0,d=a===h.length-1?r.right:0;let c=0,_=0;e>1&&(c=o[2*t+1]-o[2*t],_=o[2*(t+1)+1]-o[2*(t+1)],0===t?l[t+1].isEmpty()?_=o[2*(t+1)]-o[2*(t+1)-1]:_/=2:t===e-1?l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2:(l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2,l[t+1].isEmpty()?_=o[2*(t+1)]-n[2*(t+1)-1]:_/=2)),s.setMargins(i,c,_,d)}e.resize(s,e.mh),e.trans(t,i-n[2*a+1]),e.layout(o)}))}else{const t=n[n.length-2],e=t-n[1];h.forEach(((s,r)=>{s.resize(s.mw,e),s.trans(o[2*r],i-t),s.layout(n)}))}}$_layoutBodies(t,e,s){const i=t.rowCount,r=t.colCount,n=this._rowPoints,o=this._colPoints,h=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const a=h[e*r+n],l=o[2*n+1],d=o[2*(n+1)];a.measure(this.doc,t.getPane(e,n).body,i-s,d-l,1),a.resize(i-s,d-l),a.trans(s,this.height-d),a.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],a=n[2*(e+1)];for(let n=0;n<r;n++){const l=h[e*r+n],d=o[2*(n+1)-1],c=o[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,c-d,a-i,1),l.resize(c-d,a-i),l.trans(d,s-a),l.layout()}}}}function ot(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(c),t.ChartView.registerPaneClass(nt))}nt.STYLE_NAME="rct-panes",ot(i),t.Split=c,t.default=ot,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartSplit={},t.RealChart)}(this,(function(t,e){"use strict";function s(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}})),e.default=t,Object.freeze(e)}var i=s(e);class r{constructor(t,e){this.row=t,this.col=e,this._axes=[]}sort(t,e){const s=e&&!t||!e&&t;this._axes.length>1&&(s?this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?e._index-t._index:s>0?t._index-e._index:t.row!==e.row?e.row-t.row:t.row<this.row?e._index-t._index:t._index-e._index:i-s})):this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?t._index-e._index:s>0?e._index-t._index:t.col!==e.col?t.col-t.col:t.col<this.col?t._index-e._index:e._index-t._index:s-i})))}}class n{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(t,e,s,i){this._doPrepare(t,e,s),this._matrix.forEach((t=>{t.forEach((t=>t.sort(this.isX,i)))}))}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}_buildTicks(t,e){const s=this.isX;this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{!i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))})),this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))}))}_calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{if(e<2||s){const r=s?i.options.col:i.options.row;i._calcPoints(t[r],e)}}))}))}))}}class o extends n{constructor(t){super(t,!0)}_doPrepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var s,r;const n=t.options.position;let o=t.row;"opposite"===n?(o++,t._runPos=n):o<e-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(s=i[o])||void 0===s?void 0:s[t.col])||void 0===r||r._axes.push(t)}))}}class h extends n{constructor(t){super(t,!1)}_doPrepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var e,r;const n=t.options.position;let o=t.col;"opposite"===n?(o++,t._runPos=n):t.col<s-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(e=i[t.row])||void 0===e?void 0:e[o])||void 0===r||r._axes.push(t)}))}}class a extends e.Body{constructor(t){super(t.chart),this.pane=t}contains(t){return t.col===this.pane.col||t.row===this.pane.row}}a.defaults=e.extend(e.Body.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class l extends e.Legend{constructor(t){super(t.chart),this.pane=t}_doPrepareRender(t){super._doPrepareRender(t),this._location="body"}_getLegendSources(){return this.options.visible?this.chart._getSeries().getLegendSources(this.pane.row,this.pane.col):[]}}class d extends e.ChartItem{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInit(t){t.body=(this._body=new a(this)).init(),t.legend=(this._legend=new l(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class c extends e.ChartItem{constructor(t){super(t),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new o(t),this._yAxes=new h(t)}get count(){return this._rows*this._cols}get rowCount(){return this._rows}get colCount(){return this._cols}get paneCount(){return this._rows*this._cols}colSizes(){return this._colSizes}rowSizes(){return this._rowSizes}getPane(t,e){return this._panes[t][e]}getRow(t){return this._panes[t]}getColumn(t){return this._panes.map((e=>e[t]))}getAxisOf(t,e){var s,i;const r=this.chart,n=t.body;if(n){const o=n.pane;return e?r._getXAxes().get(t.options.xAxis)||this._xAxes.get(o.row,o.col)._axes[0]||(null===(s=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===s?void 0:s._xAxisObj):r._getXAxes().get(t.options.yAxis)||this._yAxes.get(n.pane.row,n.pane.col)._axes[0]||(null===(i=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===i?void 0:i._yAxisObj)}}isValidAxis(t){return t&&t.row<this._rows&&t.col<this._cols}_doLoadProp(t,e){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,e)}_doSetSimple(t){if(e.isArray(t)&&t.length>0){const s=e.maxv(1,+t[0]),i=e.maxv(1,e.pickNum(+t[1],s));return s>0&&i>0&&(this.$_parsePanes(s,i),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),e.isObject(t)&&(this.$_parsePanes(t.rows,t.cols),this._paneDic=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._panes=this.$_collectPanes(t),this._panes.forEach((t=>t.forEach((t=>t._prepareRender()))))}_calcSizes(t,s){const i=t.length,r=new Array(i);let n=0;if(i>1){let o=s,h=0;for(n=0;n<i;n++){const s=t[n];e.isNumber(s)?o-=r[n]=Math.max(0,Math.min(o,s)):h+=s.size}if(h>0)for(n=0;n<i;n++){const s=t[n];e.isNumber(s)||(r[n]=o*s.size/h)}}else r[n]=s;return r}getXLens(t){return this._calcSizes(this._colSizes,t)}getYLens(t){return this._calcSizes(this._rowSizes,t)}measureAxes(t,e,s,i){const r=this.getXLens(s?e:t),n=this.getYLens(s?t:e);this._xAxes._buildTicks(r,i),this._yAxes._buildTicks(n,i),this.$_calcAxesPoints(r,n,i)}$_calcAxesPoints(t,e,s){this._xAxes._calcPoints(t,s),this._yAxes._calcPoints(e,s)}completeAxesPoints(t,e){this.$_calcAxesPoints(t,e,101)}getBodyAnnotation(t){for(const e in this._paneDic){const s=this._paneDic[e].body.getAnnotation(t);if(s)return s}}prepareRender(t,e){const s=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(t,this._rows,this._cols,s),this._yAxes._prepare(e,this._rows,this._cols,s)}$_parseSizes(t){let s;return s=e.isArray(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],s.map((t=>{if(e.isString(t)){const s=t.trim();return{size:"*"===s?1:e.pickNum(parseFloat(s),1)}}return e.pickNum(+t,1)}))}$_parsePanes(t,e){this._colSizes=this.$_parseSizes(e),this._rowSizes=this.$_parseSizes(t),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(t){const s=this.chart,i=this._op.extendBody?s._body._config:void 0,r={};if(t=e.isArray(t)?t:e.isObject(t)?[t]:null,e.isArray(t)&&t.forEach((t=>{const e=+t.row||0,n=+t.col||0;if(n>=0&&n<this._cols&&e>=0&&e<this._rows){const o=new d(s,e,n);let h=t;o.init(),!i||t&&t.body&&!1===t.body.extended||(t?(h=Object.assign({},t),t.body?!1!==t.body.extended&&(h.body=Object.assign({},i,t.body)):h.body=i):h={body:i}),o._load(h),r[e+","+n]=o}})),i)for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const n=t+","+e;if(!r[n]){const o=new d(s,t,e);o.init(),o._load({body:i}),r[n]=o}}return r}$_collectPanes(t){const e=[];for(let s=0;s<this._rows;s++){const i=[];for(let e=0;e<this._cols;e++){const r=this._paneDic[s+","+e]||new d(t,s,e)._initObject();i.push(r)}e.push(i)}return e}}c.defaults=e.extend(e.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0});const _="http://www.w3.org/2000/svg",u=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},p=Array.isArray,g=function(t){return"string"==typeof t},m=Object.assign,f=Math.min,y=Math.max,w=Math.abs,v=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t};let b=0;class x{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(b++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class A extends x{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const E=Object.freeze({x:0,y:0,width:0,height:0});const S={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",N=S[C]||S[C="ko"];const k=void 0;function D(t){return t+"px"}function L(t){return null==t||Number.isNaN(t)||""===t}const T={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},B=function(t){const e=T[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return T[t]=e,e}return e};class M{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}const $=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class R{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&R.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,R.month_days[R.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,a=e+Math.ceil((o+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===a?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!p(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!p(t))return m({},t)}static checkArray(t){return p(t)?t:void 0}static makeArray(t,e=!1){return null!=t?p(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return p(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(p(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return p(t)?t:null!=t?[t]:null}static copyArray(t){return p(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-$}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static parseTuples(t){if(p(t)){const e=[];let s=-1/0;return t.forEach(((i,r)=>{p(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||r!==t.length-1||e.push([1/0,+i])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=p(t)?[]:{};for(let s of Object.keys(t))e[s]=R.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),R.log(t,+new Date-s+"ms")}static clamp(t,e,s){return y(e,f(s,t))}static makeIntArray(t,e){const s=new Array(y(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=w(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}var P;R.LOGGING=!1,R.week_days=["일","월","화","수","목","금","토"],R.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],R.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],R.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}(),function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(P||(P={}));const z="$ProductVersion";class O extends x{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||O.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),M.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){L(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){M.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(H.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(H.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new F(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new G(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(g(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,H.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||((t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))})(N.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const n=this._svg=i.createElementNS(_,"svg");n.classList.add("rct-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=i.createElement("desc");o.textContent="Created by RealChart v"+z,n.appendChild(o);const h=this._defs=i.createElementNS(_,"defs");this._initDefs(i,h),n.appendChild(h),r.appendChild(n),this._root=new V(this),n.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),m(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(_,"filter");s.setAttribute("id",O.SHADOW_FILTER);const i=t.createElementNS(_,"feGaussianBlur");i.setAttribute("stdDeviation","1.5"),i.setAttribute("in","SourceAlpha"),s.appendChild(i);const r=t.createElementNS(_,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),s.appendChild(r);const n=t.createElementNS(_,"feFlood");n.setAttribute("flood-color","#000"),s.appendChild(n);const o=t.createElementNS(_,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),s.appendChild(o);const h=t.createElementNS(_,"feMerge"),a=t.createElementNS(_,"feMergeNode"),l=t.createElementNS(_,"feMergeNode");l.setAttribute("in","SourceGraphic"),h.appendChild(a),h.appendChild(l),s.appendChild(h),e.appendChild(s)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{R.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;m(this._htmlRoot.style,{left:D(e.left-t.left),top:D(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=M.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),R.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),s):this.invalidateLayout())}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}O.CLASS_NAME="rct-control",O.SHADOW_FILTER="rr-chart-shadow-filter",O._animatable=!0;class H extends x{constructor(t,e,s=k){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(_,s||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(t,e){const s=t.createElementNS(_,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(_,e);return this._dom.insertBefore(i,s),i}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return L(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t=R.isValidNum(t)?t:this._tx,e=R.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=R.isValidNum(t)?t:this._tx,e=R.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transEx2(t,e,s=0,i=!0){const r=R.isValidNum(t)?t:this._tx,n=R.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const h=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&h.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&R.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&R.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(B(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(B(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(B(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(g(t))t&&this._dom.classList.add(t);else if(u(t)){const e=this.dom.style;for(let s in t)e.setProperty(B(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){g(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){g(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){g(t)?t&&this.addClass(t):u(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){var s,i;null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,(i="",void 0!==(s=e)?s:i))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==s||s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==e||e.addEventListener("finish",(()=>{delete this.hiding,this.setVis(!1)})),this.hiding=!0}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(H.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return H.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(R.isValidNum(e)||R.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+R.pick(this._originX,t.getAttribute("x"),0)+" "+R.pick(this._originY,t.getAttribute("y")||0)+")"),R.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=R.getNumber(this._scaleX,1),n=R.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}H.DEBUGGING=!1,H.TESTING=!1,H.ASSET_KEY="_asset_",H.TEMP_KEY="_temp_";class V extends H{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class I extends H{constructor(t){super(t,k,"clipPath");const e=this._id=R.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class F extends I{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const h=this._rect=new H(t,null,"rect");h.setAttr("fill","none"),n>0&&h.setAttr("rx",String(n)),o>0&&h.setAttr("ry",String(o)),isNaN(e)||h.setBounds(e,s,i,r),this.add(h)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class G extends I{constructor(t){super(t),this.add(this._circle=new H(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class j extends H{static create(t,e,s,i,r,n,o=0){return new j(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=k,s=k){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Y{static isBright(t){return new Y(t).isBright()}static getContrast(t,e,s){return new Y(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Y(t),r=new Y(e),n=1-s,o=Math.round(i.r*s+r.r*n),h=Math.round(i.g*s+r.g*n),a=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${h},${a},${l})`:`rgb(${o},${h},${a})`}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(R.startsWith(t,"rgb(")&&R.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):R.startsWith(t,"rgba(")&&R.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):R.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Y(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var X,W,q;Y.BLACK="#000",Y.WHITE="#fff",function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(X||(X={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(W||(W={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(q||(q={}));class U extends H{constructor(t,e=void 0){super(t,e,"text"),this._layout=W.TOP,this._overflow=q.WRAP,this._dirty=!0,this._text="",this.anchor=X.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case W.MIDDLE:i=Math.floor(s/2);break;case W.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=y(0,t),(e=f(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Y.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}class K{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new K(t,t,t,t):new K(t,t,e,e):new K(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new K(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=v(t.paddingLeft,0),this.right=v(t.paddingRight,0),this.top=v(t.paddingTop,0),this.bottom=v(t.paddingBottom,0),this}applyMargin(t){return this.left=v(t.marginLeft,0),this.right=v(t.marginRight,0),this.top=v(t.marginTop,0),this.bottom=v(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}}K.Empty=Object.freeze(new K),K.Temp=new K;class Z extends H{constructor(t,e=k){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Z.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Z.IGNORE_ATTRS={width:"",height:""};class J extends H{constructor(t,e=k){super(t,e,"g"),H.DEBUGGING&&(this.add(this._debugRect=new j(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),H.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new j(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Q extends J{constructor(t,e,s){super(t,e),this._margins=new K,this._paddings=new K,this.add(this._background=new j(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const h=this._doMeasure(t,e,s,i,r);if(h.width+=o.left+o.right,h.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=h.width+=t.left+t.right,this.mh=h.height+=t.top+t.bottom}return this.mw=h.width,this.mh=h.height,h}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class tt extends J{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new j(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new U(t,"rct-legend-item-label")),this._label.anchor=X.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const h=e.source;this._label.setBoolData("hidden",!h.visible),this._marker.setBoolData("hidden",!h.visible),this._label.setBoolData("empty",null===(n=h.isEmpty)||void 0===n?void 0:n.call(h)),this._marker.setBoolData("empty",null===(o=h.isEmpty)||void 0===o?void 0:o.call(h)),this._label.text=e.text()||"…";const a=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():E,l={width:(d=this._label.getBBox()).width,height:d.height};var d;return this._gap=v(e.legend.options.markerGap,0),{width:a.width+this._gap+l.width,height:y(a.height,l.height)}}_doLayout(t){const e=this._rMarker,s=v(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class et extends Q{constructor(t){super(t,et.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new A(this,tt)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,o=e.items(),h=this._vertical="vertical"===e.getLayout();return this._ipr=v(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?v(n.gap,0):0,h?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,h,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,h=this._margins,a=this._paddings,l=this._vertical,d=h.left+a.left,c=h.top+a.top;let _,u=d,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.top+h.bottom+a.top+a.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.left+h.right+a.left+a.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,h=e.items(),a=this._itemViews,l=o.itemGap||0,d=o.lineGap||0,c=e.getMarkerSize(),_=a.count,u=this._rowViews=[],p=this._sizes=[];let g,m,f,w;a.forEach(((e,s)=>{e.setMarker(h[s].source.legendMarker(t,c)),e.measure(t,h[s],r,n,1)}));let v=0,b=0;if(s){for(;v<_;)w=a.get(v),b%i==0?(u.push(f=[w]),m=w.mh,b++,v++):(m+=l+w.mh,m<=n?(f.push(w),b++,v++):b=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=y(s,t.mw),r=y(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=y(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=d*(u.length-1)}else{for(;v<_;)w=a.get(v),b%i==0?(u.push(f=[w]),g=w.mw,b++,v++):(g+=l+w.mw,g<=r?(f.push(w),b++,v++):b=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=y(s,t.mh)})),e+=l*(t.length-1),g=y(g,e),m+=s,p.push(s)})),m+=d*(u.length-1)}return{width:g,height:m}}}et.LEGEND_CLASS="rct-legend";class st extends e.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,s,i,r){const n=this.views,o=[];for(this.isX=i,r._axes.forEach((t=>{t.checkVisible()&&s.isValidAxis(t)&&o.push(t)}));n.length<o.length;){const s=new e.AxisView(t);this.add(s),n.push(s)}for(;n.length>o.length;)n.pop().remove();if(n.forEach(((t,e)=>{t.setModel(o[e])})),this.axes=o,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){const i=this.views,r=this.axes;i.forEach(((s,i)=>{const n=r[i];e.forEach((e=>{e.forEach((e=>{e.isConnected(n)&&s.setVis(this.visible)&&(s.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer),n._isHorz||(e._axes||(e._axes=[]),e._axes.push(n)))}))}))})),e.forEach((e=>{e.forEach((e=>{e._axes&&(e._gridRowContainer.addAll(t,e._axes),e._axes=[])}))}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).width})),{width:e,height:i}}}_doLayout(t){const e=this.views,s=this.width,i=this.height,r=e.length;let n=0,o=r-1;if(this.isHorz){let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()<1)break;t.trans(0,a),a+=t.mh}for(t=a,a=i;o>=0;o--){const t=e[o];if(t.model._posValue()>-1)break;a-=t.mh,t.trans(0,a)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mh;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(0,t),t+=i.mh}e.forEach((t=>{t.resize(s,t.mh),t.model._calcPoints(s,999),t.layout()}))}else{let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()>-1)break;t.trans(a,0),a+=t.mw}for(t=a,a=s;o>=0;o--){const t=e[o];if(t.model._posValue()<1)break;a-=t.mw,t.trans(a,0)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mw;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(t,0),t+=i.mw}e.forEach((t=>{t.resize(t.mw,i),t.model._calcPoints(i,999),t.layout()}))}}}class it extends e.SectionView{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((s,n)=>{this.isX?(s.row=i,s.col=n):(s.col=i,s.row=n),s.prepare(t,e,this.isX,r[n])}))}prepareGuides(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,n)=>{this.isX?(r.row=i,r.col=n):(r.col=i,r.row=n),r.prepareGuides(t,e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):this.sections.reduce(((i,r)=>Math.max(i,r.checkWidths(t,e,s))),0):0}checkHeights(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>Math.max(i,r.checkHeights(t,e,s))),0):this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,s,i,r,n){let o=0,h=0;return this._isHorz?this.sections.forEach((o=>{h=e.maxv(h,o.measure(t,s,i,r,n).height)})):this.sections.forEach((h=>{o=e.maxv(o,h.measure(t,s,i,r,n).width)})),{width:o,height:h}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height),e.trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]),e.trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class rt extends e.BodyView{constructor(t,e){super(t,e),this.row=0,this.col=0,this.add(this._legendView=new et(t))}getCol(){return this.col}getRow(){return this.row}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}prepareRender(t,s){const i=s.chart,r=s.depth.visible,n=this.row,o=this.col,h=i._split.getPane(n,o).body;this._animatable=e.RcControl._animatable&&i.animatable(),this._prepareSeries(t,s,i._getSeries().getPaneSeries(n,o),r),this._prepareGauges(t,i,i._getGauges().getPaneVisibles(n,o)),this._prepareAnnotations(t,h.getAnnotations().concat(i._getAnnotations().getPaneVisibles(n,o)))}_doMeasure(t,e,s,i,r){return this._legendView.setVis(e.pane.legend.visible)&&this._legendView.measure(t,e.pane.legend,s,i,r),super._doMeasure(t,e,s,i,r)}_doLayout(){super._doLayout();const t=this._legendView;if(t.visible){this._seriesViews.forEach((e=>{if(e.needDecoreateLegend()){const s=t.legendOfSeries(e.model);s&&e.decoreateLegend(s)}}));const e=t.model.options,s=e.align,i=e.verticalAlign;let r=0,n=0,o=+e.offsetX||0;switch(s){case"right":r+=this.width-t.mw-o;break;case"center":r+=(this.width-t.mw)/2+o;break;default:r+=o}switch(o=+e.offsetY||0,i){case"bottom":n+=this.height-t.mh-o;break;case"middle":n+=(this.height-t.mh)/2+o;break;default:n+=o}t.trans(r,n).resize(t.mw,t.mh),t.layout()}}}class nt extends e.PaneContainer{constructor(t,e){super(t,nt.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r){const n=e.chart,o=this._inverted=e.chart.isInverted(),h=e._xAxes,a=e._yAxes,l=s,d=i;this.$_prepareAxes(t,h,!0),this.$_prepareAxes(t,a,!1),e.measureAxes(s,i,o,r),o?(s-=this._xContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0),i-=this._yContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0)):(i-=this._xContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0),s-=this._yContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0)),e.measureAxes(s,i,o,r),this._xContainers.forEach((e=>e.measure(t,n,s,i,r))),this._yContainers.forEach((e=>e.measure(t,n,s,i,r))),s=l,i=d,o?(s-=this._xContainers.reduce(((t,e)=>t+e.mw),0),i-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(i-=this._xContainers.reduce(((t,e)=>t+e.mh),0),s-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),r++,e.measureAxes(s,i,o,r),this.$_prepareAxisGuides(t,h,!0),this.$_prepareAxisGuides(t,a,!1),this._xContainers.forEach((e=>{e.measure(t,n,s,i,r)})),this._yContainers.forEach((e=>{e.measure(t,n,s,i,r)}));const c=e.getXLens(o?i:s),_=e.getYLens(o?s:i);e.completeAxesPoints(c,_)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}getSeries(t){for(const e of this.bodies){const s=e.findSeries(t);if(s)return s}}legendByDom(t){for(const e of this.bodies){const s=e._legendView.legendByDom(t);if(s)return s}}$_init(t){this._back||(this.add(this._back=new e.RectElement(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new e.LayerElement(t,void 0)),this.add(this._axisContainer=new e.LayerElement(t,void 0)))}$_prepareBodies(t,e){e.chart;const s=e.paneCount,i=e.rowCount,r=e.colCount,n=this._bodies,o=this._bodyMap=[];for(;n.length<s;){const e=new rt(t,this._owner);this._bodyContainer.add(e),n.push(e)}for(;n.length>s;)n.pop().remove();for(let t=0;t<i;t++){const e=[];for(let s=0;s<r;s++){const i=n[t*r+s];e.push(i),i.row=t,i.col=s}o.push(e)}n.forEach((s=>{s.prepareRender(t,e.getPane(s.row,s.col).body),s.prepareGuideContainers(),s._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=this._model.chart,r=s?this._xContainers:this._yContainers,n=s?e.rows():e.cols();for(;r.length<n;){const e=new it(t,s);this._axisContainer.add(e),r.push(e)}for(;r.length>n;)r.pop().remove();r.forEach(((s,r)=>{s.prepare(t,i,e,r)}))}$_prepareAxisGuides(t,e,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=s.length,n=new Array(2*(r+1)),o=e-t.reduce(((t,e)=>t+e[i]),0),h=this._model._calcSizes(s,o);let a=0,l=0;for(l=0;l<r;l++)n[2*l]=a,n[2*l+1]=a+=t[l][i],a+=h[l];return n[2*l]=a,n[2*l+1]=a+t[l][i],n}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,e,t.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,s,t.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,s,t.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,e,t.colSizes(),"mw"))}$_layoutAxes(t,e,s,i){const r=this.control._padding,n=this._rowPoints,o=this._colPoints,h=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=o[1],e=o[o.length-2]-t;h.forEach(((t,s)=>{t.resize(t.mw,e),t.trans(n[2*s],i-o[o.length-2]),t.layout(o)}))}else{const t=n[1],e=n[n.length-2]-t;h.forEach(((s,h)=>{const a=s.sections;for(let t=0,e=a.length;t<e;t++){const s=a[t],i=0===t?r.left:0,o=t===e-1?r.right:0;let h=0,l=0;e>1&&(h=n[2*t+1]-n[2*t],l=n[2*(t+1)+1]-n[2*(t+1)],0===t?a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2:t===e-1?a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2:(a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2,a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2)),s.setMargins(i,h,l,o)}s.resize(e,s.mh),s.trans(t,i-o[2*h+1]),s.layout(n)}))}else if(e){const t=o[1];s=o[o.length-2]-t,h.forEach(((e,a)=>{const l=e.sections;for(let t=0,e=l.length;t<e;t++){const s=l[t],i=0===a?r.left:0,d=a===h.length-1?r.right:0;let c=0,_=0;e>1&&(c=o[2*t+1]-o[2*t],_=o[2*(t+1)+1]-o[2*(t+1)],0===t?l[t+1].isEmpty()?_=o[2*(t+1)]-o[2*(t+1)-1]:_/=2:t===e-1?l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2:(l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2,l[t+1].isEmpty()?_=o[2*(t+1)]-n[2*(t+1)-1]:_/=2)),s.setMargins(i,c,_,d)}e.resize(s,e.mh),e.trans(t,i-n[2*a+1]),e.layout(o)}))}else{const t=n[n.length-2],e=t-n[1];h.forEach(((s,r)=>{s.resize(s.mw,e),s.trans(o[2*r],i-t),s.layout(n)}))}}$_layoutBodies(t,e,s){const i=t.rowCount,r=t.colCount,n=this._rowPoints,o=this._colPoints,h=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const a=h[e*r+n],l=o[2*n+1],d=o[2*(n+1)];a.measure(this.doc,t.getPane(e,n).body,i-s,d-l,1),a.resize(i-s,d-l),a.trans(s,this.height-d),a.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],a=n[2*(e+1)];for(let n=0;n<r;n++){const l=h[e*r+n],d=o[2*(n+1)-1],c=o[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,c-d,a-i,1),l.resize(c-d,a-i),l.trans(d,s-a),l.layout()}}}}function ot(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(c),t.ChartView.registerPaneClass(nt))}nt.STYLE_NAME="rct-panes",ot(i),t.Split=c,t.default=ot,Object.defineProperty(t,"__esModule",{value:!0})}));
|