realchart 1.4.13 → 1.4.14
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.js +1 -1
- package/gauge.mjs +1 -1
- package/heatmap.js +1 -1
- package/heatmap.mjs +1 -1
- package/ie/gauge.ie.js +1 -1
- package/ie/heatmap.ie.js +1 -1
- package/ie/index.ie.js +2 -2
- package/ie/pictogram.ie.js +2 -2
- package/ie/split.ie.js +1 -1
- package/ie/treemap.ie.js +1 -1
- package/ie/vector.ie.js +1 -1
- package/ie/wordcloud.ie.js +1 -1
- package/index.d.ts +4 -4
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/pictogram.js +2 -2
- package/pictogram.mjs +2 -2
- package/split.js +1 -1
- package/split.mjs +1 -1
- package/treemap.js +1 -1
- package/treemap.mjs +1 -1
- package/vector.js +1 -1
- package/vector.mjs +1 -1
- package/wordcloud.js +1 -1
- package/wordcloud.mjs +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v1.4.
|
|
3
|
+
* RealChart v1.4.14
|
|
4
4
|
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",s=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},h=function(t){return"number"==typeof t},l=function(t){return"boolean"==typeof t},_=Object.assign,c=Math.floor,d=Math.ceil,u=Math.cos,p=Math.sin,g=Math.log10,m=Math.min,f=Math.max,x=Math.abs,y=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},w=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},S=(t,e,s)=>t+(e-t)*s,V=function(t){return"function"==typeof t?t:null},A={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 P="ko",C=A[P]||A[P="ko"];const k=(t,e)=>{t&&i(e)&&(C=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},L=void 0,N=Math.PI,M=2*N,E=-N/2,T=2*N/360,B=360/N/2,O="%".charCodeAt(0);function D(t){return parseFloat(t.toPrecision(12))}function R(t){return Math.floor(1e6*t)/1e6}function $(t){return t+"px"}function F(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function I(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function H(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function j(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===O?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;Q(C.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function X(t,e){return j(t,!0)||j(e,!1)}function Y(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const W="fill",U="stroke",Z={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"},q=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};class K extends Error{}const Q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},J=function(t,e,s,n=!0,a=!0,h=!1,l){let c,d;if(n&&(e=-Number.MAX_VALUE,s=Number.MAX_VALUE),r(t))c=[],t.forEach((t=>{if(i(t)&&o(t.color)){const i={fromValue:y(t.fromValue,d?d.toValue:e),toValue:y(t.toValue,s),color:t.color,style:t.style?_({},t.style):L};i.fromValue<i.toValue&&(c.push(i),d=i)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),a&&c.forEach((t=>{t.fromValue=f(t.fromValue,e),t.toValue=m(t.toValue,s)}));else if(i(t)&&r(t.colors)&&t.colors.length>0){const i=t.colors,n=r(t.styles)?t.styles:null;if(c=[],r(t.steps)&&t.steps.length>0){const o=r(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),s>o[o.length-1]&&o.push(s);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:i[m(t,i.length-1)],style:n?n[m(t,n.length-1)]:L})}else{let r=y(t.fromValue,e);const o=y(t.toValue,s),a=(o-r)/i.length;let h=0;for(;r<o;)c.push({fromValue:r,toValue:r+=a,color:i[m(h,i.length-1)],style:n?n[m(h,n.length-1)]:L}),h++}}if(h&&c&&c.length>0){let t=0,i=e;for(;t<c.length;)c[t].fromValue>i&&c.splice(t,0,{fromValue:i,toValue:c[t].fromValue,color:l}),i=c[t].toValue,t++;c[t-1].toValue<s&&c.push({fromValue:c[t-1].toValue,toValue:s,color:l})}return c},tt="shuffle",et="random",st="vertical-lr",it="vertical-rl",rt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const nt="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class ot{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&&ot.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(m(s,ot.month_days[ot.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(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?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&&!r(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&&!r(t))return _({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(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(r(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 r(t)?t:null!=t?[t]:null}static copyArray(t){return r(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()-rt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=f(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(r(t)){const e=[];let s=-1/0;return t.forEach(((i,n)=>{r(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||n!==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 isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=this.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(),ot.log(t,+new Date-s+"ms")}static clamp(t,e,s){return f(e,m(s,t))}static makeIntArray(t,e){const s=new Array(f(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 isAnimation(t){return"[object Animation]"===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=x(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}static diffAngle(t,e){const s=x(t-e);return m(s,M-s)}}ot.LOGGING=!1,ot.week_days=["일","월","화","수","목","금","토"],ot.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ot.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]],ot.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let at=0;class ht{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(at++))}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 lt extends ht{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const _t=function(t){return t&&"object"==typeof t};class ct extends lt{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),r(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=r(e)?e.slice():o(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(r(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else _t(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&Q(C.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class dt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let i;r(s)?i=new ct({},s):_t(s)&&r(s.values)&&(i=new ct(s.options,s.values)),this._map[e]=i}}}const ut="0".charCodeAt(0),pt="#".charCodeAt(0),gt=",".charCodeAt(0),mt="s".charCodeAt(0),ft="a".charCodeAt(0);class xt{static getFormatter(t){let e=xt.Formatters[t];return e||(xt.Formatters[t]=e=new xt(t)),e}static get Default(){return xt.getFormatter(xt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===ut;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===pt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===ut;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===gt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===mt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}xt.DEFAULT_FORMAT="",xt.Formatters={};const yt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],bt=[".","/","-",":"],wt="Z".charCodeAt(0),vt="z".charCodeAt(0),St="A".charCodeAt(0),Vt="a".charCodeAt(0),At="y".charCodeAt(0),Pt="M".charCodeAt(0),Ct="m".charCodeAt(0),kt="W".charCodeAt(0),Lt="w".charCodeAt(0),Nt="d".charCodeAt(0),Mt="H".charCodeAt(0),Et="h".charCodeAt(0),Tt="S".charCodeAt(0),Bt="s".charCodeAt(0);class Ot{static getFormatter(t){let e=Ot.Formatters[t];return e||(Ot.Formatters[t]=e=new Ot(t)),e}static get Default(){return Ot.getFormatter(C.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||C.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var o=s[r],a=o.length;switch(o.charCodeAt(0)){case At:i+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case Pt:i+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case Nt:i+=a>1?z(t.getDate()):t.getDate();break;case kt:i+=a>1?z(ot.weekOfYear(t,e)+1):ot.weekOfMonth(t,e,!0)+1;break;case Lt:i+=a>1?ot.long_week_days[t.getDay()]:ot.week_days[t.getDay()];break;case Mt:i+=a>1?z(t.getHours()):t.getHours();break;case Et:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?z(e):e}else i+=a>1?z(t.getHours()):t.getHours();break;case Ct:i+=a>1?z(t.getMinutes()):t.getMinutes();break;case Bt:i+=a>1?z(t.getSeconds()):t.getSeconds();break;case Vt:case St:t.getHours()<12?i+=C.am:i+=C.pm;break;case Tt:let s=t.getMilliseconds();i+=3==a?H(s):2==a?z(s):s.toString().substring(0,a);break;default:i+=o}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(bt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),yt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=St&&e<=wt||e>=Vt&&e<=vt)&&Q(C.invalidDateFormat,t)}e.push(n)}if(r<i&&ot.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&ot.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||C.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Ot.Formatters={};class Dt{static isBright(t){return new Dt(t).isBright()}static getContrast(t,e,s){return new Dt(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Dt(t),r=new Dt(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return nt?new Dt(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(ot.startsWith(t,"rgb(")&&ot.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):ot.startsWith(t,"rgba(")&&ot.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):ot.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 Dt(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}}Dt.BLACK="#000",Dt.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class Rt{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 setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}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}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:Rt.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(t,s){const i=t.createElementNS(e,"clipPath");return i.id=s,i.append(t.createElementNS(e,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(t){return Rt.isElement(t)&&t.namespaceURI===e}static isSVGClipPathElement(t){return Rt.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var $t;Rt.instanceOf=function(t,e){return Rt.isElement(t)&&t.tagName===e.toUpperCase()},Rt.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}($t||($t={}));const Ft={name:"RealChart",version:"1.4.13",license:"enterprise",code:null};class It{static decode(t){const e=It.CHARS,s=It.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}It.PAD="=",It.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class zt{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=zt.xor,i=zt.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=zt.xor,i=zt.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=zt.kb,i=zt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*zt.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=zt._decryptBlock;let i=zt._init(e),r=[],n=It.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*zt.POW24|n[a+1]*zt.POW16|n[a+2]*zt.POW8|n[a+3],h.right=n[a+4]*zt.POW24|n[a+5]*zt.POW16|n[a+6]*zt.POW8|n[a+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}zt.POW2=Math.pow(2,2),zt.POW3=Math.pow(2,3),zt.POW4=Math.pow(2,4),zt.POW8=Math.pow(2,8),zt.POW16=Math.pow(2,16),zt.POW24=Math.pow(2,24),zt.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class Ht{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=zt.decrypt(t,"dkdl"+this._getLDKey(zt.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}const Gt={linear:t=>t,inOutSine:t=>-(u(N*t)-1)/2},jt=function(t,e,s,i,r,n){const o=G(e,null!=s?s:"initial"),a=G(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Xt{constructor(){this.delay=0,this.duration=Xt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=m(1,f(0,D(s/this.duration)));this._easing&&(i=this._easing(i)),this._rate=i,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(i,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{s>=this.duration?this._stop(!1):!this._started||isFinite(this.duration)&&!this._timer||(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return this.endHandler||(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}cancel(){this._stop(!0)}rate(){return this._rate||0}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=y(t,Xt.DURATION),this.delay=e||0,this._easing=Gt[s],this._doStart(),this._started=this._prev=+new Date,isFinite(this.duration)&&(this._timer=setTimeout((()=>this._stop(!1)),1.2*this.duration)),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Xt.DURATION=700,Xt.SHORT_DURATION=300;class Yt extends Xt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const Wt=function(t){return new Yt(t).start()},Ut=function(t){return isNaN(t)?0:t};class Zt{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}reset(t,e){return this._path=[],this.move(t,e),this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}push(...t){return t.forEach((t=>{h(t)||o(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return h(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return h(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return h(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return h(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(h(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Ut(t[e]),Ut(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Ut(t[e].x),Ut(t[e].y));return this}polygon(...t){return h(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${2*-s} 0`),this}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},_=Math.sqrt(h.x*h.x+h.y*h.y);if(0===_)return void this.line(t[s].px,t[s].py);h.x/=_,h.y/=_;let c=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,_=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=_,h.y/=_,h.x<a.x?(l.x=a.x-h.x,l.y=a.y-h.y):(l.x=h.x-a.x,l.y=h.y-a.y);const e=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=e,l.y/=e,a.y*h.y>=0&&(l={x:1,y:0}),n.x=-l.x*c*r,n.y=-l.y*c*r;const s=d+o.x,p=u+o.y,g=t[i].px+n.x,m=t[i].py+n.y;this.curve(s,p,g,m,t[i].px,t[i].py),c=t[i+1].px-t[i].px,o.x=l.x*c*r,o.y=l.y*c*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,_=n.py-(o.py-s.py)*i;this.curve(a,h,l,_,n.px,n.py)}}}const qt={position:"relative",width:"100%",height:"100%",boxSizing:"border-box","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"};class Kt extends ht{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=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=Ft.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=Ht.decrypt(e);if("RealChart"!==i.name||"RealChart"!==Ft.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Ft.license!=$t.Developer&&!Ht.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values($t).includes(n))throw new Error(s);if(Ft.license=i.lic,n==$t.Evaluation||n==$t.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&Rt.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Kt.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),Rt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}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}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){I(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))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){Rt.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(Qt.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(e,"clipPath")).forEach((t=>t.remove()))}clearTemporaryDefs(){this.$_clearDefs(Qt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),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){return this.addClip(new ie(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new oe(this.doc()))}clipDonut(){return this.addClip(new ae(this.doc()))}clipPath(){return this.addClip(new ne(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(t))for(const e of Array.from(this._defs.children))if(Rt.isElement(e)&&e.id===t){t=e;break}Rt.isElement(t)&&t.parentNode===this._defs&&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}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_setTesting(){this._testing=!0,Qt.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,s,i){if(this._inited)return;const r=t.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof r.HTMLDivElement||Q(C.invalidOuterDiv,s),t=this._container.ownerDocument;const n=this._dom=t.createElement("div");_(n.style,qt),n.className=i,this._container.appendChild(n);const o=this._svg=t.createElementNS(e,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=t.createElement("desc");a.textContent="Created by RealChart v"+Ft.version,o.appendChild(a);const h=this._defs=t.createElementNS(e,"defs");this._initDefs(t,h),o.appendChild(h),n.appendChild(o),this._root=new ee(this),o.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),n.appendChild(this._tester),nt&&(this._canvas=t.createElement("canvas"))}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Kt.SHADOW_FILTER);const r=t.createElementNS(e,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=t.createElementNS(e,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=t.createElementNS(e,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=t.createElementNS(e,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=t.createElementNS(e,"feMerge"),l=t.createElementNS(e,"feMergeNode"),_=t.createElementNS(e,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_canOverflowRender(){return!1}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{ot.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,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=$(s),r.style.height=$(i)),_(this._htmlRoot.style,{left:$(e.left-t.left),top:$(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),_(n.style,qt),this._doRenderBackground(n,this._root,s,i);const o=this._padding=Rt.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:s-o.left-o.right,height:i-o.top-o.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),ot.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{i&&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)}}Kt.CLASS_NAME="rct-control",Kt.SHADOW_FILTER="rr-chart-shadow-filter",Kt._animatable=!0;class Qt extends ht{constructor(t,s,i=L){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get win(){return this._dom.ownerDocument.defaultView}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,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",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,s){const i=t.createElementNS(e,s);return this._dom.appendChild(i),i}insertElement(t,s,i){const r=t.createElementNS(e,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return I(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(){let t=this._dom.getBBox();return nt&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return nt&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),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._ani instanceof Yt||!!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,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=ot.isValidNum(t)?t:this._tx,e=ot.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)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=ot.isValidNum(t)?t:this._tx,e=ot.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",(()=>{this.$_cleanMove(r,i)})),r.addEventListener("cancel",(()=>{this.$_cleanMove(r,i)}))):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=ot.isValidNum(t)?t:this._tx,e=ot.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})),a.addEventListener("cancel",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}))):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&ot.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ot.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")||"",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(q(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(q(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(q(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(o(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(q(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){o(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this.addClass(t):i(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){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,w(e,""))}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)}stopAni(){return this._ani&&(this._ani.cancel(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Wt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:y(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=Wt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(0,t.from*(1-e)),!0),endHandler:(t,e)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!e&&this.setVis(!1)},from:y(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}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(Qt.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 Qt.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=[];(ot.isValidNum(e)||ot.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+ot.pick(this._originX,t.getAttribute("x"),0)+" "+ot.pick(this._originY,t.getAttribute("y")||0)+")"),ot.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=ot.getNumber(this._scaleX,1),n=ot.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}Qt.DEBUGGING=!1,Qt.TESTING=!1,Qt.ASSET_KEY="_asset_",Qt.CLIP_KEY="_clip_",Qt.TEMP_KEY="_temp_";class Jt extends ht{constructor(t,s,i=!1){super(),this._control=s,this._dom=t.createElement("div"),i&&(this._svg=t.createElementNS(e,"svg"),Rt.setStyles(this._svg,{width:"100%",height:"100%",boxSizing:"border-box",overflow:"visible"}),this._dom.appendChild(this._svg)),this._doInitDom(this._dom)}_doInitDom(t){t.style.position="absolute"}_doDestroy(){this._control=null,this._dom.remove()}get control(){return this._control}get dom(){return this._dom}addSvg(t){return t&&this._svg.appendChild(t.dom),t}setBounds(t,e,s,i){return Rt.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class te extends Qt{constructor(t,e){super(t,e,"g")}}class ee extends Qt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class se extends Qt{constructor(t){super(t,L,"clipPath");const e=this._id=ot.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ie extends se{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Qt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}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 re extends Qt{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class ne extends se{constructor(t){super(t),this._path=new re(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class oe extends se{constructor(t){super(t),this.add(this._circle=new Qt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class ae extends se{constructor(t){super(t),this.add(this._donut=new re(t))}setDonut(t,e,s,i){this._donut.setPath((new Zt).donut(t,e,s,i).end())}}class he{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._hideFeedback()}finally{this._doCanceled()}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}var le,_e,ce;t.TextAnchor=void 0,(le=t.TextAnchor||(t.TextAnchor={})).START="start",le.MIDDLE="middle",le.END="end",t.TextLayout=void 0,(_e=t.TextLayout||(t.TextLayout={})).TOP="top",_e.MIDDLE="middle",_e.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ce||(ce={}));class de extends Qt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=ce.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.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(e){const s=this.getBBox(),i=this.getAscent(isNaN(e)?s.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(i/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(i)}this.y=r}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=f(0,t),(e=m(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(Dt.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}}const ue="$_TH",pe="$_TW";class ge{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?xt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(ot.isDate(n)){const t=s[3]?Ot.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),L),0===this._literals[2].length&&(this._literals[2]=L)}else this._literals.push(r,n,L,L);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class me extends ge{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class fe extends me{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const xe={t:class extends me{tag(){return"</t>"}},b:class extends me{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends me{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:fe};class ye{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new ge).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in xe){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new xe[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const be=/<br.*?>|\r\n|\n/;class we{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,s,r,n,o){if(this._isVertical)return void this.buildVertical(t,s,r,n,o);const a=t.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[],d=[];t.clearDom(),n=n||t;const u=t.getStyle("writing-mode"),p=this._vertical=u===st||u===it;for(let s=0;s<_;s++){const r=l[s];let u=0,g=0,m=null;for(let[h,l]of r.words.entries()){const c=0===s&&0===h,d=s===_-1&&h===r.words.length-1,x=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";x.textContent=e+(x.textContent||"")+s}const y=x.getBBox();if(x[pe]=y.width,x[ue]=y.height,p?(u=f(u,x[pe]),g+=x[ue]):(u+=x[pe],g=f(g,x[ue])),m||(m=x),l instanceof fe){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(x),t.appendDom(s)}}d.push(m),r[ue]=g*h,r[pe]=u*h,c.push(0==s?r[pe]/2:r[pe])}if(_>0){let e=l[0];for(let s=1;s<d.length;s++)if(d[s]){let i=0,r=0;if(p?null!=d[s-1]&&(i=Math.floor(e[pe]-t.getAscent(e[pe]))+t.getAscent(l[s][pe])):r=e[ue]-t.getAscent(e[ue])+t.getAscent(l[s][ue]),null==d[0]&&d[s]==d.find((t=>null!=t))){const r=t.insertElement(a,"tspan",d[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[pe]=n.width,r[ue]=e[ue]=n.height,d[0]=r}switch(u){case st:d[s].setAttribute("dx",String(i)),d[s].setAttribute("y","0");break;case it:d[s].setAttribute("dx",String(-i)),d[s].setAttribute("y","0");break;default:d[s].setAttribute("x","0"),d[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rct-annotation"),s=t.getBBox().width,[i]=d,r=i[pe];if(e)i.setAttribute("dx",String(u===it?s-r/2:r/2));else switch(u){case st:i.setAttribute("x",String((s-r)/-2));break;case it:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][ue])}}buildVertical(t,s,r,n,o){const a=t.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[];let d=0;const u=[];t.clearDom(),n=n||t;for(let s=0;s<_;s++){const r=l[s];let p=0,g=0,m=null,x=!1;for(let[h,l]of r.words.entries()){const c=0===s&&0===h,d=s===_-1&&h===r.words.length-1,u=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";u.textContent=e+(u.textContent||"")+s}" "===u.textContent&&(x=!0,u.textContent=".");const y=u.getBBox();if(u[pe]=y.width,u[ue]=y.height,x&&(u.textContent=" ",u[ue]*=.6,x=!1),p+=u[pe],g=f(g,u[ue]),m||(m=u),l instanceof fe){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(u),t.appendDom(s)}}u.push(m),r[ue]=g*h,r[pe]=p*h,d=f(p,d),c.push(0==s?r[pe]/2:r[pe])}if(_>0){let e=l[0];u[0].setAttribute("x",String((d-u[0].getBBox().width)/2));for(let s=1;s<u.length;s++)u[s]&&(u[s].setAttribute("x",String((d-u[s].getBBox().width)/2)),u[s].setAttribute("dy",String(e[ue]-t.getAscent(e[ue])+t.getAscent(l[s][ue]))),e=l[s]);t.layoutText(l[0][ue])}}layout(e,s,i,r,n){const o=e.getBBox();let a=0,h=0;if(this._vertical)switch(a=n.left+(i-n.left-n.right-o.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(i-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(be);for(let t of s)e.push((new ye).parse(t))}}}class ve{constructor(t){this.source=t}hasDef(){return!0}}class Se extends ve{_setStops(t,s){s.setAttribute("id",this.source.id);const i=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=r(i)?[...i]:[i,"white"],a=r(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(t,s,i,r,n){const o=t.createElementNS(e,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(t,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ve extends Se{getEelement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}Ve.TYPE="lineargradient";class Ae extends Se{getEelement(t,s){const i=t.createElementNS(e,"radialGradient");return I(s.cx)||i.setAttribute("cx",s.cx),I(s.cy)||i.setAttribute("cy",s.cy),I(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}Ae.TYPE="radialgradient";class Pe extends ve{prepare(){}getEelement(t,s){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,l,c,d=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+s.pattern>=0){const t=Pe.STOCK[+s.pattern%Pe.STOCK.length];a=t.path,h=t.style,d=!t.fill,l=t.width||20,c=t.height||20}else o(s.pattern)&&(a=s.pattern,l=s.width||s.height||20,c=s.height||s.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(c)),n.setAttribute("d",a),h&&_(n.style,h),s.style&&_(n.style,s.style),d&&(n.style.fill="none");let u=s.backgroundStyle;if(o(u)||i(u)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=o(u)?u:u.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(c))}return r.append(n),r}}Pe.TYPE="pattern",Pe.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class Ce extends ve{prepare(){const t=this.source;this._colors=r(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&ot.shuffle(this._colors),this._index=0)}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=r(e.colors)?e.colors:[]}}Ce.TYPE="colors";class ke extends ve{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||ke.SIZE,height:e.height||e.width||ke.SIZE})}}ke.TYPE="images",ke.SIZE=20;class Le{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(Qt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Pe.TYPE:r(t.colors)?e=Ce.TYPE:r(t.images)&&(e=ke.TYPE)),e)switch(e.toLowerCase()){case Ve.TYPE:return new Ve(t);case Ae.TYPE:return new Ae(t);case Pe.TYPE:return new Pe(t);case Ce.TYPE:return new Ce(t);case ke.TYPE:return new ke(t)}}}}let Ne=0;const Me=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},Ee=["__proto__","constructor","prototype"],Te=function(t,e){const n=i(t)?t:{};for(const t in e)if(s.call(e,t)&&!Ee.includes(t)){const s=e[t];r(s)?n[t]=s.slice(0):i(s)?s._obj instanceof ct?n[t]=s:ot.isDate(s)?n[t]=new Date(s):n[t]=Te(n[t],s):n[t]=s}return n};class Be extends ht{constructor(t){super(),this.chart=t,Ne++}init(){const t=this._op=Te({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}_initObject(){return this.init(),this}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(this._config=t,void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t),this}saveOptions(t=!0){const e={};return this._doSave(e,this.constructor.defaults,t),e}$_updateChildren(t){if(this._children)this._children.forEach((e=>t.hasOwnProperty(e)&&this[e].updateOptions(t[e])));else{this._children=[];for(const e in this){const s=this[e];s instanceof Be&&(this._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}$_mergeOptions(t,e){const s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];r(n)?s[t]=n.slice(0):i(n)?n instanceof ct?s[t]=n:n._obj instanceof ct?s[t]=n._obj:this[t]instanceof Be?ot.isDate(n)&&(s[t]=new Date(n)):s[t]=this.$_mergeOptions(s[t],n):s[t]=n}}updateOptions(t,e=!0){const s=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(s,t),this.$_applyOptions(s),i(t)&&this.$_updateChildren(t),e&&this._changed(),this}updateOption(t,e,s=!0,i=!1){if(this[t]instanceof Be)this[t].updateOptions(e);else{const r=this._op;(i||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof Be?this[t]._doSetSimple(!l(i)||!i):(s[t]=!l(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Be)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var s;if(t){const i=t._op=Te({},t.constructor.defaults);return t.$_applyOptions(i),null===(s=t._children)||void 0===s||s.forEach((s=>{i[s]=e(t[s])})),i}};return e(this),t&&this._changed(),this}setStyle(t,e,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==e&&""!==e||(e=void 0),void 0===e?r&&s.call(r,t)&&(delete r[t],n=!0):r&&r[t]==e||(r||(r=this._style=this._op.style={}),r[t]=String(e),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,s=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),i(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),s&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const s in e)if(e.hasOwnProperty(s)){let n=e[s];this._doLoadProp(s,n)||(this[s]instanceof Be?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):i(n)?n._obj instanceof ct?t[s]=n._obj:ot.isDate(n)?t[s]=new Date(n):t[s]=_({},n):t[s]=n)}}_doSave(t,e,s){const i=this._op;for(const n in i)if(i.hasOwnProperty(n))if(s&&this[n]instanceof Be)t[n]=this[n].saveOptions(!0);else{const s=i[n];r(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(l(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=j(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Be.REFRESHED="refreshed",Be.defaults={visible:!0};class Oe{constructor(t){this._items=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}items(){return this._items.slice(0)}_internalItems(){return this._items}updateOptions(t,e){}}class De extends Be{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=y(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?xt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new we),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(ot.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=ot.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=o(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}De.defaults=Me(Be.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Re extends De{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof ke&&(this._images=e)}this._root=this._op.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2),r=Number.isFinite(+i)?+i:i;return s instanceof ke?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Re.defaults=Me(De.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class $e extends Be{}const Fe={};class Ie extends Be{static register(...t){t.forEach((t=>{Fe[t.type]=t}))}constructor(t,e){super(t),this.body=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}needClip(){return!0!==this._op.noClip}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted(),i=this._op;let r,n;if(this.body){const o=+i.x1,a=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const i=this.chart.getAxisOf(this,!0);s?this._y=e-i.getPos(e,o):this._x=i.getPos(t,o),isNaN(a)||(s?n=this._h=e-i.getPos(e,a)-this._y:r=this._w=i.getPos(t,a)-this._x)}if(!isNaN(h)){const i=this.chart.getAxisOf(this,!1);s?this._x=i.getPos(t,h):this._y=e-i.getPos(e,h),isNaN(l)||(s?r=this._w=i.getPos(t,l)-this._x:n=this._h=e-i.getPos(e,l)-this._y)}}return isNaN(r)?r=Y(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=Y(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this._op.align){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this._op.verticalAlign){case"middle":l+=(r-o)/2-a.y;break;case"bottom":l+=r-a.y-o;break;default:l+=a.y}else a=a||this.getOffset(n,o),l=this._y+a.y;return{x:h,y:l}}refresh(){this._changed(Be.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,this._row=isNaN(t.row)?NaN:t.row|0,this._col=isNaN(t.col)?NaN:t.col|0,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}Ie.defaults=Me(Be.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class ze extends Oe{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row,r=s.options.col;return t===i&&e===r}))}getAnnotation(t){const e=this._map[t];if(e instanceof Ie)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(s,t,i,e?this.owner:void 0))})):i(t)&&n.push(this.$_loadItem(s,t,0,e?this.owner:void 0)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotation=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):L}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,i);return a.init(),a.index=s,a._load(e),a}}class He extends Xt{constructor(t,e,s,i){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}getPos(t,e){const s=this._axis,i=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=s._vlen;if(i<=0)return t;if(i>=r)o=i<=0?a:a+a*(i-r)/i*(1-n),t=t*o/a;else{o=a+a*(r-i)/r*(1-n),t=t*a/o}return t+this._offset*(o/i)*(1-n)*(e?-1:1)}_doUpdate(t){return this.$_calcRange(t),this._axis._changed(),!0}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const s=this._axis.axisMin(),i=this._axis.axisMax();this._axisLen=i-s,this._offset=s-e}}class Ge extends Be{}Ge.defaults=Me(Be.defaults,{minWidth:50});class je extends Be{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Ge(this.axis.chart)).init(),this._args={chart:void 0,axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this._op.type}getFlag(t,e){const s=this.axis.axisValueAt(t,e);return s instanceof this.chart.win.Date?Ot.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):xt.getFormatter(this._op.numberFormat).toStr(s)}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}je.defaults=Me(Be.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Xe={};class Ye extends Be{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class We extends Ye{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}We.defaults=Me(Ye.defaults,{visible:void 0});class Ue extends Ye{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return nt?"vertical"===e?0:"opposite"===this.axis.options.position?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.options.position?90:270}return this._rotation}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}Ue.defaults=Me(Ye.defaults,{align:"middle",offset:0,gap:5});class Ze extends Ye{_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ze.defaults=Me(Ye.defaults,{position:"end",gap:2});class qe extends Ye{getRows(){const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[];if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this._op.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let o=1;o<r.length;o++,n++)e[n%s]&&i.push({axis:t,from:r[o-1].value,to:r[o].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doSetSimple(t){return o(t)?(this._op.colors=[t,null],!0):r(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Ke extends Ye{_doInit(t){t.rows=(this._rows=new qe(this.axis)).init()}get rows(){return this._rows}_isVisible(){return this.axis._isPolar?!1!==this._op.visible:null==this._op.visible?!this.axis._isX:this._op.visible}}Ke.defaults=Me(Ye.defaults,{visible:void 0,depthVisible:void 0});class Qe extends Re{getDefaultIconPos(){return"left"}}Qe.defaults=Me(Re.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Je extends Ye{_doInit(t){t.label=(this._label=new Qe(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(r(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(r(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}Je.defaults=Me(Ye.defaults,{front:!1,zindex:0});class ts extends Je{}class es extends Je{}class ss extends Ye{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return ot.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),isFinite(this._op.length)?this._length=this._op.length:this._length=this.axis.label._inside?0:ss.DEF_LENGTH,this._gap=this._op.gap||0}}ss.DEF_LENGTH=7,ss.defaults=Me(Ye.defaults,{visible:!1,gap:3});class is extends Re{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?w(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?w(i.firstText,i.text):r==e-1?w(i.lastText,i.text):i.text}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}_getText(t,e,s,i){return o(t)?t:this._getNumberText(e,s,i)||e}}is.defaults=Me(Re.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class rs extends Ye{getThickness(){return Math.max(0,this._op.thickness)}getMinThumbSize(){return Math.max(0,this._op.minThumbSize)}getGap(){return Math.max(0,this._op.gap)}getGapFar(){return Math.max(0,this._op.gapFar)}}rs.defaults=Me(Ye.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class ns{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}clamp(t,e=!0){return e?ot.clamp(t,this.min,this.max):ot.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class os extends We{}class as extends Be{static register(...t){t.forEach((t=>{Xe[t.type]=t,t.subtype&&(Xe[t.subtype]=t)}))}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){t.title=(this._title=new Ue(this)).init(),t.unitLabel=(this._unitLabel=new Ze(this)).init(),t.line=(this._line=new We(this)).init(),t.sectorLine=(this._sectorLine=new os(this)).init(),t.tick=(this._tick=this._createTickModel()).init(),t.label=(this._label=this._createLabel()).init(),t.grid=(this._grid=this._createGrid()).init(),t.crosshair=(this._crosshair=new je(this)).init(),t.scrollBar=(this._scrollBar=new rs(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}get title(){return this._title}get unitLabel(){return this._unitLabel}get line(){return this._line}get sectorLine(){return this._sectorLine}get tick(){return this._tick}get label(){return this._label}get grid(){return this._grid}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get xy(){return this._isX?"x":"y"}isEmpty(){return this._isEmpty}_checkEmpty(){if(this._series.length>0)for(const t of this._series)if(!t.isEmpty(!0))return!1;return!0}checkVisible(){return!0===this._op.visible||!1!==this._op.visible&&!this._isEmpty}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}valueMin(){return this._min}valueMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return E+T*this._op.startAngle}getTotalAngle(){return T*this._op.totalAngle}isArced(){return this._op.totalAngle>0&&this._op.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}labelsVisible(){return this._label.visible&&this._ticks.length>0}getXStart(){return 0}dataToAxis(t){return t}axisToData(t){return t}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[]}getSeries(){const t=[];return this._series.forEach((e=>{t.push(...e.getVisibleSeries())})),t}getConnectableSeries(){const t=[];return this._series.forEach((e=>{e.connectable(this)&&t.push(...e.getVisibleSeries())})),t}collectValues(){const t=this._values=[];this._isX?this._series.forEach((e=>{e.collectValues(this,e.needAxes()?t:null)})):this._series.forEach((e=>{const s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=m(...s),e._yMax=f(...s),t.push(...s))}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this,this._values)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter((t=>t._valid)),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this._op.position;this._isPolar=t.isPolar(),this._isHorz=t.isInverted()?!this._isX:this._isX,this._isBetween=t.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender();const s=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.isSplitted()){const t=[s[0].row];for(let e=1;e<s.length;e++)t.indexOf(s[e].row)<0&&t.push(s[e].row);t.forEach((t=>{let e=0,i=0;s.forEach((s=>{s.row==t&&s.isClusterable()&&(e+=y(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=y(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=y(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=y(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+ot.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[f(t,this._min),m(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new ns(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return r&&(i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed()),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this._op.reversed,t*this._prevRate)}checkExtents(t,e){var s;null===(s=this._ani)||void 0===s||s.cancel(),this._min===t&&this._max===e||(this._ani=new He(this,t,e,(()=>{this._changed()})))}isAnimating(){return!isNaN(this._aniMin)}_posValue(){const t=this._op.position;return"opposite"===t?-1:"between"===t?0:1}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const e=this,i=this.guides,n=function(t){var s;t!==e._guides&&(e._guides=t,s=r(t)?t:[t],i.length=0,s.forEach((t=>{let s;s="range"===t.type?new es(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ts(e):new es(e),s.init(),s._load(t),i.push(s)})))};super._doApply(t),t.startAngle=y(this._op.startAngle,0),t.totalAngle=f(0,m(360,y(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=y(Math.max(0,t.row|0),0),this._col=y(Math.max(0,t.col|0),0),s.call(t,"guide")?n(t.guide):s.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(m(...t)||0):NaN,max:t.length>0?D(f(...t)||0):NaN}}}as.defaults=Me(Be.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,marginNear:0,marginFar:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class hs extends Oe{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;r(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),this._items.forEach((t=>{t.name&&this._map.set(t.name,t)}))}visibles(){return this._items.filter((t=>t.checkVisible()))}contains(t){return this._items.indexOf(t)>=0}get(t){return o(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,e){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)}))}connect(t){const e=this.isX,s=this._items,i=t.options,r=e?i.xAxis:i.yAxis;let n;if(h(r)&&r>=0&&r<s.length?n=s.find((t=>t._index===r)):o(r)&&(n=s.find((t=>t.options.name===r))),n||(n=s[0]),n&&this.chart.isValidAxis(n))return n._connect(t),this.isX?t.setCol(n.col):t.setRow(n.row),n}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var i;let n=t._getAxisType(e.type);if(!n){let o;if(r(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(I(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(i=t._getSeries().first)||void 0===i?void 0:i.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class ls extends Be{_doPrepareRender(t){}}const _s={},cs={};class ds extends ls{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}getSize(t,e){return{width:Y(this._widthDim||this._sizeDim,t,t),height:Y(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return Y(this._leftDim,t)}getRight(t){return Y(this._rightDim,t)}getTop(t){return Y(this._topDim,t)}getBottom(t){return Y(this._bottomDim,t)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"gauge",this._type())):super._load(t)}_doApply(t){super._doApply(t),this._name=t.name||`Gauge ${this.index+1}`,this._row=y(t.row|0,0),this._col=y(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}ds.defaults=Me(ls.defaults,{size:"100%"});class us extends ds{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{_s[t.type]=t}))}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}us.defaults=Me(ds.defaults,{duration:500});class ps extends ds{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{cs[t.type]=t,cs[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(0)}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),s.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const s=this._gaugesType();r(e)?e.forEach(((e,i)=>this.$_add(us._loadGauge(t,e,s)))):i(e)&&this.$_add(us._loadGauge(t,e,s))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ps.defaults=Me(ds.defaults,{minValue:0});class gs extends Oe{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.row||0,r=s.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof us)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ps)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)})),e._op.gauge=this._gauges.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t._prepareRender()))}$_loadItem(t,e,s){if(0===Object.keys(_s).length&&0===Object.keys(cs).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let i=r(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i||(i=t._getGaugeType(e.type||t.gaugeType)),!i)throw new Error("Invalid gauge type: "+e.type);const n=new i(t);return n.init(),n._load(e),n.index=s,n}}class ms extends us{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),t.label=(this._label=this._createLabel()).init()}get label(){return this._label}getValue(){return f(this._op.minValue,m(this._op.maxValue,y(this._runValue,this._op.value)))}_setValueRate(t){this._runValue=this._prevValue+(this._op.value-this._prevValue)*t}updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this.label.options.animatable?y(this._runValue,this._op.value):this._op.value;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}ms.defaults=Me(us.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class fs extends Be{constructor(t){super(t.chart),this.scale=t}}fs.defaults=Me(Be.defaults,{reversed:!1,length:7});class xs extends Re{getText(t){return ot.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class ys extends Be{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Be(e)).init(),t.tick=(this._tick=new fs(this)).init(),t.label=(this._label=new xs(e)).init()}get line(){return this._line}get tick(){return this._tick}get label(){return this._label}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=y(s,e);const{min:i,max:r}=this._adjustMinMax(m(e,s),f(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(f(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=y(s.options.minValue,t),e=y(s.options.maxValue,e),this._min=m(t,e),this._max=f(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=m(...t)),isNaN(i)&&(i=f(...t)),this._min=m(s,i),this._max=f(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){const i=this._op;let r;return r=Array.isArray(i.steps)?i.steps.slice(0):i.stepCount>0?this._getStepsByCount(i.stepCount,e,s):i.stepInterval>0?this._getStepsByInterval(i.stepInterval,e,s):i.stepPixels>0?this._getStepsByPixels(t,i.stepPixels,e,s):[e,s],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(D(e));for(let e=1;e<t;e++)n.push(D(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,_=0;if(o/=a,h)if(o>h[_]){for(;_<h.length-1;_++)if(o>h[_]&&o<h[_+1]){o=h[++_];break}}else o=h[_];for(o*=a,this._step=o,r.push(D(l=s));;){if(l+=o,l>=i){r.push(D(i));break}r.push(D(l))}return r}}ys.defaults=Me(Be.defaults,{position:"default",stepPixels:48,gap:8});class bs extends Be{}bs.defaults=Me(Be.defaults,{visible:!1});class ws extends Be{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new bs(e)).init(),t.tickLabel=(this._tickLabel=new Be(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?Y(this._thicknessDim,t,0):"inside"===this._op.position?t:ws.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=J(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}ws.defaults=Me(Be.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class vs extends De{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}vs.defaults=Me(De.defaults,{animatable:!0});class Ss extends vs{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:Y(this._offsetXDim,t,0),y:Y(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Ss.defaults=Me(vs.defaults,{offsetX:0,offsetY:0});class Vs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(As.DEF_CENTER),this.setCenterY(As.DEF_CENTER),this.setRadius(As.DEF_RADIUS),this.setInnerRadius(As.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=j(w(t,As.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=j(w(t,As.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=j(w(t,As.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=j(w(t,As.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=j(t,!0))}getCenter(t,e){return{x:Y(this._centerXDim,t,t/2),y:Y(this._centerYDim,e,e/2)}}getExtents(t){const e=Y(this._radiusDim,t,t/2),s=m(e,this._innerDim?Y(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?Y(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=y(t%360,0),i=f(0,m(360,y(e,360)));this._startRad=E+T*s,this._handRad=T*s,this._sweepRad=T*i}}class As extends ms{_doInit(t){super._doInit(t),this._props=new Vs}get label(){return this._label}getProps(){return this._childProps||this._props}getCenter(t,e){return this._group?this._childProps.getCenter(t,e):this._props.getCenter(t,e)}getExtents(t){return this._group?this._childProps.getExtents(t):this._props.getExtents(t)}labelVisible(){return this._label.visible}_createLabel(){return new Ss(this.chart)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new Vs)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}As.DEF_CENTER="50%",As.DEF_RADIUS="40%",As.DEF_INNER="80%",As.defaults=Me(ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ps extends ps{_doInit(t){this.props=new Vs,t.label=(this._label=new Ss(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this._op.itemGap||0;let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach(((t,e)=>{const n=t._childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s}))}}_doApply(t){super._doApply(t);const e=this.props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}}Ps.defaults=Me(ps.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Cs=class extends Be{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Cs.defaults=Me(Be.defaults,{visible:void 0});class ks extends De{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||ks.DEF_TEXT}}ks.DEF_TEXT="표시할 데이터가 없습니다.",ks.defaults=Me(Be.defaults,{visible:void 0});class Ls extends Be{}Ls.defaults=Me(Be.defaults,{visible:!1});class Ns extends Be{_doInit(t){t.line=(this._line=new Ls(this.chart)).init(),t.endLine=(this._endLine=new Ls(this.chart)).init(),t.gridLine=(this._gridLine=new Ls(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Ns.defaults=Me(Be.defaults,{});class Ms extends Be{_doInit(t){t.xSide=(this._xSide=new Ns(this.chart)).init(),t.ySide=(this._ySide=new Ns(this.chart)).init(),t.orgLine=(this._orgLine=new Ls(this.chart)).init()}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this._op.visible&&this._op.length>=0}_doSetSimple(t){return h(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=m(60,f(30,y(t.angle,45)))}}Ms.defaults=Me(Be.defaults,{visible:!1,length:32,angle:32});class Es extends Be{constructor(t){super(t),this._annotations=new ze(this)}_doInit(t){t.depth=(this._depth=new Ms(this.chart)).init(),t.image=(this._image=new $e(null)).init(),t.emptyView=(this._emptyView=new ks(this.chart)).init(),t.zoomButton=(this._zoomButton=new Cs(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof ds&&this.contains(s)?s:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const s=this._depth.options,i=s.length,r=s.angle,n=d(u(r*T)*i),o=d(p(r*T)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return Y(this._radiusDim,m(t,e))}setPolar(t,e){return this._cx=Y(this._centerXDim,t),this._cy=Y(this._centerYDim,e),this._rd=Y(this._radiusDim,m(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd,cyclic:t&&t.options.totalAngle>=360}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const e=this,i=function(t){t!==e._anns&&(e._anns=t,e._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),s.call(t,"annotation")?i(t.annotation):s.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}Es.defaults=Me(Be.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Ts extends Be{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}Ts.defaults=Me(Be.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Bs extends Be{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Os extends ls{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.slice(0)}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return Y(this._maxWidthDim,t,t)}getMaxHeight(t){return Y(this._maxHeightDim,t,t)}getMarkerSize(){return y(this._op.markerSize,10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map((t=>t.source)):t.source}_isVisible(){return!0===this._op.visible&&this._visItems.length>0||!1!==this._op.visible&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=w(e.location,"bottom"),this._items=this._getLegendSources().map((t=>new Bs(this,t))),e.reversed&&(this._items=this._items.reverse());const s=this._itemMap={},i=this._visItems=[];this._items.forEach((t=>{const e=t.source.legendKey();if(ot.isNotEmpty(e)&&""!==e){const r=s[e];r?r.push(t):(s[e]=[t],i.push(t))}else i.push(t)}))}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var Ds;Os.defaults=Me(ls.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"body",gap:6,itemGap:8,markerVisible:!0,markerSize:10,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0,pointHovering:!0});const Rs=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),$s=.001;class Fs{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static polygon(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const o=i>0,a=o?0:1;return r>0?n>0?(r=m(x(i)/2,s/2,r),n=m(x(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=m(x(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=m(x(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=m(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static isCircled(t){return M-t<$s}static arc(t,e,s,i,r,n,o,a=!1){const h=m(M,x(n-r)),l=this.isCircled(h),_=h>N?1:0,c=o?1:0,d=u(r),g=p(r),f=u(n-=l?c?$s:-.001:0),y=p(n),b=[];return b.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*f,e+i*y),l&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,s,i,r,n,o,a){const h=m(M,x(o-n)),l=this.isCircled(h),_=h>N?1:0,c=a?1:0,d=u(n),g=p(n),f=u(o-=l?c?$s:-.001:0),y=p(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*f,e+i*y),l?v.push("M",t+b*f,e+w*y):v.push("L",t+b*f,e+w*y),r>0&&v.push("A",b,w,0,_,1-c,t+b*d,e+w*g),v.push("Z"),v}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){b.push("M",t,e,"A",s,i,0,c,_,n,o),b.push("L",n,o+r),b.push("A",s,i,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,d=m(M,x(o-n));const g=this.isCircled(d);let f=(n%M+M)%M,y=(o%M+M)%M;const b=[];let w,v,S,V;if(!g&&(_&&f<=N&&y>=0&&y<f||!_&&y<=N&&f>=0&&f<y))c=0,_?(w=t+s*u(n),v=e+i*p(n),S=t+s*u(N),V=e+i*p(N),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(0),v=e+i*p(0),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V)):(w=t+s*u(n),v=e+i*p(n),S=t+s*u(0),V=e+i*p(0),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(N),v=e+i*p(N),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V));else{w=t+s*u(n),v=e+i*p(n),S=t+s*u(o-=g?_?$s:-.001:0),V=e+i*p(o),_?(f=g||f<=M&&!(y>=f&&y<M)?0:f,y=g||y>N&&!(f<=y&&f>N)?N:y):(f=g||f>N&&!(y<=f&&y>N)?N:f,y=g||y<M&&!(f>=y&&f<M)?0:y);const r=t+s*u(f),a=e+i*p(f),d=t+s*u(y-=g?_?$s:-.001:0),m=e+i*p(y);c=x(y-f)>N?1:0,l(r,a,d,m),h&&(h.x1=w,h.y1=v,h.x2=S,h.y2=V)}return b}static arc3dInner(t,e,s,i,r,n,o,a,h){const l=m(M,x(o-n)),_=this.isCircled(l),c=a?1:0,d=t+s*u(n),g=e+i*p(n),f=t+s*u(o-=_?c?$s:-.001:0),y=e+i*p(o),b=l>N?1:0,w=[];return w.push("M",d,g,"A",s,i,0,b,c,f,y),w.push(_?"M":"L",f,y+r),w.push("A",s,i,0,b,1-c,d,g+r),h&&(h.x1=d,h.y1=g,h.x2=f,h.y2=y),w.push("Z"),w}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*p(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,d=c/2,g=[];g.push("M",n+a*u(r),o+h*p(r));for(let t=0;t<5;t++)g.push("L",n+a*u(r),o+h*p(r),"L",n+l*u(r+d),o+_*p(r+d)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Ds[e](0,0,f(2*s,0),f(2*i,0));break;default:r=Ds.circle(s,i,f(m(s,i),0))}t.setPath(r)}}Ds=Fs,Fs._drawers=Object.assign({circle:t=>Ds.circle(0,0,t),none:t=>[]},Ds._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Is extends Qt{static create(t,e,s,i,r,n,o=0){return new Is(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=L,s=L){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 zs extends re{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Fs.box(t,e,s,i)),this}}const Hs="head",Gs="far",js="inside",Xs="none",Ys="near",Ws="displayAll",Us="largestFirst",Zs="hidden",qs="line",Ks="area",Qs="circlebar";let Js=0;const ti="_deleted",ei="_drop",si="_save";class ii{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=Js++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...this}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(r(e.drillDown)||i(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];if(null!=i&&"object"==typeof i)for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[ti]=!0}_isDeleted(){return this[ti]}_setDrop(t){this[ei]=t}_getDrop(){return this[ei]}_setSave(t){this[si]=t}_getSave(){return this[si]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=L}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return _(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[y(s.xField,0)],this.y=e[y(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=v(t._yFielder(e),e.y,e.value),this.color=w(t._colorFielder(e),e.color),this.icon=w(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class ri{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}_internalPoints(){return this._points}get(t){return this._points[t]}pointAt(t,e){function s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find((i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach((t=>{const s=this._points.indexOf(t);s>=0&&(t._setDeleted(),e.push(t),this._points.splice(s,1))})),e}clean(){this._points=this._points.filter((t=>!t[ti]))}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter((t=>t.xValue>=i&&r>=t.xValue)).slice(0):e.filter((t=>t.xValue>i-.5&&r+.5>t.xValue)).slice(0)}return e}}class ni extends ii{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return _(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.y=e[y(s.yField,0+i)],this.z=e[y(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=w(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=S(t.zValue,this.zValue,e)}}class oi extends ii{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[b(s.highField,s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue||0}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e)}}class ai extends ss{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}ai.defaults=Me(ss.defaults,{step:1});class hi extends is{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return r(this.axis.options.categoryField)&&s>0?t.substring(s+this.sep.length):t}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}hi.defaults=Me(is.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class li extends Ke{getPositions(t){const e=t._ani,s=t._pts,i=t.options.reversed,r=t._ticks.length,n=[];if(r>0){const o=Math.max(1,t.tick.options.step||1);if(o>1)for(let t=0,a=1,h=s.length;t<=r&&a<h;t++,a+=o)n.push(e?e.getPos(s[a],i):s[a]);else for(let t=0;t<=r;t++)n.push(e?e.getPos(s[t+1],i):s[t+1])}return n}}class _i extends as{constructor(){super(...arguments),this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}get label(){return this._label}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return this._catMin+e-2;return-1}getCategorySeparator(){return this._op.categorySeparator||"+"}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new ns(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new li(this)}_createTickModel(){return new ai(this)}_createLabel(){return new hi(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=ot.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){var t;let e=super.getStartAngle(),s=+this._op.startOffset;return s>0&&(e-=m(s,1)*((null===(t=this._categories[0])||void 0===t?void 0:t.w)||1)*M/this._catLen),e}_doPrepareRender(){const t=this._op;this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=b(t.minPadding,t.padding,0),this._maxPad=b(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,y(t.categoryPadding,0))))}_adjustMinMax(t,e){const s=this._op;return s.minValue<t&&(t=s.minValue),s.maxValue>e&&(e=s.maxValue),{min:t,max:e}}_doBuildTicks(t,e,s,i){const r=this._label;let n=this._weights=this._categories.map((t=>{var e;return null!==(e=t.w)&&void 0!==e?e:1}));const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:s,max:i}=this._adjustMinMax(t,e);t=Math.floor(s),e=Math.ceil(i)}this._catMin=t,this._catMax=e;let h=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(h,this._tick.options.step||1));for(let e=-1;e>=t;e--)n.unshift(1);const l=Math.max(h,e+1);for(;n.length<l;)n.push(1);n=n.slice(Math.max(0,t),e-Math.min(0,t)+1),h=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=n[i-t]||1;_.push(s/h),_.push((s+this._maxPad)/h)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const s=t+e-1,i=this._categories[s/d-c];a.push({index:e-1,pos:NaN,value:s,label:r.getTick(e-1,i?i.t:s)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this._op.totalAngle*T;if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/t*e}}else{let t;t="edge"===this._tick.getPosition()?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1];let n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed&&(n=t-n),this._ani?this._ani.getPos(n,this._op.reversed):n}valueAt(t,e){const s=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<s.length-1;t++){const i=s[t],r=s[t+1];if(e>=i&&r>=e){return this._catMin+t-(1-(e-i)/(r-i))}}}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);let i;return i=this._ani?this._ani.getPos(this._pts[s+2],this._op.reversed)-this._ani.getPos(this._pts[s+2-1],this._op.reversed):this._pts[s+2]-this._pts[s+2-1],x(i)}getLabelLength(t,e){const s=Math.floor(e-this._catMin+.5);return s>this._tstep?this._pts[s+2]-this._pts[s+2-this._tstep]:this._pts[s+2+this._tstep-1]-this._pts[s+2-1]}getValue(t){return h(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=m(0,e.min),e.max=f(0,e.max)),e}$_collectCategories(t){const e=this._op,s=e.categories,n=this._categories=[];if(r(s)&&s.length>0)this._len=0,s.forEach((t=>{const e=null==t?1:y(t.weight,1),s=t&&t.icon;let r,o;null==t?o=r=null:i(t)?(r=w(t.name,t.label),o=w(t.label,t.name)):o=r=String(t),this._len+=e,n.push({c:r,t:o,w:e,i:s})}));else{const s=this.chart.seriesByName(e.categorySeries),i=this.chart.seriesByName(e.weightSeries)||s,o=e.weightField,a=null==i?void 0:i.data;let h=[];!e.weightByFrequency&&o&&r(a)&&a.length>0&&a.forEach((t=>{const e=t[o];ot.isNumber(e)&&e>=0?h.push(e):h.push(1)})),s&&(t=[s]);const l=e.weightByFrequency;let _,c=0;if(r(t)&&t.length>0)for(const e of t){const t=e.collectCategories(this);t.length>0&&t.forEach(((t,e)=>{l&&(t!==_?(c>0&&(n[n.length-1].w=c),_=t,c=1):c++),n.find((e=>e.c===t))||n.push({c:t,w:h[e]||1,t:t})}))}c>0&&(n[n.length-1].w=c)}this._map={},n.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}_i.type="category",_i.defaults=Me(as.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class ci extends Be{}ci.defaults=Me(Be.defaults,{visible:!1});class di extends Re{getAlign(t,e,s,i){let r=this._op.align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._op.verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._op.align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:di.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:di.OFFSET:e}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=m(1,f(0,y(t.position,1))),t.align="left"===t.align||"center"===t.align||"right"===t.align?t.align:"auto",t.verticalAlign="top"===t.verticalAlign||"middle"===t.verticalAlign||"bottom"===t.verticalAlign?t.verticalAlign:"auto"}}di.OFFSET=4,di.defaults=Me(Be.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class ui extends Be{getRadius(){return f(0,y(this._op.radius,4))}}ui.defaults=Me(Be.defaults,{visible:!1,radius:4});class pi extends Be{constructor(t){super(t.chart),this.owner=t,this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new ci(this.chart)).init(),t.fixedArea=(this._fixedArea=new ci(this.chart)).init(),t.label=(this._label=new di(this.chart)).init(),t.marker=(this._marker=new ui(this.chart)).init()}get variableArea(){return this._variableArea}get fixedArea(){return this._fixedArea}get expression(){return this._expr}get label(){return this._label}get marker(){return this._marker}getLabelDomain(){return this._labelDomain}setRange(t,e,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){const e=this._op,s=e.type,i=this.owner,r=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+e.resolution||5)),n=this._minX>0?0:(this._maxX-this._minX)/r-this._minX,o=this._minY>0?0:(this._maxY-this._minY)/r-this._minY,a=i._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+n,y:t.yValue+o}))).sort(((t,e)=>t.x-e.x)),h=(this["_"+s]||this._linear).call(this,this._formatter,a);if(this._points=[],h&&"function"==typeof h.evaluator){if(a.length>0){const t=a[0].x,i=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=i+r;if("logarithmic"===s||"power"===s){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const l=i-t,_=o-n,c=l>0?Math.ceil(this._res*_/l):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,s=h.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}else if(h&&Array.isArray(h.points))if("movingAverage"===s&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,s=e.backward>0?e.backward:0,i=h.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),s=t/e;if(a){const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}else if(i.length>=2){const t=i[i.length-1],r=i[i.length-2],o=(t.y-r.y)/(t.x-r.x);for(let i=1;i<=e;i++){const e=n.x+s*i,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}}}}else this._points.push(...h.points);this._expr=h&&h.expr,this._points.forEach((t=>{t.x-=n,t.y-=o}))}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=f(0,y(t.forward,0)),t.backward=f(0,y(t.backward,0)),this._formatter=xt.getFormatter(t.numberFormat||"0.####")}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:y(t.y,0)}))),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(x(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,s=0,i=0,r=0,n=0,o=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),o+=t.x*t.y}));const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const s=e.map((t=>({x:t.x,y:t.y}))),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+i);h.push(o),o=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)x(s[t][r])>x(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,a),l=t=>h.reduce(((e,s,i)=>e+s*t**i),0);return{expr:"y = "+(h.map(((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`})).filter((t=>t)).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=f(1,m(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+y(e.y,0)),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var gi;pi.defaults=Me(Be.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const mi={},fi={},xi=/\$\{detail\}/g;class yi extends Be{}yi.defaults=Me(Be.defaults,{visible:!1});class bi extends Re{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ot.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getOffset(){return y(this._op.offset,0)}getDefaultIconPos(){return"top"}getRotation(){return f(-90,m(90,y(this._op.rotation,0)))}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){"auto"===t.position&&(t.position="default"),super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=y(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}gi=bi,bi.OFFSET=4,bi.defaults=Me(Re.defaults,{visible:void 0,position:"default",offset:gi.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});const wi={x:"xValue",y:"yValue",z:"zValue"};class vi extends Xt{constructor(t,e,s){super(),this.series=t,this.point=e,this.delay=s?200:0,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return!this.point._isDeleted()&&(this.point._vr=t,this.series._changed(),!0)}}class Si extends Xt{constructor(t,e,s){super(),this.series=t,this.points=e,s&&(s.cancel(),this._prevAnis=s._prevAnis?[...s._prevAnis,s]:[s],this._prevVrs=new Map,this._prevAnis.forEach((t=>{t.points.forEach((t=>{isNaN(t._vr)||this._prevVrs.set(t,t._vr)}))}))),e.forEach((t=>{t._setDeleted()})),this.duration=t._decayDuration,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),e||(this.series.getPoints().clean(),this.series.$_clearDecay())},this.series.$_setDecay(this)}_doUpdate(t){return this._prevAnis&&this._prevAnis.forEach((e=>{e.points.forEach((e=>{const s=this._prevVrs.get(e);void 0!==s&&(e._vr=s*(1-t))}))})),this.points.forEach((e=>{e._vr=1-t})),this.series._changed(),!0}}class Vi extends Xt{constructor(t,e,s){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach((t=>{this.addPoint(t)})),this._interval=s,this.duration=Number.POSITIVE_INFINITY,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),this.series.$_clearDrop()}}addPoint(t){if(t&&!this._points.includes(t)){const e=this.series._getLabeledPoints().slice();e.sort(((t,e)=>t.xValue-e.xValue)),t.xValue<=e[0].xValue?t._setDrop(-1):t.xValue>=e[e.length-1].xValue&&t._setDrop(1),this._points.push(t),t._vr=0}return this}_doUpdate(t,e){const s=this._points;for(let t=s.length-1;t>=0;t--)s[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(s[t]._vr)||s[t]._vr>=1)&&s.splice(t,1);return 0!==s.length&&(this.series._changed(),!0)}}class Ai extends ii{}const Pi=12;class Ci extends Be{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach((t=>{mi[t.type]=t}))}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new ri(this),this._pointArgs={},this._paletteColors=Array(Pi).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==tt&&ot.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){ot.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){ot.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){ot.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){ot.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){const e=this._op;let s;return e.tooltipDetailCallback&&(this._getPointCallbackArgs(this._pointArgs,t),s=e.tooltipDetailCallback(this._pointArgs)),void 0===s&&(s=e.tooltipDetail||""),s}getTooltipText(t,e){const s=this._op;let i;return s.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),i=s.tooltipCallback(this._pointArgs)),void 0===i&&(i=s.tooltipText,i&&(i=i.replace(xi,this.getTooltipDetail(e)))),i}getTooltipParam(t,e,s){return Ci.getPointTooltipParam(t,e,s)}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}get isWidget(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach((i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)})),s}_getVisiblePoints(){return this._points.getRunPoints(this._xAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}isXY(){return!1}displayName(){return this._op.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e)),this._legendMarker}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return this._op.label||this.name}legendKey(){return this[this._op.legendKey]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}get xMax(){return this._maxX}get xMin(){return this._minX}get yMax(){return this._maxY}get yMin(){return this._minY}get zMax(){return this._maxZ}get zMin(){return this._minZ}canDepth(){return!1}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.options.noClip:this._op.noClip}needClip(t){const e=this._getNoClip(t);return t?!1===e:!0!==e}connectable(t){return!1}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return y(s,t.getXStart())}$_getXStep(t){return v(this._op.xStep,this.chart.chartOptions.options.xStep,1)}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_connect(t){this._xAxisObj=this._group?this._group._xAxisObj:t._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:t._connectSeries(this,!1)}_prepareRender(){this._legended=null,this._calcedColor=void 0,this._dataSourceDirty&&(this._dataSourceChanged(),this._dataSourceDirty=!1),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof _i)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(r(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>o(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>o(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);o(i)&&(i=i.trim()),this._points.forEach(((e,r)=>{let n=t.getValue(e.x);isFinite(n)||(n=s,s=t.incStep(s,i)),e.xValue=n})),e&&this._runPoints.forEach((t=>{!1!==t.visible&&e.push(t.xValue)}))}else{const s=this.hasZ();this._points.forEach(((e,i)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let i=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(i)&&t&&(i=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(s?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),i=e._prev.yValue+(i-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=i,e.isNull=!isFinite(i)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(c)&&!isNaN(e)?_=c=e:e>c?c=e:e<_&&(_=e)}if(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],s=e.map((t=>t.y)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e)),i=e.map((t=>t.x)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e));s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return y(this._op.paddingRate,1)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=J(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=L}))}prepareReferents(t){this._referents&&this._referents.forEach((e=>e.visible&&e.refer(this,t))),this.visible&&!this._visPoints&&(this._visPoints=this._buildVisPoints(this._runPoints))}refer(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPos(t){return this._getLabelDefaultPos(t,t.options.position)}_getLabelDefaultPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelDefaultPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?y(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),bi.OFFSET):this._labelOff}referBy(t){t&&(this._referents?this._referents.indexOf(t)<0&&this._referents.push(t):this._referents=[t])}setPointVisible(t,e){t&&e!==t.visible&&(t.visible=e,this.chart._pointVisibleChanged(this,t))}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._preparePointArgs(t),(this._argsPoint=e).assignTo(t)),t}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(this._op.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(this._pointLabel.options.styleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){this._op.onPointHover&&(t&&this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointHover(t?this._pointArgs:null))}getViewRangeAxis(){return this._op.viewRangeValue||this._defViewRangeValue()}isLabelsVisible(){return this._pointLabel.visible}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.options.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.options.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t,e){return o(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:L}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,s=!0){if(t instanceof ii||(t=this.getPointAt(t)),t){let i=t._prev;return i&&i.ani&&i.ani.cancel(),i=t.updateValues(this,e),i&&s&&this.chart.animatable()&&(i.ani=new vi(this,t,!1),i.ani.start()),this._dataPointsChanged(),!!i}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const s=this._doAddPoint(t);if(s){if(this._points.add(s),e&&this.chart.animatable()&&this._needAddAnimation()){const t=s._prev=s.copy();t.ani=new vi(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}addPoints(t,e=!0){const s=[];return r(t)&&t.forEach((t=>{const e=this._doAddPoint(t);e&&s.push(e)&&this._points.add(e)})),s.length>0&&(e&&this.chart.animatable()&&s.forEach((t=>{const e=t._prev=t.copy();e.ani=new vi(this,t,this._points.count>1),e.ani.start()})),this._dataPointsChanged()),s}_needDecayEffect(){return!1}removePointAt(t,e=!0){const s=this._points.get(t);return this.removePoint(s,e)}removePoint(t,e=!0){if(t instanceof ii||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof ii&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Si(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Vi(this,[t],this._decayDuration)).start(),s=!0)}else this._points.remove(t)&&(s=!0);if(s)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(r(t)){const s=t.map((t=>this._points.get(t))).filter((t=>null!=t));return this.removePoints(s,e)}return 0}removePoints(t,e=!0){if(r(t)){let s=[];if(t.forEach((t=>{t instanceof ii||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof ii&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)})),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Si(this,s,this._decayAni).start(),this._changed(),s.length;s=this._points.removeAll(s),s.length>0&&(this._dropAni?s.forEach((t=>this._dropAni.addPoint(t))):(this._dropAni=new Vi(this,s,this._decayDuration)).start())}else s=this._points.removeAll(s);if(s.length>0)return this._doPointsRemoved(s),this._dataPointsChanged(),s.length}}return 0}getDropPoints(){var t;return null===(t=this._dropAni)||void 0===t?void 0:t._points}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders(),this._decayDuration=f(0,y(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new bi(t)}_createPoint(t){return new Ai(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return n(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(r(t))return t;if(t){let e;if(t._obj instanceof ct)e=t._obj;else if(t instanceof ct)e=t;else if(Number.isFinite(t)||i(t)||l(t))return[t];if(e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){var e,s;return this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=h(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Pi+1)})`:t.color;let i,n;r(e)?i=e:o(e)?e.endsWith("@pal")||e.endsWith("@palette")?i=this.chart.getPaletteColors(e.split("@")[0]):n=this.chart._assets.get(e):this._colorByPoint()&&(i=this.chart.chartOptions.options.colors),n instanceof Ce?this._runPoints.forEach(((t,e)=>{t.color=t.color||n.getNext()||s})):r(i)?this._runPoints.forEach(((t,e)=>{t.color=t.color||i[e%i.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=V(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=V(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[wi[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=L}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}Ci.LEGEND_MARKER="rct-legend-item-marker",Ci.defaults=Me(Be.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}: ${detail}",tooltipDetail:"<b>${yValue}</b>",loadAnimation:"default",decayDuration:300,hoverEffect:"default",interactive:!0,paddingRate:1});class ki extends Oe{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find((e=>!e.isEmpty(t)))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}_internalSeries(){return this._series}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}canDepth(){return this._visibleSeries.every((t=>t.canDepth()))}_clear(){}get(t){return this._items[t]}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter((s=>t===s.row&&e===s.col))}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof Hi&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach((i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)})),s}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,s=this._items=[],n=this._series=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t instanceof Hi?n.push(...t.series):t instanceof Ci&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e._op.series=this._items.map((t=>t.options))}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof Ci?e=t:o(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>{t._setIndex(e)})),e;if(e._group.remove(e))return e}}updateData(t){}connect(t){const e=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0)));e.forEach((e=>{e._connect(t),e._valid=Boolean(e._xAxisObj&&e._yAxisObj)})),this._visibles=e.filter((t=>t._valid))}prepareRender(){const t=[];let e=0;this._series.forEach((s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape(Rs[e++%Rs.length]),i||(s._valid=!0))}})),this._visibleSeries=t.sort(((t,e)=>{let s=+(t.group?t.group.zOrder:t.zOrder)||0,i=+(e.group?e.group.zOrder:e.zOrder)||0;return s===i&&t.group&&t.group===e.group?(+t.zOrder||0)-(+e.zOrder||0):s-i}));const s=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof Ri&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const i=r(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r._setIndex(s),r.init(),r._load(e),r}return Ci._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Oi||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}}class Li extends Ci{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new pi(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Li.defaults=Me(Ci.defaults,{});class Ni extends Be{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){if(this._op.styleCallback)return this.series._getPointCallbackArgs(this._args,t),this._op.styleCallback(this._args)}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Ni.defaults=Me(Be.defaults,{radius:3});class Mi extends ii{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return w(this.x,this.y)}legendKey(){return this._legendKey}styleLegendMarker(t){}isEmpty(){return 0===this.yValue}initPrev(t,e){e.yValue=0}getParam(t){const e=super.getParam(t);return null==e&&"name"===t?this.x:"percent"===t?this._percent:e}}class Ei extends Be{_doSetSimple(t){return o(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Ei.defaults=Me(Be.defaults,{curved:!0});class Ti extends bi{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Ei(this.chart)).init()}get connector(){return this._connector}getAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}Ti.defaults=Me(bi.defaults,{visible:!0,convergent:!0,align:Xs,dedupeMode:Ws});class Bi extends Be{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?Y(this._minDim,ii.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Bi.DEF_COUNT),(this._dirty=!s||s.value!==i||s.count!==r)&&(isNaN(i)||(t=t.filter((t=>t.y>=i))),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=j(t.minValue,!0)}}Bi.DEF_COUNT=10,Bi.defaults=Me(Be.defaults,{visible:!1,x:"기타"});class Oi extends Ci{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Bi(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:Y(this._centerXDim,t),y:Y(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_needDecayEffect(){return!0}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&(this._groupedPoints||this._runPoints).forEach((e=>{this._isVisibleInLegend(e)&&t.push(e)})):super.getLegendSources(t)}_isVisibleInLegend(t){return t.yValue>=0&&(t.yValue>0||this._op.zeroInLegend)}_doApply(t){const e=this;var s,i;super._doApply(t),s=t.centerX,i=t.centerY,s!==e._centerX&&(e._centerX=s,e._centerXDim=j(v(s,e._op.center,Oi.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=j(v(i,e._op.center,Oi.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach((t=>this._sum+=t.yValue));const s=this.getSum();this._runPoints.forEach((t=>t._percent=100*t.yValue/s))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this._op.legendKey,s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({...this._op.othersGroup},t.slice(this._groupedPoints.length));e.parse(this),e.index=t.length,e.yValue=e.yGroup=e.y,this._groupedPoints.push(e)}t=this._groupedPoints}return super._buildVisPoints(t).map(((t,s)=>(t.vindex=s,t._legendKey=t[e],t)))}}Oi.DEF_CENTER="50%",Oi.defaults=Me(Ci.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Oi.DEF_CENTER,centerY:Oi.DEF_CENTER});class Di extends Oi{getRadius(t,e){return Y(this._radiusDim,m(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=j(w(t._radius=e,Di.defaults.radius),!0))}(this,t.radius)}}Di.defaults=Me(Oi.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Ri extends Li{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._op.minPointWidth}getPointWidth(t,e){const s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.options.groupPadding,i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,f(e,i)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.options.groupPadding,s-=s*e.options.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this._op.pointPadding)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,this._op.pointPadding)),this._op.minPointWidth=y(this.getMinPointWidth(),0)}}Ri.defaults=Me(Ci.defaults,{pointWidth:1,minPointWidth:0});class $i extends bi{get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new yi(this.chart)).init()}}$i.defaults=Me(bi.defaults,{});class Fi extends Ri{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new $i(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=f(0,b(e.depth,t.getDepth(),Fi.DEPTH)),this._distance=t.getDistance()+y(e.distance,0)):(this._depth=f(0,y(e.depth,Fi.DEPTH)),this._distance=y(e.distance,Fi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this._op.baseValue}}Fi.DEPTH=10,Fi.DISTANCE=5,Fi.defaults=Me(Ri.defaults,{nullAsBase:!1});class Ii extends Ri{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}}))}}class zi extends Ii{}class Hi extends Be{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{fi[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{fi[t.seriesType]=t}))}static collectTooltipText(t,e,s,i,n){function o(t,e,s,i){let r=e.replace(xi,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),r}const a=e.length>1&&r(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,h=a?t.tooltipListRow:t.tooltipRow;let l;return a?n.header=t.tooltipHeader||"":l=t.tooltipHeader||"",h&&e.forEach(((t,e)=>{let r=i;t!==s&&t.needAxes()&&(r=t.getPointAt(i.xValue)),r&&(a?(n.items.push(t),n.rows.push([o(t,h[0],r,e),o(t,h[1],r,e)])):(l&&(l+="<br>"),l+=o(t,h,i,e)))})),a?n.footer=t.tooltipFooter||"":l+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",l}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ci.getPointTooltipParam(e,s,i)}isGroupTooltip(){return!0}getTooltipText(t,e,s){return Hi.collectTooltipText(this._op,this._visibles,t,e,s)}getTooltipParam(t,e,s){return Hi.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach((e=>e.setCol(t))))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach((e=>e.setRow(t))))}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}connectable(t){return!0}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this._op.layout){case"stack":this.$_collectStack(t,e);break;case"fill":this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t,e){this._visibles.forEach((s=>{s.collectRanges(t,e)}))}prepareReferents(t){this._series.forEach((e=>e.prepareReferents(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){var e;const s=this._op;if(!1!==s.visibleInLegend&&this.visible){const i=this._series,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((t=>t.getLegendSources(r)));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(r);s.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach(((t,e)=>{t._setIndex(e)})),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}getLayoutMax(){const t=y(this._op.layoutMax,Hi.LAYOUT_MAX);return t>0?t:Hi.LAYOUT_MAX}_doApply(t){super._doApply(t),s.call(t,"children")&&(this._series=[],this.$_loadSeries(this.chart,t.children))}_doSaveArray(t,e){if("children"===t)return this._series.map((t=>t.saveOptions()))}_prepareRender(){const t=this._visibles;if(this._legended=null,this._stacked="stack"===this._op.layout||"fill"===this._op.layout,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),!(this._seriesChanged=!ot.equalArrays(t,this._visibles)))for(let t=this._visibles.length-1;t>=0;t--)if(this._visibles[t].seriesChanged()){this._seriesChanged=!0;break}super._prepareRender()}_connect(t){this._xAxisObj=t._connectSeries(this,!0),this._yAxisObj=t._connectSeries(this,!1)}_doPrepareRender(t){this._visibles.length>0&&(this._visibles.forEach((e=>e._connect(t))),this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_setIndex(t){this._index=t}_doPrepareSeries(t){}$_loadSeries(t,e){const s=this._seriesType();r(e)?e.forEach(((e,i)=>this.$_add(Ci._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(Ci._loadSeries(t,this._series.length,e,s))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i*(i<0?-1:1)),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i*(i>=0?-1:1)),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(x(e.yValue)||0)),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}Hi.LAYOUT_MAX=100,Hi.defaults=Me(Be.defaults,{layout:"default",layoutMax:Hi.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class Gi extends Hi{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ji extends Hi{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this._op.groupWidth}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}ji.defaults=Me(Hi.defaults,{groupWidth:1,groupPadding:.1});class Xi extends Li{isMarker(){return!0}isXY(){return!0}}Xi.defaults=Me(Ci.defaults,{colorByPoint:!1});class Yi extends Be{}class Wi extends Be{}const Ui={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Zi={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},qi={minPadding:0,maxPadding:0};class Ki extends Be{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new Yi(e)).init(),t.mask=(this._mask=new Wi(e)).init(),t.borderLine=(this._borderLine=new Be(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return y(this._op.thickness,Ki.defaults.thickness)}getGap(){return y(this._op.gap,Ki.defaults.gap)}getGapFar(){return y(this._op.gapFar,Ki.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=_({},e.series,Ui[t]())}else s.series=Ui.area();i(e.xAxis)?s.xAxis=_({},e.xAxis,(Zi[e.xAxis.type]||Zi.linear)(),qi):s.xAxis=_({},qi),i(e.yAxis)?s.yAxis=_({},e.yAxis,(Zi[e.yAxis.type]||Zi.linear)(),qi):s.yAxis=_(Zi.linear(),qi),this._chartConfig=s,this._axisType=s.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}Ki.defaults=Me(Be.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Qi extends Be{_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Qi.defaults=Me(Be.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class Ji extends Qi{}Ji.defaults=Me(Qi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class tr extends Be{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o=!!r.axis;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this._op.noClip;return!!l(t)&&t}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}getHeaderHeight(){const t=this._op;return t.simpleMode?0:f(y(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:f(y(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:f(y(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return y(this._op.listMarkerGap,5)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?xt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Ot.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}tr.defaults=Me(Be.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",headerHeight:7,tailSize:10,borderRadius:5,simpleMode:!1,noClip:!1,listGap:12,listRowGap:3,listMarkerSize:7,listMarkerGap:5});const er="vline",sr="hline",ir="line";class rr extends Ie{_isVisible(){return this._op.visible&&!I(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}rr.type="image";class nr extends Ie{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||nr.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}nr.type="shape",nr.defaults=Me(Ie.defaults,{width:64,height:64,shape:"square"});class or extends Ie{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?xt.getFormatter(s):L),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Ot.getFormatter(t):L)}(t.timeFormat)}}or.type="text",or.defaults=Me(Ie.defaults,{text:"Text"});class ar extends Ke{getPositions(t,e){return t.hasBreak()?t._ticks.filter((e=>!t.isBreak(e.value))).map((s=>t.getPos(e,s.value))):t._ticks.map((s=>t.getPos(e,s.value)))}}class hr extends ss{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:r});isNaN(n)||(e=n)}return e>0?e:void 0}buildSteps(t,e,s,i,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,y(.85*_,60),s,i,o,l):r(h.steps)||n(h.steps)||n(h.stepCallback)?this._getStepsBySteps(i,o,l):this._baseAxis instanceof ur&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,i,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,i,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,i,o))?this._getStepsByInterval(d,s,i,o):_>0?this._getStepsByPixels(e,_,s,i,o,l):i!==o?[i,o]:[i],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?f(8,d(t/(.9*e))+1):y(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){let e;if(super._doApply(t),this._stepPixels=!n(t.stepPixels)&&ot.parseTuples(t.stepPixels),s.call(t,"stepMultiples"))if(n(t.stepMultiples))e=t.stepMultiples;else{let s;if(r(t.stepMultiples)){let e=Number.MIN_SAFE_INTEGER;s=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>e&&s.push(+t)}))}e=s&&s.length>0?s:void 0,e&&(e=e.filter((t=>t>=1)),e.length>0?e.sort(((t,e)=>t-e)):e=void 0)}this._userMultiples=e}$_getStepPixels(t,e){let s=this._stepPixels;if(n(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?hr.STEP_PIXELS_P:t._isX?hr.STEP_PIXELS_X:hr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return f(1,s[e][1])}_findBaseAxis(){if(null!=this._op.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this._op.baseAxis);e!==t&&e instanceof ur&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),t}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h==2.5&&c(t*o/a)==t*o/a?this._step=a:a=this._step=d(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new K(e)}(s<e&&i>e,"base error"),t=f(3,t);;){if(!(d((e-s)/a)+d((i-e)/a)+1>t))break;a+=h}s=e-d((e-s)/a)*a}else s=n._fixedMin;l.push(D(s));for(let e=1;e<t;e++)l.push(D(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=D(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=D(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=D(n-t));for(n=e;n<i;)r.push(n=D(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=n(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?hr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?hr.STEP_MULTIPLES[0]:hr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const i=this._op,o=n(i.steps)?i.steps:i.stepCallback;let a;return o?(a=o.call(void 0,s),r(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=i.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(i.clipSteps?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort(((t,e)=>t-e)),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=f(1,c(t/e))+1,l=o/(h-1);const _=function(t){return Math.pow(10,t)}(c(g(l))),u=this._getStepMultiples(_,n),p=[];let m,x=0;if(l/=_,u)if(l>u[x]){for(;x<u.length-1;x++)if(l>u[x]&&l<u[x+1]){l=l<=u[x]+(u[x+1]-u[x])/2?u[x]:u[x+1];break}}else l=u[x];for(;;){for(l*=_,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-d((s-i)/l)*l,this._step=l,p.push(D(m=i));m<r;)p.push(D(m+=l));if(!u||x>u.length-2||p.length<=a)break;l=u[++x],p.length=0}return p}}hr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],hr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],hr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],hr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],hr.defaults=Me(ss.defaults,{baseRange:!1,enableDecimals:!0});class lr extends is{}lr.defaults=Me(is.defaults,{numberFormat:"0.##"});class _r extends lr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}_r.defaults=Me(lr.defaults,{useSymbols:!0});class cr extends Ye{getSize(t){return Math.min(.9*t,Y(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=y(this._op.space,0),this._sizeDim=j(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}cr.defaults=Me(Ye.defaults,{size:"30%",space:16,gridVisible:!0});class dr extends We{_isVisible(){return this._op.visible}}dr.defaults=Me(We.defaults,{visible:!1});class ur extends as{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new dr(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._baseVal}hasBreak(){return null!=this._runBreaks}_getBreaks(){return this._runBreaks?this._runBreaks.slice(0,1):[]}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.options.gridVisible&&(t===e.options.from||t===e.options.to)}}$_getPadding(t,e,s){if(!t){if(this._isX&&this._isPolar)return 0;t=ur.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var e,i;super._doApply(t);const r=null!==(e=t.minPadding)&&void 0!==e?e:t.padding,n=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,o(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,o(n)&&n.endsWith("px")&&(a=parseFloat(n),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=ot.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=ot.parseTuples(n)),this._baseVal=+this._op.baseValue,this._strictMin=j(t.strictMin,!0),this._strictMax=j(t.strictMax,!0),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new ar(this)}_createTickModel(){return new hr(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=y(this._runBase,this._min);isNaN(this._fixedMax)&&isNaN(this._maxPadPixels)&&this._calcedMax>e&&t[t.length-2]>this._calcedMax&&t[t.length-2]-this._calcedMax>.5*(t[t.length-2]-t[t.length-3])&&(t.pop(),this._setMinMax(this._min,t[t.length-1])),e=y(this._runBase,this._max),isNaN(this._fixedMin)&&isNaN(this._minPadPixels)&&this._calcedMin>e&&t[1]<this._calcedMin&&t[1]-this._calcedMin<.5*(t[1]-t[2])&&(t.shift(),this._setMinMax(t[0],this._max))}$_trimSteps(t,e,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof ur&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:h}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(a=r._baseAxis.axisMin(),h=r._baseAxis.axisMax()),this._mergedBreaks){this._runBreaks=this._mergedBreaks.slice(0);for(let t=this._runBreaks.length-1;t>=0;t--){const e=this._runBreaks[t];(isNaN(e.options.from)||isNaN(e.options.to)||e.options.from<=a||e.options.to>=h)&&this._runBreaks.splice(t,1)}this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;let l,_,c=!1,d=a,u=h;if(this._isX)if(a===h)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s,a,h);if(e){if(this._unitLen=e.len,c=!0,!this._zoom||t)if(e.min=e.min*(2*y(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=M*e.min/(h-a+e.min):t*=T,isNaN(this._fixedMax)&&this.getTotalAngle()+t>M&&(h=this._max=Math.max(this._calcedMax+e.min,h))}else isNaN(this._fixedMin)&&(a=this._min=Math.min(this._calcedMin-e.min/2,a)),isNaN(this._fixedMax)&&(h=this._max=Math.max(this._calcedMax+e.min/2,h))}else this._unitLen=1}if(a===h)l=[a];else if(this._runBreaks)l=this.$_calcBrokenSteps(this._runBreaks,s,a,h),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,s,this._runBase,a,h,!1),_=l.slice(0),l.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d;)l.shift();l.length<2&&this._fixedMin<l[0]&&l.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;l.length>2&&l[1]<=d;)l.shift();if(!isNaN(r._step))for(;l[0]>d;)l.unshift(r.getNextStep(l[0],-1))}if(a=Math.min(a,l[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;l.length>1&&l[l.length-1]>u;)l.pop();l.length<2&&this._fixedMax>l[l.length-1]&&l.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;l.length>2&&l[l.length-2]>=u;)l.pop();if(!isNaN(r._step))for(;l[l.length-1]<u;)l.push(r.getNextStep(l[l.length-1],1))}h=Math.max(h,l[l.length-1])}else l.push(a+(h-a)/2);this._prevSteps=l,this._setMinMax(a,h);const p=this.$_createTicks(l,s,a,h,i);if(c&&p.length>1){const t=this._isPolar;let e=!1;const s=_;let i,r;if(s[0]<=a){for(r=-1;r<l.length-1&&s[r+1]<l[0];)r++;for(;r>=0&&(i=s[r])>=a;){const t=this.dataToAxis(p[0].value),s=this.dataToAxis(p[1].value);if(i<t&&t-i>=s-t&&("tick"===this.$_getStartFit()||i>a)){const t=this._createTick(0,i);p.unshift(t),l.unshift(i),e=!0}r--}}if(s[s.length-1]>=h){for(r=s.length;r>0&&s[r-1]>l[l.length-1];)r--;for(;r<s.length&&(i=s[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(i>=t&&i-t>=t-s&&("tick"===this.$_getEndFit()||i<h)){const t=this._createTick(0,i);p.push(t),l.push(i),e=!0}r++}}else if(t&&h>s[s.length-1])for(;(i=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(!(D(h-t)>D(t-s)))break;{const r=this._createTick(0,i+D(t-s));p.push(r),l.push(r.value),e=!0}}e&&p.forEach(((t,e)=>t.index=e))}return p}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}_calcPoints(t,e){super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce(((t,e)=>t+e.options.space),0);t.forEach((t=>{const e=t.options,s=t.getSize(h),i=Math.max(0,e.space||0),l={from:n,to:t.options.from,pos:r,len:s};r+=s,a.push(l,t._sect={from:e.from,to:e.to,pos:r,len:i}),r+=i;this.$_buildBrokenSteps(l).forEach((t=>{t>l.from&&t<=l.to&&o.push(t)})),i>0&&o.push(e.to)}));const l=t[t.length-1];if(i>l.options.to){const t={from:l.options.to,to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&o.push(e)}))}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.length-1],o}getPos(t,e){let s;if(this._runBreaks){const i=this._sects.find((t=>e<t.to))||this._lastSect,r=i.len*(e-i.from)/(i.to-i.from);s=this._op.reversed?R(t-r-i.pos):R(r+i.pos)}else{let i=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this._op.reversed&&(i=t-i,isNaN(this._prevRate)||(i+=this._prevSize-t)),s=R(i)}return this._ani?this._ani.getPos(s,this._op.reversed):s}valueAt(t,e){if(this._isHorz?this._op.reversed&&(e=t-e):this._op.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_isLog(){return!1}$_getStartFit(){return"default"===this._op.startFit?this._isX&&!this._isPolar?"value":"tick":this._op.startFit}$_getEndFit(){return"default"===this._op.endFit?this._isX&&!this._isPolar?"value":"tick":this._op.endFit}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-Y(t,s):e+Y(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),a=!0,h=!0,l=NaN,_=NaN,d=1;if(this._series.length>0){let t,c=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||c++,d=f(d,t.getAxisPadRate())})),!this._isX&&c>0&&c<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[m(t._yMin,r[e][0]),f(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let c=r._sBase;isNaN(c)||(c=D(c),i?c>=0&&c<=e&&c<=s&&(e=t=c):c<=e?r.isBased(this)?e=t=c:l=y(m(l,c),c):c>=s&&(r.isBased(this)?s=t=c:_=y(f(_,c),c))),a&&!n&&(i||r.canMinPadding(this,e,t))&&(a=!1),h&&!o&&(i||r.canMaxPadding(this,s,t))&&(h=!1)}))}else a=n,h=o;n||(n=a),o||(o=h),this._fixedMin=this._fixedMax=NaN;const u=f(0,s-e),p=this.$_calcStrict(this._strictMin,e,-u),g=this.$_calcStrict(this._strictMax,s,u);let x=NaN,b=NaN,w=0,v=0;isNaN(p)?n?this._fixedMin=e:isNaN(this._minPadPixels)?w=this.$_getPadding(this._minPaddings,t,d):x=this._minPadPixels:this._fixedMin=e=p,isNaN(g)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?v=this.$_getPadding(this._maxPaddings,t,d):b=this._maxPadPixels:this._fixedMax=s=g;let S=e,V=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*w;e<S&&(S=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*v;e>V&&(V=e)}}else S-=u*w,V+=u*v;if(!isNaN(x)||!isNaN(b)){isNaN(x)&&(x=0),isNaN(b)&&(b=0);const e=Math.min(x+b,.9*t),s=u-c(u*(t-e)/t),i=Math.round(s*x/e);S-=i,V+=s-i}return!isNaN(l)&&l<=e&&S<l&&(S=this._fixedMin=l),!isNaN(_)&&_>=s&&V>_&&(V=this._fixedMax=_),V=f(V,S),{min:S,max:V}}$_calcXUnitLength(t,e,s){const i=[];let r=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(i.push(...t._getVisiblePoints()),r++)})),0===r&&this._series.forEach((t=>{t.visible&&!t.isXY()&&i.push(...t._getVisiblePoints())})),i.length>0){const r=i.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=r.length-1;t>0;t--)r[t]===r[t-1]&&r.splice(t,1);return this._calcUnitLen(r,t,e,s)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:y(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=m(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:y(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new cr(this);return e.init(),e._load(t),t.from>0?e:null}}$_loadBreaks(t){if(r(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.options.to=e.options.to}const e=this._breaks.sort(((t,e)=>t.options.from-e.options.from)).filter((t=>t.visible&&t.options.to>t.options.from));if(this._mergedBreaks=null,e.length>0){const i=this._mergedBreaks=[];i.push(_(new cr(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],o=e[r];s=n,o.options.from<s.options.to?t(n,o):i.push(_(new cr(this)._initObject(),o))}}var s}}ur.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],ur.defaults=Me(as.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default",unitPadding:.5});class pr extends ur{get label(){return this._label}_createLabel(){return new _r(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Hi&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}pr.type="linear";const gr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],mr=[[1,2,5,10,20,25,50,100,200,250,500],[1,2,5,10,15,30],[1,2,3,4,6,8,12],[1,2,3,4,6,12],[1,2],[1,2],[1,2,3,4,6]],fr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class xr extends hr{getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this._scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_getValidInterval(t,e,s,i,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:r});null!=n&&(e=n)}if(!isNaN(e))return+e>0?+e:NaN;if(o(e)&&fr.hasOwnProperty(e.charAt(e.length-1))){const t=parseFloat(e);return t<=-1||t>=1?e:NaN}}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=gr[e]/2&&t<gr[e+1]/2)return this._scale=e,mr[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,_=f(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=gr[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=a.date(i),p=a.date(r);let g,m=u;if(7===this._scale){const t=h.getFullYear();let e=m.getFullYear();this._step=_=Math.ceil(_),m=new Date(e,0),e<t&&e+_>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=_,m=new Date(e,0)}while(m<=p)}else if(6===this._scale){let t=m.getFullYear(),e=m.getMonth();this._step=_=Math.ceil(_),m=new Date(t,e),m<h&&new Date(t,e+_)>h&&(e=h.getMonth(),m=new Date(h.getFullYear(),e));do{n.push(+m),m.setMonth(m.getMonth()+_)}while(m<=p)}else if(4===this._scale||5===this._scale){let t=m.getFullYear(),e=m.getMonth(),s=m.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),m=new Date(t,e,s),m<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+m),m.setDate(m.getDate()+_*i)}while(m<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}g=m.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(o(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=fr[a],t=gr[this._scale];let c=new Date(s);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+h&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+h),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let s=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+h*s),c<n&&_>n&&(c=new Date(n),c.setHours(0,0,0,0));break;case 3:c.setMinutes(0);case 2:c.setSeconds(0);case 1:c.setMilliseconds(0)}if(this._step=h,s=+c,isNaN(e))for(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}}const yr=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd HH:mm"},{format:"MM-dd",beginningFormat:"yyyy-MM-dd"},{format:"MM W주",beginningFormat:"yyyy-MM-dd"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy",beginningFormat:"yyyy"}];class br extends lr{_doApply(t){super._doApply(t);const e=o(t.timeFormat)?t.timeFormat:void 0,s=o(t.beginningFormat)?t.beginningFormat:void 0,n=t.timeFormats,h=t.useBeginningFormat;if(this._formats=yr.map((t=>_(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&s&&this._formats.forEach((t=>{t.beginningFormat=s})),r(n))for(let t=0;t<n.length;t++){const e=this._formats[t],s=n[t];a(s)?e.format=s:i(s)&&(a(s.format)&&(e.format=s.format),h&&a(s.beginningFormat)&&(e.beginningFormat=s.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,o=i.tick._scale,a=Ot.getFormatter;switch(o){case 7:return a(n[o].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek)}}}br.defaults=Me(lr.defaults,{useBeginningFormat:!0});class wr extends ur{get label(){return this._label}_createTickModel(){return new xr(this)}_createLabel(){return new br(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}collectValues(){this._offset=60*y(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return h(t)?t:t instanceof this._dateClass?t.getTime():o(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(o(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}wr.type="time",wr.subtype="date",wr.defaults=Me(ur.defaults,{baseValue:NaN});class vr extends oi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Sr extends zi{pointLabelCount(){return 2}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new vr(t)}_getBottomValue(t){return t.lowValue}}Sr.type="barrange",Sr.defaults=Me(zi.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Vr extends ii{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Ar extends Fi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Vr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Ar.defaults=Me(Fi.defaults,{colorByPoint:!1,pointOffset:0});class Pr extends Ar{canDepth(){return!0}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Pr.type="bar";class Cr extends ji{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}getDepth(){return this._op.depth}getDistance(){return this._op.distance}_doApply(t){super._doApply(t),this._op.distance=y(t.distance,0)}_doPrepareSeries(t){const e=this._op.layout;if("default"===e){const e=t.length>1?t.map((t=>t.options.pointWidth)).reduce(((t,e)=>t+e),0):t[0].options.pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.options.pointWidth/e,t._childPos=s,s+=t._childWidth}))}if("overlap"===e){let e=this.getDistance();t.forEach((t=>{t._groupDistance=e+=y(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}Cr.defaults=Me(ji.defaults,{depth:10,distance:5});class kr extends Cr{_canContain(t){return t instanceof Pr}}kr.type="bargroup",kr.seriesType="bar";class Lr extends Qt{constructor(t){super(t,Ci.LEGEND_MARKER),this.add(this._back=new Is(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new re(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){Fs.setShape(this._marker,this._shape,t,t)}}class Nr extends Lr{constructor(t){super(t),this.insertFirst(this._line=new re(t)),this.insertFirst(this._area=new re(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class Mr extends Lr{constructor(t){super(t),this.insertFirst(this._line=new re(t)),this._line.setFill("none"),this.insertFirst(this._line2=new re(t)),this._line2.setFill("none"),this.insertFirst(this._area=new re(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class Er extends re{constructor(t,e=L,s=L){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){ot.isNumber(t)?this.setPath(Fs.line(t,e,s,i)):t&&this.setPath(Fs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Fs.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Fs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Fs.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Fs.line(e,t,s,t))}}class Tr extends Lr{constructor(t){super(t),this.insertFirst(this._line=new Er(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Br extends ii{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Or extends Ni{}Or.defaults=Me(Ni.defaults,{radius:4,hoverScale:1.75});class Dr extends bi{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Dr.ALIGN_GAP:0:t}getPosition(){return w(this._op.position,"default")}}Dr.ALIGN_GAP=4,Dr.defaults=Me(bi.defaults,{align:"center"});class Rr extends Li{_doInit(t){super._doInit(t),t.marker=(this._marker=new Or(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return y(t.radius,this.marker.options.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Dr(t)}_createPoint(t){return new Br(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Tr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),m(e/2,this.marker.options.radius)),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const s=t.length,i=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();i.push(e)}else{let e=0;for(;e<s;){const r=[];for(;e<s&&t[e].isNull;)e++;for(;e<s&&!t[e].isNull;)r.push(t[e++]);r.length>0&&i.push(r)}}if(e){const t=[],s=[];e.forEach((e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&s.push(e)})),t.length>0&&(t.sort(((t,e)=>t.xValue-e.xValue)),i[0].unshift(...t)),s.length>0&&(s.sort(((t,e)=>e.xValue-t.xValue)),i[i.length-1].push(...s))}return i}}Rr.defaults=Me(Ci.defaults,{nullAsBase:!1});class $r extends Re{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}$r.defaults=Me(Re.defaults,{visible:!1,offset:8});class Fr extends Rr{_doInit(t){super._doInit(t),t.flag=(this._flag=new $r(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this._op.connectEnds;if(l(e))return e;if(!t||"spline"===this._op.lineType)return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof Yr||this._group instanceof Wr?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){const t=this._op;super._doPrepareRender(),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0),t.nullAsBase&&!isNaN(t.baseValue)&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Fr.type=qs,Fr.defaults=Me(Rr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Ir extends Fr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Ir.type="spline";class zr extends Br{}class Hr extends Fr{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=y(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}_createLegendMarker(t,e){return new Nr(t)}_createPoint(t){return new zr(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t,e){if(!this.chart.isPolar()&&this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doBuildLines(t,e)}}Hr.type=Ks,Hr.defaults=Me(Rr.defaults,{});class Gr extends zr{get high(){return this.y}get highValue(){return this.yValue}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}labelCount(){return 2}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[y(s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e)}}class jr extends Dr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class Xr extends Rr{pointLabelCount(){return 2}_createLabel(t){return new jr(t)}_createLegendMarker(t,e){return new Mr(t)}_createPoint(t){return new Gr(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._visPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doBuildLines(t,e){const s=super._doBuildLines(t,e),i=[];return s.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}i.push(t,e)})),i}}Xr.type="arearange",Xr.defaults=Me(Rr.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Yr extends Hi{_canContain(t){return t instanceof Fr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Yr.type="linegroup",Yr.seriesType=qs,Yr.defaults=Me(Hi.defaults,{lineType:"default"});class Wr extends Hi{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof Hr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Wr.type="areagroup",Wr.seriesType=Ks,Wr.defaults=Me(Hi.defaults,{lineType:"default"});class Ur extends zr{}class Zr extends Hr{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Ur(t)}_doLoadData(t){const e=super._doLoadData(t);if(r(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=t._visPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=this._op,r=t.reduce(((t,e)=>t+e),0)/s,n=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-r,2)))/(s-1)),o=n/i.pointsInSigma,a=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>a;)l-=o,_.unshift(e(r,n,l));for(l=r;l<h;)l+=o,_.push(e(r,n,l));return _}}Zr.type="bellcurve",Zr.defaults=Me(Hr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class qr extends ii{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return _(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.min=e[y(s.minField,0+i)],this.low=e[y(s.lowField,1+i)],this.mid=e[y(s.midField,2+i)],this.high=e[y(s.highField,3+i)],this.y=e[b(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=w(e[s.minField],e.min),this.low=w(e[s.lowField],e.low),this.mid=w(e[s.midField],e.mid),this.high=w(e[s.highField],e.high),this.y=w(e[s.maxField],this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=S(t.minValue,this.minValue,e),this.lowValue=S(t.lowValue,this.lowValue,e),this.midValue=S(t.midValue,this.midValue,e),this.highValue=S(t.highValue,this.highValue,e)}}class Kr extends zi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new qr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}}Kr.type="boxplot",Kr.defaults=Me(zi.defaults,{tooltipText:"<b>${name}</b><br>${detail}",tooltipDetail:"min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"});class Qr extends ni{}class Jr extends Xi{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:Y(this._minSizeDim,t),max:Y(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new Qr(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=m(t,s.zValue),e=f(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e)}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){o(t)&&(t=this._xAxisObj.getValue(t)),o(e)&&(e=this._yAxisObj.getValue(e));for(let s=0;s<this._points.count;s++){const i=this._points.get(s);if(i.xValue===t&&i.yValue===e)return i}}}Jr.type="bubble",Jr.defaults=Me(Xi.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"${detail}",tooltipDetail:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class tn extends Gi{_canContain(t){return t instanceof Fr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=w(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return ot.makeIntArray(0,t.length)}}tn.type="bump",tn.seriesType=qs;class en extends ii{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return _(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.low=e[y(s.lowField,0+i)],this.close=e[y(s.closeField,1+i)],this.open=e[y(s.openField,2+i)],this.y=e[b(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=w(e[s.lowField],e.low),this.open=w(e[s.openField],e.open),this.close=w(e[s.closeField],e.close),this.y=v(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e),this.openValue=S(t.openValue,this.openValue,e),this.closeValue=S(t.closeValue,this.closeValue,e)}}class sn extends zi{canCategorized(){return!0}_createPoint(t){return new en(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Zt;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new re(t,Ci.LEGEND_MARKER).setPath(s.end())}}sn.type="candlestick",sn.defaults=Me(zi.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class rn extends $i{}rn.defaults=Me(bi.defaults,{position:"inside"});class nn extends Ar{get pointLabel(){return this._pointLabel}_createLabel(t){return new rn(t)}}nn.type=Qs;class on extends Cr{_canContain(t){return t instanceof nn}}on.type="circlebargroup",on.seriesType=Qs;class an extends oi{}class hn extends Ni{}hn.defaults=Me(Ni.defaults,{radius:4,shape:"circle"});class ln extends zi{_doInit(t){super._doInit(t),t.marker=(this._marker=new hn(this)).init(),t.lowMarker=(this._lowMarker=new hn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+f(0,this.marker.options.radius)}_createPoint(t){return new an(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=y(e.radius,s),n=e.shape||i;this._visPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n})),super.prepareAfter()}}ln.type="dumbbell";class _n extends ii{}class cn extends Fi{getSegmentSize(t){return Y(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new _n(t)}_createLegendMarker(t,e){const s=new Zt;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new re(t,Ci.LEGEND_MARKER).setPath(s.end())}}cn.type="equalizer",cn.defaults=Me(Fi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class dn extends zi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new oi(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Zt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new re(t,Ci.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}dn.type="errorbar",dn.defaults=Me(zi.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class un extends Mi{}class pn extends un{constructor(t,e){super(t),this.points=e}}class gn extends Ti{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?gn.ENDED_DIST:gn.OUTSIDE_DIST:this._op.distance||0}}gn.OUTSIDE_DIST=25,gn.ENDED_DIST=10;class mn extends Oi{getSize(t,e){return{width:f(.1*t,Y(this._widthDim,t)),height:f(.1*e,Y(this._heightDim,e))}}getNeckSize(t,e){return{width:ot.clamp(Y(this._neckWidthDim,t),this._minNeckWidth,t),height:ot.clamp(Y(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new gn(t)}_createPoint(t){return new un(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new pn(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=X(e._width,mn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=X(e._height,mn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=X(e._neckWidth,mn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=X(e._neckHeight,mn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}mn.type="funnel",mn.defaults=Me(Oi.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class fn extends ii{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return _(super._assignTo(t),{min:this.min,max:this.max})}}const xn={squreRoot:function(t){return Math.ceil(Math.sqrt(t))},struges:function(t){return Math.ceil(Math.log(t)*Math.LOG2E)},rice:function(t){return Math.ceil(2*Math.pow(t,1/3))}};class yn extends Li{getBinCount(t){const e=y(this._op.binWidth,0);if(e>0)return t/e;return y(this._op.binsNumber,0)<1?xn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new fn(t)}_doLoadPoints(t){function e(t){let e;return e=r(t)?t[y(this.yField,0)]:i(t)?v(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),s.minValue<o[0]&&o.unshift(s.minValue),s.maxValue>o[o.length-1]&&o.push(s.maxValue);const t=o.length,e=o[0],i=o[t-1],r=this.getBinCount(t),a=this._binInterval=(i-e)/r;let h=0,l=e,_=l+a;for(let e=0;e<r;e++){let s=0;if(e==r-1)s=t-h;else for(;h<t&&o[h]<_;)s++,h++;n.push({x:l,y:s,min:l,max:e===r-1?i:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=b(this._op.baseValue,this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}}yn.type="histogram",yn.defaults=Me(Ci.defaults,{baseValue:0,binsNumber:"squreRoot"});class bn extends Ni{}bn.defaults=Me(Ni.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class wn extends ii{_assignTo(t){return _(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.options.colorField,i=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[y(r.xField,0)]),this.y=e[y(r.yField,0+n)],this.radius=e[y(r.radiusField,1+n)],isNaN(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=w(e[t.options.radiusField],e.radius)}}class vn extends Fi{_doInit(t){super._doInit(t),t.marker=(this._marker=new bn(this)).init()}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new wn(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=f(t.minRadius,0),n=f(t.maxRadius,r);if(i){const t=this._runPoints.map((t=>t.radius)).filter((t=>"number"==typeof t&&!Number.isNaN(t))),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach((t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s}))}else this._runPoints.forEach((t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s}));super.prepareAfter()}}vn.type="lollipop";class Sn extends en{}class Vn extends sn{_createPoint(t){return new Sn(t)}_createLegendMarker(t,e){const s=new Zt;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new re(t,Ci.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}Vn.type="ohlc";class An extends Br{}class Pn extends Rr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new An(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+y(e.yValue,0)),0);let r=0;t.forEach((t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})})),e._doLoadPoints(s),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Pn.type="pareto",Pn.defaults=Me(Rr.defaults,{curved:!1});class Cn extends Mi{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return _(super._assignTo(t),{sliced:this.sliced})}}class kn extends Cn{constructor(t,e){super(t),this.points=e}}class Ln extends Re{getDefaultIconPos(){return"left"}}class Nn extends Ti{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?Y(this._distanceDim,e,0):t?Y(s?Nn.INNER_DIST:Nn.INSIDE_DIST,e):"far"===this._op.align?Nn.ENDED_DIST:Nn.OUTSIDE_DIST}}Nn.INSIDE_DIST=j("30%",!1),Nn.INNER_DIST=j("50%",!1),Nn.OUTSIDE_DIST=25,Nn.ENDED_DIST=10,Nn.defaults=Me(Ti.defaults,{radius:.7,rotationMode:"arc"});class Mn extends Be{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return h(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=f(0,y(t.length,0)),t.ratio=f(.3,m(.8,y(t.ratio,Mn.DEPTH_RATIO)))}}Mn.DEPTH_RATIO=.6,Mn.defaults=Me(Be.defaults,{visible:!1,length:25,ratio:Mn.DEPTH_RATIO});class En extends Di{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new Ln(this.chart)).init(),t.depth=(this._depth=new Mn(this.chart)).init()}get innerText(){return this._innerText}get depth(){return this._depth}followPointer(){return!0}hasInner(){return this._innerRadiusDim&&this._innerRadiusDim.size>0}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return!this._group&&this._sliceOffsetDim?Y(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Nn(t)}_createPoint(t){return new Cn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new kn(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset"),t.totalAngle<=0&&(t.totalAngle=360)}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=E+T*y(this._op.startAngle%360,0),this._totalRad=T*f(0,m(360,y(this._op.totalAngle,360))),this._groupPos=NaN}}En.type="pie",En.defaults=Me(Di.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Tn extends Hi{getPolarSize(t,e){return Y(this._polarDim,m(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=j(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=j(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof En}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+y(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=y(t.options.groupSize,1)/e}))}}Tn.type="piegroup",Tn.seriesType="pie",Tn.defaults=Me(Hi.defaults,{polarSize:"80%",innerSize:0});class Bn extends ii{}class On extends Xi{_createPoint(t){return new Bn(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}_createLegendMarker(t,e){return new Lr(t)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}get canPolar(){return!0}getShape(t){return this._op.shape||this._defShape}hasShape(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),m(e/2,this._op.radius)),s}}On.type="scatter",On.defaults=Me(Xi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Dn extends ii{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class Rn extends bi{}Rn.defaults=Me(bi.defaults,{offset:0});class $n extends Ii{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Rn(t)}_createPoint(t){return new Dn(t)}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let _=1,c=t.length;_<c;_++){s=t[_];if(!0===s._isMid&&_<c)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}$n.type="waterfall",$n.defaults=Me(Ii.defaults,{tooltipDetail:"<b>${y}</b>"});class Fn extends hr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let l=[],_=f(1,c(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(_-1);const e=o(Math.floor(n(t))),c=this._getStepMultiples(e);if(t/=e,c&&c.length>0)if(t>c[0]){for(let e=0;e<c.length-1;e++)if(t>c[e]&&t<c[e+1]){t=t<=c[e]+(c[e+1]-c[e])/2?c[e]:c[e+1];break}}else t=c[0];t*=e,(t<=0||!isFinite(t))&&(t=h/_),i=isNaN(s)?this._normalizeMin(i,t):s-d((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let m=i,f=a(m);for(l.push(f);f<r;)m+=t,f=a(p?Math.round(m):m),f>l[l.length-1]&&(f<r&&(1==l.length&&f-l[l.length-1]<t||l.length>1&&f-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(f))}else{i=o(i);const t=(r=o(r))-i;let e=t/(_-1);const s=o(c(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/_);const h=1e-10*e;let d=c(i/e)*e;for(d<i&&(d+=e),l.push(n(d));d<=r+h;)d+=e,d>0&&l.push(n(d))}return l}}Fn.defaults=Me(hr.defaults,{arrangeDecimals:!0});class In extends ur{_isLog(){return!0}_createLabel(){return new _r(this)}_createTickModel(){return new Fn(this)}_doApply(t){super._doApply(t);const e=this._logBase=f(2,y(t.logBase,10));this._roundThreshold=y(t.roundThrrehold,500),this._log=this.$_createLog(e),this._pow=this.$_createPow(e),this._snap=this.$_createSnap(e,this._log)}$_createLog(t){return 10===t?Math.log10:e=>Math.log10(e)/Math.log10(t)}$_createPow(t){return e=>Math.pow(t,e)}$_createSnap(t,e){return s=>{const i=c(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}_checkValues(t){return t.filter((t=>t>0))}_doCalculateRange(t){const e=super._doCalculateRange(this._values);return e.min=this._log(e.min),e.max=this._log(e.max),e}_createTick(t,e){return super._createTick(t,D(this._pow(e)))}_calcUnitLen(t,e,s,i){if(t.length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=m(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:y(e*=a,1),min:o*a}}}In.type="log",In.defaults=Me(ur.defaults,{logBase:10,roundThrrehold:500});class zn extends Be{isChartScope(){return"chart"===this.options.scope}getHoverEffect(){const t=this.options;return"auto"===t.hoverEffect?t.hoverImageUrl?"image":"background":t.hoverEffect}click(){if(this._op.onClick){const t={chart:this.chart.wrapper,button:this};this._op.onClick(t)}}}zn.defaults=Me(Be.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class Hn extends Oe{load(t){const e=this.chart,s=this._items=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t))})):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map((t=>t.options))}$_loadItem(t,e){const s=new zn(t);return s.init(),s._load(e),s}}const Gn="$ctrl";class jn extends Be{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}jn.defaults=Me(Be.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Xn extends Be{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==w(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}Xn.defaults=Me(Be.defaults,{scope:"auto"});class Yn extends Be{_doInit(t){t.pointHovering=(this._pointHovering=new Xn(this.chart)).init()}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this._op.xStart)&&void 0!==e?e:t.getXStart()}}var Wn;Yn.defaults=Me(Be.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,resizeDelay:50}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(Wn||(Wn={}));class Un extends lt{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new dt,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Le,(this._chartOptions=new Yn(this)).init(),(this._title=new Qi(this)).init(),(this._subtitle=new Ji(this)).init(),(this._legend=new Os(this)).init(),(this._credits=new jn(this)).init(),(this._tooltip=new tr(this)).init(),this._buttons=new Hn(this),Un.split_class&&(this._split=new Un.split_class(this)).init(),(this._body=new Es(this)).init(),(this._navigator=new Ki(this)).init(),(this._exporter=new Ts(this)).init(),this._series=new ki(this),this._xAxes=new hs(this,!0),this._yAxes=new hs(this,!1),this._gauges=new gs(this),this._annotations=new ze(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},Un.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Gn]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new Un(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getAxisOf(t,e){return this._splitted?this._split.getAxisOf(t,e):e?this.xAxis:this.yAxis}isValidAxis(t){return t&&(!this._splitted||this._split.isValidAxis(t))}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter((t=>t.needAxes()))}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,s){return Hi.collectTooltipText(this.axis.options,this.series,t,e,s)}getTooltipParam(t,e,s){return Hi.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof ds?e:this._annotations.get(t)}get wrapper(){return this._wrapper}get type(){return this._op.type}get gaugeType(){return this._op.gaugeType}get polar(){return this._op.polar}get inverted(){return this._op.inverted}get timeOffset(){return this._op.chart.timeOffset}get startOfWeek(){return this._op.chart.startOfWeek}get seriesCount(){return this._series.count}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){var t;return null===(t=this._gauges)||void 0===t?void 0:t.firstGauge}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}canOverflowRender(){return!1}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getAnnotations(){return this._annotations}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._splitted?this._annotations.getVisibles().filter((t=>isNaN(t.row)||isNaN(t.col))):this._annotations.getVisibles()}_getButtons(){return this._buttons}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.canPolar()}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&(null==this._gauges||this._gauges.isEmpty(t))}_getXAxesAt(t,e){return this._splitted?this._xAxes._internalItems().filter((s=>s.col===t&&(!e||s.checkVisible()))):this._xAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter((s=>s.row===t&&(!e||s.checkVisible()))):this._yAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._xAxes._internalItems().filter((t=>!s||t.checkVisible()))}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._yAxes._internalItems().filter((t=>!s||t.checkVisible()))}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getBodyAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case Wn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Wn.RIGHT:r=s.filter((t=>t._isOpposite));break;case Wn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Wn.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case Wn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Wn.RIGHT:r=i.filter((t=>t._isOpposite));break;case Wn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Wn.TOP:r=s.filter((t=>t._isOpposite))}return r?e?r.filter((t=>t.checkVisible())):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in Un.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&Te(n={},r.base),i(r[s])&&(n||(n={}),Te(n,r[s])),n?Te(n,t):t}_load(t){var e,s;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(w(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(w(t.chart,t.options)),i(t.chart)?this._credits._load(t.chart.credits):i(t.options)&&this._credits._load(t.options.credits),r.title=this._title._load(t.title),r.subtitle=this._subtitle._load(t.subtitle),r.legend=this._legend._load(t.legend),r.credits=this._credits._load(t.credits),this._buttons.load(w(t.button,t.buttons)),r.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series),null===(e=this._gauges)||void 0===e||e.load(w(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(v(t.xAxis,t.xAxes,{})),this._yAxes.load(v(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(s=this._split)||void 0===s||s._load(t.split),this._annotations.load(w(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Be||s instanceof Oe||s instanceof Le)&&s.updateOptions(t[e],!1)}e&&this._modelChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;return[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t,e);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=Pi;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=_({},r))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let s=this._templates[e];if(s)return Te(Te({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?Te(Te({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&fi[t.toLowerCase()]}_getSeriesType(t){return o(t)&&mi[t.toLowerCase()]}_getAxisType(t){return o(t)&&Xe[t.toLowerCase()]}_getGaugeType(t){return o(t)&&_s[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&cs[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Fe[t.toLowerCase()]}getAxesGap(){return y(this._chartOptions.options.axisGap,0)}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}Un.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},as.register(_i,pr,In,wr),Ci.register(Hr,Xr,Sr,Pr,Zr,Kr,Jr,sn,nn,ln,cn,dn,mn,yn,Fr,Ir,vn,Vn,Pn,En,On,$n),Hi.register(Wr,kr,tn,on,Yr,Tn),Hi.registerSeries(Wr,kr,on,Yr,Tn),Ie.register(rr,nr,or);class Zn{constructor(t,e){this._modelCallback=e,this._obj=new Un(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Gn]=null===(t=this[Gn])||void 0===t?void 0:t.destroy(),this._obj=null,this.$_destroyed=!0)}get options(){return this._obj.options}get data(){return this._obj._data}get type(){return this._obj.type}get gaugeType(){return this._obj.gaugeType}get inverted(){return this._obj.inverted}get polar(){return this._obj.polar}get assets(){return this._obj._assets}get chartOptions(){return this._obj.chartOptions}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get first(){return this._obj.first}get series(){return this._obj.firstSeries}get gauge(){return this._obj.firstGauge}get legend(){return this._obj._legend}get credits(){return this._obj._credits}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return o(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart";ot.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Un(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,ot.log("chart-items:",Ne),ot.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[Gn].refresh()}}class qn{constructor(t,e){this._obj=new ct(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Kn extends ht{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){var t;null===(t=this._orphans)||void 0===t||t.clear(),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)}$_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)}getOrphans(){return this._orphans?Array.from(this._orphans.values()):null}addOrphan(t,e){this._prepareOrphans().set(t,e),this._views.splice(this._views.indexOf(e),1)}freeOrphan(t){var e;const s=null===(e=this._orphans)||void 0===e?void 0:e.get(t);s&&(this.free(s),this._orphans.delete(t))}clearOrphans(){var t,e;for(let e of(null===(t=this._orphans)||void 0===t?void 0:t.values())||[])this.free(e);null===(e=this._orphans)||void 0===e||e.clear()}_prepareOrphans(){return this._orphans||(this._orphans=new Map),this._orphans}}const Qn=Object.freeze({x:0,y:0,width:0,height:0});function Jn(t){return{width:t.width,height:t.height}}const to=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map((([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))]))},eo=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},so=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},io=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},ro=function(t,e){const s=to(t),i=to(e),r=eo(s),n=eo(i);for(const t of[...r,...n]){const e=so(s,t),r=so(i,t);if(!io(e,r))return!1}return!0},no=function(t,e){return!(t.y>=e.y+e.height||e.y>=t.y+t.height||t.x>=e.x+t.width||e.x>=t.x+t.width)};class oo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new oo(t,t,t,t):new oo(t,t,e,e):new oo(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 oo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=y(t.paddingLeft,0),this.right=y(t.paddingRight,0),this.top=y(t.paddingTop,0),this.bottom=y(t.paddingBottom,0),this}applyMargin(t){return this.left=y(t.marginLeft,0),this.right=y(t.marginRight,0),this.top=y(t.marginTop,0),this.bottom=y(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}}}oo.Empty=Object.freeze(new oo),oo.Temp=new oo;class ao extends Qt{constructor(t,e=L){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return ao.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ao.IGNORE_ATTRS={width:"",height:""};class ho extends Qt{constructor(t,e=L){super(t,e,"g"),Qt.DEBUGGING&&(this.add(this._debugRect=new Is(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),Qt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Is(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 lo extends ho{constructor(t,e,s){super(t,e),this._margins=new oo,this._paddings=new oo,this.add(this._background=new Is(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 a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}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}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class _o extends ao{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class co extends ho{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class uo extends Qt{constructor(t,e,s){super(t,s,"image"),this._bounds=Qn,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.invalidate()},window.SVGGraphicsElement&&!nt||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return i&&(I(t)||I(e))&&(t>0&&I(e)?e=t/i.width*i.height:e>0&&I(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class po extends ao{constructor(e,s=L){super(e),this.add(this._text=new de(e,s)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Is(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.options.backgroundStyle)):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new de(t),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?(this._icon||this.add(this._icon=new uo(t,!1)),this._icon.setImage(s,+e.options.iconWidth,+e.options.iconHeight)):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,this}setContrast(t){var e;const s=null===(e=this._model)||void 0===e?void 0:e.options;if(t&&(null==s?void 0:s.autoContrast)&&this._text.setContrast(t,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=Dt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(e){const s=this._text,i=this._outline,r=this._icon;let n=0;const o=s.getBBox(),a=o.width,h=o.height;let l=a,_=h,c=0,d=0,u=0,p=0;if(this._box=void 0,r){const t=r.getBBox();switch(n=y(this._model.options.iconGap,0),c=t.width,d=t.height,this._model.getIconPos()){case"left":case"right":l+=n+c,_=Math.max(d,h);break;default:_+=n+d,l=Math.max(c,a)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);u=parseFloat(t.paddingLeft)||0,p=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(t.paddingRight)||0),_+p+(parseFloat(t.paddingBottom)||0),t.rx)}if(r)switch(this._model.getIconPos()){case"left":r.trans(u,(_-d)/2),u+=c+n,l-=c+n;break;case"right":r.trans(u+l-c,(_-d)/2),l-=c+n;break;case"top":r.trans((l-c)/2,p),p+=d+n;break;case"bottom":r.trans((l-c)/2,p+h+n)}switch(e){case"center":u+=l/2,s.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,s.anchor=t.TextAnchor.END;break;default:s.anchor=t.TextAnchor.START}return s.trans(u,p),i&&(i.anchor=s.anchor,i.setAttr("y",s.getAttr("y")),i.trans(s.tx,s.ty)),this}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new de(this.doc),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(t._style)}getBBox(){return this._box?this._box:this._box=super.getBBox()}}class go extends lo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new de(t)),this._richText=new we}rotatedWidth(){const t=this.model.getRotation()*T,e=this.getBBox();return x(p(t)*e.height)+x(u(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*T,e=this.getBBox();return x(u(t)*e.height)+x(p(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation();const n=e.options,o=n.writingMode;o&&this._textView.setStyle("writingMode",o),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===o,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(this._textView,s,i,null,null);const a=Jn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(e){const s=this._textView,i=s.getStyle("writing-mode"),r=i===st||i===it;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":s.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":s.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:s.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}s.trans(o,n)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class mo extends lo{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new de(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new we}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),Jn(this._textView.getBBox())}_doLayout(e){const s=this._textView;let i=this._margins.top+this._paddings.top,r=0;switch(this.textAlign()){case"left":s.anchor=t.TextAnchor.START,r-=this.width/2;break;case"right":s.anchor=t.TextAnchor.END,r+=this.width/2}s.trans(r,i)}}class fo extends ho{constructor(t){super(t,vo.TICK_CLASS),this.add(this._lineView=new Er(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class xo extends po{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1}setLabel(t,e,s,i,r,n){if(i){const o=t.getIcon(s);t.prepareRich(i),this.setModel(this.doc,t,o&&t.getUrl(o),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)}else t.prepareRich(""),this._text.text=""}applyBackgroundCallback(t,e){const s=t.options.backgroundStyleCallback;if("background"===t.options.effect&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*T,e=this.getBBox();return x(p(t)*e.height)+x(u(t)*e.width)}rotatedHeight(){const t=this.rotation*T,e=this.getBBox();return x(u(t)*e.height)+x(p(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_&&!t._isHorz){const t=this.getBBox(),c=r/a,d=e?n-o+l:s?n:l-o;_.transX(d-this.tx),_.shiftY((c-t.height)/-2-h),e?_.resize(i-l-2*(n+o),c-1):_.resize(i-n-l+o,c-1)}}}class yo extends Qt{constructor(t){super(t,void 0),this.add(this._back=new re(t,"rct-crosshair-flag")),this.add(this._text=new de(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.options.flag;this._text.text=(s.prefix||"")+e+(s.suffix||"");const i=this._text.getBBox(),r=new Zt,n=f(s.minWidth||0,i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}}}class bo extends ho{static isThumb(t){return t.classList.contains(bo.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Is(t,bo.TRACK_CLASS)),this.add(this._thumbView=new Is(t,bo.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=f(0,e),this._page=m(s,e),this._pos=m(t.min+e-s,f(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=f(0,m(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=y(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=l,this._trackView.setBounds(h,0,_,c),c-=i;const t=(n||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||o===r?_:_*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*a/r,h+1,t,c-2)}}}bo.CLASS_NAME="rct-axis-scrollbar",bo.TRACK_CLASS="rct-axis-scrollbar-track",bo.THUMB_CLASS="rct-axis-scrollbar-thumb";const wo=/\${label}.*?/g;class vo extends ho{constructor(t){super(t,vo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new Er(t,vo.LINE_CLASS)),this.add(this._titleView=new go(t)),this.add(this._markContainer=new Qt(t,"rct-axis-ticks")),this.add(this._labelContainer=new Qt(t,"rct-axis-labels")),this.add(this._unitView=new mo(t)),this._labelViews=new Kn(this._labelContainer,xo,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new bo(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=f(0,i.tick._getLength())+f(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=f(0,i.tick._getLength())+f(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{const n=this.model.guides.filter((t=>t.options.front==(1===r)&&t.canConstainedTo(e,s)));i.setAll(t,n,!1)}))}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new yo(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?m(0,this.width-n.width):f(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this._model=t,this._chartEmpty=t.chart.isEmpty(!0)}checkExtents(t){const e=this._prevModel,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.chart.animatable()&&s.options.animatable&&s.checkExtents(t,e)}}this._prevModel=s}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView,c=this._unitView;let d=0,u=0;return this._reversed=e.options.reversed,(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Er(t,vo.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.label._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=h?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t._ticks,o=t._markPoints,a=this._labelViews,h=this._unitView,l=this._markLen,_=this._tickGap,c=this.width,d=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?d:0,0,c):this._lineView.setVLine(s?0:c,0,d),this._lineView2&&(e?this._lineView2.setHLine(d,0,c):this._lineView2.setVLine(0,0,d))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,l),e.layout().trans(t.prev(o[i]),s?r?d:d-l:r?-l:0)})):this._markViews.forEach(((e,i)=>{e.resize(l,1),e.layout().trans(s?-l:r?c:c-l,d-t.prev(o[i]))})));const u=l+_;if(this._labelContainer.visible&&a.count>0&&(a.count>n.length?a.prepare(n.length):a.count<n.length&&ot.warn("labelViews.count < ticks.length",a.count,n.length),e?this.$_layoutLabelsHorz(a,n,r,i,s,c,d,u):this.$_layoutLabelsVert(a,n,r,i,s,c,d,u)),h.visible&&(e?this.$_layoutUnitHorz(h,a,s,c,d,u):this.$_layoutUnitVert(h,a,s,c,d,u)),!this._simpleMode){const i=t.title.options,n=this._titleView,o=this._scrollView,a=this._labelSize;let h=0,l=0;if(n.visible){const o=+i.offset||0,_=+i.gap||0;if(n.resizeByMeasured().layout(e),e){if(l+=s?0:(r?0:u+a)+_,t.options.reversed)switch(i.align){case"start":h=c-n.width/2-o;break;case"end":h=n.width/2+o;break;default:h=c/2-o}else switch(i.align){case"start":h=n.width/2+o;break;case"end":h=c-n.width/2-o;break;default:h=c/2+o}n.trans(h,l),l+=n.height}else{const t=0===n._angle?n.width:n.height;if(h=s?r?_+t/2:u+a+_+t/2:r?t/2:c-u-a-_-t/2,this._reversed)if(0===n._angle)switch(i.align){case"start":l=0+o;break;case"end":l=d-n.height-o;break;default:l=(d-n.height)/2+o}else switch(i.align){case"start":l=n.width/2-n.height/2+o;break;case"end":l=d-n.width/2-n.height/2-o;break;default:l=(d-n.height)/2+o}else if(0===n._angle)switch(i.align){case"start":l=d-n.height-o;break;case"end":l=0+o;break;default:l=(d-n.height)/2-o}else switch(i.align){case"start":l=d-n.width/2-n.height/2-o;break;case"end":l=n.width/2-n.height/2+o;break;default:l=(d-n.height)/2-o}n.trans(h,l)}}else l+=s?0:u+a;(null==o?void 0:o.visible)&&(e?(o.trans(0,l).resize(this.width,o.mh),o.setScroll(t._zoom,this._reversed)):(o.trans(0,0).resize(o.mw,this.height),o.setScroll(t._zoom,this._reversed)),o.layout())}}$_prepareTickMarks(t,e){const s=this._markContainer;if(s.visible=e.tick.visible){const i=e._markPoints.length,r=this._markViews;for(;r.length<i;){const e=new fo(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),o=e.label,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(wo)?t.setLabel(s,a,e,n.replace(wo,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_prepareLabels(t,e){if(this._labelContainer.setVis(!this._chartEmpty&&t.labelsVisible())){let e=t._ticks.length;return this._labelContainer.setStyleOrClass(t.label._style),e}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz2(t,e,s,i,r,n,o,a){const h=t.label,l=f(0,m(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,d=(i=f(1,i))*(r=m(f(1,r),_.length)),p=n||0,g=x(p)*T,y=g<35*T;let b,w=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=d){let i=0;for(let e=r;e<r+d&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+d<c){b=e.pull(v++),b.rotation=p,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===p&&b.getBBox().width>=t){w=!0;break}if(y&&b.getBBox().width*u(g)>=t){w=!0;break}if(0!==p&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-d;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=p,b.index=t,this._prepareLabel(b,_[t],h,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=f(0,m(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.options.reversed,r=t.label,n=r.options;let o,a=+n.step|0,h=+n.rows|0,l=+n.rotation%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s),c=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=l,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),c=this.$_applyStep(t,c,a||1);else{switch(a=h=0,r.options.autoArrange){case"rows":h=this.$_getRows(c);break;case"step":a=this.$_getStep(c)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(h>1){for(;t._ticks.length>h&&(c.forEach(((t,e)=>{t.row=e%h,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,h,0,!1,s));)h++;this._labelRowPts=[]}else if((isNaN(l)||Math.abs(Math.tan(l*T))<1)&&(l=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,0,!0,s)&&c.forEach(((t,e)=>{t.rotation=l}));break}a++}}else;if(c.length>0){if(h>1){const t=!isNaN(l)&&0!=l,e=this._labelRowPts;for(let t=0;t<h;t++)e.push(0);c.forEach((s=>{e[s.row]=f(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(l)||0==l){o=c[0].getBBox().height;for(let t=1;t<c.length;t++)o=f(o,c[t].getBBox().height);if(c.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=c[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<c.length;t++)r=f(r,c[t].getBBox().height);(i+s>c[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(o=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=c[c.length-1],s=t.rotatedWidth(),i=c[c.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,a=0;for(let t=0;t<c.length-1;t++)a=f(a,c[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>a?(o=a,t.hidden=!0):t.hidden=!1}}}else{o=c[0].rotatedHeight();for(let t=1;t<c.length;t++)o=f(o,c[t].rotatedHeight())}return o}return 0}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=f(1,i);let l,_=n.options.startStep||0,c=0;for(;_<a;_+=h){let i=0;for(let e=_;e<_+h&&e<a;e++)i+=t.getLabelLength(s,o[e].value);if(_+h<a&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,o[_],n,a,r),l.setVis(!0),l._text.getBBox().height>=i))return!0}const d=_-h;0<=d&&d<a&&(l=e.pull(c++),l.rotation=0,l.index=d,this._prepareLabel(l,o[d],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof ur)return this._prevWidth;const r=t.label;let n=f(1,+r.options.step|0);const o=this.$_checkOverlappedVert2(t,this._labelViews,e,n,s);let a=this._labelViews._internalItems();if(o)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,n||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++n,s););else;if(this._labelViews.freeHiddens(),a=this._labelViews._internalItems(),a.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;a[0].setContrast(null).layout(s),i=a[0].getBBox().width;for(let t=1;t<a.length;t++)a[t].setContrast(null).layout(s),i=f(i,a[t].getBBox().width);return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h.label,_=this._reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,u=t.get(0).rotation,g=u*T,m=+h.label.options.rows|0,f=u<-15&&u>=-90||u>15&&u<=90,x=t.count,b=y(h._prevRate,1);let w,v,S;if(t.freeHiddens(),t.forEach(((t,i)=>{const l=e[t.index];t.setVis(!!l)&&(t.setContrast(null).layout(c),w=t.getBBox(),v=h.prev(l.pos)+(_?n*(1-b):0),S=s?r?o+a+d[t.row]:-a-w.height-d[t.row]:r?o-a-w.height-d[t.row]:a+d[t.row],u<-15&&u>=-90?s?r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):r?(v-=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):u>15&&u<=90?s?r?(v+=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):(v-=w.width/2,t.setRotation(w.width/2,0,r?-u:u)),t.trans(v,S))})),!f&&m<2&&x>1){let e=t.get(_?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=_?i.lastOverflow:i.firstOverflow;let h,c=e.tx;c+o>=s.tx?"pull"===a?c=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?c=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(c):e.setVis(!1)}(0,e,t.get(_?x-2:1)),e=t.get(_?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const c=e.rotatedWidth(),d=_?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-c):a="hidden"!==d:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===d?h=Math.max(o+r,h-(u-p+4)):a="hidden"!==d),a?e.transX(h):e.setVis(!1)}(this,e,t.get(_?1:x-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof _i&&l.label.options.fillToCategory,c=r?s?"right":"left":i?"center":s?"left":"right",d=_?l.label.options.verticalAlign:"middle",u=_?l.label.options.align:c,p=this._titleView,g=p.visible?p.rotatedWidth()+(null===(h=p.model)||void 0===h?void 0:h.options.gap):0,m=this._labelSize,f=l.tick._getGap();const x=this._reversed,b=x?y(l._prevRate,1):1;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;t.forEach(((t,h)=>{const c=e[t.index];if(t.setVis(!!c)){const e=t.getBBox(),h=function(t,e){if(s)if(r)switch(t){case"center":return(m-e)/2-m-f-a;case"left":return-m-f-a;default:return-e-f-a}else switch(t){case"right":return n+a+f+m-e;case"center":return!p.visible&&i?(n-e)/2:n+a+f+(m-e)/2;default:return n+a+f}else if(r)switch(t){case"center":return a+(n-g-e-a+f)/2;case"right":return n-e-g+f;default:return a}else switch(t){case"left":return g-f;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-f)/2;default:return n-a-e}}(u,e.width),y=o*b-l.prev(c.pos)-e.height/2;if(t.trans(h,y),_){const s=l._weights.reduce(((t,e)=>t+e))/l._weights[t.index],h=o/s,_="top"===d?(h-e.height)/-2:"bottom"===d?(h-e.height)/2:0;t.shiftY(_),t.resizeBackByWeight(l,i,r,n,o,a,f,s,_,g)}else!x&&t.ty+e.height>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+e.height:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?h?(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):h?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,i-l.width)):(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)),t.layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=s?n:i-l.width-n;a?h?(c.getBBox(),u=Math.max(c.ty+l.height+d,r)):u=Math.min(_.ty-l.height-d,0):h?u=Math.min(c.ty-l.height-d,0):(_.getBBox(),u=Math.max(_.ty+l.height+d,r)),t.layout().trans(p,u)}}vo.AXIS_CLASS="rct-axis",vo.LINE_CLASS="rct-axis-line",vo.TICK_CLASS="rct-axis-tick";class So extends Qt{constructor(t,e,s){super(t,So.STYLE),this.add(this._back=new Is(t,So.BACK_STYLE)),this.add(this._textView=new de(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new oo).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom,rx:y(parseFloat(e.rx),0),ry:y(parseFloat(e.ry),0)},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}So.STYLE="rct-button",So.BACK_STYLE="rct-button-background";class Vo extends Qt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Ao extends re{setArc(t,e,s,i,r,n){this.setPath(Fs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Po extends Ao{setPolyline(t){this.setPath(Fs.polygon(...t))}}class Co extends re{constructor(t,e,s){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return Fs.sector(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.innerRadius||0,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}$_renderArc(){return Fs.arc(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}}const ko={};class Lo extends lo{static register(...t){t.forEach((t=>{ko[t[0].type]=t[1]}))}constructor(t,e){super(t,Lo.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new Qt(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}resetClip(t,e,s){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Lo.CLASS_NAME="rct-annotation";const No={};class Mo extends co{static register(...t){t.forEach((t=>{No[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Is(t,Mo.PANE_CLASS)),this.add(this._contentContainer=new te(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Mo.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=_(Rt.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Bo)return t;t=t.parent}}}Mo.GAUGE_CLASS="rct-gauge",Mo.PANE_CLASS="rct-gauge-pane";class Eo extends Xt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class To extends po{}class Bo extends Mo{_defaultCalss(){return Bo.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new te(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}Bo.GAUGE_GROUP_CLASS="rct-gauge-group";class Oo{static reveal(t,e){new $o(t,e)}static grow(t,e){new Io(t,e)}static spread(t,e){new zo(t,e)}static fadeIn(t){new Do(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);ot.isAnimation(s)&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Do extends Oo{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:Xt.DURATION,fill:"none"})}}class Ro extends Oo{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=Ro.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Xt.DURATION,fill:"none"}}$_left(t,e){return t.dom.firstElementChild.animate([{width:0},{width:""}],this.$_aniOptions(e))}$_right(t,e){return t.dom.firstElementChild.animate([{x:t.width},{x:""}],this.$_aniOptions(e))}$_top(t,e){return t.dom.firstElementChild.animate([{height:0},{height:""}],this.$_aniOptions(e))}$_bottom(t,e){return t.dom.firstElementChild.animate([{y:t.height},{y:""}],this.$_aniOptions(e))}}class $o extends Xt{constructor(t,e){super(),this._series=t,this._cr=Ro.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof Qt}_stop(t){super._stop(t),this._series=null}_doUpdate(t){const e=this._cr.dom.firstElementChild;switch(this._from){case"top":e.setAttribute("height",this._cr.height*t);break;case"bottom":e.setAttribute("y",this._cr.height*(1-t));break;case"right":e.setAttribute("x",this._cr.width*(1-t));break;default:e.setAttribute("width",this._cr.width*t)}return!0}}class Fo extends Xt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Qt}_stop(t){super._stop(t),this._series=null}}class Io extends Fo{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class zo extends Fo{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Ho extends po{constructor(t){super(t,"rct-series-trendline-label")}}class Go extends te{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new re(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new re(t,"rct-series-trendline-variable")),this.add(this._line=new re(t)),this.add(this._label=new Ho(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,h=this.$_getPoints(e,s);this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new re(t,"rct-series-trendline-marker")),this.add(this._endMarker=new re(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,null,e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map((t=>{const s=e.start+r.getPos(a,t.x),i=n.getPos(e.rd,t.y);return{x:e.cx+i*u(s),y:e.cy+i*p(s),a:s}})):t._points.map((t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}})),h}$_getLine(t,e){const s=new Zt;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new Zt,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new Zt,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=Fs.getDrawer(t.marker.options.shape);this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,_=this._label;if(!String(h.options.text))return void _.setVis(!1);h.prepareRich(h.options.text),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const c=h.options.position,d=t?function(t){const e=Math.floor((n.length-1)*t),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(c):0,u=t?h.getAlignPolar(d):h.getAlign(s,i,r,c),p=t?h.getVerticalAlignPolar(d):h.getVerticalAlign(s,i,r),g=h.getOffsetX(u)+("middle"===p?l:0),m=h.getOffsetY(p)+("center"===u?l:0),f=Math.floor((n.length-1)*c),x=(n.length-1)*c-f;let y,b;if(f>=n.length-1)y=n[n.length-1].x,b=n[n.length-1].y;else{const t=n[f],e=n[f+1];y=t.x+(e.x-t.x)*x,b=t.y+(e.y-t.y)*x}const w=_.getBBox();switch(u){case"left":y-=w.width+g;break;case"center":y-=w.width/2+g;break;case"right":y+=g}switch(p){case"top":b-=w.height+m;break;case"middle":b-=w.height/2+m;break;case"bottom":b+=m}t||(y<0&&(y=0),b<0&&(b=0),y+w.width>o&&(y=o-w.width),b+w.height>a&&(b=a-w.height)),_.trans(y,b)}}class jo extends Xt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Jo.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(Jo.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Xo extends po{constructor(t){super(t,"rct-point-label")}}class Yo extends te{constructor(t){super(t,"rct-point-labels"),this._labels=[new Kn(this,Xo),new Kn(this,Xo)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach((t=>e=f(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,i.icon?n.getUrl(i.icon):null,r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.stopAni().setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}})),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(no(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Us)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ro(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ro(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ro(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ro(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort(((t,e)=>t.ty-e.ty));const h=t.getBBox(),l=h.y+h.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<_&&(_=i,c=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<c;t++){const e=u(t,t+1);if(e>0){d(t,-e);for(let e=t;e>0;e--){const t=u(e-1,e);t>0&&d(e-1,-t)}}}for(let t=a-1;t>=c&&t>0;t--){const e=u(t-1,t);if(e>0){d(t,e);for(let e=t;e<a-1;e++){const t=u(e,e+1);t>0&&d(e+1,t)}}}const p=this.control.chartView().bodyView().height;if(r){const t=(t,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[c];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<c?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&s(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),h=0;for(let t=c;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=c;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===Zs&&e.forEach(((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))})),1}}class Wo extends ao{constructor(t){super(t),this.add(this._line=new re(t))}setLine(t){this._line.setPath(t)}}class Uo extends ao{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Kn(this,Wo)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach(((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class Zo extends te{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t===this.inverted&&e===this._hSave||((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform",""),this._hSave=e),this.inverted}}const qo={},Ko="rct-point-hover",Qo="rct-point-unhover";class Jo extends co{static register(...t){t.forEach((t=>{qo[t[0].type]=t[1]}))}static isPointDom(t){for(;Rt.isSVGElement(t);){if(t.classList.contains(this.POINT_CLASS))return!0;t=t.parentElement}}constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointContainer=new Zo(t,"rct-series-points")),this._labelContainer=new Yo(t)}depthEnabled(){return!1}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointLabelVisible(t){return t.visible&&!t.isNull&&!t.isEmpty()&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&(this._clearHoverClasses(e),!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e))}_doPointClicked(t){}_getPointColors(){return"a"}_setDepth(t){this._depthExt=t}setCircular(t){}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===et,this.setData("index",e._seriesIndex%Pi),this.setData("pointcolors",this._colorByPoint?this._getPointColors():L),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=r[this._legendColorProp()],e._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:"",this._visPoints=this._collectVisPoints(e),this._yReversed=e._yAxisObj.options.reversed,this._prepareSeries(t,e,s,i)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach((t=>{t!==e&&t.removeClass(Ko).addClass(Qo)}))):this._getPointPool().forEach((t=>{t.containsClass(Qo)&&t.removeClass(Qo).addClass(Ko)}))}_clearHoverClasses(t){t instanceof Qt&&t.removeClass(Ko).removeClass(Qo)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(i.forEach((e=>{if(e instanceof Qt&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.cancel(),e.setBoolData(Jo.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof _a&&r.push(new jo(this,e,!1,(()=>{e.endHover(this,!1)})))}})),t&&t.forEach((t=>{if(t&&!t.point.isNull){const e=s.find((e=>e._marker===t));e&&e.cancel(),t instanceof Qt&&(t.setBoolData(Jo.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof _a?r.push(new jo(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof ua&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}}))),s&&s.forEach(((t,e)=>{t._started&&r.push(t)})),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/s*(i||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&jt(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Li&&e.trendline.visible?(this._trendView||this.add(this._trendView=new Go(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.options.overlapOutline,contrast:i.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.options.autoHide||!this.$_labelAnimating()))&&this.$_renderTrendline(r,this._inverted,t,e),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Pi):e.index%Pi;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return y(this._growRate,1)}_getPosRate(){return y(this._posRate,1)}$_labelAnimating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||this._animations.length>0}_animating(){return this.$_labelAnimating()||!isNaN(this._prevRate)}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(t,e,s,i){const r=this.model;r instanceof Li&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=h.getBBox();let d=!0;r?(n-=e.distY,o+=e.distX,o-=c.height/2-c.height*t._vertAdjust):(n-=e.distX,o+=e.distY,n-=c.width/2);const u=n,p=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,_?n+=l:n-=c.width+l):(n-=e.base,o+=e.side,_?o-=c.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+l:a-l):(n-=e.base,o+=e.side,o+=_?a+l:a-c.height-l);break;case"far":r?n=_?l:s-c.width-l:_?(n-=e.base,o=i-c.height-l):o=l,d=!1;break;default:r?_?n-=c.width+l:n+=l:_?(n-=e.base,o+=e.side,o+=l):o-=c.height+l,d=!1}this._checkLabelOverlap(h,c,u,p,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const h=_.fit;if(isFinite(h)&&(_.inverted?o+e.width>=_.width?c=(o=_.width+h-e.width)<s+r:o<=0&&(c=(o=-h)+e.width>s-r):a+e.height>=_.height?c=(a=_.height+h-e.height)<i+n:a<=0&&(c=(a=-h)+e.height>i-n)),c){if(!isFinite(h))return t.setVis(!1),!1;_.outline&&t.setOutline(_.model)}}return t.setContrast((h||c&&_.contrast)&&l),t.trans(o,a),!0}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.options.reversed,l=a.getPos(o?t:e,f(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,m(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,x(_-l),e):r.setBounds(l,-e,x(_-l),e):r.setBounds(0,-f(l,_),t,x(_-l)):o?h?r.setBounds(_,0,x(_-l),e):r.setBounds(l,0,x(_-l),e):r.setBounds(0,e-f(l,_),t,x(_-l))}_setFill(t,e){i(e)&&e[W]?t.internalSetStyle(W,e[W]):o(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=y(e.fit,0),l=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,s);if(!_&&c!==js)if(l?c!==Gs&&c!==Hs||(d*=-1):c===Hs&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}Jo.POINT_CLASS="rct-point",Jo.DATA_FOCUS="focus",Jo.DATA_UNFOCUS="unfocus",Jo.DATA_UNHOVER="unhover",Jo.LEGEND_MARKER="rct-legend-item-marker";class ta extends re{constructor(t){super(t,Jo.POINT_CLASS)}savePrevs(){}}class ea extends ta{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class sa extends Qt{constructor(t){super(t,Jo.POINT_CLASS)}savePrevs(){}}class ia extends sa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let ra=class extends ea{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(Fs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}shrink(t,e,s,i){const r=this.point;if(!r.isNull){const n=r._vr,o=r._getDrop()*(t?-1:1);if(isNaN(o))this.hPoint*=1-n||1,this.layout(this.x,this.y,s,i,0,0,!1);else{let t=r._getSave();isNaN(t)&&r._setSave(t=this.x);const a=o<0?t*(1-n)-this.wPoint/2*n:e-(e-t)*(1-n)+this.wPoint/2*n;this.layout(a,this.y,s,i,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class na extends ia{constructor(t){super(t),this.add(this._topView=new re(t)),this.add(this._frontView=new re(t)),this.add(this._sideView=new re(t))}layout(t,e,s,i,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const _=h<0?e:e-h;if(nt&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Fs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Fs.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Dt.interpolate(o?Dt.BLACK:Dt.WHITE,l,.2)),this._sideView.setPath(Fs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Dt.interpolate(o?Dt.WHITE:Dt.BLACK,l,.2))}}class oa extends ao{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class aa extends Jo{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Oo.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class ha extends aa{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Uo(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*T,this._base=u(this._depthAngle)*e.depth,this._side=p(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),this._pointOff=e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var s;const i=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=i.pointLabel,h=this._labelViews(),l=this._labelLineContainer,c=i._xAxisObj,d=i._yAxisObj,g=this._yReversed,m=this._depthExt,x=i._group?i._groupDistance:i.distance,b=m?x*(r?p(this._depthAngle):u(this._depthAngle)):0,w=m?x*(r?u(this._depthAngle):p(this._depthAngle)):0,v=2*c.unitPad(),S=y(i.options.minPointWidth,0),V=this._yLen=r?t:e,A=r?e:t,P=t=>d.getPos(V,t),C=t=>c.getPos(A,t),k=r?0:e,L=d.valueMin(),N=P(L),M=this._baseVal=i.getBaseValue(d),E=!isNaN(M),T=this._yBase=y(P(f(L,y(M,N))),N),B=this._pointOff,O=h&&_(this._labelInfo,{inverted:r,reversed:g,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:w,side:this._side,base:this._base});h&&l.setVis(i.pointLabel.line.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(i.pointLabel.line._style),l.prepare(i),O.pb=new Zt),this._prepareLayoutPoints(t,e),null===(s=this._getPointPool().getOrphans())||void 0===s||s.forEach((t=>{this._shrinkPoint(t)})),this._getPointPool().forEach(((s,l)=>{const _=s.point;if(s.setVis(!_.isNull)){const d=c.getUnitLen(A,_.xValue)*(1-v);let u=i.getPointWidth(d,S),p=P(_.yGroup),g=T;if(_.yGroup!=_.yValue){const t=M>_.yGroup,e=_.yGroup<0,s=_.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=_.yGroup-_.yValue*(i?-1:1);g=P(r)}const m=(p-g)*n;let f=C(_.xValue)-d/2,x=k-p;isNaN(o+s.wSave)||(u=s.wSave+(u-s.wSave)*o),f+=i.getPointPos(d)+u/2,isNaN(o+s.xSave)||(f=s.xSave+(f-s.xSave)*o),_.xPos=f+=u*B,_.yPos=x,this._layoutPoint(s,l,f-b,k-T*(1-n)-g*n+w,u,m),r&&(x=A-C(_.xValue)+d/2,f=k,_.yPos=x-=i.getPointPos(d)+u/2+u*B,_.xPos=f+=E?P(_.yGroup)*n:P(_.yGroup*n)),O&&(O.labelView=h.get(_,0))&&(O.pointView=s,O.x=f,O.y=x,O.wPoint=u,O.hPoint=m,this._layoutLabel(a,O,t,e))}}))}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class la extends aa{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._pointOff=+e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=2*h.unitPad(),d=y(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,m=this._pointOff,f=a&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach(((_,x)=>{const y=_.point;if(_.setVis(!y.isNull)){const b=h.getUnitLen(p,y.xValue)*(1-c);let w=s.getPointWidth(b,d);const v=(l.getPos(u,this._getHighValue(y))-l.getPos(u,this._getLowValue(y)))*r;let S=h.getPos(p,y.xValue)-b/2,V=g-l.getPos(u,this._getHighValue(y))*r;isNaN(n+_.wSave)||(w=_.wSave+(w-_.wSave)*n),S+=s.getPointPos(b)+w/2,isNaN(n+_.xSave)||(S=_.xSave+(S-_.xSave)*n),y.xPos=S+=w*m,y.yPos=V,this._layoutPoint(_,x,S,V,w,v),i&&(V=p-h.getPos(p,y.xValue)+b/2,S=g,y.yPos=V-=s.getPointPos(b)+w/2+w*m,y.xPos=S+=l.getPos(u,this._getHighValue(y))*r),a&&(f.pointView=_,f.hPoint=v,f.x=S,f.y=V,(f.labelView=a.get(y,0))&&(f.hPoint=v,this._layoutLabel(o,f,t,e)),(f.labelView=a.get(y,1))&&(i?f.x-=v:f.y+=v,f.hPoint=-v,this._layoutLabel(o,f,t,e)))}}))}}class _a extends ta{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class ca extends Jo{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.options.position;let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==js){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class da extends Xt{constructor(t,e){super(),this.series=t,this.duration=e}_doUpdate(t){const e=this.series;return!!e&&(e._zombieRate=e._zombie.visible?t:1-t,e._refreshZombie(),!0)}_doStop(){const t=this.series;t&&(t._zombie=null,t._zombieAni=null,t.invalidate(),this.series=null)}}class ua extends Jo{togglePointVisible(t){var e;t.yValue<0||(this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(250))}needFronting(){return!0}clipInvertable(){return!1}isPointLabelVisible(t){return t===this._zombie||super.isPointLabelVisible(t)}_collectVisPoints(t){let e=super._collectVisPoints(t);return this._willZombie&&!this._willZombie.visible&&(e.push(this._willZombie),e=e.sort(((t,e)=>t.index-e.index))),e}_prepareSeries(t,e){var s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new da(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Is.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s.legendMarker()||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class pa extends Lo{constructor(t){super(t,pa.CLASS_NAME),this.addToTransform(this._imageView=new uo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.options.imageUrl);const o=this._imageView.getBBox();return this._inflaePaddings(o),Jn(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_setImage(t){this._imageView.setImage(t,this._size.width,this._size.height)}}pa.CLASS_NAME="rct-image-annotation";class ga extends Lo{constructor(t){super(t,ga.CLASS_NAME),this.addToTransform(this._shapeView=new re(t))}_doMeasure(t,e,s,i,r){var n,o,a,h;const l=e.getSize(s,i),_=null===(n=e.chart.xAxis)||void 0===n?void 0:n.getPos(s,e.options.x1),c=null===(o=e.chart.xAxis)||void 0===o?void 0:o.getPos(s,e.options.x2),d=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),u=null===(h=e.chart.yAxis)||void 0===h?void 0:h.getPos(i,e.options.y2);let p=0,g=0;switch(e.getShape()){case sr:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Fs.line(g,p,g+l.width,p));break;case er:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Fs.line(g,p,g,p+l.height));break;case ir:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:d<u?l.height:0);const t=_>c?g-l.width:g+l.width,s=d<u?p-l.height:p+l.height;this._shapeView.setPath(Fs.line(g,p,t,s));break;default:Fs.setShape(this._shapeView,e.getShape(),l.width/2,l.height/2)}return this._deflatePaddings(l),l}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}ga.CLASS_NAME="rct-shape-annotation";class ma extends Lo{constructor(e){super(e,ma.CLASS_NAME),this.addToTransform(this._textView=new de(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new we}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i),a=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(o),this._richText._isVertical="vertical"===n.writingMode,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(a,s,i,null,e._domain);const h=Jn(this._textView.getBBox());return{width:y(o.width,h.width),height:y(o.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}ma.CLASS_NAME="rct-text-annotation";class fa extends Kn{freeOrphans(){const t=this.getOrphans();return t&&t.forEach((t=>{t.point._vr>=1&&this.freeOrphan(t.point)})),this}addOrphanedPoints(t,e=!0){if(e&&this.freeOrphans(),Array.isArray(t)){const e=this._prepareOrphans();t.forEach((t=>{let s=e.get(t);s||(s=this.find((e=>e.point===t)),s&&this.addOrphan(t,s))}))}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class xa extends _a{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;Fs.setShape(this,this._shape,this._radius*t,this._radius*t),this.setStyle("opacity",String(.8*t))}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),Fs.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:Math.sqrt((i-e)**2+(r-s)**2)-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class ya extends Zo{}class ba extends Jo{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new ya(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new re(t,"rct-line-series-line")),this._markers=new fa(this._pointContainer,xa),this.add(this._tester=new re(t)),this._tester.setFill("#ff000010")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e,s){e instanceof Fr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._based&&e.options.belowStyle,this._prepareBelow(e.chart.isPolar())),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.buildLines(this._visPoints)}_doAfterLayout(){this._layoutLines(this._polar)}_runShowEffect(t){this._polar?t&&Oo.grow(this):t&&Oo.reveal(this,{from:function(t){const e=t.model._xAxisObj.options.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._prepareBelow(!!this._polar),this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines(this._polar)}getPointsAt(t,e){return[]}getNearest(t,e){const s=this.model.marker.options.radius,i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce(((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n));return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,s){return t<=this.model.marker.options.radius+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new re(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Kn(this._lineContainer,re)),i.prepare(e.length);s.length<e.length;){const t=new ie(this.doc);this.control.addClip(t),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:i,rd:r,min:o,max:a,cyclic:h}=this._polar,l=D(f(0,m((M-x(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(Fs.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Fs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Fs.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Fs.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():Fs.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(Fs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Fs.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():Fs.sector(t,i,s*_,s*_,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){var s;const i=t instanceof Fr&&this._needBelow,r=i?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(s=this._markers)||void 0===s||s.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const s=this._markersPerPoint(),o=i&&t.options.belowStyle,a=e.length;this._markers.prepare(a*s,((s,h)=>{const l=e[h%a];l.isNull||(s.point=l,n[1]=i&&l.yValue<r?o:null,this._setPointStyle(s,t,l,n)),s.point=l,s.index=h<a?0:1}))}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),Fs.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,d=r.options.maxVisible,g=r.options.minVisible,m=i.pointLabel,f=m.options.align,x=m.getAlignOffset(),y=m.getOffset(),b=m.getPosition(),w=this._labelContainer._textAlign,v=this._labelViews(),S=i._xAxisObj,V=i._yAxisObj,A=this._polar=i.chart._body.getPolar(S),P=!!A,{cx:C,cy:k,rd:L,start:N,total:M}=A||{},E=o?e:s,T=A?M:o?s:e,B=o?0:s,O=t.length,D=V.axisMax(),R=this._yReversed,$=V instanceof pr?i.getBaseValue(V):NaN,F=$>V.axisMin(),I=V.getPos(L,$);this._pointContainer.visible&&this._shrinkPoints(i),t.forEach(((t,r)=>{let m,z,H,G;A?(H=N+S.getPos(T,t.xValue),G=R?isNaN(t.yGroup)?F?I:L:F?I+(V.getPos(L,t.yGroup)-I)*h:L-V.getPos(L,D-t.yGroup)*h:isNaN(t.yGroup)?F?I:0:F?I+(V.getPos(L,t.yGroup)-I)*h:V.getPos(L,t.yGroup)*h,m=t.px=C+G*u(H),z=t.py=k+G*p(H),t.angle=H):(m=t.px=S.getPos(T,t.xValue),z=t.py=B-V.getPos(E,t.yGroup),o&&(m=V.getPos(E,t.yGroup),z=s-S.getPos(T,t.xValue))),t.xPos=m,t.yPos=z;const j=m,X=z,Y=this._markers.get(r),W=v&&v.get(t,0);if(Y&&Y.setVis(!t.isNull&&(P||!a||m>=0&&m<=e&&z>=0&&z<=s))){this._prepareMakrer(Y),this._layoutMarker(Y,n,m,z),i._maxY,t.yGroup,i._minY,t.yGroup;const e=0==r&&null!=_?_:r==O-1&&null!=c?c:i._maxY==t.yGroup&&null!=d?d:i._minY==t.yGroup&&null!=g?g:l;if(Y.setStyle("opacity",e?"1":"0"),W){W.setContrast(null).layout(w);const e=W.getBBox(),s=Y._radius;if(W.visible=!0,A){switch(b){case"inside":R?t.yValue<$?G-=y:G+=y:t.yValue<$?G+=y:G-=y;break;case"foot":R?t.yValue<$?G-=e.height/2+y:G+=e.height/2+y:t.yValue<$?G+=e.height/2+y:G-=e.height/2+y;break;default:R?t.yValue<$?G+=e.height/2+y:G-=e.height/2+y:t.yValue<$?G-=e.height/2+y:G+=e.height/2+y}m=C+G*u(H),z=k+G*p(H)-e.height/2,this.applyAutoRotation(W,H,M,S.options.totalAngle)}else switch(b){case"inside":z-=e.height/2+y;break;case"foot":z+=y+(l?s:0);break;default:z-=e.height+y+(l?s:0)}switch(f){case"left":m-=e.width+(l?s:0)+x;break;case"right":m+=(l?s:0)+x;break;default:m-=e.width/2+x}this._checkLabelOverlap(W,e,j,X,s,s,m,z,!1,null),this._layoutLabelRotation(W,e,m,z)}}else W&&W.setVis(!1)}))}_shrinkPoints(t){var e;null===(e=this._getPointPool().getOrphans())||void 0===e||e.forEach((t=>{t.visible&&t.shrink()}))}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof Fr&&this._needBelow;let o=this._buildLines(t,e._lines);if(e._runRanges)this._rangeLines.forEach(((t,n)=>{const a=e._runRanges[n];t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",a.color),t.internalSetStyleOrClass(a.style),Rt.setImportantStyle(t.dom.style,W,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Rt.setImportantStyle(t.dom.style,W,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);t?this.$_resetClips(s,i/2,h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,h.getPos(s,l),!0):this.$_resetClips(s,i,i-h.getPos(i,l),!1),a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.options.belowStyle),Rt.setImportantStyle(a.dom.style,W,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Fr&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.options.stepDir):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new Zt;return"spline"===i?this._drawCurves(t,e,r):s instanceof Fr&&"step"===i?this._drawSteps(e,r,s.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof Fr&&this._model.options.connectNullPoints;s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this.$_drawLine(t,!1,e)))}_drawStep(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep(t,!1,e,s)))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rd:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof pr?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],d=c.length;let g,m;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(g=i+_*u(c[0].angle),m=r+_*p(c[0].angle),s.move(g,m),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),g=i+_*u(c[d-1].angle),m=r+_*p(c[d-1].angle),s.line(g,m))}else e.forEach((t=>this._drawCurve(t,!1,s)))}_buildAreas(t,e,s){const i=new Zt;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class wa extends ba{constructor(t){super(t,wa.CLASS),this._flagView=new po(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.options.icon?s.getUrl(s.options.icon):null,null),i.setContrast(null).layout("left");const o=s.options.offset,a=i.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?l>this._markers.get(this._markers.count-2).y?"bottom":"top":h>this._markers.get(this._markers.count-2).x?"right":"left";const c={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[_],{width:d,height:u}=a,p=d/2,g=u/2,{width:m,height:f}=r,x=m/2,y=f/2,b=l>u+o,w=f>l+u+o,v=h>d+o,S=m>h+d+o,V={top:b,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const A=h>p&&m-h>p?h-p:h>x?m-d:0,P=l>g&&f>l+g?l-g:l>y?f-u:0;switch(_){case"top":h=A,l=b?l-u-o:0;break;case"bottom":h=A,l=w?l+o:f-u;break;case"left":h=v?h-d-o:0,l=P;break;case"right":h=S?h+o:m-d,l=P}i.trans(h,l)}}}wa.CLASS="rct-line-series";class va extends ba{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ya(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new re(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new re(t,"rct-areanrange-series-line")),Rt.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find((e=>e!==t&&e.point===t.point))]}getSibling(t){return t&&this._markers.find((e=>e!==t&&e.point===t.point))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,_=a?e:s,c=a?0:s,d=this._labelViews(),g=this._labelContainer._textAlign,m=this._polar=i.chart._body.getPolar(h),f=i.pointLabel,x=f.options.position,y=f.options.align,b=f.getAlignOffset(),w=f.getOffset();this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-l.getPos(_,s.lowValue)}const v=this._markers;for(let i=0,c=t.length;i<c;i++){const f=t[i],S=v.get(c+i),V=d&&d.get(f,1);let A,P,C;this._prepareMakrer(S),a?(A=f.px2=l.getPos(_,f.lowValue),P=f.py2=v.get(i).ty+S._radius):(A=f.px2=f.xPos,P=f.py2=f.yLow);const k=A,L=P;if(S&&S.setVis(!f.isNull&&A>=0&&A<=e&&P>=0&&P<=s)){if(this._layoutMarker(S,n,A,P),S.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=S._radius;if(m){switch(x){case"inside":P-=w;break;case"foot":P-=t.height/2+w;break;default:P+=t.height+w}A=m.cx+P*u(C),P=m.cy+P*p(C)-t.height/2,this.applyAutoRotation(V,C,m.total,h.options.totalAngle)}else switch(x){case"inside":P-=t.height/2+w;break;case"foot":P+=w+(o?e:0);break;default:P-=t.height+w+(o?e:0)}switch(y){case"left":A-=t.width+(o?e:0)+b;break;case"right":A+=(o?e:0)+b;break;default:A-=t.width/2+b}this._checkLabelOverlap(V,t,k,L,e,e,A,P,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.options.areaStyle&&e.internalSetStyleOrClass(s.options.areaStyle)}}class Sa extends ba{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new ya(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new re(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){const e=this._area;let s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new re(this.doc,"rct-area-series-area")),t?this._yReversed?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new Kn(this._areaContainer,re,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<m(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new ie(s)));for(;i.length<e.length;)i.push(this.control.addClip(new ie(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,o=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.isNull?s.yLow=NaN:s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model,s=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,r=this.height,n=e.chart.isInverted(),o=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const o=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(o.color),this._setFill(t,o.style),o.areaStyle&&t.internalSetStyleOrClass(o.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,o,this._rangeAreaClips[s],n)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(W,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(W,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof pr?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:d,cyclic:g}=l,x=new Zt,b=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(d,h):0,y=i.chart._body.options.circular;let w,v,S,V,A=!1,P=!1;if("spline"===i.options.lineType)this._drawCurves(this._polar,i.buildLines(s),x);else{g?x.move(s[0].xPos,s[0].yPos):(w=_+l*u(s[0].angle),v=c+l*p(s[0].angle),x.move(w,v),x.line(s[0].xPos,s[0].yPos));for(let t=1;t<b;t++)x.line(s[t].xPos,s[t].yPos);g||(w=_+l*u(s[b-1].angle),v=c+l*p(s[b-1].angle),x.line(w,v))}const C=s.map((t=>t.angle)),k=this._polar.min=m(...C),L=this._polar.max=f(...C),N=(new Zt).push(x.end());if(r)g?x.circle(_,c,l):a&&x.push(...Fs.arc(_,c,l,l,k,L,!0)),S=x.end(),A=!0,g?N.circle(_,c,l):N.push(...Fs.arc(_,c,l,l,k,L,!0)),V=N.end(),P=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;x.push("Z"),g?y?x.circle(_,c,d):x.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+u(t+s.pos/d*e/M)*d,y:c+p(t+s.pos/d*e/M)*d})))):y?x.push(...Fs.sector(_,c,d,d,0,k,L,!0)):x.polygon({x:_,y:c},...s.map((s=>({x:_+u(t+s.pos/d*e/M)*d,y:c+p(t+s.pos/d*e/M)*d})),{x:_,y:c})),S=x.end(!0),A=!0}else S=x.end();t.setPath(S),t.setAttr("fill-rule",A?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",P?"evenodd":""))}else{x.move(y(s[0].xPos,_),y(s[0].yLow,c)),x.line(y(s[0].xPos,_),y(s[0].yPos,c));for(let t=1;t<s.length;t++)x.line(y(s[t].xPos,_),y(s[t].yPos,c));x.line(y(s[s.length-1].xPos,_),y(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)x.line(y(s[t].xPos,_),y(s[t].yLow,c));t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),Rt.setImportantStyle(t.dom.style,U,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.options.belowStyle),Rt.setImportantStyle(e.dom.style,U,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new ne(this.doc)));const t=Fs.arc(_,c,d,d,l.start,l.start+l.total,!0);t.push("L",_,c),this._arcClip.setPath(t),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Va extends la{constructor(t){super(t,"rct-barrange-series"),this._bars=new fa(this._pointContainer,ra)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*y(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class Aa extends Co{constructor(t){super(t,Jo.POINT_CLASS)}savePrevs(){}}class Pa extends ha{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new fa(this._pointContainer,Aa)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.options.reversed,h=2*n.unitPad(),l=r.getPolar(n),{cx:_,cy:c,rd:d}=l,g=o instanceof pr?t.getBaseValue(o):NaN,f=g>o.axisMin(),x=o.getPos(d,g),y=this._pointOff,b=n.getTotalAngle();let w,v,S,V,A;i&&(w=this._labelInfo,v=t.getLabelPos(s),S=t.getLabelOff(s.getOffset()),V=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const P=s.point;if(s.setVis(!P.isNull)){const r=o.getPos(d,P.yGroup)*e,C=n.getUnitLen(b,P.xValue)*(1-h),k=t.getPointWidth(C,0);let L,N,M=l.start+n.getPos(b,P.xValue)-C/2;if(M+=k*y,M+=t.getPointPos(C)+k/2,a?f?(L=x+(o.getPos(d,P.yGroup)-x)*e,N=x):(L=d,N=o.getPos(d,P.yGroup*e)):f?(L=x+(o.getPos(d,P.yGroup)-x)*e,N=x):(L=r,N=0),s.setSector({cx:_,cy:c,rx:L,ry:L,innerRadius:N/L,start:M-k/2,angle:k,clockwise:!0}),M=s.start+s.angle/2,P.xPos=_+s.rx*u(M),P.yPos=c+s.ry*p(M),i&&(A=w.labelView=i.get(P,0))){A.layout(V);const{width:t,height:e}=A.getBBox(),i=s.ry,r=s.innerRadius*d;let o,h;o=a?f?P.yValue<g?"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?x+e/2+S:i-(i-x)/2+S:"outside"===v?i-e/2-S:"head"===v?m(x,i+e/2+S):"foot"===v?x-e/2-S:x-(x-i)/2-S:"outside"===v?r-e/2-S:"head"===v?m(d,r+e/2+S):"foot"===v?d-e/2-S:d-(d-r)/2-S:f?P.yValue<g?"outside"===v?i-e/2-S:"head"===v?i+e/2+S:"foot"===v?x-e/2-S:x-(x-i)/2-S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?x+e/2+S:i-(i-x)/2+S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:.7*i+S,h=c+o*p(M),o=_+o*u(M),"outside"!==v&&A.setContrast(s.dom),this.applyAutoRotation(A,M,l.total,n.options.totalAngle),A.trans(o-t/2,h-e/2)}}}))}}class Ca extends Pa{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new fa(t,na):new fa(t,ra)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*y(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof ra){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class ka extends Sa{constructor(t){super(t,"rct-bellcurve-series")}}class La extends oa{constructor(t){super(t,Jo.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),this._stemDown.setVLine(r,n,e),this._max.setHLine(0,t/4,3*t/4),this._min.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,o,t,a),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Er(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Er(t,"rct-boxplot-point-stem")),this.add(this._box=new Is(t,"rct-boxplot-point-box")),this.add(this._mid=new Er(t,"rct-boxplot-point-mid")),this.add(this._min=new Er(t,"rct-boxplot-point-min")),this.add(this._max=new Er(t,"rct-boxplot-point-max"))}}class Na extends la{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new fa(this._pointContainer,La)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class Ma extends _a{}class Ea extends ca{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new fa(t,Ma)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Oo.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var s;const i=this.model,r=i.options,n=this._inverted,o=i.needClip(!1),a=this._getGrowRate(),h=+r.rotation||0,l=i.pointLabel,_=l.options.position,c=l.getOffset(),d=this._labelContainer._textAlign,g=this._labelViews(),m=i._xAxisObj,f=i._yAxisObj,x=this._polar=i.chart._body.getPolar(m),b=n?t:e,w=n?e:t,v=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:S,max:V}=i.getPixelMinMax(v),A=n?0:e,P=Fs.getDrawer(r.shape);let C;null===(s=this._markers.getOrphans())||void 0===s||s.forEach((t=>{t.setPath(P(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))})),this._markers.forEach(((s,r)=>{const l=s.point,v=g&&(C=g.get(l,0));if(s.setVis(!l.isNull&&!isNaN(l.zValue))){const r=s._radius=i.getRadius(l.zValue,S,V),g=r*a*y(l._vr,1);let k,L;if(x){const t=x.start+m.getPos(w,l.xValue),e=f.getPos(x.rd,l.yValue);k=x.cx+e*u(t),L=x.cy+e*p(t)}else k=m.getPos(w,l.xValue),L=A-f.getPos(b,l.yValue),n&&(k=f.getPos(b,l.yValue),L=e-m.getPos(w,l.xValue));l.xPos=k,l.yPos=L,s.setVis(!o||k>=0&&k<=t&&L>=0&&L<=e)?(s.setPath(P(g)).trans(k,L).rotate(h),v&&(C.setContrast(s.dom).layout(d),this._layoutLabelView(C,_,c,r,k,L))):v&&v.setVis(!1)}else v&&v.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}let Ta=class extends oa{constructor(t){super(t,Jo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),o=m(n,r),a=f(1,x(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,o,t,a),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Er(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Er(t,"rct-candlestick-point-wick")),this.add(this._body=new Is(t))}};class Ba extends la{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new fa(this._pointContainer,Ta)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}class Oa extends ta{layout(t,e,s){const i=new Zt;i.circle(t,e,s),this.setPath(i.end())}}class Da extends Pa{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new fa(t,Oa)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let Ra=class extends oa{constructor(t){super(t,Jo.POINT_CLASS),this.add(this._line=new Er(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new re(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new re(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let _=t.getMarkerStyle(o);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(o),_&&n.internalSetStyleOrClass(_),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,i),Fs.setShape(r,o.shape,a,a),Fs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class $a extends la{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new fa(this._pointContainer,Ra)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}let Fa=class extends ao{constructor(t){super(t,Jo.POINT_CLASS),this._segments=new Kn(this,re),this._decimal=0,this.add(this._back=new re(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setPath(Fs.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Fs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Fs.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class Ia extends ha{constructor(t){super(t,"rct-equalizer-series"),this._bars=new fa(this._pointContainer,Fa)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_shrinkPoint(t){}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_buildSegments(t,e){const s=t.options,i=t._yAxisObj.axisMax(),r=s.segmented,n=s.segmentGap||0,o=this._pts=[];let a,h,l=0;const _=t._yAxisObj,c=_.axisMin(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(h-1))/h;o.length<2*h;)o.push(l,l+a),l+=a+n;o[o.length-1]=e;const p=o.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue>=d?(e-u)/e*(n.yValue-d)/(i-d):u/e*(d-n.yValue)/(d-c);let l=-1,_=0;for(let t=0;t<p-1;t++)if(h>=o[2*t]/e&&h<o[2*(t+1)]/e){l=t+1,_=!r&&h<o[2*t+1]/e?h*e-o[2*t]:a;break}l<0&&(l=p,_=a),0===h&&(l=0),t.prepareSegments(p,l,_,s.backStyle)}}))}}let za=class extends oa{constructor(t){super(t,Jo.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Er(t)),this.add(this._whiskerUp=new Er(t)),this.add(this._whiskerDown=new Er(t)),this.add(this._back=new Is(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Ha extends la{constructor(t){super(t,"rct-errorbar-series"),this._bars=new fa(this._pointContainer,za)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class Ga extends ta{}class ja extends ua{constructor(t){super(t,"rct-funnel-series"),this._segments=new fa(this._pointContainer,Ga),this.add(this._lineContainer=new Uo(t))}_getPointPool(){return this._segments}getClipContainer(){return null}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSegments(t,e,this._visPoints),this._lineContainer.prepare(e)}_renderSeries(t,e){this.$_calcRates(this._visPoints),this.$_layoutSegments(t,e)}_runShowEffect(t){t&&Oo.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_refreshZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach((t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)})),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=D(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=D(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?y+(V-y)*(w-t)/(w-A):y+(V-y)*(t-b)/(A-b)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,d=i.options.reversed,u=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new Zt,f=i.getCenter(t,e),y=f.x-p.width/2,b=f.y-p.height/2,w=b+p.height,v=y+p.width/2,S=p.height-g.height,V=y+(p.width-g.width)/2,A=d?w-S:b+S,P=[],C=new Zt,k=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const n=i.point;if(i.setVis(!n.isNull)){const f=n.yPos*p.height,y=(n.yPos+n.height)*p.height,M=d?w-f:b+f,E=d?w-y:b+y,T=y<S;let B,O,D,R;if(N=null==c?void 0:c.get(n),f>=S?(B=V,O=B+g.width,m.move(B,M).lines(O,M,O,E,B,E),i.ny=i.nx1=NaN):T?(B=s(M),O=B+2*(v-B),D=s(E),R=D+2*(v-D),m.move(B,M).lines(O,M,R,E,D,E),i.ny=NaN,i.nx1=D-B,i.nx2=R-B):(B=s(M),O=B+2*(v-B),D=V,R=D+g.width,m.move(B,M).lines(O,M,R,A,R,E,D,E,D,A),i.nx1=D-B,i.nx2=R-B,i.ny=x(A-M),i.nx3=D,i.nx4=R),i.setPath(m.close(!0)),n.xPos=v,n.yPos=M+(E-M)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=T?(O-B+(R-D))/2:g.width;switch(!t&&L.layout(_||"center"),l){case-1:L.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:L.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,L,_,u,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,_,u,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,n,i,L,_,u,N,C,v,a,h);L.setContrast(o&&i.dom),P.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else N&&N.setVis(!1)}}));const M=n.options.convergent,E=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==E&&"largestFirst"!==E||r.dedupe(P,c,E):(null==r?void 0:r.arrangeVertical(this,P,c,e,M,E,T))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==c?void 0:c.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,_,u,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,u,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,u,N,C,v,a,h)))})))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,_,c){const d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let m=l;if(n?m-=h.width/2:m+=h.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(m-g-c,e).end()):o.setLine(a.reset(0,0).line(m+c-g,e).end()),o.trans(g,p)}t||(n?m-=_+c+u.width:m+=c+_,i.trans(m,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),m=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const f=e.xPos=this.$_calcX(e,s,h,n);let x;if(x=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-m:0;n?o.setLine(a.reset(0,0).line(x-f-_,e).end()):o.setLine(a.reset(0,0).line(x+_-f,e).end()),o.trans(f,m)}t||(n?x-=l+_+g.width:x+=_+l,i.trans(x,m-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,u)}t||(n?p-=_+l+d.width:p+=_+l,i.trans(p,u-d.height/2))}}let Xa=class extends ea{layout(t,e){this.setPath(Fs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Ya extends aa{constructor(t){super(t,"rct-histogram-series"),this._bars=new fa(this._pointContainer,Xa)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,c=i?e:t,d=h.getPos(l,s.getBaseValue(h)),u=i?0:e,p=o&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach(((s,_)=>{const g=s.point,m=a.getPos(c,g.min),f=a.getPos(c,g.max),x=h.getPos(l,g.yValue),y=f-m+(f>m?-1:1),b=x-d;let w=m+(f-m)/2,v=u;g.xPos=w,g.yPos=v-=x,this._layoutPoint(s,_,w,v+b,y,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=c-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(l,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=y,p.hPoint=b,this._layoutLabel(n,p,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((o,a)=>{const h=o.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,d=i.getPos(e,o.point.yValue)*n,u=f(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class Wa extends ao{constructor(t){super(t,Jo.POINT_CLASS),this.add(this._line=new Er(t,"rct-lollipop-point-bar")),this.add(this._marker=new re(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),Fs.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class Ua extends ha{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_shrinkPoint(t){}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.options.styleCallback,this._bars||(this._bars=new fa(this._pointContainer,Wa)),this._bars.prepare(s.length,((t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)}))}}class Za extends oa{constructor(t){super(t,Jo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,a=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_doInitChildren(t){this.add(this._tickOpen=new Er(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Er(t,"rct-ohlc-point-tick")),this.add(this._bar=new Er(t)),this.add(this._back=new Is(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class qa extends la{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new fa(this._pointContainer,Za)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}class Ka extends ba{constructor(t){super(t,"rct-pareto-series")}}class Qa extends re{setOff(t){return this.off=x(t),this}}class Ja extends Co{constructor(t){super(t,Jo.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class th extends Qt{constructor(t){super(t,Jo.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new Co(t))}setSides(t,e,s,i,r){const n=this.point,o=D(N),a=D(((t?n.startAngle:n.startAngle+n.angle)+N/2+M)%M),h=D(a+(t?n.angle:-n.angle)-1e-4+M)%M,l=o-(a+x(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=N/2&&!(h>=a&&h<N/2)||h>=3*N/2&&!(a<h&&a>3*N/2)?(this._outArcView=i.setOff(m(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*N/2&&h<=N/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=N/2&&h<=3*N/2?(this._outArcView=i.setOff(m(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=N&&this._outArcView.setOff(m(this._outArcView.off,this._side1View.off)),h>=N&&h<M&&this._outArcView.setOff(m(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=Fs.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;nt&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Fs.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(Fs.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(Fs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Fs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Fs.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Fs.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",Dt.interpolate("#000",r,.2)),this._side2View.setStyle("fill",Dt.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",Dt.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",Dt.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Jo.DATA_FOCUS,t),this._side2View.setBoolData(Jo.DATA_FOCUS,t),this._inArcView.setBoolData(Jo.DATA_FOCUS,t),this._outArcView.setBoolData(Jo.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class eh extends ua{constructor(e){super(e,"rct-pie-series"),this._deep=!1,this._pb=new Zt,this._cx=0,this._cy=0,this._depth=0,this._ratio=1,this._rx=0,this._ry=0,this._rxInner=0,this._ryInner=0,this._slicedOff=0,this.add(this._circle=new Vo(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new po(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new te(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Uo(e))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,s.options.icon?s.getUrl(s.options.icon):null,null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,o=r-n;this._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&Oo.grow(this,(t=>{const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,this.model.options.autoSlice,!1))}))}_doPointClicked(t){if((t instanceof Ja||t instanceof th)&&this.model.options.autoSlice){const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0)}else this.invalidate()}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_refreshZombie(){this._renderSeries(this.width,this.height)}focusPointView(t,e){t instanceof th&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new fa(this._pointContainer,th,null),n=this._sides=new Kn(this._sideContainer,Qa,"rct-pie-series-side")):this._sectors=new fa(this._pointContainer,Ja,null)),this._deep=i,n&&n.prepare(4*r,((t,e)=>t.index=e)),this._sectors.prepare(r,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.options.clockwise?1:-1,n=t.filter((t=>(t.visible||t===e)&&!t.isNull)).map((t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1))).reduce(((t,e)=>t+e),0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%M;if(i>1||i>0&&!e)t.forEach((t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=D(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)}));else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,_=this._rxInner,c=this._depth,d=this._ratio,g=this._sides,m=i.pointLabel,f=m.connector.options.curved,b=this._labelViews(),w="inside"===i.getLabelPos(m),v=y(m.options.radius,.7),S=this._pb,V=m.getDistance(w,l,_),A=m.getAlign();let P=null==b?void 0:b.textAlign();const C=this._lineContainer.setVis(m.connector.visible)?this._lineContainer:null,k=this._slicedOff=i.getSliceOffset(l)*n,L=[],N=[],M=[],E=(null==b?void 0:b.getWidth(0))||0,T=this._sectors.count;let B,O;if(this._lineContainer.setStyleOrClass(m.connector.options.style),!b||P||A||(P="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=y(this.model.innerText.options.iconGap,0),n=e.width,o=e.height,a=t.getBBox(),h=a.width,l=a.height;switch(this.model.innerText.getIconPos()){case"right":t.trans(n/2+r,(o-l)/2),s-=(h+r)/2;break;case"top":t.trans(h/-2,-(l+r)),i+=l+r/2;break;case"bottom":t.trans(h/-2,o+r),i-=(l+r)/2;break;default:t.trans(-(n/2+h+r),(o-l)/2),s+=(h+r)/2}}this._textView.trans(s,i-e.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rx),this.$_calcAngles(t),this._sectors.forEach(((t,o)=>{const m=t.point;if(g){const e=4*o;t.setSides(r,g.get(e),g.get(e+1),g.get(e+2),g.get(e+3))}if(O=null==C?void 0:C.get(m),m.isNull)t.setVis(!1),b&&(B=b.get(m,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=T>1&&m.sliced,g=m.startAngle,y=g+m.angle/2;let C=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(C+=u(y)*k,D+=p(y)*k),t.trans(C,D).setVis(!0),m.xPos=a+u(y)*(k+l*v),m.yPos=h+p(y)*(k+l*v),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*d,innerRadius:_,start:g,angle:x(m.angle),clockwise:r,depth:c}),b&&(B=b.get(m,0))){const r=i.getLabelOff2(m);let n;w?(null==O||O.setVis(!1),this.$_layoutLabelInside(m,B,P,r,V,o?k:0)):(n=-1===A?this.$_layoutLabelAligned(!1,m,B,P,O,S,f,r,V,o?k:0):1==A?this.$_layoutLabelEnded(!1,m,B,P,O,S,f,r,V,o?k:0,E,e,s):this.$_layoutLabelOutside(!1,m,B,P,O,S,f,r,V,o?k:0),n?L.push(B):N.push(B)),B.setContrast(w&&t.dom).setVis(!0),M.push(B),this._layoutLabelRotation(B)}else null==O||O.setVis(!1)}})),g&&g.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const D=m.options.convergent,R=m.options.dedupeMode,$=m.options.overflow;b&&(w||0===A?"preserveOrder"!==R&&"largestFirst"!==R||b.dedupe(M,C,R):b.arrangeVertical(this,L,C,s,D,R,$)+b.arrangeVertical(this,N,C,s,D,R,$)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=T>1&&r.sliced,n=i.getLabelOff2(r);B=b.get(r,0),O=null==C?void 0:C.get(r),(null==B?void 0:B.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,B,P,O,S,f,n,V,t?k:0):1==A?this.$_layoutLabelEnded(!0,r,B,P,O,S,f,n,V,t?k:0,E,e,s):this.$_layoutLabelOutside(!0,r,B,P,O,S,f,n,V,t?k:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,d=this._cx,g=this._cy,m=this._rx,f=this._ry,x=m+l,y=f+l,b=d+u(c)*x,w=g+p(c)*y,v=b<d;!t&&!_&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let A,P,C,k=g+p(c)*f;if(v?(A=d+u(Math.PI)*m-h,P=A-S.width-a,C=d+u(Math.PI)*x-h,S.width):(A=d+u(0)*m+h,P=A+a,C=d+u(0)*x+h),r&&r.setVis(x>0)){const e=t?s.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(b-A),e,b-A,0).end()):r.setLine(n.reset(0,e).line(b-A,0).end()),r.setPos(A,k),!_&&r.trans(A,w)}return t||(s.setPos(P,k-S.height/2),!_&&s.trans(P,k-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d){const g=s.isDomAnimating(),m=e.startAngle+e.angle/2,f=this._cx,x=this._cy,y=this._rx,b=this._ry,w=y+l,v=b+l;let S=f+u(m)*w,V=x+p(m)*v;const A=S<f;!t&&!g&&s.layout(i||(A?"right":"left"));const P=s.getBBox(),C=V-P.height/2;let k,L,N,M=x+p(m)*b;if(A?(k=h+_+a,N=h+_-P.width,L=k):(k=c-h-_-a,N=c-h-_,L=k),r&&r.setVis(w>0)){const e=t?s.ty-C:0;o?r.setLine(n.reset(0,e).quad(0,e,S-L,0).end()):r.setLine(n.reset(0,e).line(S-L,0).end()),r.setPos(k,M),!g&&r.trans(L,V)}return t||(s.setPos(N,M-P.height/2),!g&&s.trans(N,M-P.height/2)),A}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),d=e.startAngle+e.angle/2,g=this._cx,m=this._cy,f=this._rx+.5*h,x=this._ry+.5*h,y=u(d)*l,b=p(d)*l,w=g+u(d)*this._rx,v=m+p(d)*this._ry,S=g+u(d)*f;let V=m+p(d)*x;const A=S<g;let P,C;return A?(P=S-.2*h,C=P):(P=S+.2*h,C=P),r&&r.setVis(f>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,P-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,P-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+y,v+b)),t||(A?C-=c.width+a:C+=a,V-=c.height/2,s.setPos(C,V),!_&&s.trans(C+y,V+b)),A}$_layoutLabelInside(t,e,s,i,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.options.autoRotation,_=h.options.rotationMode,c=a.options.clockwise;!o&&e.layout(s||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=m(a.options.totalAngle||360,360);if("angle"===_){let i=p/t*s+90,r=(i+a.options.startAngle)%360;r+=c?0:360,i+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,p,t,s)}const g=h.options.align===Ys?.3:h.options.align===Xs?.5:.7,f=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*g+i:.8*this._rx+i:.7*this._rx+i,x=this._deep?f*this._ratio:f,y=Math.cos(p),b=Math.sin(p);let w=this._cx+y*f,v=this._cy+b*x;e.move(w-d.width/2,v-d.height/2),w=this._cx+y*(n+f),v=this._cy+b*(n+x),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,s){if(e&&this._sectors.count<2)return;const i=this.model,r=this._labelViews(),n=i.pointLabel.getAlign(),o=this._slicedOff,a=i.options.autoSlice?i.options.sliceDuration:0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(u(l)*o,p(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,d=_.connector.options.curved,g="inside"===i.getLabelPos(_),m=r.get(h,0),f=i.pointLabel.getDistance(g,this._rx,this._rxInner);if(m){const t=!g&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,m,e,_.getOffset(),f,o):0===n&&this.$_layoutLabelOutside(!1,h,m,e,t,this._pb,d,_.getOffset(),f,o)}if(e){let e=m.tx,s=m.ty,i=t.tx,r=t.ty;(g||0===n)&&(m.trans(m.x,m.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(m.trans(m.tx,m.ty).transEx2(m.x,m.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class sh extends _a{setHoverRate(t,e,s){const i=this.point,r=Fs.getDrawer(t.model.getShape(i)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._hoverRadius}}class ih extends ca{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new fa(t,sh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Oo.grow(this)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),o=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart._body.getPolar(o),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,d=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,x=m.getOffset(),y=this._labelViews(),b=r?t:e,w=h?h.total:r?e:t,v=r?0:e;let S;this._markers.forEach(((i,m)=>{const V=i.point,A=y&&(S=y.get(V,0));if(i.setVis(!V.isNull)){const m=Fs.getDrawer(s.getShape(V)),y=ot.jitter(V.xValue,d),P=ot.jitter(V.yGroup,g);let C,k;if(h){const t=h.start+o.getPos(w,y),e=a.getPos(h.rd,P)*l;C=h.cx+e*u(t),k=h.cy+e*p(t)}else C=o.getPos(w,y),k=v-a.getPos(b,P),r&&(C=a.getPos(b,P),k=e-o.getPos(w,y));if(V.xPos=C,V.yPos=k,i.setVis(!!h||!n||C>=0&&C<=t&&k>=0&&k<=e)){const t=i._hoverRadius||_;i.setPath(m(t)),i.trans(C,k).rotate(c),A&&this._layoutLabelView(S,f,x,t,C,k)}else A&&A.setVis(!1)}else A&&A.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.options.radius,r=s.reduce(((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r));return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.options.radius+s}}class rh extends la{constructor(t){super(t,"rct-waterfall-series"),this._bars=new fa(this._pointContainer,ra),this.add(this._lineContainer=new te(t,"rct-waterfall-series-lines")),this._lines=new Kn(this._lineContainer,Er)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd,0,0,this._inverted),e>0){const t=this._lines.get(e-1),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):s.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}function nh(t,e){return new(ko[e._type()])(t)}function oh(t,e){return new(qo[e._viewType()])(t)}Jo.register([Hr,Sa],[Xr,va],[Pr,Ca],[Sr,Va],[Zr,ka],[Kr,Na],[Jr,Ea],[sn,Ba],[nn,Da],[ln,$a],[cn,Ia],[dn,Ha],[mn,ja],[yn,Ya],[Fr,wa],[vn,Ua],[Vn,qa],[Pn,Ka],[En,eh],[On,ih],[$n,rh]),Lo.register([or,ma],[rr,pa],[nr,ga]);class ah extends ho{constructor(t){super(t,"rct-axis-grid"),this._lines=new Kn(this,Er)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=s.options.reversed,r=this.width,n=this.height,o=s.isEmpty()?[]:t.getPositions(s,s._isHorz?r:n),a=this._lines.prepare(o.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),h=a.count-1;let l;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",o[e]===(s._isHorz?r:n))}));const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;if(s._isHorz){const e=y(s._prevRate,1);a.forEach(((a,d)=>{l=0===d?_:d===h?c:t.visible,a.setVis(l)&&a.setVLine(s.prev(o[d])+(i?r*(1-e):0),0,n)}))}else{const e=i?y(s._prevRate,1):1;a.forEach(((i,a)=>{o[a],l=0===a?_:a===h?c:t.visible,i.setVis(l)&&i.setHLine(n*e-s.prev(o[a]),0,r)}))}}}class hh extends Qt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new re(t)),this._mask.setStroke("none"),this.add(this._upLine=new re(t)),this._upLine.setFill("none"),this.add(this._downLine=new re(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(this._clip)?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new Zt;if(s){let t=0,s=0,n=i/2,o=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(o,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class lh extends Qt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new po(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){this.model=e,this._labelView.setVis(!!e.label.options.text)&&this._labelView.setModel(t,e.label,null,null)}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,this.model.label,null),this._labelView.layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class _h extends lh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Po:Er)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&this._line.setStyles(e._style)}_doLayout(t,e){const s=this.model,i=s.options.value,r=s.label,n=r.options,o=this._line,a=this._labelView.setVis(r.visible)&&this._labelView,h=a.getBBox(),l=y(n.offsetX,0),_=y(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setVLine(r,0,e),a)){switch(n.align){case"center":c=r-h.width/2+l;break;case"right":c=r+l;break;default:c=r-h.width-l}switch(n.verticalAlign){case"bottom":d="inside"===n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setHLine(r,0,t),a)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="inside"===n.position?t-h.width-l:t+l;break;default:c="inside"===n.position?l:-1*(h.width+l)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}a.visible&&a.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,a,o,i.axis.getTotalAngle(),!1),r.setStyle(W,"none"),n&&n.trans(s.cx+a*u(s.start),s.cy+a*p(s.start))}}class ch extends lh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Co:zs)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=m(s.startValue,s.endValue),r=f(s.startValue,s.endValue);this._range=e.axis.trimRange(i,r),this.setVis(e.visible&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model;s.options;const i=s.label,r=i.options,n=this._box,[o,a]=this._range,h=this._labelView.setVis(i.visible)&&this._labelView,l=h.getBBox(),_=y(r.offsetX,0),c=y(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,o;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":o="inside"===r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="inside"===r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(f(0,m(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="inside"===r.position?t-l.width-_:t+_;break;default:e="inside"===r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.startValue),h=i.axis.getPos(s.rd,i.options.endValue);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:a/h,start:o,angle:M,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*u(s.start),s.cy+t*p(s.start))}}}class dh extends te{constructor(){super(...arguments),this._views=new Kn(this,re)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach(((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.axisMin(),n.from),h=Math.max(o.axisMax(),n.to);if(n.axis._isHorz){const s=f(0,m(t,o.getPos(t,a))),r=f(0,m(t,o.getPos(t,h)));i.setPath(Fs.rectangle(s,0,r-s,e))}else{const s=f(0,m(e,o.getPos(e,a))),r=f(0,m(e,o.getPos(e,h)));i.setPath(Fs.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class uh extends te{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof ch?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof es?i=this._rangePool.pop()||new ch(t,s):e instanceof ts&&(i=this._linePool.pop()||new _h(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class ph extends re{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line"))}layout(t,e,s,i,r){const n=this.model.axis,o=n._isHorz,a=new Zt;if(this._bar){const h=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.options.showAlways&&(l=n.options.reversed?n.xValueAt(o?i-e:s):n.xValueAt(o?e:r-s)),n instanceof _i&&(l=c(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(s,0,i));this.setPath(a.end())}}class gh extends So{constructor(t){super(t,"Reset Zoom",gh.CLASS_NAME),this.setVis(!1)}}gh.CLASS_NAME="rct-reset-zoom";class mh extends te{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Is(t,"rct-empty-view-back")),this.add(this._labelView=new po(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class fh extends te{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Kn(this,Er)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(_.length,((e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-_[i],r,n-h-_[i]):e.setLine(_[i]+l,0,_[i],n)}))}}class xh extends te{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new re(t)),this.add(this._gridContainer=new te(t,"rct-body-depth-grids")),this.add(this._lineView=new Er(t,"rct-body-depth-side-line")),this.add(this._endView=new Er(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(Fs.polygon(0,o,a,0,a,n-o,0,n)),h.visible&&h.setVLineC(0,o,n),l.visible&&l.setLine(0,o,r,0)):(t.setPath(Fs.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,_]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new fh(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class yh extends te{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new xh(t,!0)),this.add(this._ySideView=new xh(t,!1)),this.add(this._orgLineView=new Er(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,_=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),_.setVis(s.ySide.visible)&&(e?_.setBounds(0,o-h,n,h):_.setBounds(0,0,a,o),_.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class bh extends ho{constructor(t,e){super(t,bh.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._hoverPointSeries=[],this._owner=e,this.add(this._hitTester=new Is(t)),this._hitTester.setFill("transparent"),this.add(this._background=new re(t,"rct-body-background")),this.add(this._depthLayer=new yh(t)),this.add(this._image=new uo(t,!0,"rct-body-image")),this.add(this._emptyView=new mh(t)),this.add(this._gridRowContainer=new dh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new te(t,"rct-axis-grids")),this.add(this._baseContainer=new te(t,"rct-axis-bases")),this.add(this._guideContainer=new uh(t,"rct-axis-guides")),this.add(this._annotationContainer=new te(t,"rct-annotations")),this.add(this._seriesContainer=new te(t,"rct-series-container")),this.add(this._axisBreakContainer=new te(t,"rct-axis-breaks")),this.add(this._labelContainer=new te(t,"rct-label-container")),this.add(this._frontGuideContainer=new uh(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new te(t,"rct-front-annotations")),this.add(this._feedbackContainer=new te(t,"rct-feedbacks")),this.add(this._zoomButton=new gh(t)),this._crosshairViews=new Kn(this._feedbackContainer,ph)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Kt._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(Jo.isPointDom(e))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){l=o[t];break}const c=null==e?void 0:e.classList,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(a>0){const e=this.chart().chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of o)if(!(t.model instanceof Rr)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=y(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})}));const a=n.reduce(((e,s)=>{if(!e.pv||!s.pv)return e||s;const i=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=i*i+r*r,o=s.pv.pv.point.xPos-t.x,a=s.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:s}));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=y(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=y(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(l=r,i=e)}}));h&&i&&l.canHover(i.dist,i.pv,s)?this.$_setFocused(l,i.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,h=this._siblings,l=this._siblingSeries;let _,c,d;if(n&&n.options.interactive&&e&&o.visible)switch(o.getScope(n,e.point)){case"axis":d=n._xAxisObj.getSeries();case"group":d||(d=n._group.getVisibleSeries());const r=d.map((t=>{if(t instanceof Xi){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof Jr){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));_=d.map((t=>i.getSeriesView(t))),c=[],r.forEach(((t,e)=>{c.push(_[e].getPointView(t))}));break;default:_=[t],c=[e]}let u=[];if(_&&_.forEach(((t,e)=>{u.push(...t.getSiblings(c[e]))})),u=u.length>1?u.sort(((t,e)=>t.hash-e.hash)):u.length>0?u:null,ot.equalArrays(h,u)||(_&&_.forEach(((t,e)=>{t.focusPoints(t.getSiblings(c[e]))})),l&&l.forEach((t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=_,this._siblings=u),e!==a){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,n&&n.options.interactive&&this.$_focusSeries(t,!0),n&&r.chartOptions.options.seriesHovering&&n.options.interactive&&this.$_hoverSeries(t))}this._focused&&n&&n.options.interactive&&(this._focused!==a||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model._group===t.model._group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData(Jo.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Jo.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach((t=>t.hoverPoint(null))),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach((t=>t.focusPoints(null))),this.removeFocus()}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}annotationByDom(t){return this._annotationViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesMap.get(t)}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.zoom(h,l)&&(this._zoomRequested=!0)}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find((e=>e.model===t))}removeFocus(){this._seriesViews.forEach((t=>{t._hoverPts.forEach((e=>{e instanceof _a&&e.endHover(t,!1),e.setBoolData(Jo.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.cancel()})),t._hoverAnis=[]})),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],h,l,r)})),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],h,l,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],h,l,r)})),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_renderBackground(t,e,s){t.setPath(Fs.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach((t=>{const e=t._model,s=e.axis;s._isHorz?s.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.options.reversed?t.trans(0,e._sect.pos):t.trans(0,o-e._sect.pos-e._sect.len),t.layout(n,o,e.axis._isHorz)})),this.isClip(this._guideClip))this._guideClip.resize(t.width(),t.height());else{const e=t._padding;this._guideClip=t.clipBounds(-1*(e.left+this.tx),-1*(e.top+this.ty),t.width(),t.height())}[this._guideContainer,this._frontGuideContainer].forEach((t=>{t.setVis(t._views.length>0)&&(t._views.forEach((t=>t.visible&&t.layout(n,o))),t.setClip(this._guideClip))})),this._gridRowContainer.layout(n,o),this._gridRowContainer.trans(a,0)}this.$_prepareCrosshairs(e.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(n,o))})),this._layoutAnnotations(this._inverted,this,n,o),this._zoomButton.visible&&this._zoomButton.trans(n-this._zoomButton.getBBox().width-10,10),this._emptyView.setVis(this.$_isEmptyVisible(e))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(e.emptyView,n,o))}$_isEmptyVisible(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(No[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof ur)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));s&&[e._getXAxesAtPane(a,h,!0),e._getYAxesAtPane(a,h,!0)].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new ah(t);r.set(e,s),i.add(s)}if(e instanceof ur&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Er(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),a.length=0,s.forEach((e=>{const s=o.get(e)||oh(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)})),this._seriesContainer.sort(a),a.forEach((t=>this._labelContainer.dom.appendChild(t._labelContainer.dom)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach((t=>t.remove())),o.length=0,s.forEach((s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach((t=>t.forEach((t=>{t instanceof pr&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new hh(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(o[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(s,i,!0),t._getYAxesAtPane(s,i,!0)].forEach((t=>t.forEach((t=>{t.crosshair.visible&&r.push(t.crosshair)})))),e.prepare(r.length,((t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)}))}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach((r=>{r._layoutView(t,e,0,0,s,i),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)}))}}bh.BODY_CLASS="rct-body";class wh extends Qt{constructor(t){super(t,vh.HANDLE_STYLE),this.add(this._back=new Is(t)),this.add(this._shape=new re(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*m(t,e);const r=new Zt;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class vh extends ho{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(vh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(vh.MASK_STYLE)}constructor(t){super(t,vh.CLASS_NAME),this.add(this._back=new Is(t,vh.BACK_STYLE)),this.add(this._container=new te(t,null)),this.add(this._mask=new Is(t,vh.MASK_STYLE)),this.add(this._trackView=new Is(t,vh.TRACK_CLASS)),this.add(this._thumbView=new Is(t,vh.THUMB_CLASS)),this.add(this._startHandle=new wh(t)),this.add(this._endHandle=new wh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let o=s,a=i;return e._vertical?o=e.getSize():a=e.getSize(),e._naviChart.layoutAxes(o,a,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(o,101),e._naviChart.yAxis._calcPoints(a,1),{width:o,height:a}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=s?(s.start-s.min)*r/s.total():0,e=s?(s.end-s.min)*r/s.total():r;this._mask.setVis(i.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(i.mask.style)),this._trackView.setBounds(-2,n,r+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,6),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle&&(this._startHandle.layout(n/3,n/3,!1),this._startHandle.trans(t,n+3),this._endHandle.layout(n/3,n/3,!1),this._endHandle.trans(e,n+3),this._startHandle.setStyleOrClass(i.handle.style),this._endHandle.setStyleOrClass(i.handle.style))}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,r,n,1),this._seriesView.resize(r,n),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,r,n,1),this._xAxisView.resize(r,n),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=oh(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new vo(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new vo(t)),i._simpleMode=!0)}}vh.CLASS_NAME="rct-navigator",vh.BACK_STYLE="rct-navigator-back",vh.MASK_STYLE="rct-navigator-mask",vh.HANDLE_STYLE="rct-navigator-handle",vh.HANDLE_BACK_STYLE="rct-navigator-handle-back",vh.TRACK_CLASS="rct-navigator-track",vh.THUMB_CLASS="rct-navigator-thumb";class Sh extends he{constructor(t){super(),this.chart=t}}class Vh extends Sh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=f(0,e-(o.x-n.x)),this._yStart=f(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new Is(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=f(0,m(i.height,e-(i.y-s.y))),this._body.setZoom(0,m(f(0,this._yStart),e),this._body.width,f(m(this._yStart,i.height),e))):(t=f(0,m(i.width,t-(i.x-s.x))),this._body.setZoom(f(0,m(this._xStart,t)),0,f(m(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=f(0,m(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,m(this._yStart,r),this._body.width,x(this._yStart-r))):(i=f(0,m(o.width,i-(o.x-n.x))),this._feedback.setBounds(m(this._xStart,i),0,x(this._xStart-i),this._body.height)),!0}}class Ah extends Sh{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class Ph extends Sh{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,_=n.model.options.minSize,c=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class Ch extends Sh{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=f(0,m(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class kh{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(x(this._clickX-i)>3||x(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(s)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){ot.makeArray(a.legend.getSources(a),!0).forEach((t=>{if(t instanceof ii){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof ua&&t.togglePointVisible(e)}}else a.source.visible=!a.source.visible,i.bodyView().hoverSeries(a.source.visible?a.source:null)}))}}else(h=i.seriesByDom(r))?h.clicked(r):(_=i.htmlButtonByDom(r))?_.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return bo.isThumb(t)?new Ah(this._chart,i.getScrollView(t)):vh.isHandle(t)?new Ph(this._chart,i._navigatorView,t):vh.isMask(t)&&r&&r.model.isZoomed()?new Ch(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Vh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class Lh extends te{constructor(t){super(t,Lh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,s){if(this.setVis(s&&s.length>0)){const i=this._itemViews,r=this._separators;for(;i.length<s.length;){const s=new de(e,"rct-history-item");s.anchor=t.TextAnchor.START,i.push(s)}for(;i.length>s.length;)i.pop().remove();for(;r.length<s.length-1;){const s=new de(e);s.anchor=t.TextAnchor.START,s.text=">",r.push(s)}for(;r.length>s.length-1;)r.pop().remove();this.$_layout(s)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}Lh.TITLE_CLASS="rct-history";class Nh extends ho{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new Is(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new de(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){return t===this._marker&&t.parent===this||this.insertFirst(this._marker=t),this._marker}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():Qn,l=Jn(this._label.getBBox());return this._gap=y(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:f(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=y(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 Mh extends lo{constructor(t){super(t,Mh.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Kn(this,Nh)}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(),a=this._vertical="vertical"===e.getLayout();return this._ipr=y(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?y(n.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,a,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,a=this._margins,h=this._paddings,l=this._vertical,_=a.left+h.left,c=a.top+h.top;let d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),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||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),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,a=e.items(),h=this._itemViews,l=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,m,x,y;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let b=0,w=0;if(s){for(;b<d;)y=h.get(b),w%i==0?(u.push(x=[y]),m=y.mh,w++,b++):(m+=l+y.mh,m<=n?(x.push(y),w++,b++):w=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=f(s,t.mw),r=f(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=f(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)y=h.get(b),w%i==0?(u.push(x=[y]),g=y.mw,w++,b++):(g+=l+y.mw,g<=r?(x.push(y),w++,b++):w=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=f(s,t.mh)})),e+=l*(t.length-1),g=f(g,e),m+=s,p.push(s)})),m+=_*(u.length-1)}return{width:g,height:m}}}Mh.LEGEND_CLASS="rct-legend";class Eh extends Qt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Vo(t))}layout(){}}class Th extends Qt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new te(t,"rct-polar-axis-markers")),this._markViews=new Kn(this._markContainer,Eh),this.add(this._gridContainer=new Qt(t,"rct-polar-axis-grids")),this._labelViews=new Kn(this._labelContainer=s,xo,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(wo)?t.setLabel(s,o,e,r.replace(wo,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks,{start:i,total:r}=s.chart._body.getPolar(e),n="auto"===s.options.rotation,o=t.length;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(o,((a,h,l)=>{a.setVis(!0),this._prepareLabel(a,t[h],s,l);const _=n?(i+e.getPos(o,t[h].value))/r*360+90:0,{width:c,height:d}=a.getBBox();a.setRotation(c/2,d/2,_)}))}else this._labelViews.forEach((t=>t.setVis(!1)))}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.options.front));e.setAll(t,i,!0),i=this._model.guides.filter((t=>t.options.front)),s.setAll(t,i,!0)}}class Bh extends Th{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Kn(this._gridContainer,Er,Bh.GRID_CLASS),e.insertFirst(this._startView=new Er(t,Bh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Er(t,Bh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Po(t,Bh.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/M)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+u(o+h)*i,_=s+p(o+h)*i;n.setFill("none"),n.setLine(e,s,l,_),n.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),h=i+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",_=[];this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),c=t.angle=o+n.pos,d=e+u(c)*(h+a.width/2)-a.width/2,g=s+p(c)*(h+a.height/2)-a.height/2;t.trans(d,g),_.push(t)}}));const c=_.length;c>2&&(x(_[c-1].angle-_[c-2].angle)<M/24||ot.diffAngle(_[c-1].angle,_[0].angle)<M/24)&&_[c-1].setVis(!1)}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+u(o)*i,s+p(o)*i),r.map((t=>{const r=t.pos;h.push(e+u(o+r)*i,s+p(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+u(o+a)*i,s+p(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+u(o)*i,s+p(o)*i),this._endView.setLine(e,s,e+u(o+a)*i,s+p(o+a)*i))}}Bh.LINE_CLASS="rct-polar-xaxis-line",Bh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Bh.GRID_CLASS="rct-polar-xaxis-grid-line";class Oh extends Th{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new Kn(this._gridContainer,Po,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Er(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Po(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof ur&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){function o(t,i){if(t.setFill("none"),a)t.setArc(e,s,i,_,c,!0);else{const r=[];l&&h[0].pos>0&&r.push(e+u(_)*i,s+p(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+u(_+n)*i,s+p(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+u(_+c)*i,s+p(_+c)*i),t.setPolyline(r)}}const a=this._circular,h=n._ticks,l=n.isArced(),_=n.getStartAngle(),c=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach(((e,s)=>{o(e,r[s].pos),e.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(l){const t=n.getStartAngle();this._labelViews.forEach(((n,a)=>{const h=n.getBBox();n.setContrast(null).trans(e+u(t)*r[a].pos-h.width*i+o,s+p(t)*r[a].pos-h.height/2)}))}else this._labelViews.forEach(((t,n)=>{const a=t.getBBox();t.setContrast(null).trans(e-a.width*i+o,s-r[n].pos-a.height/2)}))}this._lineView.visible&&(l?this._lineView.setLine(e,s,e+i*u(_),s+i*p(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class Dh extends bh{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._circular=this.model.options.circular,this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n}=this.model.getPolar(null);t.setPath(Fs.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._seriesViews.forEach((t=>{var e;t.setCircular(this._circular),t.model.needClip(!0)&&(this.isClip(this._polarClip)||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach((t=>{t.layout(s.chart.xAxis,i,r,n)})),[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis))))})),this._layoutAnnotations(!1,this,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image;this.insertAfter(this._xAxisLabelContainer=new te(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new te(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new te(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new te(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new te(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new Oh(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new Bh(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class Rh extends lo{constructor(t,e){super(t,e?Rh.SUBTITLE_CLASS:Rh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new de(t)),this._richText=new we}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),Jn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Rh.TITLE_CLASS="rct-title",Rh.SUBTITLE_CLASS="rct-subtitle";class $h extends Qt{constructor(e){super(e,"rct-tooltip-row"),this.add(this._marker=new re(e,"rct-tooltip-row-marker")),this.add(this._textView=new de(e,"rct-tooltip-row-text")),this._textView.anchor=t.TextAnchor.START,this.add(this._detailView=new de(e,"rct-tooltip-row-detail")),this._detailView.anchor=t.TextAnchor.START}layout(t,e,s,i,r){var n;const o=e.options,a=e.getMarkerSize(),h=e.getMarkerGap(),l=Fs.getDrawer(o.listMarkerShape);this._marker.setPath(l(a/2)),this._marker.setFill((null===(n=i.legendColor)||void 0===n?void 0:n.call(i))||""),r[0]?(s.setFormat(r[0]),s.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a+h)):this._textView.text="",r[1]?(s.setFormat(r[1]),s.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+h+this._textView.getBBox().width+y(e.options.listGap,4))):this._detailView.text=""}alignDetail(t){const e=this._marker.getBBox();this._detailView.transX(t-this._detailView.getBBox().width),this._marker.trans(e.width/2,this.r.height/2)}}class Fh extends Qt{constructor(e){super(e,"rct-tooltip-list"),this.add(this._headerView=new de(e)),this._headerView.anchor=t.TextAnchor.START,this.add(this._rowLayer=new te(e,"")),this.add(this._footerView=new de(e)),this._footerView.anchor=t.TextAnchor.START,this._rows=new Kn(this._rowLayer,$h)}layout(t,e,s,i){const r=this._headerView,n=this._footerView,o=y(e.options.listRowGap,4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!i.header)&&(s.setFormat(i.header),s.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(i.items.length).forEach(((r,n)=>{r.trans(0,h),r.layout(t,e,s,i.items[n],i.rows[n]),h+=r.getBBox().height+o,l=r._width=f(l,(r.r=r.getBBox()).width)})),n.setVis(!!i.footer)&&(s.setFormat(i.footer),s.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach((t=>{t.alignDetail(l)}))}}class Ih extends Qt{constructor(e){super(e,Ih.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new re(e,"rct-tooltip-back")),this.add(this._top=new re(e,"rct-tooltip-top")),this.add(this._textView=new de(e,"rct-tooltip-text")),this.add(this._listView=new Fh(e)),this._back.setAttr("filter","url(#"+Kt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new we,this.close(!0,!1)}show(t,e,s,i,n,o,a){const h=s.point,l=this._model=t.chart._tooltip,_=l.setTarget(t,h,i&&i.map((t=>t.point)));if(!_)return;const c=l.options,d=_.isGroupTooltip();let u,p=this._list;if(d){p.header=p.footer="",p.items=[],p.rows=[];const e=_.getTooltipText(t,h,p);if(0===p.rows.length){if(u=r(e)?e.join(" "):e,!u||!u.trim())return;p.rows=p.items.map((()=>[u,""]))}}else{const e=c.text||_.getTooltipText(t,h,null);if(u=r(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(l._style);const g=e.contentWidth(),x=e.contentHeight(),y=this._listView,b=this._textView,w=l.getHeaderHeight(),v=l.getTailSize(),S=t.chart.isInverted(),V=t._yAxisObj;let A,P,C,k=V.options.reversed;t instanceof Fi&&t.getBaseValue(V)>s.point.yValue&&(k=!k),d?(y.setVis(!0),b.setVis(!1),y.layout(e.doc(),l,this._richText,this._list),A=y.getBBox()):(y.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),A=b.getBBox()),P=f(c.minWidth||0,A.width+16),C=f(c.minHeight||0,A.height+12)+w;let L=t._calcedColor;t instanceof Oi?(t.options.legendByPoint||t._colorByPoint())&&(L=h._calcedColor):t._colorByPoint()&&(L=getComputedStyle(s.dom).fill),this._top.setFill(L);const N=this.isVisible()?300:0,M=c.offset+v,E=a.getFocusPointView().getBounds(),T=e.getBounds();let B,O,D=!1;const R=l.isFollowPointer(t);if(S&&!t.isWidget)B=o-C/2-f(0,m(o-C/2,x-C)),D=R?k?P+M>n:n+P+M>g:k?P+M>E.x-T.x+E.width:E.x-T.x-M>g-P,D&&(k=!k),O=k?"left":"right",this.$_drawTooltip(0,0,P,C,O,B),k?n-=P+M:n+=M,o-=C/2;else{B=n-P/2-f(0,m(n-P/2,g-P));const t=R?o-e.getRootDistance().y:E.y-T.y-e._padding.top,s=R?x-o:T.bottom-E.bottom;if(t>=C+M||s>=C+M){(k?s>=C+M:t>=C+M)?O=k?"bottom":"top":(O=k?"top":"bottom",k=!k),this.$_drawTooltip(0,0,P,C,O,B),n-=P/2,k?o+=M:o-=C+M}else{B=o-C/2-f(0,m(o-C/2,x-C));const t=E.x-T.x;O=g-t>=P+M||t<P+M?"right":"left",this.$_drawTooltip(0,0,P,C,O,B),"right"===O?n+=M:n-=P+M,o-=C/2}}return n=f(0,m(n,g-P)),o=f(0,m(o,x-C)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(f(0,n-20),f(0,o-20)),this.transEx(n,o,N/2,!1)):this.transEx(n,o,N,!1),0===N&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:P,h:C}}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:tr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){jt(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let _=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":_=_.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case"bottom":_=_.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case"left":_=_.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case"right":_=_.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c="bottom"===r,d=c?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(c?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(_)}}Ih.CLASS_NAME="rct-tooltip";class zh extends Jt{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new Ih(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class Hh extends ht{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDestroy(){this._dom.remove(),this._dom=null,super._doDestroy()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,s=Rt.isHoverAt(e),i=(this._model=t).options;return Rt.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.width)?i.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=F(i.width),isNaN(i.height)?e.style.height="":e.style.height=F(i.height),"custom"===i.hintMode?(i.hint?e.dataset.hint=i.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.hint||""),i.imageUrl?Rt.setStyles(this._img,{display:"",width:$(i.imageWidth),height:$(i.imageHeight)}):Rt.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(nt?this._hovered:s),this._span.textContent=i.text||"",this}layout(t){const e=this._dom,s=e.style,i=this._model.options,r=i.align,n=i.verticalAlign;s.left=$("left"===r?t.x+(i.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(i.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(i.offsetX||0)),s.top=$("top"===n?t.y+(i.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(i.offsetY||0))}pointerEnter(){this._hovered=!0,this.$_setImage(!0)}pointerLeave(){this._hovered=!1,this.$_setImage(!1)}click(){this._model.click()}$_initDom(t){const e=t.createElement("button"),s=t.createElement("div");return e.className="rct-html-button",Rt.setStyles(e,{position:"absolute",textAlign:"center"}),Rt.setStyles(s,{display:nt?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",Rt.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),Rt.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),nt&&Rt.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.appendChild(this._span),e}$_setImage(t){const e=this._model.options;e.imageUrl?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.hoverImageUrl||e.imageUrl})`:this._img.style.backgroundImage=`url(${e.imageUrl})`:this._img.style.backgroundImage=""}}class Gh extends _o{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Rh(t,!1)),this.add(this.subtitleView=new Rh(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):d.setModel(o),o.options.position){case"leftSide":case"left":case"rightSide":case"right":p=f(l,c),u=h+g+_;break;default:p=l+g+c,u=f(u,h+_)}return p>0&&(p+=this.titleView.visible?y(n.options.gap,0):y(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===o.alignBase?t.wChart:t.wPlot:0;let l=this._wTitle>t.wPlot||i&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===o.alignBase?0:t.xPlot;if(a>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},c=()=>{const e=f(this._hTitle,this._hSub);g=f(g,g+t(i,e,this._hTitle)),x=f(x,x+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(m=f(m,m+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=m;break;case"right":b=m+this._wTitle-this._wSub;break;default:b=m+(this._wTitle-this._wSub)/2}else b=f(b,b+d(r,h,this._wSub))},p=y(o.titleGap,0);let g=0,m=l,x=0,b=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":m=b+this._wSub+p,c();break;case"rightSide":b=m+this._wTitle+p,c();break;case"right":switch(b=m+this._wTitle+p,o.align){case"center":b=f(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=f(b,_+h-this._wSub)}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":m+=a-this._wTitle,b=m-p-this._wSub,c();break;case"left":switch(m+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=m-p-this._wSub}c();break;case"rightSide":case"right":b+=h-this._wSub,m=b-p-this._wTitle,c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":m+=(a-this._wTitle)/2,b=m-this._wSub-p,c();break;case"left":switch(m+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(m-b-this._wSub)/2;break;case"right":b=m-this._wSub-p}c();break;case"rightSide":m+=(a-this._wTitle)/2,b=m+this._wTitle+p,c();break;case"right":switch(m+=(a-this._wTitle)/2,o.align){case"left":b=m+this._wTitle+p;break;case"center":b+=m+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}}const w=y(n.offset,0),v=y(o.offset,0);0!==w&&(m+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(b+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(b+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(m,g),s.resizeByMeasured().layout().trans(b,x)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,c=a?this._wTitle:this._wSub;let d=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}n.trans(d,0)}}}class jh extends _o{_doInitChildren(t){this.add(this._legendView=new Mh(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class Xh extends _o{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach(((t,e)=>{t.prepare(i[e])})),this.setVis(o.length>0)){const t=o[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach(((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)}))}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}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,o=0;return[this.views].forEach((e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,_+=s.height}})),this.isHorz?_+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=f(n,l),o=f(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach((e=>{if(e){let h=0;e.forEach((t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===Wn.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Wn.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}})),this.isHorz?o+=r+t:a+=n+t}}));const h=i.length>0&&e.chart.body.options.zoomCallback;h&&Promise.resolve().then((()=>{i.forEach((({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof _i?Math.floor(e):e,to:t instanceof _i?Math.floor(s):s})}))}))}}class Yh extends ho{constructor(e){super(e,"rct-credits"),this.add(this._textView=new de(e)),this._textView.anchor=t.TextAnchor.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class Wh extends te{static registerPaneClass(t){this.pane_class=t}constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this._htmlButtons=[],this.add(this._annotationContainer=new te(t,"rct-annotations")),this.add(this._plotContainer=new te(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new bh(t,this));for(const e in Wn){const s=new Xh(t,Wn[e]);this._plotContainer.add(s),this._axisSectionMap[Wn[e]]=s}Wh.pane_class&&this.add(this._paneContainer=new Wh.pane_class(t,this)),this.add(this._titleSectionView=new Gh(t)),this.add(this._legendSectionView=new jh(t)),this.add(this._frontAnnotationContainer=new te(t,"rct-front-annotations")),this.add(this._creditView=new Yh(t)),this.add(this._navigatorView=new vh(t)),this.add(this._historyView=new Lh(t))}_doDestroy(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.destroy(),super._doDestroy()}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){var n,o,a;const h=this._model=e,l=h.isPolar(),_=h._credits,c=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(_.visible)&&(u=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=u.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=u.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=u.height;break;case"right":case"left":p-=u.width}if(this._navigatorView.setVis(d.visible),null===(a=this._paneContainer)||void 0===a?void 0:a.visible)this._paneContainer.measure(t,h._split,p,g,1);else{if(this._navigatorView.visible){const t=h._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1)}if(this._navigatorView.visible){const e=l?this._polarView:this._bodyView;h._navigator._vertical?g=e.mh:p=e.mw,this._navigatorView.measure(t,d,p,g,r)}this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,_=l.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,m=0,f=0,x=0,y=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=m=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=f=h.width+p+c:i-=x=h.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),y=f,b=s-m;const V=this._navigatorView;let A=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.mh-V.model.getGap()-V.model.getGapFar()),r-=A=V.mh));const P=this._legendSectionView;let C,k,L=0,N=0;if(P.visible)switch(P.resizeByMeasured().layout(),L=P.height,N=P.width,a._location){case"top":C=v+g,r-=L;break;case"bottom":r-=L,C=b-L,b-=L;break;case"right":i-=N,k=e-N;break;case"left":i-=N,y+=N,k=0}V.visible&&(b-=A,V.layout().transY(b+V.model.getGap()));let M,E=0,T=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(y,S+v).resize(i,r),this._paneContainer.layout(),E=r,T=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([Wn.LEFT,Wn.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[Wn.TOP,Wn.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[Wn.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),y+=e.mw),(e=t[Wn.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[Wn.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0),b-=e.mh),(e=t[Wn.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0))),V.visible&&V.layout().transX(y);const s={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[Wn.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[Wn.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[Wn.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[Wn.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,T=this._plotWidth-0,y=s.x,b=s.y-this._plotHeight,n.resize(T,E),n.trans(y,b),n.layout(),M=n.getRect(),n._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(h.visible){let t,i;switch(h.layout(),_.verticalAlign){case"top":i=u;break;case"middle":i=(s-h.height)/2+u;break;default:i=m>0?s-m+c:s-h.height-u}switch(_.align){case"left":t=p;break;case"center":t=(e-h.width)/2+p;break;default:t=x>0?e-x+c:e-h.width-p}h.trans(t,i)}if(T+=0,w.visible&&w.layout({xPlot:y,wPlot:T,wChart:e}).trans(0,S),P.visible){const t=a.options,n=t.align,o=t.verticalAlign;if("body"===a._location){let e=+t.offsetX||0;switch(n){case"right":y+=T-N-e;break;case"center":y+=(T-N)/2+e;break;default:y+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=E-L-e;break;case"middle":b+=(E-L)/2+e;break;default:b+=e}}else if(isNaN(C)){const e=+t.offsetY||0;if(y=k,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-L-e;break;default:b=(s-L)/2+e}b+L>s&&(b=(s-L)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-L-e;break;default:b=b+(r-L)/2+e}b+L>s&&(b=(s-L)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=C,"chart"===t.alignBase)switch(n){case"left":y=s;break;case"right":y=e-N-s;break;default:y=(e-N)/2+s}else switch(n){case"left":y+=s;break;case"right":y=y+i-N-s;break;default:y+=(i-N)/2+s}y+N>e&&(y=(e-N)/2),y<0&&(y=0)}P.trans(y,b)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,M),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=i.getTooltipPos(),d=h?r.x+c.x:l+c.x,u=h?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new zh(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new Ih(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new vo(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find((e=>e.dom.contains(t)));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find((e=>e.dom.contains(t)))}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i,r;const n=s,o=this._model&&this.bodyOf(s),a=null==n?void 0:n.classList,h=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let l=this._hoverItem;if(this._hoverItem=null,(null===(i=this._model)||void 0===i?void 0:i.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==o&&t.clearHover()})),o){const i=o.controlToElement(t,e),r=o.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(n)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(n);if(t){const e=t.legend;ot.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof Ci?o.hoverSeries(t):e.options.pointHovering&&t instanceof ii&&o.hoverPoint(t)}))}}if(l instanceof Bs&&!(this._hoverItem instanceof Bs)&&(o.hoverPoint(null),o.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void o.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?o.width:o.height,a=e._isHorz?i.x:i.y,l=r&&s.visible&&!h&&s.flag.visible&&!s.isBar()&&s.getFlag(n,a);if(l){t.showCrosshair(a,l);const r=[];o._seriesViews.forEach((t=>{let s,n=Number.MAX_SAFE_INTEGER;const o=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,a=t instanceof Gr&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-a);h<n&&(n=h,s=t)})),r.push(s)})),s.moved(a,l,r)}else t.hideCrosshiar()}))}else(null===(r=this._model)||void 0===r?void 0:r.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus(),this.$_handleAnnotationHover(s)}pointerLeaved(t,e,s){this.$_clearAnnotationHover()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in Wn){const s=this._axisSectionMap[Wn[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Dh(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach(((e,i)=>{let r=this._htmlButtons[i];r||(r=new Hh(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)}));for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach(((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)}))}}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,this,e,e.getAxes(s,!0),i,r):a.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const o=n[e];r&&o.visible&&o.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[Wn.LEFT].checkWidths(t,s,i),s-=n[Wn.RIGHT].checkWidths(t,s,i),i-=n[Wn.BOTTOM].checkHeights(t,s,i),i-=n[Wn.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,_,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Wn.LEFT||t===Wn.RIGHT?s-=e.mw:t!==Wn.BOTTOM&&t!==Wn.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,_,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Wn.LEFT||t===Wn.RIGHT?s-=e.mw:t!==Wn.BOTTOM&&t!==Wn.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.axesLayouted(l,_,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body.getRadius(s,i),o=2*Math.PI*n,a=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(o,a,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(o,a,!1),this._polarView.measure(t,e._body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)}))}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}var Uh;!function(t){t.EXPORT="$$realchart_export"}(Uh||(Uh={}));class Zh extends Kt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new Zn(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new Wh(t)}_createPointerHandler(){return new kh(this)}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof Ie&&s===Be.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof Zn&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Uh.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_canOverflowRender(){return!1}_doRender(t){var e;const s=this.model,i=s._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.theme,!0),this.setData("palette",i.palette),this.setResizeDelay(i.resizeDelay),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==i.visible)&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_doRenderBackground(t,e,s,r){if(this.model){const s=this.model._chartOptions._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e._exporter.options)}}}class qh{static getVersion(){return Ft.version}static setLicenseKey(t){Ft.code=t}static setLocale(t,e){e&&k(t,e),(t=>{t&&(C=A[P=t.substring(0,2)]),C||(C=A[P="ko"])})(t)}static registerLocale(t,e){k(t,e)}static setDebugging(t){Qt.DEBUGGING=t}static setLogging(t){ot.LOGGING=t}static setAnimatable(t){Kt._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new Zh(t,e);return o.chart.load(i(s)?s:{},r,n),o.chart[Gn]=o,o.chart}static createData(t,e){return new qn(t||{},e)}}class Kh{static empty(){return new Kh}static create(t=0,e=0){return new Kh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class Qh{static empty(){return new Qh}static create(t=0,e=0){return new Qh(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const Jh=qh.getVersion,tl=qh.setDebugging,el=qh.setLogging,sl=qh.setAnimatable,il=qh.configure,rl=qh.createChart,nl=qh.createData,ol=qh.setLicenseKey;t.Annotation=Ie,t.AnnotationView=Lo,t.ArcElement=Ao,t.AreaRangeSeries=Xr,t.AreaRangeSeriesView=va,t.AreaSeries=Hr,t.AreaSeriesGroup=Wr,t.AreaSeriesView=Sa,t.AssetCollection=Le,t.Axis=as,t.AxisBaseLine=dr,t.AxisCollection=hs,t.AxisGrid=Ke,t.AxisItem=Ye,t.AxisLabel=is,t.AxisLine=We,t.AxisScrollBar=rs,t.AxisScrollView=bo,t.AxisSectorLine=os,t.AxisTick=ss,t.AxisTitle=Ue,t.AxisView=vo,t.BarRangeSeries=Sr,t.BarRangeSeriesView=Va,t.BarSeries=Pr,t.BarSeriesBase=Ar,t.BarSeriesGroup=kr,t.BarSeriesGroupBase=Cr,t.BarSeriesPoint=Vr,t.BarSeriesView=Ca,t.BarSeriesViewBase=Pa,t.BasedSeries=Fi,t.BasedSeriesView=ha,t.BellCurveSeries=Zr,t.BellCurveSeriesView=ka,t.Body=Es,t.BodyDepth=Ms,t.BodyView=bh,t.BoxPlotSeries=Kr,t.BoxPlotSeriesView=Na,t.BoxPointElementEx=ia,t.BubbleSeries=Jr,t.BubbleSeriesView=Ea,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=tn,t.CandlestickSeries=sn,t.CandlestickSeriesView=Ba,t.CategoryAxis=_i,t.CategoryAxisGrid=li,t.CategoryAxisLabel=hi,t.CategoryAxisTick=ai,t.Chart=Zn,t.ChartControl=Zh,t.ChartData=qn,t.ChartDataCollection=dt,t.ChartElement=ho,t.ChartItem=Be,t.ChartObject=Un,t.ChartOptions=Yn,t.ChartPointerHandler=kh,t.ChartText=De,t.ChartView=Wh,t.CircelBarPointLabel=rn,t.CircleBarSeries=nn,t.CircleBarSeriesGroup=on,t.CircleBarSeriesView=Da,t.CircleElement=Vo,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=As,t.CircularGaugeGroup=Ps,t.CircularGaugeLabel=Ss,t.ClockGaugeType="clock",t.ClusterableSeries=Ri,t.ClusterableSeriesGroup=ji,t.Color=Dt,t.ConnectableSeries=Li,t.ConstraintSeriesGroup=Gi,t.ContentView=co,t.ContinuousAxis=ur,t.Credits=jn,t.Crosshair=je,t.DataPoint=ii,t.DataPointCollection=ri,t.DataPointLabel=bi,t.Dom=Rt,t.DumbbellSeries=ln,t.DumbbellSeriesView=$a,t.ElementPool=Kn,t.EqualizerSeries=cn,t.EqualizerSeriesView=Ia,t.ErrorBarSeries=dn,t.ErrorBarSeriesView=Ha,t.Exporter=Ts,t.FunnelSeries=mn,t.FunnelSeriesView=ja,t.Gauge=us,t.GaugeBase=ds,t.GaugeGroup=ps,t.GaugeGroupView=Bo,t.GaugeItem=class extends Be{constructor(t){super(t.chart)}},t.GaugeLabel=vs,t.GaugeRangeBand=ws,t.GaugeRangeLabel=bs,t.GaugeScale=ys,t.GaugeView=Mo,t.HeatmapSeriesType="heatmap",t.HistogramSeries=yn,t.HistogramSeriesView=Ya,t.IconedText=Re,t.ImageAnnotation=rr,t.ImageAnnotationView=pa,t.ImageElement=uo,t.LayerElement=te,t.Legend=Os,t.LegendItem=Bs,t.LegendItemView=Nh,t.LegendView=Mh,t.LineElement=Er,t.LinePointLabel=Dr,t.LineSeries=Fr,t.LineSeriesBase=Rr,t.LineSeriesBaseView=ba,t.LineSeriesGroup=Yr,t.LineSeriesPoint=Br,t.LineSeriesView=wa,t.LinearAxis=pr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=In,t.LollipopSeries=vn,t.LollipopSeriesView=Ua,t.LowRangedSeries=zi,t.MarkerSeries=Xi,t.MarkerSeriesPointView=_a,t.MarkerSeriesView=ca,t.NavigatorMask=Wi,t.NavigiatorHandle=Yi,t.ORG_ANGLE=E,t.OhlcSeries=Vn,t.OhlcSeriesView=qa,t.OthersGroup=Bi,t.PI_2=M,t.PaneContainer=class extends te{},t.ParetoSeries=Pn,t.ParetoSeriesView=Ka,t.PathBuilder=Zt,t.PathElement=re,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=En,t.PieSeriesGroup=Tn,t.PieSeriesLabel=Nn,t.PieSeriesText=Ln,t.PieSeriesView=eh,t.Point=Kh,t.PointElement=ta,t.PointHovering=Xn,t.PointLabelLineContainer=Uo,t.PointLabelLineView=Wo,t.PointLabelView=Xo,t.PointViewPool=fa,t.RAD_DEG=B,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=Di,t.RangedSeries=Ii,t.RcAnimation=Xt,t.RcControl=Kt,t.RcElement=Qt,t.RcObject=ht,t.RectElement=Is,t.SVGNS=e,t.ScaleView=class extends ho{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new te(t,"rct-gauge-scale-ticks")),this._ticks=new Kn(this._tickContainer,Er),this.add(this._labelContainer=new te(t,"rct-gauge-scale-tick-labels")),this._labels=new Kn(this._labelContainer,To)}},t.ScatterSeries=On,t.ScatterSeriesView=ih,t.SectionView=_o,t.SectorElement=Co,t.Series=Ci,t.SeriesAnimation=Oo,t.SeriesGroup=Hi,t.SeriesMarker=Ni,t.SeriesNavigator=Ki,t.SeriesView=Jo,t.ShapeAnnotation=nr,t.ShapeAnnotationView=ga,t.Size=Qh,t.SplineSeries=Ir,t.Subtitle=Ji,t.SvgShapes=Fs,t.TextAnnotation=or,t.TextAnnotationView=ma,t.TextElement=de,t.TimeAxis=wr,t.Title=Qi,t.Tooltip=tr,t.TreemapSeriesType="treemap",t.TrendLineArea=ci,t.TrendLineLabel=di,t.Trendline=pi,t.Utils=ot,t.ValueGauge=ms,t.ValueGaugeView=class extends Mo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?xt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==t._prevValue&&(this._ani=new Eo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}},t.VectorSeriesType="vector",t.WaterfallSeries=$n,t.WaterfallSeriesView=rh,t.Widget=ls,t.WidgetSeries=Oi,t.WidgetSeriesConnector=Ei,t.WidgetSeriesLabel=Ti,t.WidgetSeriesPoint=Mi,t.WidgetSeriesView=ua,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=ni,t.absv=x,t.assignObj=_,t.buildValueRanges=J,t.calcPercent=Y,t.configure=il,t.copyObj=t=>t&&_({},t),t.cos=u,t.createChart=rl,t.createData=nl,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=Me,t.fixnum=D,t.getVersion=Jh,t.incv=S,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=nt,t.isNumber=h,t.isObject=i,t.isString=o,t.maxv=f,t.minv=m,t.parsePercentSize=j,t.pickNum=y,t.pickProp=w,t.pickProp3=v,t.pixel=$,t.rectToSize=Jn,t.setAnimatable=sl,t.setDebugging=tl,t.setLicenseKey=ol,t.setLogging=el,t.sin=p,t.toStr=function(t){return null==t?null:String(t)}}));
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",s=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},h=function(t){return"number"==typeof t},l=function(t){return"boolean"==typeof t},_=Object.assign,c=Math.floor,d=Math.ceil,u=Math.cos,p=Math.sin,g=Math.log10,m=Math.min,f=Math.max,x=Math.abs,y=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},w=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},S=(t,e,s)=>t+(e-t)*s,V=function(t){return"function"==typeof t?t:null},A={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 P="ko",C=A[P]||A[P="ko"];const k=(t,e)=>{t&&i(e)&&(C=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},L=void 0,N=Math.PI,M=2*N,E=-N/2,T=2*N/360,B=360/N/2,O="%".charCodeAt(0);function D(t){return parseFloat(t.toPrecision(12))}function R(t){return Math.floor(1e6*t)/1e6}function $(t){return t+"px"}function F(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function I(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function H(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function j(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===O?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;Q(C.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function X(t,e){return j(t,!0)||j(e,!1)}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Y="fill",U="stroke",Z={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"},q=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};class K extends Error{}const Q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},J=function(t,e,s,n=!0,a=!0,h=!1,l){let c,d;if(n&&(e=-Number.MAX_VALUE,s=Number.MAX_VALUE),r(t))c=[],t.forEach((t=>{if(i(t)&&o(t.color)){const i={fromValue:y(t.fromValue,d?d.toValue:e),toValue:y(t.toValue,s),color:t.color,style:t.style?_({},t.style):L};i.fromValue<i.toValue&&(c.push(i),d=i)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),a&&c.forEach((t=>{t.fromValue=f(t.fromValue,e),t.toValue=m(t.toValue,s)}));else if(i(t)&&r(t.colors)&&t.colors.length>0){const i=t.colors,n=r(t.styles)?t.styles:null;if(c=[],r(t.steps)&&t.steps.length>0){const o=r(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),s>o[o.length-1]&&o.push(s);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:i[m(t,i.length-1)],style:n?n[m(t,n.length-1)]:L})}else{let r=y(t.fromValue,e);const o=y(t.toValue,s),a=(o-r)/i.length;let h=0;for(;r<o;)c.push({fromValue:r,toValue:r+=a,color:i[m(h,i.length-1)],style:n?n[m(h,n.length-1)]:L}),h++}}if(h&&c&&c.length>0){let t=0,i=e;for(;t<c.length;)c[t].fromValue>i&&c.splice(t,0,{fromValue:i,toValue:c[t].fromValue,color:l}),i=c[t].toValue,t++;c[t-1].toValue<s&&c.push({fromValue:c[t-1].toValue,toValue:s,color:l})}return c},tt="shuffle",et="random",st="vertical-lr",it="vertical-rl",rt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const nt="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class ot{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&&ot.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(m(s,ot.month_days[ot.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(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?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&&!r(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&&!r(t))return _({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(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(r(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 r(t)?t:null!=t?[t]:null}static copyArray(t){return r(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()-rt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=f(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(r(t)){const e=[];let s=-1/0;return t.forEach(((i,n)=>{r(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||n!==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 isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=this.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(),ot.log(t,+new Date-s+"ms")}static clamp(t,e,s){return f(e,m(s,t))}static makeIntArray(t,e){const s=new Array(f(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 isAnimation(t){return"[object Animation]"===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=x(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}static diffAngle(t,e){const s=x(t-e);return m(s,M-s)}}ot.LOGGING=!1,ot.week_days=["일","월","화","수","목","금","토"],ot.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ot.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]],ot.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let at=0;class ht{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(at++))}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 lt extends ht{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const _t=function(t){return t&&"object"==typeof t};class ct extends lt{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),r(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=r(e)?e.slice():o(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(r(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else _t(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&Q(C.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class dt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let i;r(s)?i=new ct({},s):_t(s)&&r(s.values)&&(i=new ct(s.options,s.values)),this._map[e]=i}}}const ut="0".charCodeAt(0),pt="#".charCodeAt(0),gt=",".charCodeAt(0),mt="s".charCodeAt(0),ft="a".charCodeAt(0);class xt{static getFormatter(t){let e=xt.Formatters[t];return e||(xt.Formatters[t]=e=new xt(t)),e}static get Default(){return xt.getFormatter(xt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===ut;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===pt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===ut;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===gt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===mt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}xt.DEFAULT_FORMAT="",xt.Formatters={};const yt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],bt=[".","/","-",":"],wt="Z".charCodeAt(0),vt="z".charCodeAt(0),St="A".charCodeAt(0),Vt="a".charCodeAt(0),At="y".charCodeAt(0),Pt="M".charCodeAt(0),Ct="m".charCodeAt(0),kt="W".charCodeAt(0),Lt="w".charCodeAt(0),Nt="d".charCodeAt(0),Mt="H".charCodeAt(0),Et="h".charCodeAt(0),Tt="S".charCodeAt(0),Bt="s".charCodeAt(0);class Ot{static getFormatter(t){let e=Ot.Formatters[t];return e||(Ot.Formatters[t]=e=new Ot(t)),e}static get Default(){return Ot.getFormatter(C.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||C.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var o=s[r],a=o.length;switch(o.charCodeAt(0)){case At:i+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case Pt:i+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case Nt:i+=a>1?z(t.getDate()):t.getDate();break;case kt:i+=a>1?z(ot.weekOfYear(t,e)+1):ot.weekOfMonth(t,e,!0)+1;break;case Lt:i+=a>1?ot.long_week_days[t.getDay()]:ot.week_days[t.getDay()];break;case Mt:i+=a>1?z(t.getHours()):t.getHours();break;case Et:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?z(e):e}else i+=a>1?z(t.getHours()):t.getHours();break;case Ct:i+=a>1?z(t.getMinutes()):t.getMinutes();break;case Bt:i+=a>1?z(t.getSeconds()):t.getSeconds();break;case Vt:case St:t.getHours()<12?i+=C.am:i+=C.pm;break;case Tt:let s=t.getMilliseconds();i+=3==a?H(s):2==a?z(s):s.toString().substring(0,a);break;default:i+=o}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(bt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),yt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=St&&e<=wt||e>=Vt&&e<=vt)&&Q(C.invalidDateFormat,t)}e.push(n)}if(r<i&&ot.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&ot.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||C.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Ot.Formatters={};class Dt{static isBright(t){return new Dt(t).isBright()}static getContrast(t,e,s){return new Dt(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Dt(t),r=new Dt(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return nt?new Dt(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(ot.startsWith(t,"rgb(")&&ot.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):ot.startsWith(t,"rgba(")&&ot.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):ot.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 Dt(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}}Dt.BLACK="#000",Dt.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class Rt{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 setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}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}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:Rt.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(t,s){const i=t.createElementNS(e,"clipPath");return i.id=s,i.append(t.createElementNS(e,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(t){return Rt.isElement(t)&&t.namespaceURI===e}static isSVGClipPathElement(t){return Rt.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var $t;Rt.instanceOf=function(t,e){return Rt.isElement(t)&&t.tagName===e.toUpperCase()},Rt.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}($t||($t={}));const Ft={name:"RealChart",version:"1.4.14",license:"enterprise",code:null};class It{static decode(t){const e=It.CHARS,s=It.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}It.PAD="=",It.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class zt{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=zt.xor,i=zt.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=zt.xor,i=zt.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=zt.kb,i=zt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*zt.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=zt._decryptBlock;let i=zt._init(e),r=[],n=It.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*zt.POW24|n[a+1]*zt.POW16|n[a+2]*zt.POW8|n[a+3],h.right=n[a+4]*zt.POW24|n[a+5]*zt.POW16|n[a+6]*zt.POW8|n[a+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}zt.POW2=Math.pow(2,2),zt.POW3=Math.pow(2,3),zt.POW4=Math.pow(2,4),zt.POW8=Math.pow(2,8),zt.POW16=Math.pow(2,16),zt.POW24=Math.pow(2,24),zt.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class Ht{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=zt.decrypt(t,"dkdl"+this._getLDKey(zt.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}const Gt={linear:t=>t,inOutSine:t=>-(u(N*t)-1)/2},jt=function(t,e,s,i,r,n){const o=G(e,null!=s?s:"initial"),a=G(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Xt{constructor(){this.delay=0,this.duration=Xt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=m(1,f(0,D(s/this.duration)));this._easing&&(i=this._easing(i)),this._rate=i,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(i,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{s>=this.duration?this._stop(!1):!this._started||isFinite(this.duration)&&!this._timer||(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return this.endHandler||(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}cancel(){this._stop(!0)}rate(){return this._rate||0}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=y(t,Xt.DURATION),this.delay=e||0,this._easing=Gt[s],this._doStart(),this._started=this._prev=+new Date,isFinite(this.duration)&&(this._timer=setTimeout((()=>this._stop(!1)),1.2*this.duration)),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Xt.DURATION=700,Xt.SHORT_DURATION=300;class Wt extends Xt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const Yt=function(t){return new Wt(t).start()},Ut=function(t){return isNaN(t)?0:t};class Zt{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}reset(t,e){return this._path=[],this.move(t,e),this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}push(...t){return t.forEach((t=>{h(t)||o(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return h(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return h(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return h(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return h(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(h(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Ut(t[e]),Ut(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Ut(t[e].x),Ut(t[e].y));return this}polygon(...t){return h(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${2*-s} 0`),this}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},_=Math.sqrt(h.x*h.x+h.y*h.y);if(0===_)return void this.line(t[s].px,t[s].py);h.x/=_,h.y/=_;let c=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,_=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=_,h.y/=_,h.x<a.x?(l.x=a.x-h.x,l.y=a.y-h.y):(l.x=h.x-a.x,l.y=h.y-a.y);const e=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=e,l.y/=e,a.y*h.y>=0&&(l={x:1,y:0}),n.x=-l.x*c*r,n.y=-l.y*c*r;const s=d+o.x,p=u+o.y,g=t[i].px+n.x,m=t[i].py+n.y;this.curve(s,p,g,m,t[i].px,t[i].py),c=t[i+1].px-t[i].px,o.x=l.x*c*r,o.y=l.y*c*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,_=n.py-(o.py-s.py)*i;this.curve(a,h,l,_,n.px,n.py)}}}const qt={position:"relative",width:"100%",height:"100%",boxSizing:"border-box","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"};class Kt extends ht{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=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=Ft.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=Ht.decrypt(e);if("RealChart"!==i.name||"RealChart"!==Ft.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Ft.license!=$t.Developer&&!Ht.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values($t).includes(n))throw new Error(s);if(Ft.license=i.lic,n==$t.Evaluation||n==$t.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&Rt.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Kt.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),Rt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}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}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){I(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))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){Rt.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(Qt.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(e,"clipPath")).forEach((t=>t.remove()))}clearTemporaryDefs(){this.$_clearDefs(Qt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),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){return this.addClip(new ie(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new oe(this.doc()))}clipDonut(){return this.addClip(new ae(this.doc()))}clipPath(){return this.addClip(new ne(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(t))for(const e of Array.from(this._defs.children))if(Rt.isElement(e)&&e.id===t){t=e;break}Rt.isElement(t)&&t.parentNode===this._defs&&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}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_setTesting(){this._testing=!0,Qt.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,s,i){if(this._inited)return;const r=t.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof r.HTMLDivElement||Q(C.invalidOuterDiv,s),t=this._container.ownerDocument;const n=this._dom=t.createElement("div");_(n.style,qt),n.className=i,this._container.appendChild(n);const o=this._svg=t.createElementNS(e,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=t.createElement("desc");a.textContent="Created by RealChart v"+Ft.version,o.appendChild(a);const h=this._defs=t.createElementNS(e,"defs");this._initDefs(t,h),o.appendChild(h),n.appendChild(o),this._root=new ee(this),o.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),n.appendChild(this._tester),nt&&(this._canvas=t.createElement("canvas"))}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Kt.SHADOW_FILTER);const r=t.createElementNS(e,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=t.createElementNS(e,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=t.createElementNS(e,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=t.createElementNS(e,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=t.createElementNS(e,"feMerge"),l=t.createElementNS(e,"feMergeNode"),_=t.createElementNS(e,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_canOverflowRender(){return!1}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{ot.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,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=$(s),r.style.height=$(i)),_(this._htmlRoot.style,{left:$(e.left-t.left),top:$(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),_(n.style,qt),this._doRenderBackground(n,this._root,s,i);const o=this._padding=Rt.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:s-o.left-o.right,height:i-o.top-o.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),ot.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{i&&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)}}Kt.CLASS_NAME="rct-control",Kt.SHADOW_FILTER="rr-chart-shadow-filter",Kt._animatable=!0;class Qt extends ht{constructor(t,s,i=L){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get win(){return this._dom.ownerDocument.defaultView}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,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",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,s){const i=t.createElementNS(e,s);return this._dom.appendChild(i),i}insertElement(t,s,i){const r=t.createElementNS(e,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return I(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(){let t=this._dom.getBBox();return nt&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return nt&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),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._ani instanceof Wt||!!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,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=ot.isValidNum(t)?t:this._tx,e=ot.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)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=ot.isValidNum(t)?t:this._tx,e=ot.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",(()=>{this.$_cleanMove(r,i)})),r.addEventListener("cancel",(()=>{this.$_cleanMove(r,i)}))):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=ot.isValidNum(t)?t:this._tx,e=ot.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})),a.addEventListener("cancel",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}))):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&ot.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ot.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")||"",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(q(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(q(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(q(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(o(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(q(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){o(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this.addClass(t):i(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){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,w(e,""))}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)}stopAni(){return this._ani&&(this._ani.cancel(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Yt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:y(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=Yt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(0,t.from*(1-e)),!0),endHandler:(t,e)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!e&&this.setVis(!1)},from:y(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}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(Qt.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 Qt.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=[];(ot.isValidNum(e)||ot.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+ot.pick(this._originX,t.getAttribute("x"),0)+" "+ot.pick(this._originY,t.getAttribute("y")||0)+")"),ot.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=ot.getNumber(this._scaleX,1),n=ot.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}Qt.DEBUGGING=!1,Qt.TESTING=!1,Qt.ASSET_KEY="_asset_",Qt.CLIP_KEY="_clip_",Qt.TEMP_KEY="_temp_";class Jt extends ht{constructor(t,s,i=!1){super(),this._control=s,this._dom=t.createElement("div"),i&&(this._svg=t.createElementNS(e,"svg"),Rt.setStyles(this._svg,{width:"100%",height:"100%",boxSizing:"border-box",overflow:"visible"}),this._dom.appendChild(this._svg)),this._doInitDom(this._dom)}_doInitDom(t){t.style.position="absolute"}_doDestroy(){this._control=null,this._dom.remove()}get control(){return this._control}get dom(){return this._dom}addSvg(t){return t&&this._svg.appendChild(t.dom),t}setBounds(t,e,s,i){return Rt.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class te extends Qt{constructor(t,e){super(t,e,"g")}}class ee extends Qt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class se extends Qt{constructor(t){super(t,L,"clipPath");const e=this._id=ot.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ie extends se{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Qt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}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 re extends Qt{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class ne extends se{constructor(t){super(t),this._path=new re(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class oe extends se{constructor(t){super(t),this.add(this._circle=new Qt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class ae extends se{constructor(t){super(t),this.add(this._donut=new re(t))}setDonut(t,e,s,i){this._donut.setPath((new Zt).donut(t,e,s,i).end())}}class he{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._hideFeedback()}finally{this._doCanceled()}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}var le,_e,ce;t.TextAnchor=void 0,(le=t.TextAnchor||(t.TextAnchor={})).START="start",le.MIDDLE="middle",le.END="end",t.TextLayout=void 0,(_e=t.TextLayout||(t.TextLayout={})).TOP="top",_e.MIDDLE="middle",_e.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ce||(ce={}));class de extends Qt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=ce.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.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(e){const s=this.getBBox(),i=this.getAscent(isNaN(e)?s.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(i/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(i)}this.y=r}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=f(0,t),(e=m(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(Dt.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}}const ue="$_TH",pe="$_TW";class ge{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?xt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(ot.isDate(n)){const t=s[3]?Ot.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),L),0===this._literals[2].length&&(this._literals[2]=L)}else this._literals.push(r,n,L,L);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class me extends ge{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class fe extends me{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const xe={t:class extends me{tag(){return"</t>"}},b:class extends me{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends me{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:fe};class ye{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new ge).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in xe){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new xe[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const be=/<br.*?>|\r\n|\n/;class we{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,s,r,n,o){if(this._isVertical)return void this.buildVertical(t,s,r,n,o);const a=t.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[],d=[];t.clearDom(),n=n||t;const u=t.getStyle("writing-mode"),p=this._vertical=u===st||u===it;for(let s=0;s<_;s++){const r=l[s];let u=0,g=0,m=null;for(let[h,l]of r.words.entries()){const c=0===s&&0===h,d=s===_-1&&h===r.words.length-1,x=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";x.textContent=e+(x.textContent||"")+s}const y=x.getBBox();if(x[pe]=y.width,x[ue]=y.height,p?(u=f(u,x[pe]),g+=x[ue]):(u+=x[pe],g=f(g,x[ue])),m||(m=x),l instanceof fe){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(x),t.appendDom(s)}}d.push(m),r[ue]=g*h,r[pe]=u*h,c.push(0==s?r[pe]/2:r[pe])}if(_>0){let e=l[0];for(let s=1;s<d.length;s++)if(d[s]){let i=0,r=0;if(p?null!=d[s-1]&&(i=Math.floor(e[pe]-t.getAscent(e[pe]))+t.getAscent(l[s][pe])):r=e[ue]-t.getAscent(e[ue])+t.getAscent(l[s][ue]),null==d[0]&&d[s]==d.find((t=>null!=t))){const r=t.insertElement(a,"tspan",d[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[pe]=n.width,r[ue]=e[ue]=n.height,d[0]=r}switch(u){case st:d[s].setAttribute("dx",String(i)),d[s].setAttribute("y","0");break;case it:d[s].setAttribute("dx",String(-i)),d[s].setAttribute("y","0");break;default:d[s].setAttribute("x","0"),d[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rct-annotation"),s=t.getBBox().width,[i]=d,r=i[pe];if(e)i.setAttribute("dx",String(u===it?s-r/2:r/2));else switch(u){case st:i.setAttribute("x",String((s-r)/-2));break;case it:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][ue])}}buildVertical(t,s,r,n,o){const a=t.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[];let d=0;const u=[];t.clearDom(),n=n||t;for(let s=0;s<_;s++){const r=l[s];let p=0,g=0,m=null,x=!1;for(let[h,l]of r.words.entries()){const c=0===s&&0===h,d=s===_-1&&h===r.words.length-1,u=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";u.textContent=e+(u.textContent||"")+s}" "===u.textContent&&(x=!0,u.textContent=".");const y=u.getBBox();if(u[pe]=y.width,u[ue]=y.height,x&&(u.textContent=" ",u[ue]*=.6,x=!1),p+=u[pe],g=f(g,u[ue]),m||(m=u),l instanceof fe){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(u),t.appendDom(s)}}u.push(m),r[ue]=g*h,r[pe]=p*h,d=f(p,d),c.push(0==s?r[pe]/2:r[pe])}if(_>0){let e=l[0];u[0].setAttribute("x",String((d-u[0].getBBox().width)/2));for(let s=1;s<u.length;s++)u[s]&&(u[s].setAttribute("x",String((d-u[s].getBBox().width)/2)),u[s].setAttribute("dy",String(e[ue]-t.getAscent(e[ue])+t.getAscent(l[s][ue]))),e=l[s]);t.layoutText(l[0][ue])}}layout(e,s,i,r,n){const o=e.getBBox();let a=0,h=0;if(this._vertical)switch(a=n.left+(i-n.left-n.right-o.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(i-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(be);for(let t of s)e.push((new ye).parse(t))}}}class ve{constructor(t){this.source=t}hasDef(){return!0}}class Se extends ve{_setStops(t,s){s.setAttribute("id",this.source.id);const i=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=r(i)?[...i]:[i,"white"],a=r(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(t,s,i,r,n){const o=t.createElementNS(e,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(t,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ve extends Se{getEelement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}Ve.TYPE="lineargradient";class Ae extends Se{getEelement(t,s){const i=t.createElementNS(e,"radialGradient");return I(s.cx)||i.setAttribute("cx",s.cx),I(s.cy)||i.setAttribute("cy",s.cy),I(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}Ae.TYPE="radialgradient";class Pe extends ve{prepare(){}getEelement(t,s){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,l,c,d=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+s.pattern>=0){const t=Pe.STOCK[+s.pattern%Pe.STOCK.length];a=t.path,h=t.style,d=!t.fill,l=t.width||20,c=t.height||20}else o(s.pattern)&&(a=s.pattern,l=s.width||s.height||20,c=s.height||s.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(c)),n.setAttribute("d",a),h&&_(n.style,h),s.style&&_(n.style,s.style),d&&(n.style.fill="none");let u=s.backgroundStyle;if(o(u)||i(u)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=o(u)?u:u.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(c))}return r.append(n),r}}Pe.TYPE="pattern",Pe.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class Ce extends ve{prepare(){const t=this.source;this._colors=r(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&ot.shuffle(this._colors),this._index=0)}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=r(e.colors)?e.colors:[]}}Ce.TYPE="colors";class ke extends ve{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||ke.SIZE,height:e.height||e.width||ke.SIZE})}}ke.TYPE="images",ke.SIZE=20;class Le{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(Qt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Pe.TYPE:r(t.colors)?e=Ce.TYPE:r(t.images)&&(e=ke.TYPE)),e)switch(e.toLowerCase()){case Ve.TYPE:return new Ve(t);case Ae.TYPE:return new Ae(t);case Pe.TYPE:return new Pe(t);case Ce.TYPE:return new Ce(t);case ke.TYPE:return new ke(t)}}}}let Ne=0;const Me=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},Ee=["__proto__","constructor","prototype"],Te=function(t,e){const n=i(t)?t:{};for(const t in e)if(s.call(e,t)&&!Ee.includes(t)){const s=e[t];r(s)?n[t]=s.slice(0):i(s)?s._obj instanceof ct?n[t]=s:ot.isDate(s)?n[t]=new Date(s):n[t]=Te(n[t],s):n[t]=s}return n};class Be extends ht{constructor(t){super(),this.chart=t,Ne++}init(){const t=this._op=Te({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}_initObject(){return this.init(),this}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(this._config=t,void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t),this}saveOptions(t=!0){const e={};return this._doSave(e,this.constructor.defaults,t),e}$_updateChildren(t){if(this._children)this._children.forEach((e=>t.hasOwnProperty(e)&&this[e].updateOptions(t[e])));else{this._children=[];for(const e in this){const s=this[e];s instanceof Be&&(this._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}$_mergeOptions(t,e){const s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];r(n)?s[t]=n.slice(0):i(n)?n instanceof ct?s[t]=n:n._obj instanceof ct?s[t]=n._obj:this[t]instanceof Be?ot.isDate(n)&&(s[t]=new Date(n)):s[t]=this.$_mergeOptions(s[t],n):s[t]=n}}updateOptions(t,e=!0){const s=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(s,t),this.$_applyOptions(s),i(t)&&this.$_updateChildren(t),e&&this._changed(),this}updateOption(t,e,s=!0,i=!1){if(this[t]instanceof Be)this[t].updateOptions(e);else{const r=this._op;(i||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof Be?this[t]._doSetSimple(!l(i)||!i):(s[t]=!l(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Be)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var s;if(t){const i=t._op=Te({},t.constructor.defaults);return t.$_applyOptions(i),null===(s=t._children)||void 0===s||s.forEach((s=>{i[s]=e(t[s])})),i}};return e(this),t&&this._changed(),this}setStyle(t,e,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==e&&""!==e||(e=void 0),void 0===e?r&&s.call(r,t)&&(delete r[t],n=!0):r&&r[t]==e||(r||(r=this._style=this._op.style={}),r[t]=String(e),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,s=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),i(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),s&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const s in e)if(e.hasOwnProperty(s)){let n=e[s];this._doLoadProp(s,n)||(this[s]instanceof Be?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):i(n)?n._obj instanceof ct?t[s]=n._obj:ot.isDate(n)?t[s]=new Date(n):t[s]=_({},n):t[s]=n)}}_doSave(t,e,s){const i=this._op;for(const n in i)if(i.hasOwnProperty(n))if(s&&this[n]instanceof Be)t[n]=this[n].saveOptions(!0);else{const s=i[n];r(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(l(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=j(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Be.REFRESHED="refreshed",Be.defaults={visible:!0};class Oe{constructor(t){this._items=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}items(){return this._items.slice(0)}_internalItems(){return this._items}updateOptions(t,e){}}class De extends Be{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=y(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?xt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new we),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(ot.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=ot.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=o(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}De.defaults=Me(Be.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Re extends De{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof ke&&(this._images=e)}this._root=this._op.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2),r=Number.isFinite(+i)?+i:i;return s instanceof ke?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Re.defaults=Me(De.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class $e extends Be{}const Fe={};class Ie extends Be{static register(...t){t.forEach((t=>{Fe[t.type]=t}))}constructor(t,e){super(t),this.body=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}needClip(){return!0!==this._op.noClip}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted(),i=this._op;let r,n;if(this.body){const o=+i.x1,a=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const i=this.chart.getAxisOf(this,!0);s?this._y=e-i.getPos(e,o):this._x=i.getPos(t,o),isNaN(a)||(s?n=this._h=e-i.getPos(e,a)-this._y:r=this._w=i.getPos(t,a)-this._x)}if(!isNaN(h)){const i=this.chart.getAxisOf(this,!1);s?this._x=i.getPos(t,h):this._y=e-i.getPos(e,h),isNaN(l)||(s?r=this._w=i.getPos(t,l)-this._x:n=this._h=e-i.getPos(e,l)-this._y)}}return isNaN(r)?r=W(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=W(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this._op.align){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this._op.verticalAlign){case"middle":l+=(r-o)/2-a.y;break;case"bottom":l+=r-a.y-o;break;default:l+=a.y}else a=a||this.getOffset(n,o),l=this._y+a.y;return{x:h,y:l}}refresh(){this._changed(Be.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,this._row=isNaN(t.row)?NaN:t.row|0,this._col=isNaN(t.col)?NaN:t.col|0,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}Ie.defaults=Me(Be.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class ze extends Oe{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row,r=s.options.col;return t===i&&e===r}))}getAnnotation(t){const e=this._map[t];if(e instanceof Ie)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(s,t,i,e?this.owner:void 0))})):i(t)&&n.push(this.$_loadItem(s,t,0,e?this.owner:void 0)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotation=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):L}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,i);return a.init(),a.index=s,a._load(e),a}}class He extends Xt{constructor(t,e,s,i){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}getPos(t,e){const s=this._axis,i=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=s._vlen;if(i<=0)return t;if(i>=r)o=i<=0?a:a+a*(i-r)/i*(1-n),t=t*o/a;else{o=a+a*(r-i)/r*(1-n),t=t*a/o}return t+this._offset*(o/i)*(1-n)*(e?-1:1)}_doUpdate(t){return this.$_calcRange(t),this._axis._changed(),!0}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const s=this._axis.axisMin(),i=this._axis.axisMax();this._axisLen=i-s,this._offset=s-e}}class Ge extends Be{}Ge.defaults=Me(Be.defaults,{minWidth:50});class je extends Be{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Ge(this.axis.chart)).init(),this._args={chart:void 0,axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this._op.type}getFlag(t,e){const s=this.axis.axisValueAt(t,e);return s instanceof this.chart.win.Date?Ot.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):xt.getFormatter(this._op.numberFormat).toStr(s)}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}je.defaults=Me(Be.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Xe={};class We extends Be{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ye extends We{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ye.defaults=Me(We.defaults,{visible:void 0});class Ue extends We{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return nt?"vertical"===e?0:"opposite"===this.axis.options.position?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.options.position?90:270}return this._rotation}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}Ue.defaults=Me(We.defaults,{align:"middle",offset:0,gap:5});class Ze extends We{_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ze.defaults=Me(We.defaults,{position:"end",gap:2});class qe extends We{getRows(){const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[];if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this._op.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let o=1;o<r.length;o++,n++)e[n%s]&&i.push({axis:t,from:r[o-1].value,to:r[o].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doSetSimple(t){return o(t)?(this._op.colors=[t,null],!0):r(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Ke extends We{_doInit(t){t.rows=(this._rows=new qe(this.axis)).init()}get rows(){return this._rows}_isVisible(){return this.axis._isPolar?!1!==this._op.visible:null==this._op.visible?!this.axis._isX:this._op.visible}}Ke.defaults=Me(We.defaults,{visible:void 0,depthVisible:void 0});class Qe extends Re{getDefaultIconPos(){return"left"}}Qe.defaults=Me(Re.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Je extends We{_doInit(t){t.label=(this._label=new Qe(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(r(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(r(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}Je.defaults=Me(We.defaults,{front:!1,zindex:0});class ts extends Je{}class es extends Je{}class ss extends We{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return ot.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),isFinite(this._op.length)?this._length=this._op.length:this._length=this.axis.label._inside?0:ss.DEF_LENGTH,this._gap=this._op.gap||0}}ss.DEF_LENGTH=7,ss.defaults=Me(We.defaults,{visible:!1,gap:3});class is extends Re{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?w(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?w(i.firstText,i.text):r==e-1?w(i.lastText,i.text):i.text}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}_getText(t,e,s,i){return o(t)?t:this._getNumberText(e,s,i)||e}}is.defaults=Me(Re.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class rs extends We{getThickness(){return Math.max(0,this._op.thickness)}getMinThumbSize(){return Math.max(0,this._op.minThumbSize)}getGap(){return Math.max(0,this._op.gap)}getGapFar(){return Math.max(0,this._op.gapFar)}}rs.defaults=Me(We.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class ns{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}clamp(t,e=!0){return e?ot.clamp(t,this.min,this.max):ot.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class os extends Ye{}class as extends Be{static register(...t){t.forEach((t=>{Xe[t.type]=t,t.subtype&&(Xe[t.subtype]=t)}))}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){t.title=(this._title=new Ue(this)).init(),t.unitLabel=(this._unitLabel=new Ze(this)).init(),t.line=(this._line=new Ye(this)).init(),t.sectorLine=(this._sectorLine=new os(this)).init(),t.tick=(this._tick=this._createTickModel()).init(),t.label=(this._label=this._createLabel()).init(),t.grid=(this._grid=this._createGrid()).init(),t.crosshair=(this._crosshair=new je(this)).init(),t.scrollBar=(this._scrollBar=new rs(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}get title(){return this._title}get unitLabel(){return this._unitLabel}get line(){return this._line}get sectorLine(){return this._sectorLine}get tick(){return this._tick}get label(){return this._label}get grid(){return this._grid}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get xy(){return this._isX?"x":"y"}isEmpty(){return this._isEmpty}_checkEmpty(){if(this._series.length>0)for(const t of this._series)if(!t.isEmpty(!0))return!1;return!0}checkVisible(){return!0===this._op.visible||!1!==this._op.visible&&!this._isEmpty}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}valueMin(){return this._min}valueMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return E+T*this._op.startAngle}getTotalAngle(){return T*this._op.totalAngle}isArced(){return this._op.totalAngle>0&&this._op.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}labelsVisible(){return this._label.visible&&this._ticks.length>0}getXStart(){return 0}dataToAxis(t){return t}axisToData(t){return t}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[]}getSeries(){const t=[];return this._series.forEach((e=>{t.push(...e.getVisibleSeries())})),t}getConnectableSeries(){const t=[];return this._series.forEach((e=>{e.connectable(this)&&t.push(...e.getVisibleSeries())})),t}collectValues(){const t=this._values=[];this._isX?this._series.forEach((e=>{e.collectValues(this,e.needAxes()?t:null)})):this._series.forEach((e=>{const s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=m(...s),e._yMax=f(...s),t.push(...s))}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this,this._values)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter((t=>t._valid)),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this._op.position;this._isPolar=t.isPolar(),this._isHorz=t.isInverted()?!this._isX:this._isX,this._isBetween=t.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender();const s=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.isSplitted()){const t=[s[0].row];for(let e=1;e<s.length;e++)t.indexOf(s[e].row)<0&&t.push(s[e].row);t.forEach((t=>{let e=0,i=0;s.forEach((s=>{s.row==t&&s.isClusterable()&&(e+=y(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=y(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=y(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=y(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+ot.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[f(t,this._min),m(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new ns(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return r&&(i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed()),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this._op.reversed,t*this._prevRate)}checkExtents(t,e){var s;null===(s=this._ani)||void 0===s||s.cancel(),this._min===t&&this._max===e||(this._ani=new He(this,t,e,(()=>{this._changed()})))}isAnimating(){return!isNaN(this._aniMin)}_posValue(){const t=this._op.position;return"opposite"===t?-1:"between"===t?0:1}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const e=this,i=this.guides,n=function(t){var s;t!==e._guides&&(e._guides=t,s=r(t)?t:[t],i.length=0,s.forEach((t=>{let s;s="range"===t.type?new es(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ts(e):new es(e),s.init(),s._load(t),i.push(s)})))};super._doApply(t),t.startAngle=y(this._op.startAngle,0),t.totalAngle=f(0,m(360,y(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=y(Math.max(0,t.row|0),0),this._col=y(Math.max(0,t.col|0),0),s.call(t,"guide")?n(t.guide):s.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(m(...t)||0):NaN,max:t.length>0?D(f(...t)||0):NaN}}}as.defaults=Me(Be.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,marginNear:0,marginFar:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class hs extends Oe{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;r(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),this._items.forEach((t=>{t.name&&this._map.set(t.name,t)}))}visibles(){return this._items.filter((t=>t.checkVisible()))}contains(t){return this._items.indexOf(t)>=0}get(t){return o(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,e){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)}))}connect(t){const e=this.isX,s=this._items,i=t.options,r=e?i.xAxis:i.yAxis;let n;if(h(r)&&r>=0&&r<s.length?n=s.find((t=>t._index===r)):o(r)&&(n=s.find((t=>t.options.name===r))),n||(n=s[0]),n&&this.chart.isValidAxis(n))return n._connect(t),this.isX?t.setCol(n.col):t.setRow(n.row),n}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var i;let n=t._getAxisType(e.type);if(!n){let o;if(r(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(I(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(i=t._getSeries().first)||void 0===i?void 0:i.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class ls extends Be{_doPrepareRender(t){}}const _s={},cs={};class ds extends ls{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}getSize(t,e){return{width:W(this._widthDim||this._sizeDim,t,t),height:W(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return W(this._leftDim,t)}getRight(t){return W(this._rightDim,t)}getTop(t){return W(this._topDim,t)}getBottom(t){return W(this._bottomDim,t)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"gauge",this._type())):super._load(t)}_doApply(t){super._doApply(t),this._name=t.name||`Gauge ${this.index+1}`,this._row=y(t.row|0,0),this._col=y(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}ds.defaults=Me(ls.defaults,{size:"100%"});class us extends ds{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{_s[t.type]=t}))}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}us.defaults=Me(ds.defaults,{duration:500});class ps extends ds{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{cs[t.type]=t,cs[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(0)}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),s.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const s=this._gaugesType();r(e)?e.forEach(((e,i)=>this.$_add(us._loadGauge(t,e,s)))):i(e)&&this.$_add(us._loadGauge(t,e,s))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ps.defaults=Me(ds.defaults,{minValue:0});class gs extends Oe{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.row||0,r=s.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof us)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ps)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)})),e._op.gauge=this._gauges.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t._prepareRender()))}$_loadItem(t,e,s){if(0===Object.keys(_s).length&&0===Object.keys(cs).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let i=r(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i||(i=t._getGaugeType(e.type||t.gaugeType)),!i)throw new Error("Invalid gauge type: "+e.type);const n=new i(t);return n.init(),n._load(e),n.index=s,n}}class ms extends us{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),t.label=(this._label=this._createLabel()).init()}get label(){return this._label}getValue(){return f(this._op.minValue,m(this._op.maxValue,y(this._runValue,this._op.value)))}_setValueRate(t){this._runValue=this._prevValue+(this._op.value-this._prevValue)*t}updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this.label.options.animatable?y(this._runValue,this._op.value):this._op.value;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}ms.defaults=Me(us.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class fs extends Be{constructor(t){super(t.chart),this.scale=t}}fs.defaults=Me(Be.defaults,{reversed:!1,length:7});class xs extends Re{getText(t){return ot.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class ys extends Be{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Be(e)).init(),t.tick=(this._tick=new fs(this)).init(),t.label=(this._label=new xs(e)).init()}get line(){return this._line}get tick(){return this._tick}get label(){return this._label}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=y(s,e);const{min:i,max:r}=this._adjustMinMax(m(e,s),f(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(f(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=y(s.options.minValue,t),e=y(s.options.maxValue,e),this._min=m(t,e),this._max=f(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=m(...t)),isNaN(i)&&(i=f(...t)),this._min=m(s,i),this._max=f(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){const i=this._op;let r;return r=Array.isArray(i.steps)?i.steps.slice(0):i.stepCount>0?this._getStepsByCount(i.stepCount,e,s):i.stepInterval>0?this._getStepsByInterval(i.stepInterval,e,s):i.stepPixels>0?this._getStepsByPixels(t,i.stepPixels,e,s):[e,s],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(D(e));for(let e=1;e<t;e++)n.push(D(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,_=0;if(o/=a,h)if(o>h[_]){for(;_<h.length-1;_++)if(o>h[_]&&o<h[_+1]){o=h[++_];break}}else o=h[_];for(o*=a,this._step=o,r.push(D(l=s));;){if(l+=o,l>=i){r.push(D(i));break}r.push(D(l))}return r}}ys.defaults=Me(Be.defaults,{position:"default",stepPixels:48,gap:8});class bs extends Be{}bs.defaults=Me(Be.defaults,{visible:!1});class ws extends Be{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new bs(e)).init(),t.tickLabel=(this._tickLabel=new Be(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?W(this._thicknessDim,t,0):"inside"===this._op.position?t:ws.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=J(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}ws.defaults=Me(Be.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class vs extends De{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}vs.defaults=Me(De.defaults,{animatable:!0});class Ss extends vs{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Ss.defaults=Me(vs.defaults,{offsetX:0,offsetY:0});class Vs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(As.DEF_CENTER),this.setCenterY(As.DEF_CENTER),this.setRadius(As.DEF_RADIUS),this.setInnerRadius(As.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=j(w(t,As.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=j(w(t,As.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=j(w(t,As.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=j(w(t,As.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=j(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=m(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=y(t%360,0),i=f(0,m(360,y(e,360)));this._startRad=E+T*s,this._handRad=T*s,this._sweepRad=T*i}}class As extends ms{_doInit(t){super._doInit(t),this._props=new Vs}get label(){return this._label}getProps(){return this._childProps||this._props}getCenter(t,e){return this._group?this._childProps.getCenter(t,e):this._props.getCenter(t,e)}getExtents(t){return this._group?this._childProps.getExtents(t):this._props.getExtents(t)}labelVisible(){return this._label.visible}_createLabel(){return new Ss(this.chart)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new Vs)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}As.DEF_CENTER="50%",As.DEF_RADIUS="40%",As.DEF_INNER="80%",As.defaults=Me(ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ps extends ps{_doInit(t){this.props=new Vs,t.label=(this._label=new Ss(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this._op.itemGap||0;let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach(((t,e)=>{const n=t._childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s}))}}_doApply(t){super._doApply(t);const e=this.props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}}Ps.defaults=Me(ps.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Cs=class extends Be{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Cs.defaults=Me(Be.defaults,{visible:void 0});class ks extends De{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||ks.DEF_TEXT}}ks.DEF_TEXT="표시할 데이터가 없습니다.",ks.defaults=Me(Be.defaults,{visible:void 0});class Ls extends Be{}Ls.defaults=Me(Be.defaults,{visible:!1});class Ns extends Be{_doInit(t){t.line=(this._line=new Ls(this.chart)).init(),t.endLine=(this._endLine=new Ls(this.chart)).init(),t.gridLine=(this._gridLine=new Ls(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Ns.defaults=Me(Be.defaults,{});class Ms extends Be{_doInit(t){t.xSide=(this._xSide=new Ns(this.chart)).init(),t.ySide=(this._ySide=new Ns(this.chart)).init(),t.orgLine=(this._orgLine=new Ls(this.chart)).init()}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this._op.visible&&this._op.length>=0}_doSetSimple(t){return h(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=m(60,f(30,y(t.angle,45)))}}Ms.defaults=Me(Be.defaults,{visible:!1,length:32,angle:32});class Es extends Be{constructor(t){super(t),this._annotations=new ze(this)}_doInit(t){t.depth=(this._depth=new Ms(this.chart)).init(),t.image=(this._image=new $e(null)).init(),t.emptyView=(this._emptyView=new ks(this.chart)).init(),t.zoomButton=(this._zoomButton=new Cs(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof ds&&this.contains(s)?s:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const s=this._depth.options,i=s.length,r=s.angle,n=d(u(r*T)*i),o=d(p(r*T)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return W(this._radiusDim,m(t,e))}setPolar(t,e){return this._cx=W(this._centerXDim,t),this._cy=W(this._centerYDim,e),this._rd=W(this._radiusDim,m(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd,cyclic:t&&t.options.totalAngle>=360}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const e=this,i=function(t){t!==e._anns&&(e._anns=t,e._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),s.call(t,"annotation")?i(t.annotation):s.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}Es.defaults=Me(Be.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Ts extends Be{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}Ts.defaults=Me(Be.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Bs extends Be{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Os extends ls{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.slice(0)}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}getMarkerSize(){return y(this._op.markerSize,10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map((t=>t.source)):t.source}_isVisible(){return!0===this._op.visible&&this._visItems.length>0||!1!==this._op.visible&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=w(e.location,"bottom"),this._items=this._getLegendSources().map((t=>new Bs(this,t))),e.reversed&&(this._items=this._items.reverse());const s=this._itemMap={},i=this._visItems=[];this._items.forEach((t=>{const e=t.source.legendKey();if(ot.isNotEmpty(e)&&""!==e){const r=s[e];r?r.push(t):(s[e]=[t],i.push(t))}else i.push(t)}))}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var Ds;Os.defaults=Me(ls.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"body",gap:6,itemGap:8,markerVisible:!0,markerSize:10,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0,pointHovering:!0});const Rs=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),$s=.001;class Fs{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static polygon(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const o=i>0,a=o?0:1;return r>0?n>0?(r=m(x(i)/2,s/2,r),n=m(x(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=m(x(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=m(x(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=m(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static isCircled(t){return M-t<$s}static arc(t,e,s,i,r,n,o,a=!1){const h=m(M,x(n-r)),l=this.isCircled(h),_=h>N?1:0,c=o?1:0,d=u(r),g=p(r),f=u(n-=l?c?$s:-.001:0),y=p(n),b=[];return b.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*f,e+i*y),l&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,s,i,r,n,o,a){const h=m(M,x(o-n)),l=this.isCircled(h),_=h>N?1:0,c=a?1:0,d=u(n),g=p(n),f=u(o-=l?c?$s:-.001:0),y=p(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*f,e+i*y),l?v.push("M",t+b*f,e+w*y):v.push("L",t+b*f,e+w*y),r>0&&v.push("A",b,w,0,_,1-c,t+b*d,e+w*g),v.push("Z"),v}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){b.push("M",t,e,"A",s,i,0,c,_,n,o),b.push("L",n,o+r),b.push("A",s,i,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,d=m(M,x(o-n));const g=this.isCircled(d);let f=(n%M+M)%M,y=(o%M+M)%M;const b=[];let w,v,S,V;if(!g&&(_&&f<=N&&y>=0&&y<f||!_&&y<=N&&f>=0&&f<y))c=0,_?(w=t+s*u(n),v=e+i*p(n),S=t+s*u(N),V=e+i*p(N),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(0),v=e+i*p(0),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V)):(w=t+s*u(n),v=e+i*p(n),S=t+s*u(0),V=e+i*p(0),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(N),v=e+i*p(N),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V));else{w=t+s*u(n),v=e+i*p(n),S=t+s*u(o-=g?_?$s:-.001:0),V=e+i*p(o),_?(f=g||f<=M&&!(y>=f&&y<M)?0:f,y=g||y>N&&!(f<=y&&f>N)?N:y):(f=g||f>N&&!(y<=f&&y>N)?N:f,y=g||y<M&&!(f>=y&&f<M)?0:y);const r=t+s*u(f),a=e+i*p(f),d=t+s*u(y-=g?_?$s:-.001:0),m=e+i*p(y);c=x(y-f)>N?1:0,l(r,a,d,m),h&&(h.x1=w,h.y1=v,h.x2=S,h.y2=V)}return b}static arc3dInner(t,e,s,i,r,n,o,a,h){const l=m(M,x(o-n)),_=this.isCircled(l),c=a?1:0,d=t+s*u(n),g=e+i*p(n),f=t+s*u(o-=_?c?$s:-.001:0),y=e+i*p(o),b=l>N?1:0,w=[];return w.push("M",d,g,"A",s,i,0,b,c,f,y),w.push(_?"M":"L",f,y+r),w.push("A",s,i,0,b,1-c,d,g+r),h&&(h.x1=d,h.y1=g,h.x2=f,h.y2=y),w.push("Z"),w}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*p(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,d=c/2,g=[];g.push("M",n+a*u(r),o+h*p(r));for(let t=0;t<5;t++)g.push("L",n+a*u(r),o+h*p(r),"L",n+l*u(r+d),o+_*p(r+d)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Ds[e](0,0,f(2*s,0),f(2*i,0));break;default:r=Ds.circle(s,i,f(m(s,i),0))}t.setPath(r)}}Ds=Fs,Fs._drawers=Object.assign({circle:t=>Ds.circle(0,0,t),none:t=>[]},Ds._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Is extends Qt{static create(t,e,s,i,r,n,o=0){return new Is(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=L,s=L){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 zs extends re{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Fs.box(t,e,s,i)),this}}const Hs="head",Gs="far",js="inside",Xs="none",Ws="near",Ys="displayAll",Us="largestFirst",Zs="hidden",qs="line",Ks="area",Qs="circlebar";let Js=0;const ti="_deleted",ei="_drop",si="_save";class ii{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=Js++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...this}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(r(e.drillDown)||i(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];if(null!=i&&"object"==typeof i)for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[ti]=!0}_isDeleted(){return this[ti]}_setDrop(t){this[ei]=t}_getDrop(){return this[ei]}_setSave(t){this[si]=t}_getSave(){return this[si]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=L}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return _(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[y(s.xField,0)],this.y=e[y(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=v(t._yFielder(e),e.y,e.value),this.color=w(t._colorFielder(e),e.color),this.icon=w(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class ri{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}_internalPoints(){return this._points}get(t){return this._points[t]}pointAt(t,e){function s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find((i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach((t=>{const s=this._points.indexOf(t);s>=0&&(t._setDeleted(),e.push(t),this._points.splice(s,1))})),e}clean(){this._points=this._points.filter((t=>!t[ti]))}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter((t=>t.xValue>=i&&r>=t.xValue)).slice(0):e.filter((t=>t.xValue>i-.5&&r+.5>t.xValue)).slice(0)}return e}}class ni extends ii{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return _(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.y=e[y(s.yField,0+i)],this.z=e[y(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=w(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=S(t.zValue,this.zValue,e)}}class oi extends ii{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[b(s.highField,s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue||0}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e)}}class ai extends ss{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}ai.defaults=Me(ss.defaults,{step:1});class hi extends is{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return r(this.axis.options.categoryField)&&s>0?t.substring(s+this.sep.length):t}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}hi.defaults=Me(is.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class li extends Ke{getPositions(t){const e=t._ani,s=t._pts,i=t.options.reversed,r=t._ticks.length,n=[];if(r>0){const o=Math.max(1,t.tick.options.step||1);if(o>1)for(let t=0,a=1,h=s.length;t<=r&&a<h;t++,a+=o)n.push(e?e.getPos(s[a],i):s[a]);else for(let t=0;t<=r;t++)n.push(e?e.getPos(s[t+1],i):s[t+1])}return n}}class _i extends as{constructor(){super(...arguments),this._weights=new Map,this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}get label(){return this._label}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return this._catMin+e-2;return-1}getCategorySeparator(){return this._op.categorySeparator||"+"}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new ns(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new li(this)}_createTickModel(){return new ai(this)}_createLabel(){return new hi(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=ot.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=m(e,1)*this.getWeight(0)*M/this._catLen),t}_doPrepareRender(){const t=this._op;this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=b(t.minPadding,t.padding,0),this._maxPad=b(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,y(t.categoryPadding,0))))}_adjustMinMax(t,e){const s=this._op;return s.minValue<t&&(t=s.minValue),s.maxValue>e&&(e=s.maxValue),{min:t,max:e}}_doBuildTicks(t,e,s,i){const r=this._label;let n=this._weights;const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:s,max:i}=this._adjustMinMax(t,e);t=Math.floor(s),e=Math.ceil(i)}this._catMin=t,this._catMax=e;let h=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(h,this._tick.options.step||1));let l=0;for(const t of n.values())l+=t;h=this._len=this._minPad+this._maxPad+h-n.size+l;const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=this.getWeight(i);_.push(s/h),_.push((s+this._maxPad)/h)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const s=t+e-1,i=this._categories[s/d-c];this.getWeight(s)<=0||a.push({index:e-1,pos:NaN,value:s,label:r.getTick(e-1,i?i.t:s)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this._op.totalAngle*T;if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/t*e}}else{let t;t="edge"===this._tick.getPosition()?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1];let n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed&&(n=t-n),this._ani?this._ani.getPos(n,this._op.reversed):n}valueAt(t,e){const s=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<s.length-1;t++){const i=s[t],r=s[t+1];if(e>=i&&r>=e){return this._catMin+t-(1-(e-i)/(r-i))}}}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);let i;return i=this._ani?this._ani.getPos(this._pts[s+2],this._op.reversed)-this._ani.getPos(this._pts[s+2-1],this._op.reversed):this._pts[s+2]-this._pts[s+2-1],x(i)}getLabelLength(t,e){const s=Math.floor(e-this._catMin+.5);return s>this._tstep?this._pts[s+2]-this._pts[s+2-this._tstep]:this._pts[s+2+this._tstep-1]-this._pts[s+2-1]}getValue(t){return h(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=m(0,e.min),e.max=f(0,e.max)),e}$_collectCategories(t){const e=this._op,s=e.categories,n=this._categories=[];let a=this._weights;if(a.clear(),r(s)&&s.length>0)this._len=0,s.forEach((t=>{const e=null==t?1:f(y(t.weight,1),0),s=t&&t.icon;let r,o;null==t?o=r=null:i(t)?(r=w(t.name,t.label),o=w(t.label,t.name)):o=r=String(t),this._len+=e,n.push({c:r,t:o,i:s}),a.set(a.size,e)}));else{const s=this.chart.seriesByName(e.categorySeries),i=this.chart.seriesByName(e.weightSeries)||s,h=e.weightField,l=null==i?void 0:i.data,_=e.weightByFrequency;s&&(t=[s]);const c=[];for(const e of t)e.collectCategories(this).forEach((t=>{c.includes(t)||(c.push(t),n.push({c:t,t:t}))}));if(h&&r(l)&&l.length>0){const t=i.getPoints();let e=null;l.forEach(((s,i)=>{var r,n;const l=t.get(i);if(!l)return;const d=l.x,u=f(null!==(r=s[h])&&void 0!==r?r:1,0);if(o(d)){const t=c.indexOf(d);if(-1===t)return void(e=null);if(!a.has(t))return a.set(t,u),e=d,void(this._len+=u);_&&e===d&&(a.set(t,f((null!==(n=a.get(t))&&void 0!==n?n:0)+u,0)),this._len+=u)}else Number.isInteger(d)?(a.has(d)||(a.set(d,u),this._len+=u),e=null):e=null}))}else if(r(t)&&t.length>0){const e=new Set;for(const s of t){const t=s.collectCategories(this),i=t.length;if(0===i)continue;let r=t[0],n=1;for(let s=1;s<i;s++){const i=t[s],o=c.indexOf(r);i!==r?(-1===o||e.has(r)||(e.add(r),a.set(o,_?n:1)),r=i,n=1):n++}e.has(r)||(e.add(r),a.set(c.indexOf(r),_?n:1))}}}this._map={},n.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}_i.type="category",_i.defaults=Me(as.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class ci extends Be{}ci.defaults=Me(Be.defaults,{visible:!1});class di extends Re{getAlign(t,e,s,i){let r=this._op.align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._op.verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._op.align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:di.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:di.OFFSET:e}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=m(1,f(0,y(t.position,1))),t.align="left"===t.align||"center"===t.align||"right"===t.align?t.align:"auto",t.verticalAlign="top"===t.verticalAlign||"middle"===t.verticalAlign||"bottom"===t.verticalAlign?t.verticalAlign:"auto"}}di.OFFSET=4,di.defaults=Me(Be.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class ui extends Be{getRadius(){return f(0,y(this._op.radius,4))}}ui.defaults=Me(Be.defaults,{visible:!1,radius:4});class pi extends Be{constructor(t){super(t.chart),this.owner=t,this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new ci(this.chart)).init(),t.fixedArea=(this._fixedArea=new ci(this.chart)).init(),t.label=(this._label=new di(this.chart)).init(),t.marker=(this._marker=new ui(this.chart)).init()}get variableArea(){return this._variableArea}get fixedArea(){return this._fixedArea}get expression(){return this._expr}get label(){return this._label}get marker(){return this._marker}getLabelDomain(){return this._labelDomain}setRange(t,e,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){const e=this._op,s=e.type,i=this.owner,r=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+e.resolution||5)),n=this._minX>0?0:(this._maxX-this._minX)/r-this._minX,o=this._minY>0?0:(this._maxY-this._minY)/r-this._minY,a=i._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+n,y:t.yValue+o}))).sort(((t,e)=>t.x-e.x)),h=(this["_"+s]||this._linear).call(this,this._formatter,a);if(this._points=[],h&&"function"==typeof h.evaluator){if(a.length>0){const t=a[0].x,i=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=i+r;if("logarithmic"===s||"power"===s){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const l=i-t,_=o-n,c=l>0?Math.ceil(this._res*_/l):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,s=h.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}else if(h&&Array.isArray(h.points))if("movingAverage"===s&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,s=e.backward>0?e.backward:0,i=h.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),s=t/e;if(a){const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}else if(i.length>=2){const t=i[i.length-1],r=i[i.length-2],o=(t.y-r.y)/(t.x-r.x);for(let i=1;i<=e;i++){const e=n.x+s*i,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}}}}else this._points.push(...h.points);this._expr=h&&h.expr,this._points.forEach((t=>{t.x-=n,t.y-=o}))}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=f(0,y(t.forward,0)),t.backward=f(0,y(t.backward,0)),this._formatter=xt.getFormatter(t.numberFormat||"0.####")}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:y(t.y,0)}))),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(x(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,s=0,i=0,r=0,n=0,o=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),o+=t.x*t.y}));const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const s=e.map((t=>({x:t.x,y:t.y}))),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+i);h.push(o),o=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)x(s[t][r])>x(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,a),l=t=>h.reduce(((e,s,i)=>e+s*t**i),0);return{expr:"y = "+(h.map(((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`})).filter((t=>t)).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=f(1,m(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+y(e.y,0)),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var gi;pi.defaults=Me(Be.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const mi={},fi={},xi=/\$\{detail\}/g;class yi extends Be{}yi.defaults=Me(Be.defaults,{visible:!1});class bi extends Re{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ot.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getOffset(){return y(this._op.offset,0)}getDefaultIconPos(){return"top"}getRotation(){return f(-90,m(90,y(this._op.rotation,0)))}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){"auto"===t.position&&(t.position="default"),super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=y(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}gi=bi,bi.OFFSET=4,bi.defaults=Me(Re.defaults,{visible:void 0,position:"default",offset:gi.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});const wi={x:"xValue",y:"yValue",z:"zValue"};class vi extends Xt{constructor(t,e,s){super(),this.series=t,this.point=e,this.delay=s?200:0,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return!this.point._isDeleted()&&(this.point._vr=t,this.series._changed(),!0)}}class Si extends Xt{constructor(t,e,s){super(),this.series=t,this.points=e,s&&(s.cancel(),this._prevAnis=s._prevAnis?[...s._prevAnis,s]:[s],this._prevVrs=new Map,this._prevAnis.forEach((t=>{t.points.forEach((t=>{isNaN(t._vr)||this._prevVrs.set(t,t._vr)}))}))),e.forEach((t=>{t._setDeleted()})),this.duration=t._decayDuration,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),e||(this.series.getPoints().clean(),this.series.$_clearDecay())},this.series.$_setDecay(this)}_doUpdate(t){return this._prevAnis&&this._prevAnis.forEach((e=>{e.points.forEach((e=>{const s=this._prevVrs.get(e);void 0!==s&&(e._vr=s*(1-t))}))})),this.points.forEach((e=>{e._vr=1-t})),this.series._changed(),!0}}class Vi extends Xt{constructor(t,e,s){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach((t=>{this.addPoint(t)})),this._interval=s,this.duration=Number.POSITIVE_INFINITY,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),this.series.$_clearDrop()}}addPoint(t){if(t&&!this._points.includes(t)){const e=this.series._getLabeledPoints().slice();e.sort(((t,e)=>t.xValue-e.xValue)),t.xValue<=e[0].xValue?t._setDrop(-1):t.xValue>=e[e.length-1].xValue&&t._setDrop(1),this._points.push(t),t._vr=0}return this}_doUpdate(t,e){const s=this._points;for(let t=s.length-1;t>=0;t--)s[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(s[t]._vr)||s[t]._vr>=1)&&s.splice(t,1);return 0!==s.length&&(this.series._changed(),!0)}}class Ai extends ii{}const Pi=12;class Ci extends Be{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach((t=>{mi[t.type]=t}))}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new ri(this),this._pointArgs={},this._paletteColors=Array(Pi).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==tt&&ot.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){ot.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){ot.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){ot.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){ot.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){const e=this._op;let s;return e.tooltipDetailCallback&&(this._getPointCallbackArgs(this._pointArgs,t),s=e.tooltipDetailCallback(this._pointArgs)),void 0===s&&(s=e.tooltipDetail||""),s}getTooltipText(t,e){const s=this._op;let i;return s.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),i=s.tooltipCallback(this._pointArgs)),void 0===i&&(i=s.tooltipText,i&&(i=i.replace(xi,this.getTooltipDetail(e)))),i}getTooltipParam(t,e,s){return Ci.getPointTooltipParam(t,e,s)}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}get isWidget(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach((i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)})),s}_getVisiblePoints(){return this._points.getRunPoints(this._xAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}isXY(){return!1}displayName(){return this._op.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e)),this._legendMarker}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return this._op.label||this.name}legendKey(){return this[this._op.legendKey]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}get xMax(){return this._maxX}get xMin(){return this._minX}get yMax(){return this._maxY}get yMin(){return this._minY}get zMax(){return this._maxZ}get zMin(){return this._minZ}canDepth(){return!1}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.options.noClip:this._op.noClip}needClip(t){const e=this._getNoClip(t);return t?!1===e:!0!==e}connectable(t){return!1}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return y(s,t.getXStart())}$_getXStep(t){return v(this._op.xStep,this.chart.chartOptions.options.xStep,1)}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_connect(t){this._xAxisObj=this._group?this._group._xAxisObj:t._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:t._connectSeries(this,!1)}_prepareRender(){this._legended=null,this._calcedColor=void 0,this._dataSourceDirty&&(this._dataSourceChanged(),this._dataSourceDirty=!1),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof _i)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(r(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>o(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>o(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);o(i)&&(i=i.trim()),this._points.forEach(((e,r)=>{let n=t.getValue(e.x);isFinite(n)||(n=s,s=t.incStep(s,i)),e.xValue=n})),e&&this._runPoints.forEach((t=>{!1!==t.visible&&e.push(t.xValue)}))}else{const s=this.hasZ();this._points.forEach(((e,i)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let i=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(i)&&t&&(i=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(s?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),i=e._prev.yValue+(i-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=i,e.isNull=!isFinite(i)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(c)&&!isNaN(e)?_=c=e:e>c?c=e:e<_&&(_=e)}if(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],s=e.map((t=>t.y)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e)),i=e.map((t=>t.x)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e));s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return y(this._op.paddingRate,1)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=J(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=L}))}prepareReferents(t){this._referents&&this._referents.forEach((e=>e.visible&&e.refer(this,t))),this.visible&&!this._visPoints&&(this._visPoints=this._buildVisPoints(this._runPoints))}refer(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPos(t){return this._getLabelDefaultPos(t,t.options.position)}_getLabelDefaultPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelDefaultPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?y(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),bi.OFFSET):this._labelOff}referBy(t){t&&(this._referents?this._referents.indexOf(t)<0&&this._referents.push(t):this._referents=[t])}setPointVisible(t,e){t&&e!==t.visible&&(t.visible=e,this.chart._pointVisibleChanged(this,t))}_preparePointArgs(t){this._pointLabelCallback=V(this._pointLabel.options.textCallback),this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._preparePointArgs(t),(this._argsPoint=e).assignTo(t)),t}getPointText(t,e,s){let i;return n(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(n(this._op.pointStyleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(n(this._pointLabel.options.styleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(n(this._op.onPointClick))return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){n(this._op.onPointHover)&&(t&&this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointHover(t?this._pointArgs:null))}getViewRangeAxis(){return this._op.viewRangeValue||this._defViewRangeValue()}isLabelsVisible(){return this._pointLabel.visible}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.options.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.options.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t,e){return o(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:L}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,s=!0){if(t instanceof ii||(t=this.getPointAt(t)),t){let i=t._prev;return i&&i.ani&&i.ani.cancel(),i=t.updateValues(this,e),i&&s&&this.chart.animatable()&&(i.ani=new vi(this,t,!1),i.ani.start()),this._dataPointsChanged(),!!i}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const s=this._doAddPoint(t);if(s){if(this._points.add(s),e&&this.chart.animatable()&&this._needAddAnimation()){const t=s._prev=s.copy();t.ani=new vi(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}addPoints(t,e=!0){const s=[];return r(t)&&t.forEach((t=>{const e=this._doAddPoint(t);e&&s.push(e)&&this._points.add(e)})),s.length>0&&(e&&this.chart.animatable()&&s.forEach((t=>{const e=t._prev=t.copy();e.ani=new vi(this,t,this._points.count>1),e.ani.start()})),this._dataPointsChanged()),s}_needDecayEffect(){return!1}removePointAt(t,e=!0){const s=this._points.get(t);return this.removePoint(s,e)}removePoint(t,e=!0){if(t instanceof ii||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof ii&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Si(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Vi(this,[t],this._decayDuration)).start(),s=!0)}else this._points.remove(t)&&(s=!0);if(s)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(r(t)){const s=t.map((t=>this._points.get(t))).filter((t=>null!=t));return this.removePoints(s,e)}return 0}removePoints(t,e=!0){if(r(t)){let s=[];if(t.forEach((t=>{t instanceof ii||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof ii&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)})),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Si(this,s,this._decayAni).start(),this._changed(),s.length;s=this._points.removeAll(s),s.length>0&&(this._dropAni?s.forEach((t=>this._dropAni.addPoint(t))):(this._dropAni=new Vi(this,s,this._decayDuration)).start())}else s=this._points.removeAll(s);if(s.length>0)return this._doPointsRemoved(s),this._dataPointsChanged(),s.length}}return 0}getDropPoints(){var t;return null===(t=this._dropAni)||void 0===t?void 0:t._points}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders(),this._decayDuration=f(0,y(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new bi(t)}_createPoint(t){return new Ai(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return n(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(r(t))return t;if(t){let e;if(t._obj instanceof ct)e=t._obj;else if(t instanceof ct)e=t;else if(Number.isFinite(t)||i(t)||l(t))return[t];if(e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){var e,s;return this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=h(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Pi+1)})`:t.color;let i,n;r(e)?i=e:o(e)?e.endsWith("@pal")||e.endsWith("@palette")?i=this.chart.getPaletteColors(e.split("@")[0]):n=this.chart._assets.get(e):this._colorByPoint()&&(i=this.chart.chartOptions.options.colors),n instanceof Ce?this._runPoints.forEach(((t,e)=>{t.color=t.color||n.getNext()||s})):r(i)?this._runPoints.forEach(((t,e)=>{t.color=t.color||i[e%i.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=V(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=V(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[wi[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=L}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}Ci.LEGEND_MARKER="rct-legend-item-marker",Ci.defaults=Me(Be.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}: ${detail}",tooltipDetail:"<b>${yValue}</b>",loadAnimation:"default",decayDuration:300,hoverEffect:"default",interactive:!0,paddingRate:1});class ki extends Oe{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find((e=>!e.isEmpty(t)))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}_internalSeries(){return this._series}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}canDepth(){return this._visibleSeries.every((t=>t.canDepth()))}_clear(){}get(t){return this._items[t]}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter((s=>t===s.row&&e===s.col))}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof Hi&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach((i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)})),s}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,s=this._items=[],n=this._series=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t instanceof Hi?n.push(...t.series):t instanceof Ci&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e._op.series=this._items.map((t=>t.options))}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof Ci?e=t:o(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>{t._setIndex(e)})),e;if(e._group.remove(e))return e}}updateData(t){}connect(t){const e=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0)));e.forEach((e=>{e._connect(t),e._valid=Boolean(e._xAxisObj&&e._yAxisObj)})),this._visibles=e.filter((t=>t._valid))}prepareRender(){const t=[];let e=0;this._series.forEach((s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape(Rs[e++%Rs.length]),i||(s._valid=!0))}})),this._visibleSeries=t.sort(((t,e)=>{let s=+(t.group?t.group.zOrder:t.zOrder)||0,i=+(e.group?e.group.zOrder:e.zOrder)||0;return s===i&&t.group&&t.group===e.group?(+t.zOrder||0)-(+e.zOrder||0):s-i}));const s=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof Ri&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const i=r(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r._setIndex(s),r.init(),r._load(e),r}return Ci._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Oi||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}}class Li extends Ci{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new pi(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Li.defaults=Me(Ci.defaults,{});class Ni extends Be{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){if(this._op.styleCallback)return this.series._getPointCallbackArgs(this._args,t),this._op.styleCallback(this._args)}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Ni.defaults=Me(Be.defaults,{radius:3});class Mi extends ii{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return w(this.x,this.y)}legendKey(){return this._legendKey}styleLegendMarker(t){}isEmpty(){return 0===this.yValue}initPrev(t,e){e.yValue=0}getParam(t){const e=super.getParam(t);return null==e&&"name"===t?this.x:"percent"===t?this._percent:e}}class Ei extends Be{_doSetSimple(t){return o(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Ei.defaults=Me(Be.defaults,{curved:!0});class Ti extends bi{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Ei(this.chart)).init()}get connector(){return this._connector}getAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}Ti.defaults=Me(bi.defaults,{visible:!0,convergent:!0,align:Xs,dedupeMode:Ys});class Bi extends Be{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?W(this._minDim,ii.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Bi.DEF_COUNT),(this._dirty=!s||s.value!==i||s.count!==r)&&(isNaN(i)||(t=t.filter((t=>t.y>=i))),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=j(t.minValue,!0)}}Bi.DEF_COUNT=10,Bi.defaults=Me(Be.defaults,{visible:!1,x:"기타"});class Oi extends Ci{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Bi(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:W(this._centerXDim,t),y:W(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_needDecayEffect(){return!0}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&(this._groupedPoints||this._runPoints).forEach((e=>{this._isVisibleInLegend(e)&&t.push(e)})):super.getLegendSources(t)}_isVisibleInLegend(t){return t.yValue>=0&&(t.yValue>0||this._op.zeroInLegend)}_doApply(t){const e=this;var s,i;super._doApply(t),s=t.centerX,i=t.centerY,s!==e._centerX&&(e._centerX=s,e._centerXDim=j(v(s,e._op.center,Oi.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=j(v(i,e._op.center,Oi.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach((t=>this._sum+=t.yValue));const s=this.getSum();this._runPoints.forEach((t=>t._percent=100*t.yValue/s))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this._op.legendKey,s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({...this._op.othersGroup},t.slice(this._groupedPoints.length));e.parse(this),e.index=t.length,e.yValue=e.yGroup=e.y,this._groupedPoints.push(e)}t=this._groupedPoints}return super._buildVisPoints(t).map(((t,s)=>(t.vindex=s,t._legendKey=t[e],t)))}}Oi.DEF_CENTER="50%",Oi.defaults=Me(Ci.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Oi.DEF_CENTER,centerY:Oi.DEF_CENTER});class Di extends Oi{getRadius(t,e){return W(this._radiusDim,m(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=j(w(t._radius=e,Di.defaults.radius),!0))}(this,t.radius)}}Di.defaults=Me(Oi.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Ri extends Li{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._op.minPointWidth}getPointWidth(t,e){const s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.options.groupPadding,i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,f(e,i)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.options.groupPadding,s-=s*e.options.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this._op.pointPadding)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,this._op.pointPadding)),this._op.minPointWidth=y(this.getMinPointWidth(),0)}}Ri.defaults=Me(Ci.defaults,{pointWidth:1,minPointWidth:0});class $i extends bi{get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new yi(this.chart)).init()}}$i.defaults=Me(bi.defaults,{});class Fi extends Ri{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new $i(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=f(0,b(e.depth,t.getDepth(),Fi.DEPTH)),this._distance=t.getDistance()+y(e.distance,0)):(this._depth=f(0,y(e.depth,Fi.DEPTH)),this._distance=y(e.distance,Fi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this._op.baseValue}}Fi.DEPTH=10,Fi.DISTANCE=5,Fi.defaults=Me(Ri.defaults,{nullAsBase:!1});class Ii extends Ri{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}}))}}class zi extends Ii{}class Hi extends Be{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{fi[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{fi[t.seriesType]=t}))}static collectTooltipText(t,e,s,i,n){function o(t,e,s,i){let r=e.replace(xi,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),r}const a=e.length>1&&r(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,h=a?t.tooltipListRow:t.tooltipRow;let l;return a?n.header=t.tooltipHeader||"":l=t.tooltipHeader||"",h&&e.forEach(((t,e)=>{let r=i;t!==s&&t.needAxes()&&(r=t.getPointAt(i.xValue)),r&&(a?(n.items.push(t),n.rows.push([o(t,h[0],r,e),o(t,h[1],r,e)])):(l&&(l+="<br>"),l+=o(t,h,i,e)))})),a?n.footer=t.tooltipFooter||"":l+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",l}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ci.getPointTooltipParam(e,s,i)}isGroupTooltip(){return!0}getTooltipText(t,e,s){return Hi.collectTooltipText(this._op,this._visibles,t,e,s)}getTooltipParam(t,e,s){return Hi.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach((e=>e.setCol(t))))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach((e=>e.setRow(t))))}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}connectable(t){return!0}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this._op.layout){case"stack":this.$_collectStack(t,e);break;case"fill":this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t,e){this._visibles.forEach((s=>{s.collectRanges(t,e)}))}prepareReferents(t){this._series.forEach((e=>e.prepareReferents(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){var e;const s=this._op;if(!1!==s.visibleInLegend&&this.visible){const i=this._series,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((t=>t.getLegendSources(r)));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(r);s.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach(((t,e)=>{t._setIndex(e)})),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}getLayoutMax(){const t=y(this._op.layoutMax,Hi.LAYOUT_MAX);return t>0?t:Hi.LAYOUT_MAX}_doApply(t){super._doApply(t),s.call(t,"children")&&(this._series=[],this.$_loadSeries(this.chart,t.children))}_doSaveArray(t,e){if("children"===t)return this._series.map((t=>t.saveOptions()))}_prepareRender(){const t=this._visibles;if(this._legended=null,this._stacked="stack"===this._op.layout||"fill"===this._op.layout,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),!(this._seriesChanged=!ot.equalArrays(t,this._visibles)))for(let t=this._visibles.length-1;t>=0;t--)if(this._visibles[t].seriesChanged()){this._seriesChanged=!0;break}super._prepareRender()}_connect(t){this._xAxisObj=t._connectSeries(this,!0),this._yAxisObj=t._connectSeries(this,!1)}_doPrepareRender(t){this._visibles.length>0&&(this._visibles.forEach((e=>e._connect(t))),this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_setIndex(t){this._index=t}_doPrepareSeries(t){}$_loadSeries(t,e){const s=this._seriesType();r(e)?e.forEach(((e,i)=>this.$_add(Ci._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(Ci._loadSeries(t,this._series.length,e,s))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i*(i<0?-1:1)),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i*(i>=0?-1:1)),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(x(e.yValue)||0)),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}Hi.LAYOUT_MAX=100,Hi.defaults=Me(Be.defaults,{layout:"default",layoutMax:Hi.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class Gi extends Hi{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ji extends Hi{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this._op.groupWidth}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}ji.defaults=Me(Hi.defaults,{groupWidth:1,groupPadding:.1});class Xi extends Li{isMarker(){return!0}isXY(){return!0}}Xi.defaults=Me(Ci.defaults,{colorByPoint:!1});class Wi extends Be{}class Yi extends Be{}const Ui={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Zi={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},qi={minPadding:0,maxPadding:0};class Ki extends Be{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new Wi(e)).init(),t.mask=(this._mask=new Yi(e)).init(),t.borderLine=(this._borderLine=new Be(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return y(this._op.thickness,Ki.defaults.thickness)}getGap(){return y(this._op.gap,Ki.defaults.gap)}getGapFar(){return y(this._op.gapFar,Ki.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=_({},e.series,Ui[t]())}else s.series=Ui.area();i(e.xAxis)?s.xAxis=_({},e.xAxis,(Zi[e.xAxis.type]||Zi.linear)(),qi):s.xAxis=_({},qi),i(e.yAxis)?s.yAxis=_({},e.yAxis,(Zi[e.yAxis.type]||Zi.linear)(),qi):s.yAxis=_(Zi.linear(),qi),this._chartConfig=s,this._axisType=s.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}Ki.defaults=Me(Be.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Qi extends Be{_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Qi.defaults=Me(Be.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class Ji extends Qi{}Ji.defaults=Me(Qi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class tr extends Be{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o=!!r.axis;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this._op.noClip;return!!l(t)&&t}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}getHeaderHeight(){const t=this._op;return t.simpleMode?0:f(y(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:f(y(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:f(y(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return y(this._op.listMarkerGap,5)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?xt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Ot.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}tr.defaults=Me(Be.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",headerHeight:7,tailSize:10,borderRadius:5,simpleMode:!1,noClip:!1,listGap:12,listRowGap:3,listMarkerSize:7,listMarkerGap:5});const er="vline",sr="hline",ir="line";class rr extends Ie{_isVisible(){return this._op.visible&&!I(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}rr.type="image";class nr extends Ie{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||nr.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}nr.type="shape",nr.defaults=Me(Ie.defaults,{width:64,height:64,shape:"square"});class or extends Ie{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!I(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?xt.getFormatter(s):L),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Ot.getFormatter(t):L)}(t.timeFormat)}}or.type="text",or.defaults=Me(Ie.defaults,{text:"Text"});class ar extends Ke{getPositions(t,e){return t.hasBreak()?t._ticks.filter((e=>!t.isBreak(e.value))).map((s=>t.getPos(e,s.value))):t._ticks.map((s=>t.getPos(e,s.value)))}}class hr extends ss{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:r});isNaN(n)||(e=n)}return e>0?e:void 0}buildSteps(t,e,s,i,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,y(.85*_,60),s,i,o,l):r(h.steps)||n(h.steps)||n(h.stepCallback)?this._getStepsBySteps(i,o,l):this._baseAxis instanceof ur&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,i,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,i,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,i,o))?this._getStepsByInterval(d,s,i,o):_>0?this._getStepsByPixels(e,_,s,i,o,l):i!==o?[i,o]:[i],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?f(8,d(t/(.9*e))+1):y(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){let e;if(super._doApply(t),this._stepPixels=!n(t.stepPixels)&&ot.parseTuples(t.stepPixels),s.call(t,"stepMultiples"))if(n(t.stepMultiples))e=t.stepMultiples;else{let s;if(r(t.stepMultiples)){let e=Number.MIN_SAFE_INTEGER;s=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>e&&s.push(+t)}))}e=s&&s.length>0?s:void 0,e&&(e=e.filter((t=>t>=1)),e.length>0?e.sort(((t,e)=>t-e)):e=void 0)}this._userMultiples=e}$_getStepPixels(t,e){let s=this._stepPixels;if(n(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?hr.STEP_PIXELS_P:t._isX?hr.STEP_PIXELS_X:hr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return f(1,s[e][1])}_findBaseAxis(){if(null!=this._op.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this._op.baseAxis);e!==t&&e instanceof ur&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),t}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h==2.5&&c(t*o/a)==t*o/a?this._step=a:a=this._step=d(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new K(e)}(s<e&&i>e,"base error"),t=f(3,t);;){if(!(d((e-s)/a)+d((i-e)/a)+1>t))break;a+=h}s=e-d((e-s)/a)*a}else s=n._fixedMin;l.push(D(s));for(let e=1;e<t;e++)l.push(D(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=D(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=D(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=D(n-t));for(n=e;n<i;)r.push(n=D(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=n(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?hr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?hr.STEP_MULTIPLES[0]:hr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const i=this._op,o=n(i.steps)?i.steps:i.stepCallback;let a;return o?(a=o.call(void 0,s),r(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=i.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(i.clipSteps?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort(((t,e)=>t-e)),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=f(1,c(t/e))+1,l=o/(h-1);const _=function(t){return Math.pow(10,t)}(c(g(l))),u=this._getStepMultiples(_,n),p=[];let m,x=0;if(l/=_,u)if(l>u[x]){for(;x<u.length-1;x++)if(l>u[x]&&l<u[x+1]){l=l<=u[x]+(u[x+1]-u[x])/2?u[x]:u[x+1];break}}else l=u[x];for(;;){for(l*=_,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-d((s-i)/l)*l,this._step=l,p.push(D(m=i));m<r;)p.push(D(m+=l));if(!u||x>u.length-2||p.length<=a)break;l=u[++x],p.length=0}return p}}hr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],hr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],hr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],hr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],hr.defaults=Me(ss.defaults,{baseRange:!1,enableDecimals:!0});class lr extends is{}lr.defaults=Me(is.defaults,{numberFormat:"0.##"});class _r extends lr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}_r.defaults=Me(lr.defaults,{useSymbols:!0});class cr extends We{getSize(t){return Math.min(.9*t,W(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=y(this._op.space,0),this._sizeDim=j(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}cr.defaults=Me(We.defaults,{size:"30%",space:16,gridVisible:!0});class dr extends Ye{_isVisible(){return this._op.visible}}dr.defaults=Me(Ye.defaults,{visible:!1});class ur extends as{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new dr(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._baseVal}hasBreak(){return null!=this._runBreaks}_getBreaks(){return this._runBreaks?this._runBreaks.slice(0,1):[]}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.options.gridVisible&&(t===e.options.from||t===e.options.to)}}$_getPadding(t,e,s){if(!t){if(this._isX&&this._isPolar)return 0;t=ur.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var e,i;super._doApply(t);const r=null!==(e=t.minPadding)&&void 0!==e?e:t.padding,n=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,o(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,o(n)&&n.endsWith("px")&&(a=parseFloat(n),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=ot.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=ot.parseTuples(n)),this._baseVal=+this._op.baseValue,this._strictMin=j(t.strictMin,!0),this._strictMax=j(t.strictMax,!0),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new ar(this)}_createTickModel(){return new hr(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=y(this._runBase,this._min);isNaN(this._fixedMax)&&isNaN(this._maxPadPixels)&&this._calcedMax>e&&t[t.length-2]>this._calcedMax&&t[t.length-2]-this._calcedMax>.5*(t[t.length-2]-t[t.length-3])&&(t.pop(),this._setMinMax(this._min,t[t.length-1])),e=y(this._runBase,this._max),isNaN(this._fixedMin)&&isNaN(this._minPadPixels)&&this._calcedMin>e&&t[1]<this._calcedMin&&t[1]-this._calcedMin<.5*(t[1]-t[2])&&(t.shift(),this._setMinMax(t[0],this._max))}$_trimSteps(t,e,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof ur&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:h}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(a=r._baseAxis.axisMin(),h=r._baseAxis.axisMax()),this._mergedBreaks){this._runBreaks=this._mergedBreaks.slice(0);for(let t=this._runBreaks.length-1;t>=0;t--){const e=this._runBreaks[t];(isNaN(e.options.from)||isNaN(e.options.to)||e.options.from<=a||e.options.to>=h)&&this._runBreaks.splice(t,1)}this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;let l,_,c=!1,d=a,u=h;if(this._isX)if(a===h)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s,a,h);if(e){if(this._unitLen=e.len,c=!0,!this._zoom||t)if(e.min=e.min*(2*y(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=M*e.min/(h-a+e.min):t*=T,isNaN(this._fixedMax)&&this.getTotalAngle()+t>M&&(h=this._max=Math.max(this._calcedMax+e.min,h))}else isNaN(this._fixedMin)&&(a=this._min=Math.min(this._calcedMin-e.min/2,a)),isNaN(this._fixedMax)&&(h=this._max=Math.max(this._calcedMax+e.min/2,h))}else this._unitLen=1}if(a===h)l=[a];else if(this._runBreaks)l=this.$_calcBrokenSteps(this._runBreaks,s,a,h),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,s,this._runBase,a,h,!1),_=l.slice(0),l.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d;)l.shift();l.length<2&&this._fixedMin<l[0]&&l.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;l.length>2&&l[1]<=d;)l.shift();if(!isNaN(r._step))for(;l[0]>d;)l.unshift(r.getNextStep(l[0],-1))}if(a=Math.min(a,l[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;l.length>1&&l[l.length-1]>u;)l.pop();l.length<2&&this._fixedMax>l[l.length-1]&&l.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;l.length>2&&l[l.length-2]>=u;)l.pop();if(!isNaN(r._step))for(;l[l.length-1]<u;)l.push(r.getNextStep(l[l.length-1],1))}h=Math.max(h,l[l.length-1])}else l.push(a+(h-a)/2);this._prevSteps=l,this._setMinMax(a,h);const p=this.$_createTicks(l,s,a,h,i);if(c&&p.length>1){const t=this._isPolar;let e=!1;const s=_;let i,r;if(s[0]<=a){for(r=-1;r<l.length-1&&s[r+1]<l[0];)r++;for(;r>=0&&(i=s[r])>=a;){const t=this.dataToAxis(p[0].value),s=this.dataToAxis(p[1].value);if(i<t&&t-i>=s-t&&("tick"===this.$_getStartFit()||i>a)){const t=this._createTick(0,i);p.unshift(t),l.unshift(i),e=!0}r--}}if(s[s.length-1]>=h){for(r=s.length;r>0&&s[r-1]>l[l.length-1];)r--;for(;r<s.length&&(i=s[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(i>=t&&i-t>=t-s&&("tick"===this.$_getEndFit()||i<h)){const t=this._createTick(0,i);p.push(t),l.push(i),e=!0}r++}}else if(t&&h>s[s.length-1])for(;(i=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(!(D(h-t)>D(t-s)))break;{const r=this._createTick(0,i+D(t-s));p.push(r),l.push(r.value),e=!0}}e&&p.forEach(((t,e)=>t.index=e))}return p}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}_calcPoints(t,e){super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce(((t,e)=>t+e.options.space),0);t.forEach((t=>{const e=t.options,s=t.getSize(h),i=Math.max(0,e.space||0),l={from:n,to:t.options.from,pos:r,len:s};r+=s,a.push(l,t._sect={from:e.from,to:e.to,pos:r,len:i}),r+=i;this.$_buildBrokenSteps(l).forEach((t=>{t>l.from&&t<=l.to&&o.push(t)})),i>0&&o.push(e.to)}));const l=t[t.length-1];if(i>l.options.to){const t={from:l.options.to,to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&o.push(e)}))}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.length-1],o}getPos(t,e){let s;if(this._runBreaks){const i=this._sects.find((t=>e<t.to))||this._lastSect,r=i.len*(e-i.from)/(i.to-i.from);s=this._op.reversed?R(t-r-i.pos):R(r+i.pos)}else{let i=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this._op.reversed&&(i=t-i,isNaN(this._prevRate)||(i+=this._prevSize-t)),s=R(i)}return this._ani?this._ani.getPos(s,this._op.reversed):s}valueAt(t,e){if(this._isHorz?this._op.reversed&&(e=t-e):this._op.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_isLog(){return!1}$_getStartFit(){return"default"===this._op.startFit?this._isX&&!this._isPolar?"value":"tick":this._op.startFit}$_getEndFit(){return"default"===this._op.endFit?this._isX&&!this._isPolar?"value":"tick":this._op.endFit}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-W(t,s):e+W(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),a=!0,l=!0,_=NaN,d=NaN,u=1;if(this._series.length>0){let t,c=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||c++,u=f(u,t.getAxisPadRate())})),!this._isX&&c>0&&c<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[m(t._yMin,r[e][0]),f(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let c=r._sBase;h(c)&&!isNaN(c)&&(c=D(c),i?c>=0&&c<=e&&c<=s&&(e=t=c):c<=e?r.isBased(this)?e=t=c:_=y(m(_,c),c):c>=s&&(r.isBased(this)?s=t=c:d=y(f(d,c),c))),a&&!n&&(i||r.canMinPadding(this,e,t))&&(a=!1),l&&!o&&(i||r.canMaxPadding(this,s,t))&&(l=!1)}))}else a=n,l=o;n||(n=a),o||(o=l),this._fixedMin=this._fixedMax=NaN;const p=f(0,s-e),g=this.$_calcStrict(this._strictMin,e,-p),x=this.$_calcStrict(this._strictMax,s,p);let b=NaN,w=NaN,v=0,S=0;isNaN(g)?n?this._fixedMin=e:isNaN(this._minPadPixels)?v=this.$_getPadding(this._minPaddings,t,u):b=this._minPadPixels:this._fixedMin=e=g,isNaN(x)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?S=this.$_getPadding(this._maxPaddings,t,u):w=this._maxPadPixels:this._fixedMax=s=x;let V=e,A=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*v;e<V&&(V=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*S;e>A&&(A=e)}}else V-=p*v,A+=p*S;if(!isNaN(b)||!isNaN(w)){isNaN(b)&&(b=0),isNaN(w)&&(w=0);const e=Math.min(b+w,.9*t),s=p-c(p*(t-e)/t),i=Math.round(s*b/e);V-=i,A+=s-i}return!isNaN(_)&&_<=e&&V<_&&(V=this._fixedMin=_),!isNaN(d)&&d>=s&&A>d&&(A=this._fixedMax=d),A=f(A,V),{min:V,max:A}}$_calcXUnitLength(t,e,s){const i=[];let r=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(i.push(...t._getVisiblePoints()),r++)})),0===r&&this._series.forEach((t=>{t.visible&&!t.isXY()&&i.push(...t._getVisiblePoints())})),i.length>0){const r=i.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=r.length-1;t>0;t--)r[t]===r[t-1]&&r.splice(t,1);return this._calcUnitLen(r,t,e,s)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:y(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=m(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:y(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new cr(this);return e.init(),e._load(t),t.from>0?e:null}}$_loadBreaks(t){if(r(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.options.to=e.options.to}const e=this._breaks.sort(((t,e)=>t.options.from-e.options.from)).filter((t=>t.visible&&t.options.to>t.options.from));if(this._mergedBreaks=null,e.length>0){const i=this._mergedBreaks=[];i.push(_(new cr(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],o=e[r];s=n,o.options.from<s.options.to?t(n,o):i.push(_(new cr(this)._initObject(),o))}}var s}}ur.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],ur.defaults=Me(as.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default",unitPadding:.5});class pr extends ur{get label(){return this._label}_createLabel(){return new _r(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Hi&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}pr.type="linear";const gr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],mr=[[1,2,5,10,20,25,50,100,200,250,500],[1,2,5,10,15,30],[1,2,3,4,6,8,12],[1,2,3,4,6,12],[1,2],[1,2],[1,2,3,4,6]],fr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class xr extends hr{getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this._scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_getValidInterval(t,e,s,i,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:r});null!=n&&(e=n)}if(!isNaN(e))return+e>0?+e:NaN;if(o(e)&&fr.hasOwnProperty(e.charAt(e.length-1))){const t=parseFloat(e);return t<=-1||t>=1?e:NaN}}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=gr[e]/2&&t<gr[e+1]/2)return this._scale=e,mr[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,_=f(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=gr[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=a.date(i),p=a.date(r);let g,m=u;if(7===this._scale){const t=h.getFullYear();let e=m.getFullYear();this._step=_=Math.ceil(_),m=new Date(e,0),e<t&&e+_>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=_,m=new Date(e,0)}while(m<=p)}else if(6===this._scale){let t=m.getFullYear(),e=m.getMonth();this._step=_=Math.ceil(_),m=new Date(t,e),m<h&&new Date(t,e+_)>h&&(e=h.getMonth(),m=new Date(h.getFullYear(),e));do{n.push(+m),m.setMonth(m.getMonth()+_)}while(m<=p)}else if(4===this._scale||5===this._scale){let t=m.getFullYear(),e=m.getMonth(),s=m.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),m=new Date(t,e,s),m<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+m),m.setDate(m.getDate()+_*i)}while(m<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}g=m.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(o(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=fr[a],t=gr[this._scale];let c=new Date(s);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+h&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+h),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let s=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+h*s),c<n&&_>n&&(c=new Date(n),c.setHours(0,0,0,0));break;case 3:c.setMinutes(0);case 2:c.setSeconds(0);case 1:c.setMilliseconds(0)}if(this._step=h,s=+c,isNaN(e))for(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}}const yr=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd HH:mm"},{format:"MM-dd",beginningFormat:"yyyy-MM-dd"},{format:"MM W주",beginningFormat:"yyyy-MM-dd"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy",beginningFormat:"yyyy"}];class br extends lr{_doApply(t){super._doApply(t);const e=o(t.timeFormat)?t.timeFormat:void 0,s=o(t.beginningFormat)?t.beginningFormat:void 0,n=t.timeFormats,h=t.useBeginningFormat;if(this._formats=yr.map((t=>_(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&s&&this._formats.forEach((t=>{t.beginningFormat=s})),r(n))for(let t=0;t<n.length;t++){const e=this._formats[t],s=n[t];a(s)?e.format=s:i(s)&&(a(s.format)&&(e.format=s.format),h&&a(s.beginningFormat)&&(e.beginningFormat=s.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,o=i.tick._scale,a=Ot.getFormatter;switch(o){case 7:return a(n[o].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek)}}}br.defaults=Me(lr.defaults,{useBeginningFormat:!0});class wr extends ur{get label(){return this._label}_createTickModel(){return new xr(this)}_createLabel(){return new br(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}collectValues(){this._offset=60*y(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return h(t)?t:t instanceof this._dateClass?t.getTime():o(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(o(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}wr.type="time",wr.subtype="date",wr.defaults=Me(ur.defaults,{baseValue:NaN});class vr extends oi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Sr extends zi{pointLabelCount(){return 2}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new vr(t)}_getBottomValue(t){return t.lowValue}}Sr.type="barrange",Sr.defaults=Me(zi.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Vr extends ii{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Ar extends Fi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Vr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Ar.defaults=Me(Fi.defaults,{colorByPoint:!1,pointOffset:0});class Pr extends Ar{canDepth(){return!0}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Pr.type="bar";class Cr extends ji{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}getDepth(){return this._op.depth}getDistance(){return this._op.distance}_doApply(t){super._doApply(t),this._op.distance=y(t.distance,0)}_doPrepareSeries(t){const e=this._op.layout;if("default"===e){const e=t.length>1?t.map((t=>t.options.pointWidth)).reduce(((t,e)=>t+e),0):t[0].options.pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.options.pointWidth/e,t._childPos=s,s+=t._childWidth}))}if("overlap"===e){let e=this.getDistance();t.forEach((t=>{t._groupDistance=e+=y(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}Cr.defaults=Me(ji.defaults,{depth:10,distance:5});class kr extends Cr{_canContain(t){return t instanceof Pr}}kr.type="bargroup",kr.seriesType="bar";class Lr extends Qt{constructor(t){super(t,Ci.LEGEND_MARKER),this.add(this._back=new Is(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new re(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){Fs.setShape(this._marker,this._shape,t,t)}}class Nr extends Lr{constructor(t){super(t),this.insertFirst(this._line=new re(t)),this.insertFirst(this._area=new re(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class Mr extends Lr{constructor(t){super(t),this.insertFirst(this._line=new re(t)),this._line.setFill("none"),this.insertFirst(this._line2=new re(t)),this._line2.setFill("none"),this.insertFirst(this._area=new re(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class Er extends re{constructor(t,e=L,s=L){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){ot.isNumber(t)?this.setPath(Fs.line(t,e,s,i)):t&&this.setPath(Fs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Fs.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Fs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Fs.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Fs.line(e,t,s,t))}}class Tr extends Lr{constructor(t){super(t),this.insertFirst(this._line=new Er(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Br extends ii{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Or extends Ni{}Or.defaults=Me(Ni.defaults,{radius:4,hoverScale:1.75});class Dr extends bi{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Dr.ALIGN_GAP:0:t}getPosition(){return w(this._op.position,"default")}}Dr.ALIGN_GAP=4,Dr.defaults=Me(bi.defaults,{align:"center"});class Rr extends Li{_doInit(t){super._doInit(t),t.marker=(this._marker=new Or(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return y(t.radius,this.marker.options.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Dr(t)}_createPoint(t){return new Br(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Tr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),m(e/2,this.marker.options.radius)),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const s=t.length,i=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();i.push(e)}else{let e=0;for(;e<s;){const r=[];for(;e<s&&t[e].isNull;)e++;for(;e<s&&!t[e].isNull;)r.push(t[e++]);r.length>0&&i.push(r)}}if(e){const t=[],s=[];e.forEach((e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&s.push(e)})),t.length>0&&(t.sort(((t,e)=>t.xValue-e.xValue)),i[0].unshift(...t)),s.length>0&&(s.sort(((t,e)=>e.xValue-t.xValue)),i[i.length-1].push(...s))}return i}}Rr.defaults=Me(Ci.defaults,{nullAsBase:!1});class $r extends Re{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}$r.defaults=Me(Re.defaults,{visible:!1,offset:8});class Fr extends Rr{_doInit(t){super._doInit(t),t.flag=(this._flag=new $r(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this._op.connectEnds;if(l(e))return e;if(!t||"spline"===this._op.lineType)return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof Wr||this._group instanceof Yr?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){const t=this._op;super._doPrepareRender(),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0),t.nullAsBase&&!isNaN(t.baseValue)&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Fr.type=qs,Fr.defaults=Me(Rr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Ir extends Fr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Ir.type="spline";class zr extends Br{}class Hr extends Fr{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=y(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}_createLegendMarker(t,e){return new Nr(t)}_createPoint(t){return new zr(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t,e){if(!this.chart.isPolar()&&this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doBuildLines(t,e)}}Hr.type=Ks,Hr.defaults=Me(Rr.defaults,{});class Gr extends zr{get high(){return this.y}get highValue(){return this.yValue}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}labelCount(){return 2}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[y(s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e)}}class jr extends Dr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class Xr extends Rr{pointLabelCount(){return 2}_createLabel(t){return new jr(t)}_createLegendMarker(t,e){return new Mr(t)}_createPoint(t){return new Gr(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._visPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doBuildLines(t,e){const s=super._doBuildLines(t,e),i=[];return s.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}i.push(t,e)})),i}}Xr.type="arearange",Xr.defaults=Me(Rr.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Wr extends Hi{_canContain(t){return t instanceof Fr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Wr.type="linegroup",Wr.seriesType=qs,Wr.defaults=Me(Hi.defaults,{lineType:"default"});class Yr extends Hi{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof Hr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Yr.type="areagroup",Yr.seriesType=Ks,Yr.defaults=Me(Hi.defaults,{lineType:"default"});class Ur extends zr{}class Zr extends Hr{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Ur(t)}_doLoadData(t){const e=super._doLoadData(t);if(r(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=t._visPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=this._op,r=t.reduce(((t,e)=>t+e),0)/s,n=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-r,2)))/(s-1)),o=n/i.pointsInSigma,a=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>a;)l-=o,_.unshift(e(r,n,l));for(l=r;l<h;)l+=o,_.push(e(r,n,l));return _}}Zr.type="bellcurve",Zr.defaults=Me(Hr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class qr extends ii{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return _(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.min=e[y(s.minField,0+i)],this.low=e[y(s.lowField,1+i)],this.mid=e[y(s.midField,2+i)],this.high=e[y(s.highField,3+i)],this.y=e[b(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=w(e[s.minField],e.min),this.low=w(e[s.lowField],e.low),this.mid=w(e[s.midField],e.mid),this.high=w(e[s.highField],e.high),this.y=w(e[s.maxField],this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=S(t.minValue,this.minValue,e),this.lowValue=S(t.lowValue,this.lowValue,e),this.midValue=S(t.midValue,this.midValue,e),this.highValue=S(t.highValue,this.highValue,e)}}class Kr extends zi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new qr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}}Kr.type="boxplot",Kr.defaults=Me(zi.defaults,{tooltipText:"<b>${name}</b><br>${detail}",tooltipDetail:"min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"});class Qr extends ni{}class Jr extends Xi{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new Qr(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=m(t,s.zValue),e=f(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e)}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){o(t)&&(t=this._xAxisObj.getValue(t)),o(e)&&(e=this._yAxisObj.getValue(e));for(let s=0;s<this._points.count;s++){const i=this._points.get(s);if(i.xValue===t&&i.yValue===e)return i}}}Jr.type="bubble",Jr.defaults=Me(Xi.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"${detail}",tooltipDetail:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class tn extends Gi{_canContain(t){return t instanceof Fr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=w(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return ot.makeIntArray(0,t.length)}}tn.type="bump",tn.seriesType=qs;class en extends ii{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return _(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.low=e[y(s.lowField,0+i)],this.close=e[y(s.closeField,1+i)],this.open=e[y(s.openField,2+i)],this.y=e[b(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=w(e[s.lowField],e.low),this.open=w(e[s.openField],e.open),this.close=w(e[s.closeField],e.close),this.y=v(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e),this.openValue=S(t.openValue,this.openValue,e),this.closeValue=S(t.closeValue,this.closeValue,e)}}class sn extends zi{canCategorized(){return!0}_createPoint(t){return new en(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Zt;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new re(t,Ci.LEGEND_MARKER).setPath(s.end())}}sn.type="candlestick",sn.defaults=Me(zi.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class rn extends $i{}rn.defaults=Me(bi.defaults,{position:"inside"});class nn extends Ar{get pointLabel(){return this._pointLabel}_createLabel(t){return new rn(t)}}nn.type=Qs;class on extends Cr{_canContain(t){return t instanceof nn}}on.type="circlebargroup",on.seriesType=Qs;class an extends oi{}class hn extends Ni{}hn.defaults=Me(Ni.defaults,{radius:4,shape:"circle"});class ln extends zi{_doInit(t){super._doInit(t),t.marker=(this._marker=new hn(this)).init(),t.lowMarker=(this._lowMarker=new hn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+f(0,this.marker.options.radius)}_createPoint(t){return new an(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=y(e.radius,s),n=e.shape||i;this._visPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n})),super.prepareAfter()}}ln.type="dumbbell";class _n extends ii{}class cn extends Fi{getSegmentSize(t){return W(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new _n(t)}_createLegendMarker(t,e){const s=new Zt;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new re(t,Ci.LEGEND_MARKER).setPath(s.end())}}cn.type="equalizer",cn.defaults=Me(Fi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class dn extends zi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new oi(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Zt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new re(t,Ci.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}dn.type="errorbar",dn.defaults=Me(zi.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class un extends Mi{}class pn extends un{constructor(t,e){super(t),this.points=e}}class gn extends Ti{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?gn.ENDED_DIST:gn.OUTSIDE_DIST:this._op.distance||0}}gn.OUTSIDE_DIST=25,gn.ENDED_DIST=10;class mn extends Oi{getSize(t,e){return{width:f(.1*t,W(this._widthDim,t)),height:f(.1*e,W(this._heightDim,e))}}getNeckSize(t,e){return{width:ot.clamp(W(this._neckWidthDim,t),this._minNeckWidth,t),height:ot.clamp(W(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new gn(t)}_createPoint(t){return new un(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new pn(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=X(e._width,mn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=X(e._height,mn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=X(e._neckWidth,mn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=X(e._neckHeight,mn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}mn.type="funnel",mn.defaults=Me(Oi.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class fn extends ii{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return _(super._assignTo(t),{min:this.min,max:this.max})}}const xn={squreRoot:function(t){return Math.ceil(Math.sqrt(t))},struges:function(t){return Math.ceil(Math.log(t)*Math.LOG2E)},rice:function(t){return Math.ceil(2*Math.pow(t,1/3))}};class yn extends Li{getBinCount(t){const e=y(this._op.binWidth,0);if(e>0)return t/e;return y(this._op.binsNumber,0)<1?xn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new fn(t)}_doLoadPoints(t){function e(t){let e;return e=r(t)?t[y(this.yField,0)]:i(t)?v(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),s.minValue<o[0]&&o.unshift(s.minValue),s.maxValue>o[o.length-1]&&o.push(s.maxValue);const t=o.length,e=o[0],i=o[t-1],r=this.getBinCount(t),a=this._binInterval=(i-e)/r;let h=0,l=e,_=l+a;for(let e=0;e<r;e++){let s=0;if(e==r-1)s=t-h;else for(;h<t&&o[h]<_;)s++,h++;n.push({x:l,y:s,min:l,max:e===r-1?i:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=b(this._op.baseValue,this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}}yn.type="histogram",yn.defaults=Me(Ci.defaults,{baseValue:0,binsNumber:"squreRoot"});class bn extends Ni{}bn.defaults=Me(Ni.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class wn extends ii{_assignTo(t){return _(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.options.colorField,i=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[y(r.xField,0)]),this.y=e[y(r.yField,0+n)],this.radius=e[y(r.radiusField,1+n)],isNaN(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=w(e[t.options.radiusField],e.radius)}}class vn extends Fi{_doInit(t){super._doInit(t),t.marker=(this._marker=new bn(this)).init()}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new wn(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=f(t.minRadius,0),n=f(t.maxRadius,r);if(i){const t=this._runPoints.map((t=>t.radius)).filter((t=>"number"==typeof t&&!Number.isNaN(t))),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach((t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s}))}else this._runPoints.forEach((t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s}));super.prepareAfter()}}vn.type="lollipop";class Sn extends en{}class Vn extends sn{_createPoint(t){return new Sn(t)}_createLegendMarker(t,e){const s=new Zt;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new re(t,Ci.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}Vn.type="ohlc";class An extends Br{}class Pn extends Rr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new An(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+y(e.yValue,0)),0);let r=0;t.forEach((t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})})),e._doLoadPoints(s),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Pn.type="pareto",Pn.defaults=Me(Rr.defaults,{curved:!1});class Cn extends Mi{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return _(super._assignTo(t),{sliced:this.sliced})}}class kn extends Cn{constructor(t,e){super(t),this.points=e}}class Ln extends Re{getDefaultIconPos(){return"left"}}class Nn extends Ti{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?W(this._distanceDim,e,0):t?W(s?Nn.INNER_DIST:Nn.INSIDE_DIST,e):"far"===this._op.align?Nn.ENDED_DIST:Nn.OUTSIDE_DIST}}Nn.INSIDE_DIST=j("30%",!1),Nn.INNER_DIST=j("50%",!1),Nn.OUTSIDE_DIST=25,Nn.ENDED_DIST=10,Nn.defaults=Me(Ti.defaults,{radius:.7,rotationMode:"arc"});class Mn extends Be{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return h(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=f(0,y(t.length,0)),t.ratio=f(.3,m(.8,y(t.ratio,Mn.DEPTH_RATIO)))}}Mn.DEPTH_RATIO=.6,Mn.defaults=Me(Be.defaults,{visible:!1,length:25,ratio:Mn.DEPTH_RATIO});class En extends Di{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new Ln(this.chart)).init(),t.depth=(this._depth=new Mn(this.chart)).init()}get innerText(){return this._innerText}get depth(){return this._depth}followPointer(){return!0}hasInner(){return this._innerRadiusDim&&this._innerRadiusDim.size>0}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return!this._group&&this._sliceOffsetDim?W(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Nn(t)}_createPoint(t){return new Cn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new kn(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset"),t.totalAngle<=0&&(t.totalAngle=360)}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=E+T*y(this._op.startAngle%360,0),this._totalRad=T*f(0,m(360,y(this._op.totalAngle,360))),this._groupPos=NaN}}En.type="pie",En.defaults=Me(Di.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Tn extends Hi{getPolarSize(t,e){return W(this._polarDim,m(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=j(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=j(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof En}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+y(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=y(t.options.groupSize,1)/e}))}}Tn.type="piegroup",Tn.seriesType="pie",Tn.defaults=Me(Hi.defaults,{polarSize:"80%",innerSize:0});class Bn extends ii{}class On extends Xi{_createPoint(t){return new Bn(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}_createLegendMarker(t,e){return new Lr(t)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}get canPolar(){return!0}getShape(t){return this._op.shape||this._defShape}hasShape(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),m(e/2,this._op.radius)),s}}On.type="scatter",On.defaults=Me(Xi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Dn extends ii{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class Rn extends bi{}Rn.defaults=Me(bi.defaults,{offset:0});class $n extends Ii{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Rn(t)}_createPoint(t){return new Dn(t)}_createLegendMarker(t,e){return Is.create(t,Ci.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let _=1,c=t.length;_<c;_++){s=t[_];if(!0===s._isMid&&_<c)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}$n.type="waterfall",$n.defaults=Me(Ii.defaults,{tooltipDetail:"<b>${y}</b>"});class Fn extends hr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let l=[],_=f(1,c(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(_-1);const e=o(Math.floor(n(t))),c=this._getStepMultiples(e);if(t/=e,c&&c.length>0)if(t>c[0]){for(let e=0;e<c.length-1;e++)if(t>c[e]&&t<c[e+1]){t=t<=c[e]+(c[e+1]-c[e])/2?c[e]:c[e+1];break}}else t=c[0];t*=e,(t<=0||!isFinite(t))&&(t=h/_),i=isNaN(s)?this._normalizeMin(i,t):s-d((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let m=i,f=a(m);for(l.push(f);f<r;)m+=t,f=a(p?Math.round(m):m),f>l[l.length-1]&&(f<r&&(1==l.length&&f-l[l.length-1]<t||l.length>1&&f-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(f))}else{i=o(i);const t=(r=o(r))-i;let e=t/(_-1);const s=o(c(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/_);const h=1e-10*e;let d=c(i/e)*e;for(d<i&&(d+=e),l.push(n(d));d<=r+h;)d+=e,d>0&&l.push(n(d))}return l}}Fn.defaults=Me(hr.defaults,{arrangeDecimals:!0});class In extends ur{_isLog(){return!0}_createLabel(){return new _r(this)}_createTickModel(){return new Fn(this)}_doApply(t){super._doApply(t);const e=this._logBase=f(2,y(t.logBase,10));this._roundThreshold=y(t.roundThrrehold,500),this._log=this.$_createLog(e),this._pow=this.$_createPow(e),this._snap=this.$_createSnap(e,this._log)}$_createLog(t){return 10===t?Math.log10:e=>Math.log10(e)/Math.log10(t)}$_createPow(t){return e=>Math.pow(t,e)}$_createSnap(t,e){return s=>{const i=c(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}_checkValues(t){return t.filter((t=>t>0))}_doCalculateRange(t){const e=super._doCalculateRange(this._values);return e.min=this._log(e.min),e.max=this._log(e.max),e}_createTick(t,e){return super._createTick(t,D(this._pow(e)))}_calcUnitLen(t,e,s,i){if(t.length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=m(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:y(e*=a,1),min:o*a}}}In.type="log",In.defaults=Me(ur.defaults,{logBase:10,roundThrrehold:500});class zn extends Be{isChartScope(){return"chart"===this.options.scope}getHoverEffect(){const t=this.options;return"auto"===t.hoverEffect?t.hoverImageUrl?"image":"background":t.hoverEffect}click(){if(this._op.onClick){const t={chart:this.chart.wrapper,button:this};this._op.onClick(t)}}}zn.defaults=Me(Be.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class Hn extends Oe{load(t){const e=this.chart,s=this._items=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t))})):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map((t=>t.options))}$_loadItem(t,e){const s=new zn(t);return s.init(),s._load(e),s}}const Gn="$ctrl";class jn extends Be{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}jn.defaults=Me(Be.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Xn extends Be{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==w(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}Xn.defaults=Me(Be.defaults,{scope:"auto"});class Wn extends Be{_doInit(t){t.pointHovering=(this._pointHovering=new Xn(this.chart)).init()}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this._op.xStart)&&void 0!==e?e:t.getXStart()}}var Yn;Wn.defaults=Me(Be.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,resizeDelay:50}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(Yn||(Yn={}));class Un extends lt{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new dt,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Le,(this._chartOptions=new Wn(this)).init(),(this._title=new Qi(this)).init(),(this._subtitle=new Ji(this)).init(),(this._legend=new Os(this)).init(),(this._credits=new jn(this)).init(),(this._tooltip=new tr(this)).init(),this._buttons=new Hn(this),Un.split_class&&(this._split=new Un.split_class(this)).init(),(this._body=new Es(this)).init(),(this._navigator=new Ki(this)).init(),(this._exporter=new Ts(this)).init(),this._series=new ki(this),this._xAxes=new hs(this,!0),this._yAxes=new hs(this,!1),this._gauges=new gs(this),this._annotations=new ze(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},Un.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Gn]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new Un(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getAxisOf(t,e){return this._splitted?this._split.getAxisOf(t,e):e?this.xAxis:this.yAxis}isValidAxis(t){return t&&(!this._splitted||this._split.isValidAxis(t))}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter((t=>t.needAxes()))}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,s){return Hi.collectTooltipText(this.axis.options,this.series,t,e,s)}getTooltipParam(t,e,s){return Hi.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof ds?e:this._annotations.get(t)}get wrapper(){return this._wrapper}get type(){return this._op.type}get gaugeType(){return this._op.gaugeType}get polar(){return this._op.polar}get inverted(){return this._op.inverted}get timeOffset(){return this._op.chart.timeOffset}get startOfWeek(){return this._op.chart.startOfWeek}get seriesCount(){return this._series.count}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){var t;return null===(t=this._gauges)||void 0===t?void 0:t.firstGauge}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}canOverflowRender(){return!1}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getAnnotations(){return this._annotations}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._splitted?this._annotations.getVisibles().filter((t=>isNaN(t.row)||isNaN(t.col))):this._annotations.getVisibles()}_getButtons(){return this._buttons}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.canPolar()}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&(null==this._gauges||this._gauges.isEmpty(t))}_getXAxesAt(t,e){return this._splitted?this._xAxes._internalItems().filter((s=>s.col===t&&(!e||s.checkVisible()))):this._xAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter((s=>s.row===t&&(!e||s.checkVisible()))):this._yAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._xAxes._internalItems().filter((t=>!s||t.checkVisible()))}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._yAxes._internalItems().filter((t=>!s||t.checkVisible()))}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getBodyAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case Yn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Yn.RIGHT:r=s.filter((t=>t._isOpposite));break;case Yn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Yn.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case Yn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Yn.RIGHT:r=i.filter((t=>t._isOpposite));break;case Yn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Yn.TOP:r=s.filter((t=>t._isOpposite))}return r?e?r.filter((t=>t.checkVisible())):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in Un.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&Te(n={},r.base),i(r[s])&&(n||(n={}),Te(n,r[s])),n?Te(n,t):t}_load(t){var e,s;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(w(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(w(t.chart,t.options)),i(t.chart)?this._credits._load(t.chart.credits):i(t.options)&&this._credits._load(t.options.credits),r.title=this._title._load(t.title),r.subtitle=this._subtitle._load(t.subtitle),r.legend=this._legend._load(t.legend),r.credits=this._credits._load(t.credits),this._buttons.load(w(t.button,t.buttons)),r.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series),null===(e=this._gauges)||void 0===e||e.load(w(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(v(t.xAxis,t.xAxes,{})),this._yAxes.load(v(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(s=this._split)||void 0===s||s._load(t.split),this._annotations.load(w(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Be||s instanceof Oe||s instanceof Le)&&s.updateOptions(t[e],!1)}e&&this._modelChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;return[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t,e);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=Pi;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=_({},r))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let s=this._templates[e];if(s)return Te(Te({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?Te(Te({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&fi[t.toLowerCase()]}_getSeriesType(t){return o(t)&&mi[t.toLowerCase()]}_getAxisType(t){return o(t)&&Xe[t.toLowerCase()]}_getGaugeType(t){return o(t)&&_s[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&cs[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Fe[t.toLowerCase()]}getAxesGap(){return y(this._chartOptions.options.axisGap,0)}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}Un.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},as.register(_i,pr,In,wr),Ci.register(Hr,Xr,Sr,Pr,Zr,Kr,Jr,sn,nn,ln,cn,dn,mn,yn,Fr,Ir,vn,Vn,Pn,En,On,$n),Hi.register(Yr,kr,tn,on,Wr,Tn),Hi.registerSeries(Yr,kr,on,Wr,Tn),Ie.register(rr,nr,or);class Zn{constructor(t,e){this._modelCallback=e,this._obj=new Un(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Gn]=null===(t=this[Gn])||void 0===t?void 0:t.destroy(),this._obj=null,this.$_destroyed=!0)}get options(){return this._obj.options}get data(){return this._obj._data}get type(){return this._obj.type}get gaugeType(){return this._obj.gaugeType}get inverted(){return this._obj.inverted}get polar(){return this._obj.polar}get assets(){return this._obj._assets}get chartOptions(){return this._obj.chartOptions}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get first(){return this._obj.first}get series(){return this._obj.firstSeries}get gauge(){return this._obj.firstGauge}get legend(){return this._obj._legend}get credits(){return this._obj._credits}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return o(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart";ot.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Un(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,ot.log("chart-items:",Ne),ot.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[Gn].refresh()}}class qn{constructor(t,e){this._obj=new ct(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Kn extends ht{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){var t;null===(t=this._orphans)||void 0===t||t.clear(),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)}$_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)}getOrphans(){return this._orphans?Array.from(this._orphans.values()):null}addOrphan(t,e){this._prepareOrphans().set(t,e),this._views.splice(this._views.indexOf(e),1)}freeOrphan(t){var e;const s=null===(e=this._orphans)||void 0===e?void 0:e.get(t);s&&(this.free(s),this._orphans.delete(t))}clearOrphans(){var t,e;for(let e of(null===(t=this._orphans)||void 0===t?void 0:t.values())||[])this.free(e);null===(e=this._orphans)||void 0===e||e.clear()}_prepareOrphans(){return this._orphans||(this._orphans=new Map),this._orphans}}const Qn=Object.freeze({x:0,y:0,width:0,height:0});function Jn(t){return{width:t.width,height:t.height}}const to=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map((([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))]))},eo=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},so=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},io=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},ro=function(t,e){const s=to(t),i=to(e),r=eo(s),n=eo(i);for(const t of[...r,...n]){const e=so(s,t),r=so(i,t);if(!io(e,r))return!1}return!0},no=function(t,e){return!(t.y>=e.y+e.height||e.y>=t.y+t.height||t.x>=e.x+t.width||e.x>=t.x+t.width)};class oo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new oo(t,t,t,t):new oo(t,t,e,e):new oo(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 oo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=y(t.paddingLeft,0),this.right=y(t.paddingRight,0),this.top=y(t.paddingTop,0),this.bottom=y(t.paddingBottom,0),this}applyMargin(t){return this.left=y(t.marginLeft,0),this.right=y(t.marginRight,0),this.top=y(t.marginTop,0),this.bottom=y(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}}}oo.Empty=Object.freeze(new oo),oo.Temp=new oo;class ao extends Qt{constructor(t,e=L){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return ao.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ao.IGNORE_ATTRS={width:"",height:""};class ho extends Qt{constructor(t,e=L){super(t,e,"g"),Qt.DEBUGGING&&(this.add(this._debugRect=new Is(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),Qt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Is(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 lo extends ho{constructor(t,e,s){super(t,e),this._margins=new oo,this._paddings=new oo,this.add(this._background=new Is(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 a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}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}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class _o extends ao{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class co extends ho{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class uo extends Qt{constructor(t,e,s){super(t,s,"image"),this._bounds=Qn,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.invalidate()},window.SVGGraphicsElement&&!nt||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return i&&(I(t)||I(e))&&(t>0&&I(e)?e=t/i.width*i.height:e>0&&I(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class po extends ao{constructor(e,s=L){super(e),this.add(this._text=new de(e,s)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Is(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.options.backgroundStyle)):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new de(t),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?(this._icon||this.add(this._icon=new uo(t,!1)),this._icon.setImage(s,+e.options.iconWidth,+e.options.iconHeight)):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,this}setContrast(t){var e;const s=null===(e=this._model)||void 0===e?void 0:e.options;if(t&&(null==s?void 0:s.autoContrast)&&this._text.setContrast(t,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=Dt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(e){const s=this._text,i=this._outline,r=this._icon;let n=0;const o=s.getBBox(),a=o.width,h=o.height;let l=a,_=h,c=0,d=0,u=0,p=0;if(this._box=void 0,r){const t=r.getBBox();switch(n=y(this._model.options.iconGap,0),c=t.width,d=t.height,this._model.getIconPos()){case"left":case"right":l+=n+c,_=Math.max(d,h);break;default:_+=n+d,l=Math.max(c,a)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);u=parseFloat(t.paddingLeft)||0,p=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(t.paddingRight)||0),_+p+(parseFloat(t.paddingBottom)||0),t.rx)}if(r)switch(this._model.getIconPos()){case"left":r.trans(u,(_-d)/2),u+=c+n,l-=c+n;break;case"right":r.trans(u+l-c,(_-d)/2),l-=c+n;break;case"top":r.trans((l-c)/2,p),p+=d+n;break;case"bottom":r.trans((l-c)/2,p+h+n)}switch(e){case"center":u+=l/2,s.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,s.anchor=t.TextAnchor.END;break;default:s.anchor=t.TextAnchor.START}return s.trans(u,p),i&&(i.anchor=s.anchor,i.setAttr("y",s.getAttr("y")),i.trans(s.tx,s.ty)),this}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new de(this.doc),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(t._style)}getBBox(){return this._box?this._box:this._box=super.getBBox()}}class go extends lo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new de(t)),this._richText=new we}rotatedWidth(){const t=this.model.getRotation()*T,e=this.getBBox();return x(p(t)*e.height)+x(u(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*T,e=this.getBBox();return x(u(t)*e.height)+x(p(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation();const n=e.options,o=n.writingMode;o&&this._textView.setStyle("writingMode",o),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===o,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(this._textView,s,i,null,null);const a=Jn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(e){const s=this._textView,i=s.getStyle("writing-mode"),r=i===st||i===it;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":s.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":s.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:s.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}s.trans(o,n)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class mo extends lo{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new de(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new we}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),Jn(this._textView.getBBox())}_doLayout(e){const s=this._textView;let i=this._margins.top+this._paddings.top,r=0;switch(this.textAlign()){case"left":s.anchor=t.TextAnchor.START,r-=this.width/2;break;case"right":s.anchor=t.TextAnchor.END,r+=this.width/2}s.trans(r,i)}}class fo extends ho{constructor(t){super(t,vo.TICK_CLASS),this.add(this._lineView=new Er(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class xo extends po{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1}setLabel(t,e,s,i,r,n){if(i){const o=t.getIcon(s);t.prepareRich(i),this.setModel(this.doc,t,o&&t.getUrl(o),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)}else t.prepareRich(""),this._text.text=""}applyBackgroundCallback(t,e){const s=t.options.backgroundStyleCallback;if("background"===t.options.effect&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*T,e=this.getBBox();return x(p(t)*e.height)+x(u(t)*e.width)}rotatedHeight(){const t=this.rotation*T,e=this.getBBox();return x(u(t)*e.height)+x(p(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_&&!t._isHorz){const t=this.getBBox(),c=r/a,d=e?n-o+l:s?n:l-o;_.transX(d-this.tx),_.shiftY((c-t.height)/-2-h),e?_.resize(i-l-2*(n+o),c-1):_.resize(i-n-l+o,c-1)}}}class yo extends Qt{constructor(t){super(t,void 0),this.add(this._back=new re(t,"rct-crosshair-flag")),this.add(this._text=new de(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.options.flag;this._text.text=(s.prefix||"")+e+(s.suffix||"");const i=this._text.getBBox(),r=new Zt,n=f(s.minWidth||0,i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}}}class bo extends ho{static isThumb(t){return t.classList.contains(bo.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Is(t,bo.TRACK_CLASS)),this.add(this._thumbView=new Is(t,bo.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=f(0,e),this._page=m(s,e),this._pos=m(t.min+e-s,f(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=f(0,m(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=y(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=l,this._trackView.setBounds(h,0,_,c),c-=i;const t=(n||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||o===r?_:_*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*a/r,h+1,t,c-2)}}}bo.CLASS_NAME="rct-axis-scrollbar",bo.TRACK_CLASS="rct-axis-scrollbar-track",bo.THUMB_CLASS="rct-axis-scrollbar-thumb";const wo=/\${label}.*?/g;class vo extends ho{constructor(t){super(t,vo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new Er(t,vo.LINE_CLASS)),this.add(this._titleView=new go(t)),this.add(this._markContainer=new Qt(t,"rct-axis-ticks")),this.add(this._labelContainer=new Qt(t,"rct-axis-labels")),this.add(this._unitView=new mo(t)),this._labelViews=new Kn(this._labelContainer,xo,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new bo(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=f(0,i.tick._getLength())+f(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=f(0,i.tick._getLength())+f(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{const n=this.model.guides.filter((t=>t.options.front==(1===r)&&t.canConstainedTo(e,s)));i.setAll(t,n,!1)}))}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new yo(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?m(0,this.width-n.width):f(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this._model=t,this._chartEmpty=t.chart.isEmpty(!0)}checkExtents(t){const e=this._prevModel,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.chart.animatable()&&s.options.animatable&&s.checkExtents(t,e)}}this._prevModel=s}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView,c=this._unitView;let d=0,u=0;return this._reversed=e.options.reversed,(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Er(t,vo.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.label._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=h?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t._ticks,o=t._markPoints,a=this._labelViews,h=this._unitView,l=this._markLen,_=this._tickGap,c=this.width,d=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?d:0,0,c):this._lineView.setVLine(s?0:c,0,d),this._lineView2&&(e?this._lineView2.setHLine(d,0,c):this._lineView2.setVLine(0,0,d))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,l),e.layout().trans(t.prev(o[i]),s?r?d:d-l:r?-l:0)})):this._markViews.forEach(((e,i)=>{e.resize(l,1),e.layout().trans(s?-l:r?c:c-l,d-t.prev(o[i]))})));const u=l+_;if(this._labelContainer.visible&&a.count>0&&(a.count>n.length?a.prepare(n.length):a.count<n.length&&ot.warn("labelViews.count < ticks.length",a.count,n.length),e?this.$_layoutLabelsHorz(a,n,r,i,s,c,d,u):this.$_layoutLabelsVert(a,n,r,i,s,c,d,u)),h.visible&&(e?this.$_layoutUnitHorz(h,a,s,c,d,u):this.$_layoutUnitVert(h,a,s,c,d,u)),!this._simpleMode){const i=t.title.options,n=this._titleView,o=this._scrollView,a=this._labelSize;let h=0,l=0;if(n.visible){const o=+i.offset||0,_=+i.gap||0;if(n.resizeByMeasured().layout(e),e){if(l+=s?0:(r?0:u+a)+_,t.options.reversed)switch(i.align){case"start":h=c-n.width/2-o;break;case"end":h=n.width/2+o;break;default:h=c/2-o}else switch(i.align){case"start":h=n.width/2+o;break;case"end":h=c-n.width/2-o;break;default:h=c/2+o}n.trans(h,l),l+=n.height}else{const t=0===n._angle?n.width:n.height;if(h=s?r?_+t/2:u+a+_+t/2:r?t/2:c-u-a-_-t/2,this._reversed)if(0===n._angle)switch(i.align){case"start":l=0+o;break;case"end":l=d-n.height-o;break;default:l=(d-n.height)/2+o}else switch(i.align){case"start":l=n.width/2-n.height/2+o;break;case"end":l=d-n.width/2-n.height/2-o;break;default:l=(d-n.height)/2+o}else if(0===n._angle)switch(i.align){case"start":l=d-n.height-o;break;case"end":l=0+o;break;default:l=(d-n.height)/2-o}else switch(i.align){case"start":l=d-n.width/2-n.height/2-o;break;case"end":l=n.width/2-n.height/2+o;break;default:l=(d-n.height)/2-o}n.trans(h,l)}}else l+=s?0:u+a;(null==o?void 0:o.visible)&&(e?(o.trans(0,l).resize(this.width,o.mh),o.setScroll(t._zoom,this._reversed)):(o.trans(0,0).resize(o.mw,this.height),o.setScroll(t._zoom,this._reversed)),o.layout())}}$_prepareTickMarks(t,e){const s=this._markContainer;if(s.visible=e.tick.visible){const i=e._markPoints.length,r=this._markViews;for(;r.length<i;){const e=new fo(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),o=e.label,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(wo)?t.setLabel(s,a,e,n.replace(wo,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_prepareLabels(t,e){if(this._labelContainer.setVis(!this._chartEmpty&&t.labelsVisible())){let e=t._ticks.length;return this._labelContainer.setStyleOrClass(t.label._style),e}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz2(t,e,s,i,r,n,o,a){const h=t.label,l=f(0,m(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,d=(i=f(1,i))*(r=m(f(1,r),_.length)),p=n||0,g=x(p)*T,y=g<35*T;let b,w=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=d){let i=0;for(let e=r;e<r+d&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+d<c){b=e.pull(v++),b.rotation=p,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===p&&b.getBBox().width>=t){w=!0;break}if(y&&b.getBBox().width*u(g)>=t){w=!0;break}if(0!==p&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-d;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=p,b.index=t,this._prepareLabel(b,_[t],h,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=f(0,m(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.options.reversed,r=t.label,n=r.options;let o,a=+n.step|0,h=+n.rows|0,l=+n.rotation%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s),c=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=l,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),c=this.$_applyStep(t,c,a||1);else{switch(a=h=0,r.options.autoArrange){case"rows":h=this.$_getRows(c);break;case"step":a=this.$_getStep(c)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(h>1){for(;t._ticks.length>h&&(c.forEach(((t,e)=>{t.row=e%h,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,h,0,!1,s));)h++;this._labelRowPts=[]}else if((isNaN(l)||Math.abs(Math.tan(l*T))<1)&&(l=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,0,!0,s)&&c.forEach(((t,e)=>{t.rotation=l}));break}a++}}else;if(c.length>0){if(h>1){const t=!isNaN(l)&&0!=l,e=this._labelRowPts;for(let t=0;t<h;t++)e.push(0);c.forEach((s=>{e[s.row]=f(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(l)||0==l){o=c[0].getBBox().height;for(let t=1;t<c.length;t++)o=f(o,c[t].getBBox().height);if(c.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=c[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<c.length;t++)r=f(r,c[t].getBBox().height);(i+s>c[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(o=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=c[c.length-1],s=t.rotatedWidth(),i=c[c.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,a=0;for(let t=0;t<c.length-1;t++)a=f(a,c[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>a?(o=a,t.hidden=!0):t.hidden=!1}}}else{o=c[0].rotatedHeight();for(let t=1;t<c.length;t++)o=f(o,c[t].rotatedHeight())}return o}return 0}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=f(1,i);let l,_=n.options.startStep||0,c=0;for(;_<a;_+=h){let i=0;for(let e=_;e<_+h&&e<a;e++)i+=t.getLabelLength(s,o[e].value);if(_+h<a&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,o[_],n,a,r),l.setVis(!0),l._text.getBBox().height>=i))return!0}const d=_-h;0<=d&&d<a&&(l=e.pull(c++),l.rotation=0,l.index=d,this._prepareLabel(l,o[d],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof ur)return this._prevWidth;const r=t.label;let n=f(1,+r.options.step|0);const o=this.$_checkOverlappedVert2(t,this._labelViews,e,n,s);let a=this._labelViews._internalItems();if(o)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,n||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++n,s););else;if(this._labelViews.freeHiddens(),a=this._labelViews._internalItems(),a.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;a[0].setContrast(null).layout(s),i=a[0].getBBox().width;for(let t=1;t<a.length;t++)a[t].setContrast(null).layout(s),i=f(i,a[t].getBBox().width);return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h.label,_=this._reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,u=t.get(0).rotation,g=u*T,m=+h.label.options.rows|0,f=u<-15&&u>=-90||u>15&&u<=90,x=t.count,b=y(h._prevRate,1);let w,v,S;if(t.freeHiddens(),t.forEach(((t,i)=>{const l=e[t.index];t.setVis(!!l)&&(t.setContrast(null).layout(c),w=t.getBBox(),v=h.prev(l.pos)+(_?n*(1-b):0),S=s?r?o+a+d[t.row]:-a-w.height-d[t.row]:r?o-a-w.height-d[t.row]:a+d[t.row],u<-15&&u>=-90?s?r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):r?(v-=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):u>15&&u<=90?s?r?(v+=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):(v-=w.width/2,t.setRotation(w.width/2,0,r?-u:u)),t.trans(v,S))})),!f&&m<2&&x>1){let e=t.get(_?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=_?i.lastOverflow:i.firstOverflow;let h,c=e.tx;c+o>=s.tx?"pull"===a?c=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?c=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(c):e.setVis(!1)}(0,e,t.get(_?x-2:1)),e=t.get(_?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const c=e.rotatedWidth(),d=_?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-c):a="hidden"!==d:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===d?h=Math.max(o+r,h-(u-p+4)):a="hidden"!==d),a?e.transX(h):e.setVis(!1)}(this,e,t.get(_?1:x-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof _i&&l.label.options.fillToCategory,c=r?s?"right":"left":i?"center":s?"left":"right",d=_?l.label.options.verticalAlign:"middle",u=_?l.label.options.align:c,p=this._titleView,g=p.visible?p.rotatedWidth()+(null===(h=p.model)||void 0===h?void 0:h.options.gap):0,m=this._labelSize,f=l.tick._getGap();const x=this._reversed,b=x?y(l._prevRate,1):1;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;t.forEach(((t,h)=>{var c;const y=e[t.index];if(t.setVis(!!y)){const e=t.getBBox(),h=function(t,e){if(s)if(r)switch(t){case"center":return(m-e)/2-m-f-a;case"left":return-m-f-a;default:return-e-f-a}else switch(t){case"right":return n+a+f+m-e;case"center":return!p.visible&&i?(n-e)/2:n+a+f+(m-e)/2;default:return n+a+f}else if(r)switch(t){case"center":return a+(n-g-e-a+f)/2;case"right":return n-e-g+f;default:return a}else switch(t){case"left":return g-f;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-f)/2;default:return n-a-e}}(u,e.width),v=o*b-l.prev(y.pos)-e.height/2;if(t.trans(h,v),_){const s=(l._len-l._minPad-l._maxPad)/(null!==(c=l._weights.get(y.value))&&void 0!==c?c:1),h=o/s,_="top"===d?(h-e.height)/-2:"bottom"===d?(h-e.height)/2:0;t.shiftY(_),t.resizeBackByWeight(l,i,r,n,o,a,f,s,_,g)}else!x&&t.ty+e.height>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+e.height:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?h?(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):h?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,i-l.width)):(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)),t.layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=s?n:i-l.width-n;a?h?(c.getBBox(),u=Math.max(c.ty+l.height+d,r)):u=Math.min(_.ty-l.height-d,0):h?u=Math.min(c.ty-l.height-d,0):(_.getBBox(),u=Math.max(_.ty+l.height+d,r)),t.layout().trans(p,u)}}vo.AXIS_CLASS="rct-axis",vo.LINE_CLASS="rct-axis-line",vo.TICK_CLASS="rct-axis-tick";class So extends Qt{constructor(t,e,s){super(t,So.STYLE),this.add(this._back=new Is(t,So.BACK_STYLE)),this.add(this._textView=new de(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new oo).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom,rx:y(parseFloat(e.rx),0),ry:y(parseFloat(e.ry),0)},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}So.STYLE="rct-button",So.BACK_STYLE="rct-button-background";class Vo extends Qt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Ao extends re{setArc(t,e,s,i,r,n){this.setPath(Fs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Po extends Ao{setPolyline(t){this.setPath(Fs.polygon(...t))}}class Co extends re{constructor(t,e,s){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return Fs.sector(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.innerRadius||0,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}$_renderArc(){return Fs.arc(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}}const ko={};class Lo extends lo{static register(...t){t.forEach((t=>{ko[t[0].type]=t[1]}))}constructor(t,e){super(t,Lo.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new Qt(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}resetClip(t,e,s){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Lo.CLASS_NAME="rct-annotation";const No={};class Mo extends co{static register(...t){t.forEach((t=>{No[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Is(t,Mo.PANE_CLASS)),this.add(this._contentContainer=new te(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Mo.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=_(Rt.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Bo)return t;t=t.parent}}}Mo.GAUGE_CLASS="rct-gauge",Mo.PANE_CLASS="rct-gauge-pane";class Eo extends Xt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class To extends po{}class Bo extends Mo{_defaultCalss(){return Bo.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new te(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}Bo.GAUGE_GROUP_CLASS="rct-gauge-group";class Oo{static reveal(t,e){new $o(t,e)}static grow(t,e){new Io(t,e)}static spread(t,e){new zo(t,e)}static fadeIn(t){new Do(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);ot.isAnimation(s)&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Do extends Oo{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:Xt.DURATION,fill:"none"})}}class Ro extends Oo{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=Ro.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Xt.DURATION,fill:"none"}}$_left(t,e){return t.dom.firstElementChild.animate([{width:0},{width:""}],this.$_aniOptions(e))}$_right(t,e){return t.dom.firstElementChild.animate([{x:t.width},{x:""}],this.$_aniOptions(e))}$_top(t,e){return t.dom.firstElementChild.animate([{height:0},{height:""}],this.$_aniOptions(e))}$_bottom(t,e){return t.dom.firstElementChild.animate([{y:t.height},{y:""}],this.$_aniOptions(e))}}class $o extends Xt{constructor(t,e){super(),this._series=t,this._cr=Ro.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof Qt}_stop(t){super._stop(t),this._series=null}_doUpdate(t){const e=this._cr.dom.firstElementChild;switch(this._from){case"top":e.setAttribute("height",this._cr.height*t);break;case"bottom":e.setAttribute("y",this._cr.height*(1-t));break;case"right":e.setAttribute("x",this._cr.width*(1-t));break;default:e.setAttribute("width",this._cr.width*t)}return!0}}class Fo extends Xt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Qt}_stop(t){super._stop(t),this._series=null}}class Io extends Fo{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class zo extends Fo{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Ho extends po{constructor(t){super(t,"rct-series-trendline-label")}}class Go extends te{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new re(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new re(t,"rct-series-trendline-variable")),this.add(this._line=new re(t)),this.add(this._label=new Ho(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,h=this.$_getPoints(e,s);this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new re(t,"rct-series-trendline-marker")),this.add(this._endMarker=new re(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,null,e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map((t=>{const s=e.start+r.getPos(a,t.x),i=n.getPos(e.rd,t.y);return{x:e.cx+i*u(s),y:e.cy+i*p(s),a:s}})):t._points.map((t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}})),h}$_getLine(t,e){const s=new Zt;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new Zt,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new Zt,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=Fs.getDrawer(t.marker.options.shape);this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,_=this._label;if(!String(h.options.text))return void _.setVis(!1);h.prepareRich(h.options.text),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const c=h.options.position,d=t?function(t){const e=Math.floor((n.length-1)*t),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(c):0,u=t?h.getAlignPolar(d):h.getAlign(s,i,r,c),p=t?h.getVerticalAlignPolar(d):h.getVerticalAlign(s,i,r),g=h.getOffsetX(u)+("middle"===p?l:0),m=h.getOffsetY(p)+("center"===u?l:0),f=Math.floor((n.length-1)*c),x=(n.length-1)*c-f;let y,b;if(f>=n.length-1)y=n[n.length-1].x,b=n[n.length-1].y;else{const t=n[f],e=n[f+1];y=t.x+(e.x-t.x)*x,b=t.y+(e.y-t.y)*x}const w=_.getBBox();switch(u){case"left":y-=w.width+g;break;case"center":y-=w.width/2+g;break;case"right":y+=g}switch(p){case"top":b-=w.height+m;break;case"middle":b-=w.height/2+m;break;case"bottom":b+=m}t||(y<0&&(y=0),b<0&&(b=0),y+w.width>o&&(y=o-w.width),b+w.height>a&&(b=a-w.height)),_.trans(y,b)}}class jo extends Xt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Jo.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(Jo.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Xo extends po{constructor(t){super(t,"rct-point-label")}}class Wo extends te{constructor(t){super(t,"rct-point-labels"),this._labels=[new Kn(this,Xo),new Kn(this,Xo)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach((t=>e=f(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,i.icon?n.getUrl(i.icon):null,r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.stopAni().setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}})),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(no(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Us)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ro(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ro(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ro(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ro(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort(((t,e)=>t.ty-e.ty));const h=t.getBBox(),l=h.y+h.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<_&&(_=i,c=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<c;t++){const e=u(t,t+1);if(e>0){d(t,-e);for(let e=t;e>0;e--){const t=u(e-1,e);t>0&&d(e-1,-t)}}}for(let t=a-1;t>=c&&t>0;t--){const e=u(t-1,t);if(e>0){d(t,e);for(let e=t;e<a-1;e++){const t=u(e,e+1);t>0&&d(e+1,t)}}}const p=this.control.chartView().bodyView().height;if(r){const t=(t,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[c];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<c?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&s(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),h=0;for(let t=c;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=c;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===Zs&&e.forEach(((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))})),1}}class Yo extends ao{constructor(t){super(t),this.add(this._line=new re(t))}setLine(t){this._line.setPath(t)}}class Uo extends ao{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Kn(this,Yo)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach(((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class Zo extends te{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t===this.inverted&&e===this._hSave||((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform",""),this._hSave=e),this.inverted}}const qo={},Ko="rct-point-hover",Qo="rct-point-unhover";class Jo extends co{static register(...t){t.forEach((t=>{qo[t[0].type]=t[1]}))}static isPointDom(t){for(;Rt.isSVGElement(t);){if(t.classList.contains(this.POINT_CLASS))return!0;t=t.parentElement}}constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointContainer=new Zo(t,"rct-series-points")),this._labelContainer=new Wo(t)}depthEnabled(){return!1}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointLabelVisible(t){return t.visible&&!t.isNull&&!t.isEmpty()&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&(this._clearHoverClasses(e),!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e))}_doPointClicked(t){}_getPointColors(){return"a"}_setDepth(t){this._depthExt=t}setCircular(t){}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===et,this.setData("index",e._seriesIndex%Pi),this.setData("pointcolors",this._colorByPoint?this._getPointColors():L),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=r[this._legendColorProp()],e._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:"",this._visPoints=this._collectVisPoints(e),this._yReversed=e._yAxisObj.options.reversed,this._prepareSeries(t,e,s,i)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach((t=>{t!==e&&t.removeClass(Ko).addClass(Qo)}))):this._getPointPool().forEach((t=>{t.containsClass(Qo)&&t.removeClass(Qo).addClass(Ko)}))}_clearHoverClasses(t){t instanceof Qt&&t.removeClass(Ko).removeClass(Qo)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(i.forEach((e=>{if(e instanceof Qt&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.cancel(),e.setBoolData(Jo.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof _a&&r.push(new jo(this,e,!1,(()=>{e.endHover(this,!1)})))}})),t&&t.forEach((t=>{if(t&&!t.point.isNull){const e=s.find((e=>e._marker===t));e&&e.cancel(),t instanceof Qt&&(t.setBoolData(Jo.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof _a?r.push(new jo(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof ua&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}}))),s&&s.forEach(((t,e)=>{t._started&&r.push(t)})),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/s*(i||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&jt(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Li&&e.trendline.visible?(this._trendView||this.add(this._trendView=new Go(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.options.overlapOutline,contrast:i.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.options.autoHide||!this.$_labelAnimating()))&&this.$_renderTrendline(r,this._inverted,t,e),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Pi):e.index%Pi;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return y(this._growRate,1)}_getPosRate(){return y(this._posRate,1)}$_labelAnimating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||this._animations.length>0}_animating(){return this.$_labelAnimating()||!isNaN(this._prevRate)}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(t,e,s,i){const r=this.model;r instanceof Li&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=h.getBBox();let d=!0;r?(n-=e.distY,o+=e.distX,o-=c.height/2-c.height*t._vertAdjust):(n-=e.distX,o+=e.distY,n-=c.width/2);const u=n,p=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,_?n+=l:n-=c.width+l):(n-=e.base,o+=e.side,_?o-=c.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+l:a-l):(n-=e.base,o+=e.side,o+=_?a+l:a-c.height-l);break;case"far":r?n=_?l:s-c.width-l:_?(n-=e.base,o=i-c.height-l):o=l,d=!1;break;default:r?_?n-=c.width+l:n+=l:_?(n-=e.base,o+=e.side,o+=l):o-=c.height+l,d=!1}this._checkLabelOverlap(h,c,u,p,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const h=_.fit;if(isFinite(h)&&(_.inverted?o+e.width>=_.width?c=(o=_.width+h-e.width)<s+r:o<=0&&(c=(o=-h)+e.width>s-r):a+e.height>=_.height?c=(a=_.height+h-e.height)<i+n:a<=0&&(c=(a=-h)+e.height>i-n)),c){if(!isFinite(h))return t.setVis(!1),!1;_.outline&&t.setOutline(_.model)}}return t.setContrast((h||c&&_.contrast)&&l),t.trans(o,a),!0}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.options.reversed,l=a.getPos(o?t:e,f(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,m(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,x(_-l),e):r.setBounds(l,-e,x(_-l),e):r.setBounds(0,-f(l,_),t,x(_-l)):o?h?r.setBounds(_,0,x(_-l),e):r.setBounds(l,0,x(_-l),e):r.setBounds(0,e-f(l,_),t,x(_-l))}_setFill(t,e){i(e)&&e[Y]?t.internalSetStyle(Y,e[Y]):o(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=y(e.fit,0),l=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,s);if(!_&&c!==js)if(l?c!==Gs&&c!==Hs||(d*=-1):c===Hs&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}Jo.POINT_CLASS="rct-point",Jo.DATA_FOCUS="focus",Jo.DATA_UNFOCUS="unfocus",Jo.DATA_UNHOVER="unhover",Jo.LEGEND_MARKER="rct-legend-item-marker";class ta extends re{constructor(t){super(t,Jo.POINT_CLASS)}savePrevs(){}}class ea extends ta{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class sa extends Qt{constructor(t){super(t,Jo.POINT_CLASS)}savePrevs(){}}class ia extends sa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let ra=class extends ea{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(Fs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}shrink(t,e,s,i){const r=this.point;if(!r.isNull){const n=r._vr,o=r._getDrop()*(t?-1:1);if(isNaN(o))this.hPoint*=1-n||1,this.layout(this.x,this.y,s,i,0,0,!1);else{let t=r._getSave();isNaN(t)&&r._setSave(t=this.x);const a=o<0?t*(1-n)-this.wPoint/2*n:e-(e-t)*(1-n)+this.wPoint/2*n;this.layout(a,this.y,s,i,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class na extends ia{constructor(t){super(t),this.add(this._topView=new re(t)),this.add(this._frontView=new re(t)),this.add(this._sideView=new re(t))}layout(t,e,s,i,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const _=h<0?e:e-h;if(nt&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Fs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Fs.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Dt.interpolate(o?Dt.BLACK:Dt.WHITE,l,.2)),this._sideView.setPath(Fs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Dt.interpolate(o?Dt.WHITE:Dt.BLACK,l,.2))}}class oa extends ao{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class aa extends Jo{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Oo.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class ha extends aa{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Uo(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*T,this._base=u(this._depthAngle)*e.depth,this._side=p(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),this._pointOff=e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var s;const i=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=i.pointLabel,h=this._labelViews(),l=this._labelLineContainer,c=i._xAxisObj,d=i._yAxisObj,g=this._yReversed,m=this._depthExt,x=i._group?i._groupDistance:i.distance,b=m?x*(r?p(this._depthAngle):u(this._depthAngle)):0,w=m?x*(r?u(this._depthAngle):p(this._depthAngle)):0,v=2*c.unitPad(),S=y(i.options.minPointWidth,0),V=this._yLen=r?t:e,A=r?e:t,P=t=>d.getPos(V,t),C=t=>c.getPos(A,t),k=r?0:e,L=d.valueMin(),N=P(L),M=this._baseVal=i.getBaseValue(d),E=!isNaN(M),T=this._yBase=y(P(f(L,y(M,N))),N),B=this._pointOff,O=h&&_(this._labelInfo,{inverted:r,reversed:g,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:w,side:this._side,base:this._base});h&&l.setVis(i.pointLabel.line.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(i.pointLabel.line._style),l.prepare(i),O.pb=new Zt),this._prepareLayoutPoints(t,e),null===(s=this._getPointPool().getOrphans())||void 0===s||s.forEach((t=>{this._shrinkPoint(t)})),this._getPointPool().forEach(((s,l)=>{const _=s.point;if(s.setVis(!_.isNull)){const d=c.getUnitLen(A,_.xValue)*(1-v);let u=i.getPointWidth(d,S),p=P(_.yGroup),g=T;if(_.yGroup!=_.yValue){const t=M>_.yGroup,e=_.yGroup<0,s=_.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=_.yGroup-_.yValue*(i?-1:1);g=P(r)}const m=(p-g)*n;let f=C(_.xValue)-d/2,x=k-p;isNaN(o+s.wSave)||(u=s.wSave+(u-s.wSave)*o),f+=i.getPointPos(d)+u/2,isNaN(o+s.xSave)||(f=s.xSave+(f-s.xSave)*o),_.xPos=f+=u*B,_.yPos=x,this._layoutPoint(s,l,f-b,k-T*(1-n)-g*n+w,u,m),r&&(x=A-C(_.xValue)+d/2,f=k,_.yPos=x-=i.getPointPos(d)+u/2+u*B,_.xPos=f+=E?P(_.yGroup)*n:P(_.yGroup*n)),O&&(O.labelView=h.get(_,0))&&(O.pointView=s,O.x=f,O.y=x,O.wPoint=u,O.hPoint=m,this._layoutLabel(a,O,t,e))}}))}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class la extends aa{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._pointOff=+e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=2*h.unitPad(),d=y(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,m=this._pointOff,f=a&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach(((_,x)=>{const y=_.point;if(_.setVis(!y.isNull)){const b=h.getUnitLen(p,y.xValue)*(1-c);let w=s.getPointWidth(b,d);const v=(l.getPos(u,this._getHighValue(y))-l.getPos(u,this._getLowValue(y)))*r;let S=h.getPos(p,y.xValue)-b/2,V=g-l.getPos(u,this._getHighValue(y))*r;isNaN(n+_.wSave)||(w=_.wSave+(w-_.wSave)*n),S+=s.getPointPos(b)+w/2,isNaN(n+_.xSave)||(S=_.xSave+(S-_.xSave)*n),y.xPos=S+=w*m,y.yPos=V,this._layoutPoint(_,x,S,V,w,v),i&&(V=p-h.getPos(p,y.xValue)+b/2,S=g,y.yPos=V-=s.getPointPos(b)+w/2+w*m,y.xPos=S+=l.getPos(u,this._getHighValue(y))*r),a&&(f.pointView=_,f.hPoint=v,f.x=S,f.y=V,(f.labelView=a.get(y,0))&&(f.hPoint=v,this._layoutLabel(o,f,t,e)),(f.labelView=a.get(y,1))&&(i?f.x-=v:f.y+=v,f.hPoint=-v,this._layoutLabel(o,f,t,e)))}}))}}class _a extends ta{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class ca extends Jo{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.options.position;let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==js){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class da extends Xt{constructor(t,e){super(),this.series=t,this.duration=e}_doUpdate(t){const e=this.series;return!!e&&(e._zombieRate=e._zombie.visible?t:1-t,e._refreshZombie(),!0)}_doStop(){const t=this.series;t&&(t._zombie=null,t._zombieAni=null,t.invalidate(),this.series=null)}}class ua extends Jo{togglePointVisible(t){var e;t.yValue<0||(this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(250))}needFronting(){return!0}clipInvertable(){return!1}isPointLabelVisible(t){return t===this._zombie||super.isPointLabelVisible(t)}_collectVisPoints(t){let e=super._collectVisPoints(t);return this._willZombie&&!this._willZombie.visible&&(e.push(this._willZombie),e=e.sort(((t,e)=>t.index-e.index))),e}_prepareSeries(t,e){var s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new da(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Is.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s.legendMarker()||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class pa extends Lo{constructor(t){super(t,pa.CLASS_NAME),this.addToTransform(this._imageView=new uo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.options.imageUrl);const o=this._imageView.getBBox();return this._inflaePaddings(o),Jn(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_setImage(t){this._imageView.setImage(t,this._size.width,this._size.height)}}pa.CLASS_NAME="rct-image-annotation";class ga extends Lo{constructor(t){super(t,ga.CLASS_NAME),this.addToTransform(this._shapeView=new re(t))}_doMeasure(t,e,s,i,r){var n,o,a,h;const l=e.getSize(s,i),_=null===(n=e.chart.xAxis)||void 0===n?void 0:n.getPos(s,e.options.x1),c=null===(o=e.chart.xAxis)||void 0===o?void 0:o.getPos(s,e.options.x2),d=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),u=null===(h=e.chart.yAxis)||void 0===h?void 0:h.getPos(i,e.options.y2);let p=0,g=0;switch(e.getShape()){case sr:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Fs.line(g,p,g+l.width,p));break;case er:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Fs.line(g,p,g,p+l.height));break;case ir:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:d<u?l.height:0);const t=_>c?g-l.width:g+l.width,s=d<u?p-l.height:p+l.height;this._shapeView.setPath(Fs.line(g,p,t,s));break;default:Fs.setShape(this._shapeView,e.getShape(),l.width/2,l.height/2)}return this._deflatePaddings(l),l}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}ga.CLASS_NAME="rct-shape-annotation";class ma extends Lo{constructor(e){super(e,ma.CLASS_NAME),this.addToTransform(this._textView=new de(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new we}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i),a=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(o),this._richText._isVertical="vertical"===n.writingMode,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(a,s,i,null,e._domain);const h=Jn(this._textView.getBBox());return{width:y(o.width,h.width),height:y(o.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}ma.CLASS_NAME="rct-text-annotation";class fa extends Kn{freeOrphans(){const t=this.getOrphans();return t&&t.forEach((t=>{t.point._vr>=1&&this.freeOrphan(t.point)})),this}addOrphanedPoints(t,e=!0){if(e&&this.freeOrphans(),Array.isArray(t)){const e=this._prepareOrphans();t.forEach((t=>{let s=e.get(t);s||(s=this.find((e=>e.point===t)),s&&this.addOrphan(t,s))}))}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class xa extends _a{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;Fs.setShape(this,this._shape,this._radius*t,this._radius*t),this.setStyle("opacity",String(.8*t))}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),Fs.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:Math.sqrt((i-e)**2+(r-s)**2)-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class ya extends Zo{}class ba extends Jo{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new ya(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new re(t,"rct-line-series-line")),this._markers=new fa(this._pointContainer,xa),this.add(this._tester=new re(t)),this._tester.setFill("#ff000010")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e,s){e instanceof Fr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._based&&e.options.belowStyle,this._prepareBelow(e.chart.isPolar())),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.buildLines(this._visPoints)}_doAfterLayout(){this._layoutLines(this._polar)}_runShowEffect(t){this._polar?t&&Oo.grow(this):t&&Oo.reveal(this,{from:function(t){const e=t.model._xAxisObj.options.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._prepareBelow(!!this._polar),this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines(this._polar)}getPointsAt(t,e){return[]}getNearest(t,e){const s=this.model.marker.options.radius,i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce(((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n));return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,s){return t<=this.model.marker.options.radius+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new re(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Kn(this._lineContainer,re)),i.prepare(e.length);s.length<e.length;){const t=new ie(this.doc);this.control.addClip(t),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:i,rd:r,min:o,max:a,cyclic:h}=this._polar,l=D(f(0,m((M-x(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(Fs.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Fs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Fs.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Fs.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():Fs.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(Fs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Fs.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():Fs.sector(t,i,s*_,s*_,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){var s;const i=t instanceof Fr&&this._needBelow,r=i?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(s=this._markers)||void 0===s||s.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const s=this._markersPerPoint(),o=i&&t.options.belowStyle,a=e.length;this._markers.prepare(a*s,((s,h)=>{const l=e[h%a];l.isNull||(s.point=l,n[1]=i&&l.yValue<r?o:null,this._setPointStyle(s,t,l,n)),s.point=l,s.index=h<a?0:1}))}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),Fs.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,d=r.options.maxVisible,g=r.options.minVisible,m=i.pointLabel,f=m.options.align,x=m.getAlignOffset(),y=m.getOffset(),b=m.getPosition(),w=this._labelContainer._textAlign,v=this._labelViews(),S=i._xAxisObj,V=i._yAxisObj,A=this._polar=i.chart._body.getPolar(S),P=!!A,{cx:C,cy:k,rd:L,start:N,total:M}=A||{},E=o?e:s,T=A?M:o?s:e,B=o?0:s,O=t.length,D=V.axisMax(),R=this._yReversed,$=V instanceof pr?i.getBaseValue(V):NaN,F=$>V.axisMin(),I=V.getPos(L,$);this._pointContainer.visible&&this._shrinkPoints(i),t.forEach(((t,r)=>{let m,z,H,G;A?(H=N+S.getPos(T,t.xValue),G=R?isNaN(t.yGroup)?F?I:L:F?I+(V.getPos(L,t.yGroup)-I)*h:L-V.getPos(L,D-t.yGroup)*h:isNaN(t.yGroup)?F?I:0:F?I+(V.getPos(L,t.yGroup)-I)*h:V.getPos(L,t.yGroup)*h,m=t.px=C+G*u(H),z=t.py=k+G*p(H),t.angle=H):(m=t.px=S.getPos(T,t.xValue),z=t.py=B-V.getPos(E,t.yGroup),o&&(m=V.getPos(E,t.yGroup),z=s-S.getPos(T,t.xValue))),t.xPos=m,t.yPos=z;const j=m,X=z,W=this._markers.get(r),Y=v&&v.get(t,0);if(W&&W.setVis(!t.isNull&&(P||!a||m>=0&&m<=e&&z>=0&&z<=s))){this._prepareMakrer(W),this._layoutMarker(W,n,m,z),i._maxY,t.yGroup,i._minY,t.yGroup;const e=0==r&&null!=_?_:r==O-1&&null!=c?c:i._maxY==t.yGroup&&null!=d?d:i._minY==t.yGroup&&null!=g?g:l;if(W.setStyle("opacity",e?"1":"0"),Y){Y.setContrast(null).layout(w);const e=Y.getBBox(),s=W._radius;if(Y.visible=!0,A){switch(b){case"inside":R?t.yValue<$?G-=y:G+=y:t.yValue<$?G+=y:G-=y;break;case"foot":R?t.yValue<$?G-=e.height/2+y:G+=e.height/2+y:t.yValue<$?G+=e.height/2+y:G-=e.height/2+y;break;default:R?t.yValue<$?G+=e.height/2+y:G-=e.height/2+y:t.yValue<$?G-=e.height/2+y:G+=e.height/2+y}m=C+G*u(H),z=k+G*p(H)-e.height/2,this.applyAutoRotation(Y,H,M,S.options.totalAngle)}else switch(b){case"inside":z-=e.height/2+y;break;case"foot":z+=y+(l?s:0);break;default:z-=e.height+y+(l?s:0)}switch(f){case"left":m-=e.width+(l?s:0)+x;break;case"right":m+=(l?s:0)+x;break;default:m-=e.width/2+x}this._checkLabelOverlap(Y,e,j,X,s,s,m,z,!1,null),this._layoutLabelRotation(Y,e,m,z)}}else Y&&Y.setVis(!1)}))}_shrinkPoints(t){var e;null===(e=this._getPointPool().getOrphans())||void 0===e||e.forEach((t=>{t.visible&&t.shrink()}))}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof Fr&&this._needBelow;let o=this._buildLines(t,e._lines);if(e._runRanges)this._rangeLines.forEach(((t,n)=>{const a=e._runRanges[n];t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",a.color),t.internalSetStyleOrClass(a.style),Rt.setImportantStyle(t.dom.style,Y,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Rt.setImportantStyle(t.dom.style,Y,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);t?this.$_resetClips(s,i/2,h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,h.getPos(s,l),!0):this.$_resetClips(s,i,i-h.getPos(i,l),!1),a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.options.belowStyle),Rt.setImportantStyle(a.dom.style,Y,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Fr&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.options.stepDir):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new Zt;return"spline"===i?this._drawCurves(t,e,r):s instanceof Fr&&"step"===i?this._drawSteps(e,r,s.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof Fr&&this._model.options.connectNullPoints;s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this.$_drawLine(t,!1,e)))}_drawStep(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep(t,!1,e,s)))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rd:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof pr?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],d=c.length;let g,m;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(g=i+_*u(c[0].angle),m=r+_*p(c[0].angle),s.move(g,m),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),g=i+_*u(c[d-1].angle),m=r+_*p(c[d-1].angle),s.line(g,m))}else e.forEach((t=>this._drawCurve(t,!1,s)))}_buildAreas(t,e,s){const i=new Zt;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class wa extends ba{constructor(t){super(t,wa.CLASS),this._flagView=new po(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.options.icon?s.getUrl(s.options.icon):null,null),i.setContrast(null).layout("left");const o=s.options.offset,a=i.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?l>this._markers.get(this._markers.count-2).y?"bottom":"top":h>this._markers.get(this._markers.count-2).x?"right":"left";const c={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[_],{width:d,height:u}=a,p=d/2,g=u/2,{width:m,height:f}=r,x=m/2,y=f/2,b=l>u+o,w=f>l+u+o,v=h>d+o,S=m>h+d+o,V={top:b,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const A=h>p&&m-h>p?h-p:h>x?m-d:0,P=l>g&&f>l+g?l-g:l>y?f-u:0;switch(_){case"top":h=A,l=b?l-u-o:0;break;case"bottom":h=A,l=w?l+o:f-u;break;case"left":h=v?h-d-o:0,l=P;break;case"right":h=S?h+o:m-d,l=P}i.trans(h,l)}}}wa.CLASS="rct-line-series";class va extends ba{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ya(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new re(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new re(t,"rct-areanrange-series-line")),Rt.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find((e=>e!==t&&e.point===t.point))]}getSibling(t){return t&&this._markers.find((e=>e!==t&&e.point===t.point))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,_=a?e:s,c=a?0:s,d=this._labelViews(),g=this._labelContainer._textAlign,m=this._polar=i.chart._body.getPolar(h),f=i.pointLabel,x=f.options.position,y=f.options.align,b=f.getAlignOffset(),w=f.getOffset();this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-l.getPos(_,s.lowValue)}const v=this._markers;for(let i=0,c=t.length;i<c;i++){const f=t[i],S=v.get(c+i),V=d&&d.get(f,1);let A,P,C;this._prepareMakrer(S),a?(A=f.px2=l.getPos(_,f.lowValue),P=f.py2=v.get(i).ty+S._radius):(A=f.px2=f.xPos,P=f.py2=f.yLow);const k=A,L=P;if(S&&S.setVis(!f.isNull&&A>=0&&A<=e&&P>=0&&P<=s)){if(this._layoutMarker(S,n,A,P),S.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=S._radius;if(m){switch(x){case"inside":P-=w;break;case"foot":P-=t.height/2+w;break;default:P+=t.height+w}A=m.cx+P*u(C),P=m.cy+P*p(C)-t.height/2,this.applyAutoRotation(V,C,m.total,h.options.totalAngle)}else switch(x){case"inside":P-=t.height/2+w;break;case"foot":P+=w+(o?e:0);break;default:P-=t.height+w+(o?e:0)}switch(y){case"left":A-=t.width+(o?e:0)+b;break;case"right":A+=(o?e:0)+b;break;default:A-=t.width/2+b}this._checkLabelOverlap(V,t,k,L,e,e,A,P,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.options.areaStyle&&e.internalSetStyleOrClass(s.options.areaStyle)}}class Sa extends ba{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new ya(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new re(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){const e=this._area;let s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new re(this.doc,"rct-area-series-area")),t?this._yReversed?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new Kn(this._areaContainer,re,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<m(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new ie(s)));for(;i.length<e.length;)i.push(this.control.addClip(new ie(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,o=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.isNull?s.yLow=NaN:s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model,s=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,r=this.height,n=e.chart.isInverted(),o=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const o=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(o.color),this._setFill(t,o.style),o.areaStyle&&t.internalSetStyleOrClass(o.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,o,this._rangeAreaClips[s],n)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Y,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(Y,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof pr?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:d,cyclic:g}=l,x=new Zt,b=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(d,h):0,y=i.chart._body.options.circular;let w,v,S,V,A=!1,P=!1;if("spline"===i.options.lineType)this._drawCurves(this._polar,i.buildLines(s),x);else{g?x.move(s[0].xPos,s[0].yPos):(w=_+l*u(s[0].angle),v=c+l*p(s[0].angle),x.move(w,v),x.line(s[0].xPos,s[0].yPos));for(let t=1;t<b;t++)x.line(s[t].xPos,s[t].yPos);g||(w=_+l*u(s[b-1].angle),v=c+l*p(s[b-1].angle),x.line(w,v))}const C=s.map((t=>t.angle)),k=this._polar.min=m(...C),L=this._polar.max=f(...C),N=(new Zt).push(x.end());if(r)g?x.circle(_,c,l):a&&x.push(...Fs.arc(_,c,l,l,k,L,!0)),S=x.end(),A=!0,g?N.circle(_,c,l):N.push(...Fs.arc(_,c,l,l,k,L,!0)),V=N.end(),P=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;x.push("Z"),g?y?x.circle(_,c,d):x.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+u(t+s.pos/d*e/M)*d,y:c+p(t+s.pos/d*e/M)*d})))):y?x.push(...Fs.sector(_,c,d,d,0,k,L,!0)):x.polygon({x:_,y:c},...s.map((s=>({x:_+u(t+s.pos/d*e/M)*d,y:c+p(t+s.pos/d*e/M)*d})),{x:_,y:c})),S=x.end(!0),A=!0}else S=x.end();t.setPath(S),t.setAttr("fill-rule",A?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",P?"evenodd":""))}else{x.move(y(s[0].xPos,_),y(s[0].yLow,c)),x.line(y(s[0].xPos,_),y(s[0].yPos,c));for(let t=1;t<s.length;t++)x.line(y(s[t].xPos,_),y(s[t].yPos,c));x.line(y(s[s.length-1].xPos,_),y(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)x.line(y(s[t].xPos,_),y(s[t].yLow,c));t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),Rt.setImportantStyle(t.dom.style,U,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.options.belowStyle),Rt.setImportantStyle(e.dom.style,U,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new ne(this.doc)));const t=Fs.arc(_,c,d,d,l.start,l.start+l.total,!0);t.push("L",_,c),this._arcClip.setPath(t),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Va extends la{constructor(t){super(t,"rct-barrange-series"),this._bars=new fa(this._pointContainer,ra)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*y(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class Aa extends Co{constructor(t){super(t,Jo.POINT_CLASS)}savePrevs(){}}class Pa extends ha{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new fa(this._pointContainer,Aa)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.options.reversed,h=2*n.unitPad(),l=r.getPolar(n),{cx:_,cy:c,rd:d}=l,g=o instanceof pr?t.getBaseValue(o):NaN,f=g>o.axisMin(),x=o.getPos(d,g),y=this._pointOff,b=n.getTotalAngle();let w,v,S,V,A;i&&(w=this._labelInfo,v=t.getLabelPos(s),S=t.getLabelOff(s.getOffset()),V=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const P=s.point;if(s.setVis(!P.isNull)){const r=o.getPos(d,P.yGroup)*e,C=n.getUnitLen(b,P.xValue)*(1-h),k=t.getPointWidth(C,0);let L,N,M=l.start+n.getPos(b,P.xValue)-C/2;if(M+=k*y,M+=t.getPointPos(C)+k/2,a?f?(L=x+(o.getPos(d,P.yGroup)-x)*e,N=x):(L=d,N=o.getPos(d,P.yGroup*e)):f?(L=x+(o.getPos(d,P.yGroup)-x)*e,N=x):(L=r,N=0),s.setSector({cx:_,cy:c,rx:L,ry:L,innerRadius:N/L,start:M-k/2,angle:k,clockwise:!0}),M=s.start+s.angle/2,P.xPos=_+s.rx*u(M),P.yPos=c+s.ry*p(M),i&&(A=w.labelView=i.get(P,0))){A.layout(V);const{width:t,height:e}=A.getBBox(),i=s.ry,r=s.innerRadius*d;let o,h;o=a?f?P.yValue<g?"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?x+e/2+S:i-(i-x)/2+S:"outside"===v?i-e/2-S:"head"===v?m(x,i+e/2+S):"foot"===v?x-e/2-S:x-(x-i)/2-S:"outside"===v?r-e/2-S:"head"===v?m(d,r+e/2+S):"foot"===v?d-e/2-S:d-(d-r)/2-S:f?P.yValue<g?"outside"===v?i-e/2-S:"head"===v?i+e/2+S:"foot"===v?x-e/2-S:x-(x-i)/2-S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?x+e/2+S:i-(i-x)/2+S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:.7*i+S,h=c+o*p(M),o=_+o*u(M),"outside"!==v&&A.setContrast(s.dom),this.applyAutoRotation(A,M,l.total,n.options.totalAngle),A.trans(o-t/2,h-e/2)}}}))}}class Ca extends Pa{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new fa(t,na):new fa(t,ra)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*y(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof ra){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class ka extends Sa{constructor(t){super(t,"rct-bellcurve-series")}}class La extends oa{constructor(t){super(t,Jo.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),this._stemDown.setVLine(r,n,e),this._max.setHLine(0,t/4,3*t/4),this._min.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,o,t,a),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Er(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Er(t,"rct-boxplot-point-stem")),this.add(this._box=new Is(t,"rct-boxplot-point-box")),this.add(this._mid=new Er(t,"rct-boxplot-point-mid")),this.add(this._min=new Er(t,"rct-boxplot-point-min")),this.add(this._max=new Er(t,"rct-boxplot-point-max"))}}class Na extends la{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new fa(this._pointContainer,La)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class Ma extends _a{}class Ea extends ca{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new fa(t,Ma)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Oo.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var s;const i=this.model,r=i.options,n=this._inverted,o=i.needClip(!1),a=this._getGrowRate(),h=+r.rotation||0,l=i.pointLabel,_=l.options.position,c=l.getOffset(),d=this._labelContainer._textAlign,g=this._labelViews(),m=i._xAxisObj,f=i._yAxisObj,x=this._polar=i.chart._body.getPolar(m),b=n?t:e,w=n?e:t,v=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:S,max:V}=i.getPixelMinMax(v),A=n?0:e,P=Fs.getDrawer(r.shape);let C;null===(s=this._markers.getOrphans())||void 0===s||s.forEach((t=>{t.setPath(P(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))})),this._markers.forEach(((s,r)=>{const l=s.point,v=g&&(C=g.get(l,0));if(s.setVis(!l.isNull&&!isNaN(l.zValue))){const r=s._radius=i.getRadius(l.zValue,S,V),g=r*a*y(l._vr,1);let k,L;if(x){const t=x.start+m.getPos(w,l.xValue),e=f.getPos(x.rd,l.yValue);k=x.cx+e*u(t),L=x.cy+e*p(t)}else k=m.getPos(w,l.xValue),L=A-f.getPos(b,l.yValue),n&&(k=f.getPos(b,l.yValue),L=e-m.getPos(w,l.xValue));l.xPos=k,l.yPos=L,s.setVis(!o||k>=0&&k<=t&&L>=0&&L<=e)?(s.setPath(P(g)).trans(k,L).rotate(h),v&&(C.setContrast(s.dom).layout(d),this._layoutLabelView(C,_,c,r,k,L))):v&&v.setVis(!1)}else v&&v.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}let Ta=class extends oa{constructor(t){super(t,Jo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),o=m(n,r),a=f(1,x(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,o,t,a),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Er(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Er(t,"rct-candlestick-point-wick")),this.add(this._body=new Is(t))}};class Ba extends la{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new fa(this._pointContainer,Ta)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}class Oa extends ta{layout(t,e,s){const i=new Zt;i.circle(t,e,s),this.setPath(i.end())}}class Da extends Pa{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new fa(t,Oa)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let Ra=class extends oa{constructor(t){super(t,Jo.POINT_CLASS),this.add(this._line=new Er(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new re(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new re(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let _=t.getMarkerStyle(o);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(o),_&&n.internalSetStyleOrClass(_),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,i),Fs.setShape(r,o.shape,a,a),Fs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class $a extends la{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new fa(this._pointContainer,Ra)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}let Fa=class extends ao{constructor(t){super(t,Jo.POINT_CLASS),this._segments=new Kn(this,re),this._decimal=0,this.add(this._back=new re(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setPath(Fs.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Fs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Fs.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class Ia extends ha{constructor(t){super(t,"rct-equalizer-series"),this._bars=new fa(this._pointContainer,Fa)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_shrinkPoint(t){}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_buildSegments(t,e){const s=t.options,i=t._yAxisObj.axisMax(),r=s.segmented,n=s.segmentGap||0,o=this._pts=[];let a,h,l=0;const _=t._yAxisObj,c=_.axisMin(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(h-1))/h;o.length<2*h;)o.push(l,l+a),l+=a+n;o[o.length-1]=e;const p=o.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue>=d?(e-u)/e*(n.yValue-d)/(i-d):u/e*(d-n.yValue)/(d-c);let l=-1,_=0;for(let t=0;t<p-1;t++)if(h>=o[2*t]/e&&h<o[2*(t+1)]/e){l=t+1,_=!r&&h<o[2*t+1]/e?h*e-o[2*t]:a;break}l<0&&(l=p,_=a),0===h&&(l=0),t.prepareSegments(p,l,_,s.backStyle)}}))}}let za=class extends oa{constructor(t){super(t,Jo.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Er(t)),this.add(this._whiskerUp=new Er(t)),this.add(this._whiskerDown=new Er(t)),this.add(this._back=new Is(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Ha extends la{constructor(t){super(t,"rct-errorbar-series"),this._bars=new fa(this._pointContainer,za)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class Ga extends ta{}class ja extends ua{constructor(t){super(t,"rct-funnel-series"),this._segments=new fa(this._pointContainer,Ga),this.add(this._lineContainer=new Uo(t))}_getPointPool(){return this._segments}getClipContainer(){return null}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSegments(t,e,this._visPoints),this._lineContainer.prepare(e)}_renderSeries(t,e){this.$_calcRates(this._visPoints),this.$_layoutSegments(t,e)}_runShowEffect(t){t&&Oo.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_refreshZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach((t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)})),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=D(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=D(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?y+(V-y)*(w-t)/(w-A):y+(V-y)*(t-b)/(A-b)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,d=i.options.reversed,u=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new Zt,f=i.getCenter(t,e),y=f.x-p.width/2,b=f.y-p.height/2,w=b+p.height,v=y+p.width/2,S=p.height-g.height,V=y+(p.width-g.width)/2,A=d?w-S:b+S,P=[],C=new Zt,k=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const n=i.point;if(i.setVis(!n.isNull)){const f=n.yPos*p.height,y=(n.yPos+n.height)*p.height,M=d?w-f:b+f,E=d?w-y:b+y,T=y<S;let B,O,D,R;if(N=null==c?void 0:c.get(n),f>=S?(B=V,O=B+g.width,m.move(B,M).lines(O,M,O,E,B,E),i.ny=i.nx1=NaN):T?(B=s(M),O=B+2*(v-B),D=s(E),R=D+2*(v-D),m.move(B,M).lines(O,M,R,E,D,E),i.ny=NaN,i.nx1=D-B,i.nx2=R-B):(B=s(M),O=B+2*(v-B),D=V,R=D+g.width,m.move(B,M).lines(O,M,R,A,R,E,D,E,D,A),i.nx1=D-B,i.nx2=R-B,i.ny=x(A-M),i.nx3=D,i.nx4=R),i.setPath(m.close(!0)),n.xPos=v,n.yPos=M+(E-M)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=T?(O-B+(R-D))/2:g.width;switch(!t&&L.layout(_||"center"),l){case-1:L.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:L.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,L,_,u,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,_,u,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,n,i,L,_,u,N,C,v,a,h);L.setContrast(o&&i.dom),P.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else N&&N.setVis(!1)}}));const M=n.options.convergent,E=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==E&&"largestFirst"!==E||r.dedupe(P,c,E):(null==r?void 0:r.arrangeVertical(this,P,c,e,M,E,T))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==c?void 0:c.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,_,u,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,u,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,u,N,C,v,a,h)))})))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,_,c){const d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let m=l;if(n?m-=h.width/2:m+=h.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(m-g-c,e).end()):o.setLine(a.reset(0,0).line(m+c-g,e).end()),o.trans(g,p)}t||(n?m-=_+c+u.width:m+=c+_,i.trans(m,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),m=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const f=e.xPos=this.$_calcX(e,s,h,n);let x;if(x=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-m:0;n?o.setLine(a.reset(0,0).line(x-f-_,e).end()):o.setLine(a.reset(0,0).line(x+_-f,e).end()),o.trans(f,m)}t||(n?x-=l+_+g.width:x+=_+l,i.trans(x,m-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,u)}t||(n?p-=_+l+d.width:p+=_+l,i.trans(p,u-d.height/2))}}let Xa=class extends ea{layout(t,e){this.setPath(Fs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Wa extends aa{constructor(t){super(t,"rct-histogram-series"),this._bars=new fa(this._pointContainer,Xa)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,c=i?e:t,d=h.getPos(l,s.getBaseValue(h)),u=i?0:e,p=o&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach(((s,_)=>{const g=s.point,m=a.getPos(c,g.min),f=a.getPos(c,g.max),x=h.getPos(l,g.yValue),y=f-m+(f>m?-1:1),b=x-d;let w=m+(f-m)/2,v=u;g.xPos=w,g.yPos=v-=x,this._layoutPoint(s,_,w,v+b,y,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=c-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(l,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=y,p.hPoint=b,this._layoutLabel(n,p,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((o,a)=>{const h=o.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,d=i.getPos(e,o.point.yValue)*n,u=f(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class Ya extends ao{constructor(t){super(t,Jo.POINT_CLASS),this.add(this._line=new Er(t,"rct-lollipop-point-bar")),this.add(this._marker=new re(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),Fs.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class Ua extends ha{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_shrinkPoint(t){}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.options.styleCallback,this._bars||(this._bars=new fa(this._pointContainer,Ya)),this._bars.prepare(s.length,((t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)}))}}class Za extends oa{constructor(t){super(t,Jo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,a=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_doInitChildren(t){this.add(this._tickOpen=new Er(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Er(t,"rct-ohlc-point-tick")),this.add(this._bar=new Er(t)),this.add(this._back=new Is(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class qa extends la{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new fa(this._pointContainer,Za)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}class Ka extends ba{constructor(t){super(t,"rct-pareto-series")}}class Qa extends re{setOff(t){return this.off=x(t),this}}class Ja extends Co{constructor(t){super(t,Jo.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class th extends Qt{constructor(t){super(t,Jo.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new Co(t))}setSides(t,e,s,i,r){const n=this.point,o=D(N),a=D(((t?n.startAngle:n.startAngle+n.angle)+N/2+M)%M),h=D(a+(t?n.angle:-n.angle)-1e-4+M)%M,l=o-(a+x(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=N/2&&!(h>=a&&h<N/2)||h>=3*N/2&&!(a<h&&a>3*N/2)?(this._outArcView=i.setOff(m(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*N/2&&h<=N/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=N/2&&h<=3*N/2?(this._outArcView=i.setOff(m(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=N&&this._outArcView.setOff(m(this._outArcView.off,this._side1View.off)),h>=N&&h<M&&this._outArcView.setOff(m(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=Fs.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;nt&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Fs.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(Fs.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(Fs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Fs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Fs.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Fs.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",Dt.interpolate("#000",r,.2)),this._side2View.setStyle("fill",Dt.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",Dt.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",Dt.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Jo.DATA_FOCUS,t),this._side2View.setBoolData(Jo.DATA_FOCUS,t),this._inArcView.setBoolData(Jo.DATA_FOCUS,t),this._outArcView.setBoolData(Jo.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class eh extends ua{constructor(e){super(e,"rct-pie-series"),this._deep=!1,this._pb=new Zt,this._cx=0,this._cy=0,this._depth=0,this._ratio=1,this._rx=0,this._ry=0,this._rxInner=0,this._ryInner=0,this._slicedOff=0,this.add(this._circle=new Vo(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new po(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new te(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Uo(e))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,s.options.icon?s.getUrl(s.options.icon):null,null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,o=r-n;this._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&Oo.grow(this,(t=>{const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,this.model.options.autoSlice,!1))}))}_doPointClicked(t){if((t instanceof Ja||t instanceof th)&&this.model.options.autoSlice){const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0)}else this.invalidate()}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_refreshZombie(){this._renderSeries(this.width,this.height)}focusPointView(t,e){t instanceof th&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new fa(this._pointContainer,th,null),n=this._sides=new Kn(this._sideContainer,Qa,"rct-pie-series-side")):this._sectors=new fa(this._pointContainer,Ja,null)),this._deep=i,n&&n.prepare(4*r,((t,e)=>t.index=e)),this._sectors.prepare(r,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.options.clockwise?1:-1,n=t.filter((t=>(t.visible||t===e)&&!t.isNull)).map((t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1))).reduce(((t,e)=>t+e),0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%M;if(i>1||i>0&&!e)t.forEach((t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=D(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)}));else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,_=this._rxInner,c=this._depth,d=this._ratio,g=this._sides,m=i.pointLabel,f=m.connector.options.curved,b=this._labelViews(),w="inside"===i.getLabelPos(m),v=y(m.options.radius,.7),S=this._pb,V=m.getDistance(w,l,_),A=m.getAlign();let P=null==b?void 0:b.textAlign();const C=this._lineContainer.setVis(m.connector.visible)?this._lineContainer:null,k=this._slicedOff=i.getSliceOffset(l)*n,L=[],N=[],M=[],E=(null==b?void 0:b.getWidth(0))||0,T=this._sectors.count;let B,O;if(this._lineContainer.setStyleOrClass(m.connector.options.style),!b||P||A||(P="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=y(this.model.innerText.options.iconGap,0),n=e.width,o=e.height,a=t.getBBox(),h=a.width,l=a.height;switch(this.model.innerText.getIconPos()){case"right":t.trans(n/2+r,(o-l)/2),s-=(h+r)/2;break;case"top":t.trans(h/-2,-(l+r)),i+=l+r/2;break;case"bottom":t.trans(h/-2,o+r),i-=(l+r)/2;break;default:t.trans(-(n/2+h+r),(o-l)/2),s+=(h+r)/2}}this._textView.trans(s,i-e.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rx),this.$_calcAngles(t),this._sectors.forEach(((t,o)=>{const m=t.point;if(g){const e=4*o;t.setSides(r,g.get(e),g.get(e+1),g.get(e+2),g.get(e+3))}if(O=null==C?void 0:C.get(m),m.isNull)t.setVis(!1),b&&(B=b.get(m,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=T>1&&m.sliced,g=m.startAngle,y=g+m.angle/2;let C=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(C+=u(y)*k,D+=p(y)*k),t.trans(C,D).setVis(!0),m.xPos=a+u(y)*(k+l*v),m.yPos=h+p(y)*(k+l*v),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*d,innerRadius:_,start:g,angle:x(m.angle),clockwise:r,depth:c}),b&&(B=b.get(m,0))){const r=i.getLabelOff2(m);let n;w?(null==O||O.setVis(!1),this.$_layoutLabelInside(m,B,P,r,V,o?k:0)):(n=-1===A?this.$_layoutLabelAligned(!1,m,B,P,O,S,f,r,V,o?k:0):1==A?this.$_layoutLabelEnded(!1,m,B,P,O,S,f,r,V,o?k:0,E,e,s):this.$_layoutLabelOutside(!1,m,B,P,O,S,f,r,V,o?k:0),n?L.push(B):N.push(B)),B.setContrast(w&&t.dom).setVis(!0),M.push(B),this._layoutLabelRotation(B)}else null==O||O.setVis(!1)}})),g&&g.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const D=m.options.convergent,R=m.options.dedupeMode,$=m.options.overflow;b&&(w||0===A?"preserveOrder"!==R&&"largestFirst"!==R||b.dedupe(M,C,R):b.arrangeVertical(this,L,C,s,D,R,$)+b.arrangeVertical(this,N,C,s,D,R,$)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=T>1&&r.sliced,n=i.getLabelOff2(r);B=b.get(r,0),O=null==C?void 0:C.get(r),(null==B?void 0:B.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,B,P,O,S,f,n,V,t?k:0):1==A?this.$_layoutLabelEnded(!0,r,B,P,O,S,f,n,V,t?k:0,E,e,s):this.$_layoutLabelOutside(!0,r,B,P,O,S,f,n,V,t?k:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,d=this._cx,g=this._cy,m=this._rx,f=this._ry,x=m+l,y=f+l,b=d+u(c)*x,w=g+p(c)*y,v=b<d;!t&&!_&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let A,P,C,k=g+p(c)*f;if(v?(A=d+u(Math.PI)*m-h,P=A-S.width-a,C=d+u(Math.PI)*x-h,S.width):(A=d+u(0)*m+h,P=A+a,C=d+u(0)*x+h),r&&r.setVis(x>0)){const e=t?s.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(b-A),e,b-A,0).end()):r.setLine(n.reset(0,e).line(b-A,0).end()),r.setPos(A,k),!_&&r.trans(A,w)}return t||(s.setPos(P,k-S.height/2),!_&&s.trans(P,k-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d){const g=s.isDomAnimating(),m=e.startAngle+e.angle/2,f=this._cx,x=this._cy,y=this._rx,b=this._ry,w=y+l,v=b+l;let S=f+u(m)*w,V=x+p(m)*v;const A=S<f;!t&&!g&&s.layout(i||(A?"right":"left"));const P=s.getBBox(),C=V-P.height/2;let k,L,N,M=x+p(m)*b;if(A?(k=h+_+a,N=h+_-P.width,L=k):(k=c-h-_-a,N=c-h-_,L=k),r&&r.setVis(w>0)){const e=t?s.ty-C:0;o?r.setLine(n.reset(0,e).quad(0,e,S-L,0).end()):r.setLine(n.reset(0,e).line(S-L,0).end()),r.setPos(k,M),!g&&r.trans(L,V)}return t||(s.setPos(N,M-P.height/2),!g&&s.trans(N,M-P.height/2)),A}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),d=e.startAngle+e.angle/2,g=this._cx,m=this._cy,f=this._rx+.5*h,x=this._ry+.5*h,y=u(d)*l,b=p(d)*l,w=g+u(d)*this._rx,v=m+p(d)*this._ry,S=g+u(d)*f;let V=m+p(d)*x;const A=S<g;let P,C;return A?(P=S-.2*h,C=P):(P=S+.2*h,C=P),r&&r.setVis(f>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,P-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,P-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+y,v+b)),t||(A?C-=c.width+a:C+=a,V-=c.height/2,s.setPos(C,V),!_&&s.trans(C+y,V+b)),A}$_layoutLabelInside(t,e,s,i,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.options.autoRotation,_=h.options.rotationMode,c=a.options.clockwise;!o&&e.layout(s||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=m(a.options.totalAngle||360,360);if("angle"===_){let i=p/t*s+90,r=(i+a.options.startAngle)%360;r+=c?0:360,i+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,p,t,s)}const g=h.options.align===Ws?.3:h.options.align===Xs?.5:.7,f=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*g+i:.8*this._rx+i:.7*this._rx+i,x=this._deep?f*this._ratio:f,y=Math.cos(p),b=Math.sin(p);let w=this._cx+y*f,v=this._cy+b*x;e.move(w-d.width/2,v-d.height/2),w=this._cx+y*(n+f),v=this._cy+b*(n+x),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,s){if(e&&this._sectors.count<2)return;const i=this.model,r=this._labelViews(),n=i.pointLabel.getAlign(),o=this._slicedOff,a=i.options.autoSlice?i.options.sliceDuration:0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(u(l)*o,p(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,d=_.connector.options.curved,g="inside"===i.getLabelPos(_),m=r.get(h,0),f=i.pointLabel.getDistance(g,this._rx,this._rxInner);if(m){const t=!g&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,m,e,_.getOffset(),f,o):0===n&&this.$_layoutLabelOutside(!1,h,m,e,t,this._pb,d,_.getOffset(),f,o)}if(e){let e=m.tx,s=m.ty,i=t.tx,r=t.ty;(g||0===n)&&(m.trans(m.x,m.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(m.trans(m.tx,m.ty).transEx2(m.x,m.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class sh extends _a{setHoverRate(t,e,s){const i=this.point,r=Fs.getDrawer(t.model.getShape(i)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._hoverRadius}}class ih extends ca{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new fa(t,sh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Oo.grow(this)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),o=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart._body.getPolar(o),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,d=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,x=m.getOffset(),y=this._labelViews(),b=r?t:e,w=h?h.total:r?e:t,v=r?0:e;let S;this._markers.forEach(((i,m)=>{const V=i.point,A=y&&(S=y.get(V,0));if(i.setVis(!V.isNull)){const m=Fs.getDrawer(s.getShape(V)),y=ot.jitter(V.xValue,d),P=ot.jitter(V.yGroup,g);let C,k;if(h){const t=h.start+o.getPos(w,y),e=a.getPos(h.rd,P)*l;C=h.cx+e*u(t),k=h.cy+e*p(t)}else C=o.getPos(w,y),k=v-a.getPos(b,P),r&&(C=a.getPos(b,P),k=e-o.getPos(w,y));if(V.xPos=C,V.yPos=k,i.setVis(!!h||!n||C>=0&&C<=t&&k>=0&&k<=e)){const t=i._hoverRadius||_;i.setPath(m(t)),i.trans(C,k).rotate(c),A&&this._layoutLabelView(S,f,x,t,C,k)}else A&&A.setVis(!1)}else A&&A.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.options.radius,r=s.reduce(((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r));return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.options.radius+s}}class rh extends la{constructor(t){super(t,"rct-waterfall-series"),this._bars=new fa(this._pointContainer,ra),this.add(this._lineContainer=new te(t,"rct-waterfall-series-lines")),this._lines=new Kn(this._lineContainer,Er)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd,0,0,this._inverted),e>0){const t=this._lines.get(e-1),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):s.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}function nh(t,e){return new(ko[e._type()])(t)}function oh(t,e){return new(qo[e._viewType()])(t)}Jo.register([Hr,Sa],[Xr,va],[Pr,Ca],[Sr,Va],[Zr,ka],[Kr,Na],[Jr,Ea],[sn,Ba],[nn,Da],[ln,$a],[cn,Ia],[dn,Ha],[mn,ja],[yn,Wa],[Fr,wa],[vn,Ua],[Vn,qa],[Pn,Ka],[En,eh],[On,ih],[$n,rh]),Lo.register([or,ma],[rr,pa],[nr,ga]);class ah extends ho{constructor(t){super(t,"rct-axis-grid"),this._lines=new Kn(this,Er)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=s.options.reversed,r=this.width,n=this.height,o=s.isEmpty()?[]:t.getPositions(s,s._isHorz?r:n),a=this._lines.prepare(o.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),h=a.count-1;let l;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",o[e]===(s._isHorz?r:n))}));const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;if(s._isHorz){const e=y(s._prevRate,1);a.forEach(((a,d)=>{l=0===d?_:d===h?c:t.visible,a.setVis(l)&&a.setVLine(s.prev(o[d])+(i?r*(1-e):0),0,n)}))}else{const e=i?y(s._prevRate,1):1;a.forEach(((i,a)=>{o[a],l=0===a?_:a===h?c:t.visible,i.setVis(l)&&i.setHLine(n*e-s.prev(o[a]),0,r)}))}}}class hh extends Qt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new re(t)),this._mask.setStroke("none"),this.add(this._upLine=new re(t)),this._upLine.setFill("none"),this.add(this._downLine=new re(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(this._clip)?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new Zt;if(s){let t=0,s=0,n=i/2,o=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(o,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class lh extends Qt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new po(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){this.model=e,this._labelView.setVis(!!e.label.options.text)&&this._labelView.setModel(t,e.label,null,null)}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,this.model.label,null),this._labelView.layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class _h extends lh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Po:Er)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&this._line.setStyles(e._style)}_doLayout(t,e){const s=this.model,i=s.options.value,r=s.label,n=r.options,o=this._line,a=this._labelView.setVis(r.visible)&&this._labelView,h=a.getBBox(),l=y(n.offsetX,0),_=y(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setVLine(r,0,e),a)){switch(n.align){case"center":c=r-h.width/2+l;break;case"right":c=r+l;break;default:c=r-h.width-l}switch(n.verticalAlign){case"bottom":d="inside"===n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setHLine(r,0,t),a)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="inside"===n.position?t-h.width-l:t+l;break;default:c="inside"===n.position?l:-1*(h.width+l)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}a.visible&&a.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,a,o,i.axis.getTotalAngle(),!1),r.setStyle(Y,"none"),n&&n.trans(s.cx+a*u(s.start),s.cy+a*p(s.start))}}class ch extends lh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Co:zs)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=m(s.startValue,s.endValue),r=f(s.startValue,s.endValue);this._range=e.axis.trimRange(i,r),this.setVis(e.visible&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model;s.options;const i=s.label,r=i.options,n=this._box,[o,a]=this._range,h=this._labelView.setVis(i.visible)&&this._labelView,l=h.getBBox(),_=y(r.offsetX,0),c=y(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,o;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":o="inside"===r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="inside"===r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(f(0,m(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="inside"===r.position?t-l.width-_:t+_;break;default:e="inside"===r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.startValue),h=i.axis.getPos(s.rd,i.options.endValue);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:a/h,start:o,angle:M,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*u(s.start),s.cy+t*p(s.start))}}}class dh extends te{constructor(){super(...arguments),this._views=new Kn(this,re)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach(((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.axisMin(),n.from),h=Math.max(o.axisMax(),n.to);if(n.axis._isHorz){const s=f(0,m(t,o.getPos(t,a))),r=f(0,m(t,o.getPos(t,h)));i.setPath(Fs.rectangle(s,0,r-s,e))}else{const s=f(0,m(e,o.getPos(e,a))),r=f(0,m(e,o.getPos(e,h)));i.setPath(Fs.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class uh extends te{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof ch?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof es?i=this._rangePool.pop()||new ch(t,s):e instanceof ts&&(i=this._linePool.pop()||new _h(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class ph extends re{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line"))}layout(t,e,s,i,r){const n=this.model.axis,o=n._isHorz,a=new Zt;if(this._bar){const h=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.options.showAlways&&(l=n.options.reversed?n.xValueAt(o?i-e:s):n.xValueAt(o?e:r-s)),n instanceof _i&&(l=c(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(s,0,i));this.setPath(a.end())}}class gh extends So{constructor(t){super(t,"Reset Zoom",gh.CLASS_NAME),this.setVis(!1)}}gh.CLASS_NAME="rct-reset-zoom";class mh extends te{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Is(t,"rct-empty-view-back")),this.add(this._labelView=new po(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class fh extends te{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Kn(this,Er)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(_.length,((e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-_[i],r,n-h-_[i]):e.setLine(_[i]+l,0,_[i],n)}))}}class xh extends te{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new re(t)),this.add(this._gridContainer=new te(t,"rct-body-depth-grids")),this.add(this._lineView=new Er(t,"rct-body-depth-side-line")),this.add(this._endView=new Er(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(Fs.polygon(0,o,a,0,a,n-o,0,n)),h.visible&&h.setVLineC(0,o,n),l.visible&&l.setLine(0,o,r,0)):(t.setPath(Fs.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,_]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new fh(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class yh extends te{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new xh(t,!0)),this.add(this._ySideView=new xh(t,!1)),this.add(this._orgLineView=new Er(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,_=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),_.setVis(s.ySide.visible)&&(e?_.setBounds(0,o-h,n,h):_.setBounds(0,0,a,o),_.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class bh extends ho{constructor(t,e){super(t,bh.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._hoverPointSeries=[],this._owner=e,this.add(this._hitTester=new Is(t)),this._hitTester.setFill("transparent"),this.add(this._background=new re(t,"rct-body-background")),this.add(this._depthLayer=new yh(t)),this.add(this._image=new uo(t,!0,"rct-body-image")),this.add(this._emptyView=new mh(t)),this.add(this._gridRowContainer=new dh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new te(t,"rct-axis-grids")),this.add(this._baseContainer=new te(t,"rct-axis-bases")),this.add(this._guideContainer=new uh(t,"rct-axis-guides")),this.add(this._annotationContainer=new te(t,"rct-annotations")),this.add(this._seriesContainer=new te(t,"rct-series-container")),this.add(this._axisBreakContainer=new te(t,"rct-axis-breaks")),this.add(this._labelContainer=new te(t,"rct-label-container")),this.add(this._frontGuideContainer=new uh(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new te(t,"rct-front-annotations")),this.add(this._feedbackContainer=new te(t,"rct-feedbacks")),this.add(this._zoomButton=new gh(t)),this._crosshairViews=new Kn(this._feedbackContainer,ph)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Kt._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(Jo.isPointDom(e))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){l=o[t];break}const c=null==e?void 0:e.classList,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(a>0){const e=this.chart().chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of o)if(!(t.model instanceof Rr)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=y(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})}));const a=n.reduce(((e,s)=>{if(!e.pv||!s.pv)return e||s;const i=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=i*i+r*r,o=s.pv.pv.point.xPos-t.x,a=s.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:s}));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=y(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=y(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(l=r,i=e)}}));h&&i&&l.canHover(i.dist,i.pv,s)?this.$_setFocused(l,i.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,h=this._siblings,l=this._siblingSeries;let _,c,d;if(n&&n.options.interactive&&e&&o.visible)switch(o.getScope(n,e.point)){case"axis":d=n._xAxisObj.getSeries();case"group":d||(d=n._group.getVisibleSeries());const r=d.map((t=>{if(t instanceof Xi){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof Jr){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));_=d.map((t=>i.getSeriesView(t))),c=[],r.forEach(((t,e)=>{c.push(_[e].getPointView(t))}));break;default:_=[t],c=[e]}let u=[];if(_&&_.forEach(((t,e)=>{u.push(...t.getSiblings(c[e]))})),u=u.length>1?u.sort(((t,e)=>t.hash-e.hash)):u.length>0?u:null,ot.equalArrays(h,u)||(_&&_.forEach(((t,e)=>{t.focusPoints(t.getSiblings(c[e]))})),l&&l.forEach((t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=_,this._siblings=u),e!==a){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,n&&n.options.interactive&&this.$_focusSeries(t,!0),n&&r.chartOptions.options.seriesHovering&&n.options.interactive&&this.$_hoverSeries(t))}this._focused&&n&&n.options.interactive&&(this._focused!==a||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model._group===t.model._group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData(Jo.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Jo.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach((t=>t.hoverPoint(null))),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach((t=>t.focusPoints(null))),this.removeFocus()}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}annotationByDom(t){return this._annotationViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesMap.get(t)}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.zoom(h,l)&&(this._zoomRequested=!0)}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find((e=>e.model===t))}removeFocus(){this._seriesViews.forEach((t=>{t._hoverPts.forEach((e=>{e instanceof _a&&e.endHover(t,!1),e.setBoolData(Jo.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.cancel()})),t._hoverAnis=[]})),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],h,l,r)})),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],h,l,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],h,l,r)})),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_renderBackground(t,e,s){t.setPath(Fs.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach((t=>{const e=t._model,s=e.axis;s._isHorz?s.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.options.reversed?t.trans(0,e._sect.pos):t.trans(0,o-e._sect.pos-e._sect.len),t.layout(n,o,e.axis._isHorz)})),this.isClip(this._guideClip))this._guideClip.resize(t.width(),t.height());else{const e=t._padding;this._guideClip=t.clipBounds(-1*(e.left+this.tx),-1*(e.top+this.ty),t.width(),t.height())}[this._guideContainer,this._frontGuideContainer].forEach((t=>{t.setVis(t._views.length>0)&&(t._views.forEach((t=>t.visible&&t.layout(n,o))),t.setClip(this._guideClip))})),this._gridRowContainer.layout(n,o),this._gridRowContainer.trans(a,0)}this.$_prepareCrosshairs(e.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(n,o))})),this._layoutAnnotations(this._inverted,this,n,o),this._zoomButton.visible&&this._zoomButton.trans(n-this._zoomButton.getBBox().width-10,10),this._emptyView.setVis(this.$_isEmptyVisible(e))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(e.emptyView,n,o))}$_isEmptyVisible(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(No[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof ur)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));s&&[e._getXAxesAtPane(a,h,!0),e._getYAxesAtPane(a,h,!0)].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new ah(t);r.set(e,s),i.add(s)}if(e instanceof ur&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Er(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),a.length=0,s.forEach((e=>{const s=o.get(e)||oh(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)})),this._seriesContainer.sort(a),a.forEach((t=>this._labelContainer.dom.appendChild(t._labelContainer.dom)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach((t=>t.remove())),o.length=0,s.forEach((s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach((t=>t.forEach((t=>{t instanceof pr&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new hh(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(o[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(s,i,!0),t._getYAxesAtPane(s,i,!0)].forEach((t=>t.forEach((t=>{t.crosshair.visible&&r.push(t.crosshair)})))),e.prepare(r.length,((t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)}))}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach((r=>{r._layoutView(t,e,0,0,s,i),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)}))}}bh.BODY_CLASS="rct-body";class wh extends Qt{constructor(t){super(t,vh.HANDLE_STYLE),this.add(this._back=new Is(t)),this.add(this._shape=new re(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*m(t,e);const r=new Zt;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class vh extends ho{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(vh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(vh.MASK_STYLE)}constructor(t){super(t,vh.CLASS_NAME),this.add(this._back=new Is(t,vh.BACK_STYLE)),this.add(this._container=new te(t,null)),this.add(this._mask=new Is(t,vh.MASK_STYLE)),this.add(this._trackView=new Is(t,vh.TRACK_CLASS)),this.add(this._thumbView=new Is(t,vh.THUMB_CLASS)),this.add(this._startHandle=new wh(t)),this.add(this._endHandle=new wh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let o=s,a=i;return e._vertical?o=e.getSize():a=e.getSize(),e._naviChart.layoutAxes(o,a,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(o,101),e._naviChart.yAxis._calcPoints(a,1),{width:o,height:a}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=s?(s.start-s.min)*r/s.total():0,e=s?(s.end-s.min)*r/s.total():r;this._mask.setVis(i.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(i.mask.style)),this._trackView.setBounds(-2,n,r+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,6),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle&&(this._startHandle.layout(n/3,n/3,!1),this._startHandle.trans(t,n+3),this._endHandle.layout(n/3,n/3,!1),this._endHandle.trans(e,n+3),this._startHandle.setStyleOrClass(i.handle.style),this._endHandle.setStyleOrClass(i.handle.style))}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,r,n,1),this._seriesView.resize(r,n),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,r,n,1),this._xAxisView.resize(r,n),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=oh(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new vo(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new vo(t)),i._simpleMode=!0)}}vh.CLASS_NAME="rct-navigator",vh.BACK_STYLE="rct-navigator-back",vh.MASK_STYLE="rct-navigator-mask",vh.HANDLE_STYLE="rct-navigator-handle",vh.HANDLE_BACK_STYLE="rct-navigator-handle-back",vh.TRACK_CLASS="rct-navigator-track",vh.THUMB_CLASS="rct-navigator-thumb";class Sh extends he{constructor(t){super(),this.chart=t}}class Vh extends Sh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=f(0,e-(o.x-n.x)),this._yStart=f(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new Is(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=f(0,m(i.height,e-(i.y-s.y))),this._body.setZoom(0,m(f(0,this._yStart),e),this._body.width,f(m(this._yStart,i.height),e))):(t=f(0,m(i.width,t-(i.x-s.x))),this._body.setZoom(f(0,m(this._xStart,t)),0,f(m(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=f(0,m(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,m(this._yStart,r),this._body.width,x(this._yStart-r))):(i=f(0,m(o.width,i-(o.x-n.x))),this._feedback.setBounds(m(this._xStart,i),0,x(this._xStart-i),this._body.height)),!0}}class Ah extends Sh{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class Ph extends Sh{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,_=n.model.options.minSize,c=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class Ch extends Sh{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=f(0,m(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class kh{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(x(this._clickX-i)>3||x(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(s)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){ot.makeArray(a.legend.getSources(a),!0).forEach((t=>{if(t instanceof ii){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof ua&&t.togglePointVisible(e)}}else a.source.visible=!a.source.visible,i.bodyView().hoverSeries(a.source.visible?a.source:null)}))}}else(h=i.seriesByDom(r))?h.clicked(r):(_=i.htmlButtonByDom(r))?_.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return bo.isThumb(t)?new Ah(this._chart,i.getScrollView(t)):vh.isHandle(t)?new Ph(this._chart,i._navigatorView,t):vh.isMask(t)&&r&&r.model.isZoomed()?new Ch(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Vh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class Lh extends te{constructor(t){super(t,Lh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,s){if(this.setVis(s&&s.length>0)){const i=this._itemViews,r=this._separators;for(;i.length<s.length;){const s=new de(e,"rct-history-item");s.anchor=t.TextAnchor.START,i.push(s)}for(;i.length>s.length;)i.pop().remove();for(;r.length<s.length-1;){const s=new de(e);s.anchor=t.TextAnchor.START,s.text=">",r.push(s)}for(;r.length>s.length-1;)r.pop().remove();this.$_layout(s)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}Lh.TITLE_CLASS="rct-history";class Nh extends ho{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new Is(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new de(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){return t===this._marker&&t.parent===this||this.insertFirst(this._marker=t),this._marker}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():Qn,l=Jn(this._label.getBBox());return this._gap=y(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:f(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=y(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 Mh extends lo{constructor(t){super(t,Mh.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Kn(this,Nh)}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(),a=this._vertical="vertical"===e.getLayout();return this._ipr=y(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?y(n.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,a,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,a=this._margins,h=this._paddings,l=this._vertical,_=a.left+h.left,c=a.top+h.top;let d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),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||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),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,a=e.items(),h=this._itemViews,l=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,m,x,y;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let b=0,w=0;if(s){for(;b<d;)y=h.get(b),w%i==0?(u.push(x=[y]),m=y.mh,w++,b++):(m+=l+y.mh,m<=n?(x.push(y),w++,b++):w=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=f(s,t.mw),r=f(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=f(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)y=h.get(b),w%i==0?(u.push(x=[y]),g=y.mw,w++,b++):(g+=l+y.mw,g<=r?(x.push(y),w++,b++):w=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=f(s,t.mh)})),e+=l*(t.length-1),g=f(g,e),m+=s,p.push(s)})),m+=_*(u.length-1)}return{width:g,height:m}}}Mh.LEGEND_CLASS="rct-legend";class Eh extends Qt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Vo(t))}layout(){}}class Th extends Qt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new te(t,"rct-polar-axis-markers")),this._markViews=new Kn(this._markContainer,Eh),this.add(this._gridContainer=new Qt(t,"rct-polar-axis-grids")),this._labelViews=new Kn(this._labelContainer=s,xo,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(wo)?t.setLabel(s,o,e,r.replace(wo,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks;s.chart._body.getPolar(e),s.options.rotation;const i=t.length;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(i,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}else this._labelViews.forEach((t=>t.setVis(!1)))}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.options.front));e.setAll(t,i,!0),i=this._model.guides.filter((t=>t.options.front)),s.setAll(t,i,!0)}}class Bh extends Th{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Kn(this._gridContainer,Er,Bh.GRID_CLASS),e.insertFirst(this._startView=new Er(t,Bh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Er(t,Bh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Po(t,Bh.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/M)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+u(o+h)*i,_=s+p(o+h)*i;n.setFill("none"),n.setLine(e,s,l,_),n.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),h=i+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",_=[],c=t.label.options.rotation||0,d="auto"===c;this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),g=t.angle=o+n.pos,m=(g*B%360+360)%360,f=m>90&&m<270;if(d){const i=e-a.width/2+u(g)*(h+a.width/2),r=s-a.height/2+p(g)*(h+a.width/2);t.trans(i,r),t.setRotation(a.width/2,a.height/2,f?g*B+180:g*B)}else{const i=e+u(g)*(h+a.width/2)-a.width/2,r=s+p(g)*(h+a.height/2)-a.height/2;t.trans(i,r),t.setRotation(a.width/2,a.height/2,c)}_.push(t)}}));const g=_.length;g>2&&(x(_[g-1].angle-_[g-2].angle)<M/24||ot.diffAngle(_[g-1].angle,_[0].angle)<M/24)&&_[g-1].setVis(!1)}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+u(o)*i,s+p(o)*i),r.map((t=>{const r=t.pos;h.push(e+u(o+r)*i,s+p(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+u(o+a)*i,s+p(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+u(o)*i,s+p(o)*i),this._endView.setLine(e,s,e+u(o+a)*i,s+p(o+a)*i))}}Bh.LINE_CLASS="rct-polar-xaxis-line",Bh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Bh.GRID_CLASS="rct-polar-xaxis-grid-line";class Oh extends Th{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new Kn(this._gridContainer,Po,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Er(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Po(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof ur&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){function o(t,i){if(t.setFill("none"),a)t.setArc(e,s,i,_,c,!0);else{const r=[];l&&h[0].pos>0&&r.push(e+u(_)*i,s+p(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+u(_+n)*i,s+p(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+u(_+c)*i,s+p(_+c)*i),t.setPolyline(r)}}const a=this._circular,h=n._ticks,l=n.isArced(),_=n.getStartAngle(),c=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach(((e,s)=>{o(e,r[s].pos),e.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(l){const t=n.getStartAngle();this._labelViews.forEach(((n,a)=>{const h=n.getBBox();n.setContrast(null).trans(e+u(t)*r[a].pos-h.width*i+o,s+p(t)*r[a].pos-h.height/2)}))}else this._labelViews.forEach(((t,n)=>{const a=t.getBBox();t.setContrast(null).trans(e-a.width*i+o,s-r[n].pos-a.height/2)}))}this._lineView.visible&&(l?this._lineView.setLine(e,s,e+i*u(_),s+i*p(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class Dh extends bh{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._circular=this.model.options.circular,this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n}=this.model.getPolar(null);t.setPath(Fs.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._seriesViews.forEach((t=>{var e;t.setCircular(this._circular),t.model.needClip(!0)&&(this.isClip(this._polarClip)||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach((t=>{t.layout(s.chart.xAxis,i,r,n)})),[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis))))})),this._layoutAnnotations(!1,this,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image;this.insertAfter(this._xAxisLabelContainer=new te(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new te(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new te(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new te(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new te(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new Oh(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new Bh(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class Rh extends lo{constructor(t,e){super(t,e?Rh.SUBTITLE_CLASS:Rh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new de(t)),this._richText=new we}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),Jn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Rh.TITLE_CLASS="rct-title",Rh.SUBTITLE_CLASS="rct-subtitle";class $h extends Qt{constructor(e){super(e,"rct-tooltip-row"),this.add(this._marker=new re(e,"rct-tooltip-row-marker")),this.add(this._textView=new de(e,"rct-tooltip-row-text")),this._textView.anchor=t.TextAnchor.START,this.add(this._detailView=new de(e,"rct-tooltip-row-detail")),this._detailView.anchor=t.TextAnchor.START}layout(t,e,s,i,r){var n;const o=e.options,a=e.getMarkerSize(),h=e.getMarkerGap(),l=Fs.getDrawer(o.listMarkerShape);this._marker.setPath(l(a/2)),this._marker.setFill((null===(n=i.legendColor)||void 0===n?void 0:n.call(i))||""),r[0]?(s.setFormat(r[0]),s.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a+h)):this._textView.text="",r[1]?(s.setFormat(r[1]),s.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+h+this._textView.getBBox().width+y(e.options.listGap,4))):this._detailView.text=""}alignDetail(t){const e=this._marker.getBBox();this._detailView.transX(t-this._detailView.getBBox().width),this._marker.trans(e.width/2,this.r.height/2)}}class Fh extends Qt{constructor(e){super(e,"rct-tooltip-list"),this.add(this._headerView=new de(e)),this._headerView.anchor=t.TextAnchor.START,this.add(this._rowLayer=new te(e,"")),this.add(this._footerView=new de(e)),this._footerView.anchor=t.TextAnchor.START,this._rows=new Kn(this._rowLayer,$h)}layout(t,e,s,i){const r=this._headerView,n=this._footerView,o=y(e.options.listRowGap,4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!i.header)&&(s.setFormat(i.header),s.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(i.items.length).forEach(((r,n)=>{r.trans(0,h),r.layout(t,e,s,i.items[n],i.rows[n]),h+=r.getBBox().height+o,l=r._width=f(l,(r.r=r.getBBox()).width)})),n.setVis(!!i.footer)&&(s.setFormat(i.footer),s.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach((t=>{t.alignDetail(l)}))}}class Ih extends Qt{constructor(e){super(e,Ih.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new re(e,"rct-tooltip-back")),this.add(this._top=new re(e,"rct-tooltip-top")),this.add(this._textView=new de(e,"rct-tooltip-text")),this.add(this._listView=new Fh(e)),this._back.setAttr("filter","url(#"+Kt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new we,this.close(!0,!1)}show(t,e,s,i,n,o,a){const h=s.point,l=this._model=t.chart._tooltip,_=l.setTarget(t,h,i&&i.map((t=>t.point)));if(!_)return;const c=l.options,d=_.isGroupTooltip();let u,p=this._list;if(d){p.header=p.footer="",p.items=[],p.rows=[];const e=_.getTooltipText(t,h,p);if(0===p.rows.length){if(u=r(e)?e.join(" "):e,!u||!u.trim())return;p.rows=p.items.map((()=>[u,""]))}}else{const e=c.text||_.getTooltipText(t,h,null);if(u=r(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(l._style);const g=e.contentWidth(),x=e.contentHeight(),y=this._listView,b=this._textView,w=l.getHeaderHeight(),v=l.getTailSize(),S=t.chart.isInverted(),V=t._yAxisObj;let A,P,C,k=V.options.reversed;t instanceof Fi&&t.getBaseValue(V)>s.point.yValue&&(k=!k),d?(y.setVis(!0),b.setVis(!1),y.layout(e.doc(),l,this._richText,this._list),A=y.getBBox()):(y.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),A=b.getBBox()),P=f(c.minWidth||0,A.width+16),C=f(c.minHeight||0,A.height+12)+w;let L=t._calcedColor;t instanceof Oi?(t.options.legendByPoint||t._colorByPoint())&&(L=h._calcedColor):t._colorByPoint()&&(L=getComputedStyle(s.dom).fill),this._top.setFill(L);const N=this.isVisible()?300:0,M=c.offset+v,E=a.getFocusPointView().getBounds(),T=e.getBounds();let B,O,D=!1;const R=l.isFollowPointer(t);if(S&&!t.isWidget)B=o-C/2-f(0,m(o-C/2,x-C)),D=R?k?P+M>n:n+P+M>g:k?P+M>E.x-T.x+E.width:E.x-T.x-M>g-P,D&&(k=!k),O=k?"left":"right",this.$_drawTooltip(0,0,P,C,O,B),k?n-=P+M:n+=M,o-=C/2;else{B=n-P/2-f(0,m(n-P/2,g-P));const t=R?o-e.getRootDistance().y:E.y-T.y-e._padding.top,s=R?x-o:T.bottom-E.bottom;if(t>=C+M||s>=C+M){(k?s>=C+M:t>=C+M)?O=k?"bottom":"top":(O=k?"top":"bottom",k=!k),this.$_drawTooltip(0,0,P,C,O,B),n-=P/2,k?o+=M:o-=C+M}else{B=o-C/2-f(0,m(o-C/2,x-C));const t=E.x-T.x;O=g-t>=P+M||t<P+M?"right":"left",this.$_drawTooltip(0,0,P,C,O,B),"right"===O?n+=M:n-=P+M,o-=C/2}}return n=f(0,m(n,g-P)),o=f(0,m(o,x-C)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(f(0,n-20),f(0,o-20)),this.transEx(n,o,N/2,!1)):this.transEx(n,o,N,!1),0===N&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:P,h:C}}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:tr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){jt(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let _=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":_=_.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case"bottom":_=_.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case"left":_=_.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case"right":_=_.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c="bottom"===r,d=c?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(c?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(_)}}Ih.CLASS_NAME="rct-tooltip";class zh extends Jt{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new Ih(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class Hh extends ht{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDestroy(){this._dom.remove(),this._dom=null,super._doDestroy()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,s=Rt.isHoverAt(e),i=(this._model=t).options;return Rt.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.width)?i.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=F(i.width),isNaN(i.height)?e.style.height="":e.style.height=F(i.height),"custom"===i.hintMode?(i.hint?e.dataset.hint=i.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.hint||""),i.imageUrl?Rt.setStyles(this._img,{display:"",width:$(i.imageWidth),height:$(i.imageHeight)}):Rt.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(nt?this._hovered:s),this._span.textContent=i.text||"",this}layout(t){const e=this._dom,s=e.style,i=this._model.options,r=i.align,n=i.verticalAlign;s.left=$("left"===r?t.x+(i.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(i.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(i.offsetX||0)),s.top=$("top"===n?t.y+(i.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(i.offsetY||0))}pointerEnter(){this._hovered=!0,this.$_setImage(!0)}pointerLeave(){this._hovered=!1,this.$_setImage(!1)}click(){this._model.click()}$_initDom(t){const e=t.createElement("button"),s=t.createElement("div");return e.className="rct-html-button",Rt.setStyles(e,{position:"absolute",textAlign:"center"}),Rt.setStyles(s,{display:nt?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",Rt.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),Rt.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),nt&&Rt.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.appendChild(this._span),e}$_setImage(t){const e=this._model.options;e.imageUrl?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.hoverImageUrl||e.imageUrl})`:this._img.style.backgroundImage=`url(${e.imageUrl})`:this._img.style.backgroundImage=""}}class Gh extends _o{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Rh(t,!1)),this.add(this.subtitleView=new Rh(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):d.setModel(o),o.options.position){case"leftSide":case"left":case"rightSide":case"right":p=f(l,c),u=h+g+_;break;default:p=l+g+c,u=f(u,h+_)}return p>0&&(p+=this.titleView.visible?y(n.options.gap,0):y(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===o.alignBase?t.wChart:t.wPlot:0;let l=this._wTitle>t.wPlot||i&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===o.alignBase?0:t.xPlot;if(a>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},c=()=>{const e=f(this._hTitle,this._hSub);g=f(g,g+t(i,e,this._hTitle)),x=f(x,x+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(m=f(m,m+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=m;break;case"right":b=m+this._wTitle-this._wSub;break;default:b=m+(this._wTitle-this._wSub)/2}else b=f(b,b+d(r,h,this._wSub))},p=y(o.titleGap,0);let g=0,m=l,x=0,b=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":m=b+this._wSub+p,c();break;case"rightSide":b=m+this._wTitle+p,c();break;case"right":switch(b=m+this._wTitle+p,o.align){case"center":b=f(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=f(b,_+h-this._wSub)}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":m+=a-this._wTitle,b=m-p-this._wSub,c();break;case"left":switch(m+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=m-p-this._wSub}c();break;case"rightSide":case"right":b+=h-this._wSub,m=b-p-this._wTitle,c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":m+=(a-this._wTitle)/2,b=m-this._wSub-p,c();break;case"left":switch(m+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(m-b-this._wSub)/2;break;case"right":b=m-this._wSub-p}c();break;case"rightSide":m+=(a-this._wTitle)/2,b=m+this._wTitle+p,c();break;case"right":switch(m+=(a-this._wTitle)/2,o.align){case"left":b=m+this._wTitle+p;break;case"center":b+=m+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}}const w=y(n.offset,0),v=y(o.offset,0);0!==w&&(m+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(b+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(b+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(m,g),s.resizeByMeasured().layout().trans(b,x)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,c=a?this._wTitle:this._wSub;let d=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}n.trans(d,0)}}}class jh extends _o{_doInitChildren(t){this.add(this._legendView=new Mh(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class Xh extends _o{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach(((t,e)=>{t.prepare(i[e])})),this.setVis(o.length>0)){const t=o[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach(((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)}))}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}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,o=0;return[this.views].forEach((e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,_+=s.height}})),this.isHorz?_+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=f(n,l),o=f(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach((e=>{if(e){let h=0;e.forEach((t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===Yn.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Yn.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}})),this.isHorz?o+=r+t:a+=n+t}}));const h=i.length>0&&e.chart.body.options.zoomCallback;h&&Promise.resolve().then((()=>{i.forEach((({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof _i?Math.floor(e):e,to:t instanceof _i?Math.floor(s):s})}))}))}}class Wh extends ho{constructor(e){super(e,"rct-credits"),this.add(this._textView=new de(e)),this._textView.anchor=t.TextAnchor.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class Yh extends te{static registerPaneClass(t){this.pane_class=t}constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this._htmlButtons=[],this.add(this._annotationContainer=new te(t,"rct-annotations")),this.add(this._plotContainer=new te(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new bh(t,this));for(const e in Yn){const s=new Xh(t,Yn[e]);this._plotContainer.add(s),this._axisSectionMap[Yn[e]]=s}Yh.pane_class&&this.add(this._paneContainer=new Yh.pane_class(t,this)),this.add(this._titleSectionView=new Gh(t)),this.add(this._legendSectionView=new jh(t)),this.add(this._frontAnnotationContainer=new te(t,"rct-front-annotations")),this.add(this._creditView=new Wh(t)),this.add(this._navigatorView=new vh(t)),this.add(this._historyView=new Lh(t))}_doDestroy(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.destroy(),super._doDestroy()}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){var n,o,a;const h=this._model=e,l=h.isPolar(),_=h._credits,c=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(_.visible)&&(u=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=u.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=u.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=u.height;break;case"right":case"left":p-=u.width}if(this._navigatorView.setVis(d.visible),null===(a=this._paneContainer)||void 0===a?void 0:a.visible)this._paneContainer.measure(t,h._split,p,g,1);else{if(this._navigatorView.visible){const t=h._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1)}if(this._navigatorView.visible){const e=l?this._polarView:this._bodyView;h._navigator._vertical?g=e.mh:p=e.mw,this._navigatorView.measure(t,d,p,g,r)}this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,_=l.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,m=0,f=0,x=0,y=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=m=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=f=h.width+p+c:i-=x=h.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),y=f,b=s-m;const V=this._navigatorView;let A=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.mh-V.model.getGap()-V.model.getGapFar()),r-=A=V.mh));const P=this._legendSectionView;let C,k,L=0,N=0;if(P.visible)switch(P.resizeByMeasured().layout(),L=P.height,N=P.width,a._location){case"top":C=v+g,r-=L;break;case"bottom":r-=L,C=b-L,b-=L;break;case"right":i-=N,k=e-N;break;case"left":i-=N,y+=N,k=0}V.visible&&(b-=A,V.layout().transY(b+V.model.getGap()));let M,E=0,T=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(y,S+v).resize(i,r),this._paneContainer.layout(),E=r,T=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([Yn.LEFT,Yn.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[Yn.TOP,Yn.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[Yn.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),y+=e.mw),(e=t[Yn.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[Yn.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0),b-=e.mh),(e=t[Yn.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0))),V.visible&&V.layout().transX(y);const s={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[Yn.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[Yn.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[Yn.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[Yn.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,T=this._plotWidth-0,y=s.x,b=s.y-this._plotHeight,n.resize(T,E),n.trans(y,b),n.layout(),M=n.getRect(),n._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(h.visible){let t,i;switch(h.layout(),_.verticalAlign){case"top":i=u;break;case"middle":i=(s-h.height)/2+u;break;default:i=m>0?s-m+c:s-h.height-u}switch(_.align){case"left":t=p;break;case"center":t=(e-h.width)/2+p;break;default:t=x>0?e-x+c:e-h.width-p}h.trans(t,i)}if(T+=0,w.visible&&w.layout({xPlot:y,wPlot:T,wChart:e}).trans(0,S),P.visible){const t=a.options,n=t.align,o=t.verticalAlign;if("body"===a._location){let e=+t.offsetX||0;switch(n){case"right":y+=T-N-e;break;case"center":y+=(T-N)/2+e;break;default:y+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=E-L-e;break;case"middle":b+=(E-L)/2+e;break;default:b+=e}}else if(isNaN(C)){const e=+t.offsetY||0;if(y=k,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-L-e;break;default:b=(s-L)/2+e}b+L>s&&(b=(s-L)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-L-e;break;default:b=b+(r-L)/2+e}b+L>s&&(b=(s-L)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=C,"chart"===t.alignBase)switch(n){case"left":y=s;break;case"right":y=e-N-s;break;default:y=(e-N)/2+s}else switch(n){case"left":y+=s;break;case"right":y=y+i-N-s;break;default:y+=(i-N)/2+s}y+N>e&&(y=(e-N)/2),y<0&&(y=0)}P.trans(y,b)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,M),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=i.getTooltipPos(),d=h?r.x+c.x:l+c.x,u=h?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new zh(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new Ih(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new vo(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find((e=>e.dom.contains(t)));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find((e=>e.dom.contains(t)))}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i,r;const n=s,o=this._model&&this.bodyOf(s),a=null==n?void 0:n.classList,h=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let l=this._hoverItem;if(this._hoverItem=null,(null===(i=this._model)||void 0===i?void 0:i.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==o&&t.clearHover()})),o){const i=o.controlToElement(t,e),r=o.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(n)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(n);if(t){const e=t.legend;ot.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof Ci?o.hoverSeries(t):e.options.pointHovering&&t instanceof ii&&o.hoverPoint(t)}))}}if(l instanceof Bs&&!(this._hoverItem instanceof Bs)&&(o.hoverPoint(null),o.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void o.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?o.width:o.height,a=e._isHorz?i.x:i.y,l=r&&s.visible&&!h&&s.flag.visible&&!s.isBar()&&s.getFlag(n,a);if(l){t.showCrosshair(a,l);const r=[];o._seriesViews.forEach((t=>{let s,n=Number.MAX_SAFE_INTEGER;const o=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,a=t instanceof Gr&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-a);h<n&&(n=h,s=t)})),r.push(s)})),s.moved(a,l,r)}else t.hideCrosshiar()}))}else(null===(r=this._model)||void 0===r?void 0:r.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus(),this.$_handleAnnotationHover(s)}pointerLeaved(t,e,s){this.$_clearAnnotationHover()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in Yn){const s=this._axisSectionMap[Yn[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Dh(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach(((e,i)=>{let r=this._htmlButtons[i];r||(r=new Hh(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)}));for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach(((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)}))}}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,this,e,e.getAxes(s,!0),i,r):a.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const o=n[e];r&&o.visible&&o.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[Yn.LEFT].checkWidths(t,s,i),s-=n[Yn.RIGHT].checkWidths(t,s,i),i-=n[Yn.BOTTOM].checkHeights(t,s,i),i-=n[Yn.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,_,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Yn.LEFT||t===Yn.RIGHT?s-=e.mw:t!==Yn.BOTTOM&&t!==Yn.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,_,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Yn.LEFT||t===Yn.RIGHT?s-=e.mw:t!==Yn.BOTTOM&&t!==Yn.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.axesLayouted(l,_,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body.getRadius(s,i),o=2*Math.PI*n,a=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(o,a,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(o,a,!1),this._polarView.measure(t,e._body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)}))}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}var Uh;!function(t){t.EXPORT="$$realchart_export"}(Uh||(Uh={}));class Zh extends Kt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new Zn(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new Yh(t)}_createPointerHandler(){return new kh(this)}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof Ie&&s===Be.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof Zn&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Uh.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_canOverflowRender(){return!1}_doRender(t){var e;const s=this.model,i=s._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.theme,!0),this.setData("palette",i.palette),this.setResizeDelay(i.resizeDelay),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==i.visible)&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_doRenderBackground(t,e,s,r){if(this.model){const s=this.model._chartOptions._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e._exporter.options)}}}class qh{static getVersion(){return Ft.version}static setLicenseKey(t){Ft.code=t}static setLocale(t,e){e&&k(t,e),(t=>{t&&(C=A[P=t.substring(0,2)]),C||(C=A[P="ko"])})(t)}static registerLocale(t,e){k(t,e)}static setDebugging(t){Qt.DEBUGGING=t}static setLogging(t){ot.LOGGING=t}static setAnimatable(t){Kt._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new Zh(t,e);return o.chart.load(i(s)?s:{},r,n),o.chart[Gn]=o,o.chart}static createData(t,e){return new qn(t||{},e)}}class Kh{static empty(){return new Kh}static create(t=0,e=0){return new Kh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class Qh{static empty(){return new Qh}static create(t=0,e=0){return new Qh(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const Jh=qh.getVersion,tl=qh.setDebugging,el=qh.setLogging,sl=qh.setAnimatable,il=qh.configure,rl=qh.createChart,nl=qh.createData,ol=qh.setLicenseKey;t.Annotation=Ie,t.AnnotationView=Lo,t.ArcElement=Ao,t.AreaRangeSeries=Xr,t.AreaRangeSeriesView=va,t.AreaSeries=Hr,t.AreaSeriesGroup=Yr,t.AreaSeriesView=Sa,t.AssetCollection=Le,t.Axis=as,t.AxisBaseLine=dr,t.AxisCollection=hs,t.AxisGrid=Ke,t.AxisItem=We,t.AxisLabel=is,t.AxisLine=Ye,t.AxisScrollBar=rs,t.AxisScrollView=bo,t.AxisSectorLine=os,t.AxisTick=ss,t.AxisTitle=Ue,t.AxisView=vo,t.BarRangeSeries=Sr,t.BarRangeSeriesView=Va,t.BarSeries=Pr,t.BarSeriesBase=Ar,t.BarSeriesGroup=kr,t.BarSeriesGroupBase=Cr,t.BarSeriesPoint=Vr,t.BarSeriesView=Ca,t.BarSeriesViewBase=Pa,t.BasedSeries=Fi,t.BasedSeriesView=ha,t.BellCurveSeries=Zr,t.BellCurveSeriesView=ka,t.Body=Es,t.BodyDepth=Ms,t.BodyView=bh,t.BoxPlotSeries=Kr,t.BoxPlotSeriesView=Na,t.BoxPointElementEx=ia,t.BubbleSeries=Jr,t.BubbleSeriesView=Ea,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=tn,t.CandlestickSeries=sn,t.CandlestickSeriesView=Ba,t.CategoryAxis=_i,t.CategoryAxisGrid=li,t.CategoryAxisLabel=hi,t.CategoryAxisTick=ai,t.Chart=Zn,t.ChartControl=Zh,t.ChartData=qn,t.ChartDataCollection=dt,t.ChartElement=ho,t.ChartItem=Be,t.ChartObject=Un,t.ChartOptions=Wn,t.ChartPointerHandler=kh,t.ChartText=De,t.ChartView=Yh,t.CircelBarPointLabel=rn,t.CircleBarSeries=nn,t.CircleBarSeriesGroup=on,t.CircleBarSeriesView=Da,t.CircleElement=Vo,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=As,t.CircularGaugeGroup=Ps,t.CircularGaugeLabel=Ss,t.ClockGaugeType="clock",t.ClusterableSeries=Ri,t.ClusterableSeriesGroup=ji,t.Color=Dt,t.ConnectableSeries=Li,t.ConstraintSeriesGroup=Gi,t.ContentView=co,t.ContinuousAxis=ur,t.Credits=jn,t.Crosshair=je,t.DataPoint=ii,t.DataPointCollection=ri,t.DataPointLabel=bi,t.Dom=Rt,t.DumbbellSeries=ln,t.DumbbellSeriesView=$a,t.ElementPool=Kn,t.EqualizerSeries=cn,t.EqualizerSeriesView=Ia,t.ErrorBarSeries=dn,t.ErrorBarSeriesView=Ha,t.Exporter=Ts,t.FunnelSeries=mn,t.FunnelSeriesView=ja,t.Gauge=us,t.GaugeBase=ds,t.GaugeGroup=ps,t.GaugeGroupView=Bo,t.GaugeItem=class extends Be{constructor(t){super(t.chart)}},t.GaugeLabel=vs,t.GaugeRangeBand=ws,t.GaugeRangeLabel=bs,t.GaugeScale=ys,t.GaugeView=Mo,t.HeatmapSeriesType="heatmap",t.HistogramSeries=yn,t.HistogramSeriesView=Wa,t.IconedText=Re,t.ImageAnnotation=rr,t.ImageAnnotationView=pa,t.ImageElement=uo,t.LayerElement=te,t.Legend=Os,t.LegendItem=Bs,t.LegendItemView=Nh,t.LegendView=Mh,t.LineElement=Er,t.LinePointLabel=Dr,t.LineSeries=Fr,t.LineSeriesBase=Rr,t.LineSeriesBaseView=ba,t.LineSeriesGroup=Wr,t.LineSeriesPoint=Br,t.LineSeriesView=wa,t.LinearAxis=pr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=In,t.LollipopSeries=vn,t.LollipopSeriesView=Ua,t.LowRangedSeries=zi,t.MarkerSeries=Xi,t.MarkerSeriesPointView=_a,t.MarkerSeriesView=ca,t.NavigatorMask=Yi,t.NavigiatorHandle=Wi,t.ORG_ANGLE=E,t.OhlcSeries=Vn,t.OhlcSeriesView=qa,t.OthersGroup=Bi,t.PI_2=M,t.PaneContainer=class extends te{},t.ParetoSeries=Pn,t.ParetoSeriesView=Ka,t.PathBuilder=Zt,t.PathElement=re,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=En,t.PieSeriesGroup=Tn,t.PieSeriesLabel=Nn,t.PieSeriesText=Ln,t.PieSeriesView=eh,t.Point=Kh,t.PointElement=ta,t.PointHovering=Xn,t.PointLabelLineContainer=Uo,t.PointLabelLineView=Yo,t.PointLabelView=Xo,t.PointViewPool=fa,t.RAD_DEG=B,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=Di,t.RangedSeries=Ii,t.RcAnimation=Xt,t.RcControl=Kt,t.RcElement=Qt,t.RcObject=ht,t.RectElement=Is,t.SVGNS=e,t.ScaleView=class extends ho{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new te(t,"rct-gauge-scale-ticks")),this._ticks=new Kn(this._tickContainer,Er),this.add(this._labelContainer=new te(t,"rct-gauge-scale-tick-labels")),this._labels=new Kn(this._labelContainer,To)}},t.ScatterSeries=On,t.ScatterSeriesView=ih,t.SectionView=_o,t.SectorElement=Co,t.Series=Ci,t.SeriesAnimation=Oo,t.SeriesGroup=Hi,t.SeriesMarker=Ni,t.SeriesNavigator=Ki,t.SeriesView=Jo,t.ShapeAnnotation=nr,t.ShapeAnnotationView=ga,t.Size=Qh,t.SplineSeries=Ir,t.Subtitle=Ji,t.SvgShapes=Fs,t.TextAnnotation=or,t.TextAnnotationView=ma,t.TextElement=de,t.TimeAxis=wr,t.Title=Qi,t.Tooltip=tr,t.TreemapSeriesType="treemap",t.TrendLineArea=ci,t.TrendLineLabel=di,t.Trendline=pi,t.Utils=ot,t.ValueGauge=ms,t.ValueGaugeView=class extends Mo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?xt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==t._prevValue&&(this._ani=new Eo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}},t.VectorSeriesType="vector",t.WaterfallSeries=$n,t.WaterfallSeriesView=rh,t.Widget=ls,t.WidgetSeries=Oi,t.WidgetSeriesConnector=Ei,t.WidgetSeriesLabel=Ti,t.WidgetSeriesPoint=Mi,t.WidgetSeriesView=ua,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=ni,t.absv=x,t.assignObj=_,t.buildValueRanges=J,t.calcPercent=W,t.configure=il,t.copyObj=t=>t&&_({},t),t.cos=u,t.createChart=rl,t.createData=nl,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=Me,t.fixnum=D,t.getVersion=Jh,t.incv=S,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=nt,t.isNumber=h,t.isObject=i,t.isString=o,t.maxv=f,t.minv=m,t.parsePercentSize=j,t.pickNum=y,t.pickProp=w,t.pickProp3=v,t.pixel=$,t.rectToSize=Jn,t.setAnimatable=sl,t.setDebugging=tl,t.setLicenseKey=ol,t.setLogging=el,t.sin=p,t.toStr=function(t){return null==t?null:String(t)}}));
|