realchart 1.4.7 → 1.4.8

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart v1.4.7
3
+ * RealChart v1.4.8
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"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=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const P="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class C{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&&C.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,C.month_days[C.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()-A}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 deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=C.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(),C.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 isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=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}}C.LOGGING=!1,C.week_days=["일","월","화","수","목","금","토"],C.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],C.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]],C.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const k={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 L="ko",N=k[L]||k[L="ko"];const M=(t,e)=>{t&&i(e)&&(N=k[t.substring(0,2)]=Object.assign(k.ko,k.en,e))};let E=0;class T{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(E++))}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 B extends T{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 O=void 0,R=Math.PI,D=2*R,F=-R/2,$=2*R/360,I=360/R/2,z="%".charCodeAt(0);function H(t){return parseFloat(t.toPrecision(12))}function G(t){return Math.floor(1e6*t)/1e6}function j(t){return t+"px"}function Y(t){return null==t||Number.isNaN(t)||""===t}function X(t){return t<10?"0"+t:String(t)}function W(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function U(t,e){const s={};return s[t]=e,s}function Z(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)===z?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;st(N.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 q(t,e){return Z(t,!0)||Z(e,!1)}function K(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Q="fill",J={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"},tt=function(t){const e=J[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return J[t]=e,e}return e};class et extends Error{}const st=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},it=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):O};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)]:O})}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)]:O}),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},rt="shuffle",nt="random",ot="vertical-lr",at="vertical-rl",ht=function(t){return t&&"object"==typeof t};class lt extends B{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 ht(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)&&st(N.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class _t{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 lt({},s):ht(s)&&r(s.values)&&(i=new lt(s.options,s.values)),this._map[e]=i}}}const ct="0".charCodeAt(0),dt="#".charCodeAt(0),ut=",".charCodeAt(0),pt="s".charCodeAt(0),gt="a".charCodeAt(0);class mt{static getFormatter(t){let e=mt.Formatters[t];return e||(mt.Formatters[t]=e=new mt(t)),e}static get Default(){return mt.getFormatter(mt.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)===ct;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===dt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===ct;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ut){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===pt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===gt){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}mt.DEFAULT_FORMAT="",mt.Formatters={};const ft=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],xt=[".","/","-",":"],yt="Z".charCodeAt(0),bt="z".charCodeAt(0),wt="A".charCodeAt(0),vt="a".charCodeAt(0),St="y".charCodeAt(0),Vt="M".charCodeAt(0),At="m".charCodeAt(0),Pt="W".charCodeAt(0),Ct="w".charCodeAt(0),kt="d".charCodeAt(0),Lt="H".charCodeAt(0),Nt="h".charCodeAt(0),Mt="S".charCodeAt(0),Et="s".charCodeAt(0);class Tt{static getFormatter(t){let e=Tt.Formatters[t];return e||(Tt.Formatters[t]=e=new Tt(t)),e}static get Default(){return Tt.getFormatter(N.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||N.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 St:i+=a>2?t.getFullYear():X(t.getFullYear()%100);break;case Vt:i+=a>1?X(t.getMonth()+1):t.getMonth()+1;break;case kt:i+=a>1?X(t.getDate()):t.getDate();break;case Pt:i+=a>1?X(C.weekOfYear(t,e)+1):C.weekOfMonth(t,e,!0)+1;break;case Ct:i+=a>1?C.long_week_days[t.getDay()]:C.week_days[t.getDay()];break;case Lt:i+=a>1?X(t.getHours()):t.getHours();break;case Nt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?X(e):e}else i+=a>1?X(t.getHours()):t.getHours();break;case At:i+=a>1?X(t.getMinutes()):t.getMinutes();break;case Et:i+=a>1?X(t.getSeconds()):t.getSeconds();break;case vt:case wt:t.getHours()<12?i+=N.am:i+=N.pm;break;case Mt:let s=t.getMilliseconds();i+=3==a?W(s):2==a?X(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(xt.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),ft.indexOf(n)<0){let e=n.charCodeAt(0);(e>=wt&&e<=yt||e>=vt&&e<=bt)&&st(N.invalidDateFormat,t)}e.push(n)}if(r<i&&C.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&C.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||N.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Tt.Formatters={};class Bt{static isBright(t){return new Bt(t).isBright()}static getContrast(t,e,s){return new Bt(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Bt(t),r=new Bt(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 P?new Bt(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(C.startsWith(t,"rgb(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):C.startsWith(t,"rgba(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):C.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 Bt(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}}Bt.BLACK="#000",Bt.WHITE="#fff";class Ot{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 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 setClipPath(t,e){t.setAttribute("clip-path",`url(#${e instanceof SVGClipPathElement?e.id:e})`)}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}}var Rt;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Rt||(Rt={}));const Dt={name:"RealChart",version:"1.4.7",license:"enterprise",code:null};class Ft{static decode(t){const e=Ft.CHARS,s=Ft.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}}Ft.PAD="=",Ft.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class $t{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=$t.xor,i=$t.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=$t.xor,i=$t.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=$t.kb,i=$t._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*$t.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=$t._decryptBlock;let i=$t._init(e),r=[],n=Ft.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*$t.POW24|n[a+1]*$t.POW16|n[a+2]*$t.POW8|n[a+3],h.right=n[a+4]*$t.POW24|n[a+5]*$t.POW16|n[a+6]*$t.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)}}$t.POW2=Math.pow(2,2),$t.POW3=Math.pow(2,3),$t.POW4=Math.pow(2,4),$t.POW8=Math.pow(2,8),$t.POW16=Math.pow(2,16),$t.POW24=Math.pow(2,24),$t.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 It{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=$t.decrypt(t,"dkdl"+this._getLDKey($t.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 zt={inOutSine:t=>-(u(R*t)-1)/2},Ht=function(t,e,s,i,r,n){const o=U(e,null!=s?s:"initial"),a=U(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Gt{constructor(){this.delay=0,this.duration=Gt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=m(1,f(0,H(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop(!0)}finally{t>=this.duration?this._stop(!1):this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop(!0)}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=y(t,Gt.DURATION),this.delay=e||0,this._easing=zt[s],this._doStart(),this._started=+new Date,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}}Gt.DURATION=700,Gt.SHORT_DURATION=300;class jt extends Gt{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 jt(t).start()};class Xt extends T{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=Dt.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=It.decrypt(e);if("RealChart"!==i.name||"RealChart"!==Dt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Dt.license!=Rt.Developer&&!It.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(Rt).includes(n))throw new Error(s);if(Dt.license=i.lic,n==Rt.Evaluation||n==Rt.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&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Xt.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),Ot.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){Y(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){Ot.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(Wt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(Wt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new Kt(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new Jt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}_setTesting(){this._testing=!0,Wt.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;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||st(N.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");_(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const o=this._svg=r.createElementNS(e,"svg");o.classList.add("rct-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created by RealChart v"+Dt.version,o.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Zt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute"}),this._tester=r.createElement("div"),n.appendChild(this._tester),P&&(this._canvas=r.createElement("canvas"))}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Xt.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()}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{C.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=j(s),r.style.height=j(i)),_(this._htmlRoot.style,{left:j(e.left-t.left),top:j(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),_(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(n,this._root,s,i);const o=this._padding=Ot.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(),C.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)}}Xt.CLASS_NAME="rct-control",Xt.SHADOW_FILTER="rr-chart-shadow-filter",Xt._animatable=!0;class Wt extends T{constructor(t,s,i=O){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 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 Y(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 P&&(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 P&&(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 jt||!!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=C.isValidNum(t)?t:this._tx,e=C.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=C.isValidNum(t)?t:this._tx,e=C.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=C.isValidNum(t)?t:this._tx,e=C.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&&C.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&C.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(tt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(tt(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(tt(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(tt(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.stop(),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}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(Wt.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 Wt.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=[];(C.isValidNum(e)||C.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+C.pick(this._originX,t.getAttribute("x"),0)+" "+C.pick(this._originY,t.getAttribute("y")||0)+")"),C.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=C.getNumber(this._scaleX,1),n=C.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}Wt.DEBUGGING=!1,Wt.TESTING=!1,Wt.ASSET_KEY="_asset_",Wt.TEMP_KEY="_temp_";class Ut extends Wt{constructor(t,e){super(t,e,"g")}}class Zt extends Wt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class qt extends Wt{constructor(t){super(t,O,"clipPath");const e=this._id=C.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Kt extends qt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Wt(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 Qt extends Wt{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 Jt extends qt{constructor(t){super(t),this.add(this._circle=new Wt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class te{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 ee,se,ie;t.TextAnchor=void 0,(ee=t.TextAnchor||(t.TextAnchor={})).START="start",ee.MIDDLE="middle",ee.END="end",t.TextLayout=void 0,(se=t.TextLayout||(t.TextLayout={})).TOP="top",se.MIDDLE="middle",se.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ie||(ie={}));class re extends Wt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=ie.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(Bt.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 ne="$_TH",oe="$_TW";class ae{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]?mt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Tt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");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),O),0===this._literals[2].length&&(this._literals[2]=O)}else this._literals.push(r,n,O,O);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class he extends ae{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 le extends he{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 _e={t:class extends he{tag(){return"</t>"}},b:class extends he{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends he{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:le};class ce{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 ae).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 _e){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 _e[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 de=/<br.*?>|\r\n|\n/;class ue{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===ot||u===at;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[oe]=y.width,x[ne]=y.height,p?(u=f(u,x[oe]),g+=x[ne]):(u+=x[oe],g=f(g,x[ne])),m||(m=x),l instanceof le){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[ne]=g*h,r[oe]=u*h,c.push(0==s?r[oe]/2:r[oe])}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[oe]-t.getAscent(e[oe]))+t.getAscent(l[s][oe])):r=e[ne]-t.getAscent(e[ne])+t.getAscent(l[s][ne]),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[oe]=n.width,r[ne]=e[ne]=n.height,d[0]=r}switch(u){case ot:d[s].setAttribute("dx",String(i)),d[s].setAttribute("y","0");break;case at: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[oe];if(e)i.setAttribute("dx",String(u===at?s-r/2:r/2));else switch(u){case ot:i.setAttribute("x",String((s-r)/-2));break;case at:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][ne])}}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[oe]=y.width,u[ne]=y.height,x&&(u.textContent=" ",u[ne]*=.6,x=!1),p+=u[oe],g=f(g,u[ne]),m||(m=u),l instanceof le){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[ne]=g*h,r[oe]=p*h,d=f(p,d),c.push(0==s?r[oe]/2:r[oe])}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[ne]-t.getAscent(e[ne])+t.getAscent(l[s][ne]))),e=l[s]);t.layoutText(l[0][ne])}}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(de);for(let t of s)e.push((new ce).parse(t))}}}class pe{constructor(t){this.source=t}hasDef(){return!0}}class ge extends pe{_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 me extends ge{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}}me.TYPE="lineargradient";class fe extends ge{getEelement(t,s){const i=t.createElementNS(e,"radialGradient");return Y(s.cx)||i.setAttribute("cx",s.cx),Y(s.cy)||i.setAttribute("cy",s.cy),Y(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}fe.TYPE="radialgradient";class xe extends pe{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=xe.STOCK[+s.pattern%xe.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}}xe.TYPE="pattern",xe.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 ye extends pe{prepare(){const t=this.source;this._colors=r(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&C.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:[]}}ye.TYPE="colors";class be extends pe{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||be.SIZE,height:e.height||e.width||be.SIZE})}}be.TYPE="images",be.SIZE=20;class we{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(Wt.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=xe.TYPE:r(t.colors)?e=ye.TYPE:r(t.images)&&(e=be.TYPE)),e)switch(e.toLowerCase()){case me.TYPE:return new me(t);case fe.TYPE:return new fe(t);case xe.TYPE:return new xe(t);case ye.TYPE:return new ye(t);case be.TYPE:return new be(t)}}}}let ve=0;const Se=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},Ve=["__proto__","constructor","prototype"],Ae=function(t,e){const s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!Ve.includes(t)){const n=e[t];r(n)?s[t]=n.slice(0):n instanceof Date?s[t]=new Date(n):i(n)?n._obj instanceof lt?s[t]=n:s[t]=Ae(s[t],n):s[t]=n}return s};class Pe extends T{constructor(t){super(),this.chart=t,ve++}init(){const t=this._op=Ae({},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 Pe&&(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):n instanceof Date?s[t]=new Date(n):i(n)?n instanceof lt?s[t]=n:n._obj instanceof lt?s[t]=n._obj:this[t]instanceof Pe||(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 Pe)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 Pe?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 Pe)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){if(t){const s=t._op=Ae({},t.constructor.defaults);return t.$_applyOptions(s),t._children.forEach((i=>{s[i]=e(t[i])})),s}};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 Pe?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):n instanceof Date?t[s]=new Date(n):i(n)?n._obj instanceof lt?t[s]=n._obj: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 Pe)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`]=Z(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Pe.REFRESHED="refreshed",Pe.defaults={visible:!0};class Ce{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 ke extends Pe{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?mt.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 ue),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(C.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=C.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}}ke.defaults=Se(Pe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Le extends ke{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 be&&(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 be?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Le.defaults=Se(ke.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Ne extends Pe{}const Me={};class Ee extends Pe{static register(...t){t.forEach((t=>{Me[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=K(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=K(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(Pe.REFRESHED)}_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){}}Ee.defaults=Se(Pe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Te extends Ce{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 Ee)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):O}))}$_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 Be extends Pe{}Be.defaults=Se(Pe.defaults,{minWidth:50});class Oe extends Pe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Be(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 Date?Tt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):mt.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)}}Oe.defaults=Se(Pe.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Re={};class De extends Pe{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Fe extends De{_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)}}Fe.defaults=Se(De.defaults,{visible:void 0});class $e extends De{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return P?"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&&!Y(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)}}$e.defaults=Se(De.defaults,{align:"middle",offset:0,gap:5});class Ie extends De{_isVisible(){return this._op.visible&&!Y(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ie.defaults=Se(De.defaults,{position:"end",gap:2});class ze extends De{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 He extends De{_doInit(t){t.rows=(this._rows=new ze(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}}He.defaults=Se(De.defaults,{visible:void 0,depthVisible:void 0});class Ge extends Le{getDefaultIconPos(){return"left"}}Ge.defaults=Se(Le.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class je extends De{_doInit(t){t.label=(this._label=new Ge(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=Se(De.defaults,{front:!1,zindex:0});class Ye extends je{}class Xe extends je{}class We extends De{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return C.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:We.DEF_LENGTH,this._gap=this._op.gap||0}}We.DEF_LENGTH=7,We.defaults=Se(De.defaults,{visible:!1,gap:3});class Ue extends Le{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}}Ue.defaults=Se(Le.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Ze extends De{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)}}Ze.defaults=Se(De.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class qe{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?C.clamp(t,this.min,this.max):C.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 Ke extends Fe{}class Qe extends Pe{static register(...t){t.forEach((t=>{Re[t.type]=t,t.subtype&&(Re[t.subtype]=t)}))}_animating(){return!isNaN(this._prevRate)}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this._isX=e}_doInit(t){t.title=(this._title=new $e(this)).init(),t.unitLabel=(this._unitLabel=new Ie(this)).init(),t.line=(this._line=new Fe(this)).init(),t.sectorLine=(this._sectorLine=new Ke(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 Oe(this)).init(),t.scrollBar=(this._scrollBar=new Ze(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 F+$*y(this._op.startAngle,0)}getTotalAngle(){return $*f(0,m(360,y(this._op.totalAngle,360)))}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))})),1===this._index&&console.log(t))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(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._op.position;this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&"between"===t&&this._isX,this._isOpposite="opposite"===t,this._runPos=t,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender();const e=this._series;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!C.equalArrays(e,this._prevSeries)))for(const t of e)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&e.length>0)if(this.chart.isSplitted()){const t=[e[0].row];for(let s=1;s<e.length;s++)t.indexOf(e[s].row)<0&&t.push(e[s].row);t.forEach((t=>{let s=0,i=0;e.forEach((e=>{e.row==t&&e.isClusterable()&&(s+=y(e.groupWidth(),1))})),e.forEach((e=>{if(e.row==t&&e.isClusterable()){const t=y(e.groupWidth(),1)/s;e.setCluster(t,i),i+=t}}))}))}else{let t=0,s=0;e.forEach((e=>{e.isClusterable()&&(t+=y(e.groupWidth(),1))})),e.forEach((e=>{if(e.isClusterable()){const i=y(e.groupWidth(),1)/t;e.setCluster(i,s),s+=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)))}polarOff(){return 0}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+C.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 qe(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){this._prevRate=t}prev(t){return isNaN(this._prevRate)?t:this._op.reversed?t+(this._vlen-t)*(this._prevRate-1):t*this._prevRate}_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 Xe(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new Ye(e):new Xe(e),s.init(),s._load(t),i.push(s)})))};super._doApply(t),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?H(m(...t)||0):NaN,max:t.length>0?H(f(...t)||0):NaN}}}Qe.defaults=Se(Pe.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}:<b> ${yValue}</b>",animatable:!0,fixedSize:!1});class Je extends Ce{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(Y(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._isPolar=t.isPolar(),o}}class ts extends Pe{_doPrepareRender(t){}}const es={},ss={};class is extends ts{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:K(this._widthDim||this._sizeDim,t,t),height:K(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return K(this._leftDim,t)}getRight(t){return K(this._rightDim,t)}getTop(t){return K(this._topDim,t)}getBottom(t){return K(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")}}is.defaults=Se(ts.defaults,{size:"100%"});class rs extends is{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{es[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}}rs.defaults=Se(is.defaults,{duration:500});class ns extends is{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{ss[t.type]=t,ss[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(rs._loadGauge(t,e,s)))):i(e)&&this.$_add(rs._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)}}ns.defaults=Se(is.defaults,{minValue:0});class os extends Ce{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 rs)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 ns)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(es).length&&0===Object.keys(ss).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 as extends rs{constructor(){super(...arguments),this._prevValue=0}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 y(this._runValue,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}}}as.defaults=Se(rs.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class hs extends Pe{constructor(t){super(t.chart),this.scale=t}}hs.defaults=Se(Pe.defaults,{reversed:!1,length:7});class ls extends Le{getText(t){return C.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class _s extends Pe{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Pe(e)).init(),t.tick=(this._tick=new hs(this)).init(),t.label=(this._label=new ls(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(H(e));for(let e=1;e<t;e++)n.push(H(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(H(l=s));;){if(l+=o,l>=i){r.push(H(i));break}r.push(H(l))}return r}}_s.defaults=Se(Pe.defaults,{position:"default",stepPixels:48,gap:8});class cs extends Pe{}cs.defaults=Se(Pe.defaults,{visible:!1});class ds extends Pe{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new cs(e)).init(),t.tickLabel=(this._tickLabel=new Pe(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?K(this._thicknessDim,t,0):"inside"===this._op.position?t:ds.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=it(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}ds.defaults=Se(Pe.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class us extends ke{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}us.defaults=Se(ke.defaults,{animatable:!0});class ps extends us{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:K(this._offsetXDim,t,0),y:K(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}ps.defaults=Se(us.defaults,{offsetX:0,offsetY:0});class gs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ms.DEF_CENTER),this.setCenterY(ms.DEF_CENTER),this.setRadius(ms.DEF_RADIUS),this.setInnerRadius(ms.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Z(w(t,ms.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Z(w(t,ms.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Z(w(t,ms.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Z(w(t,ms.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Z(t,!0))}getCenter(t,e){return{x:K(this._centerXDim,t,t/2),y:K(this._centerYDim,e,e/2)}}getExtents(t){const e=K(this._radiusDim,t,t/2),s=m(e,this._innerDim?K(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?K(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=F+$*s,this._handRad=$*s,this._sweepRad=$*i}}class ms extends as{_doInit(t){this._props=new gs,t.label=(this._label=new ps(this.chart)).init()}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}_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 gs)}_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)}}ms.DEF_CENTER="50%",ms.DEF_RADIUS="40%",ms.DEF_INNER="80%",ms.defaults=Se(as.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class fs extends ns{_doInit(t){this.props=new gs,t.label=(this._label=new ps(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)}}fs.defaults=Se(ns.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let xs=class extends Pe{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};xs.defaults=Se(Pe.defaults,{visible:void 0});class ys extends ke{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||ys.DEF_TEXT}}ys.DEF_TEXT="표시할 데이터가 없습니다.",ys.defaults=Se(Pe.defaults,{visible:void 0});class bs extends Pe{}bs.defaults=Se(Pe.defaults,{visible:!1});class ws extends Pe{_doInit(t){t.line=(this._line=new bs(this.chart)).init(),t.endLine=(this._endLine=new bs(this.chart)).init(),t.gridLine=(this._gridLine=new bs(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}ws.defaults=Se(Pe.defaults,{});class vs extends Pe{_doInit(t){t.xSide=(this._xSide=new ws(this.chart)).init(),t.ySide=(this._ySide=new ws(this.chart)).init(),t.orgLine=(this._orgLine=new bs(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)))}}vs.defaults=Se(Pe.defaults,{visible:!1,length:32,angle:32});class Ss extends Pe{constructor(t){super(t),this._annotations=new Te(this)}_doInit(t){t.depth=(this._depth=new vs(this.chart)).init(),t.image=(this._image=new Ne(null)).init(),t.emptyView=(this._emptyView=new ys(this.chart)).init(),t.zoomButton=(this._zoomButton=new xs(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof is&&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*$)*i),o=d(p(r*$)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return K(this._radiusDim,m(t,e))}setPolar(t,e){return this._cx=K(this._centerXDim,t),this._cy=K(this._centerYDim,e),this._rd=K(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}: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()}}Ss.defaults=Se(Pe.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Vs extends Pe{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)}}Vs.defaults=Se(Pe.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class As extends Pe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Ps extends ts{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 K(this._maxWidthDim,t,t)}getMaxHeight(t){return K(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 As(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(C.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()}}Ps.defaults=Se(ts.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 Cs=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),ks=.001;class Ls{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 D-t<ks}static arc(t,e,s,i,r,n,o,a=!1){const h=m(D,x(n-r)),l=this.isCircled(h),_=h>R?1:0,c=o?1:0,d=u(r),g=p(r),f=u(n-=l?c?ks:-.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(D,x(o-n)),l=this.isCircled(h),_=h>R?1:0,c=a?1:0,d=u(n),g=p(n),f=u(o-=l?c?ks:-.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 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(D,x(o-n));const g=this.isCircled(d);let f=(n%D+D)%D,y=(o%D+D)%D;const b=[];let w,v,S,V;if(!g&&(_&&f<=R&&y>=0&&y<f||!_&&y<=R&&f>=0&&f<y))c=0,_?(w=t+s*u(n),v=e+i*p(n),S=t+s*u(R),V=e+i*p(R),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(R),v=e+i*p(R),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?_?ks:-.001:0),V=e+i*p(o),_?(f=g||f<=D&&!(y>=f&&y<D)?0:f,y=g||y>R&&!(f<=y&&f>R)?R:y):(f=g||f>R&&!(y<=f&&y>R)?R:f,y=g||y<D&&!(f>=y&&f<D)?0:y);const r=t+s*u(f),a=e+i*p(f),d=t+s*u(y-=g?_?ks:-.001:0),m=e+i*p(y);c=x(y-f)>R?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(D,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?ks:-.001:0),y=e+i*p(o),b=l>R?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=Ls[e](0,0,f(2*s,0),f(2*i,0));break;default:r=Ls.circle(s,i,f(m(s,i),0))}t.setPath(r)}}class Ns extends Wt{static create(t,e,s,i,r,n,o=0){return new Ns(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=O,s=O){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 Ms extends Qt{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Ls.box(t,e,s,i)),this}}const Es="head",Ts="far",Bs="inside",Os="none",Rs="near",Ds="displayAll",Fs="largestFirst",$s="hidden",Is="line",zs="area",Hs="circlebar";let Gs=0;const js="_deleted";class Ys{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=Gs++,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[js]=!0}_isDeleted(){return this[js]}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=O}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 Xs{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 this._points.splice(e,1),!0}clean(){this._points=this._points.filter((t=>!t[js]))}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 Ws extends Ys{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.yValue=e.zValue=this.yValue}applyValueRate(t,e){this.zValue=S(t.zValue,this.zValue,e)}}class Us extends Ys{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}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e)}}class Zs extends We{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Zs.defaults=Se(We.defaults,{step:1});class qs extends Ue{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}}qs.defaults=Se(Ue.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class Ks extends He{getPoints(t){const e=t._pts,s=t._ticks.length,i=[];if(s>0){const r=Math.max(1,t.tick.options.step||1);if(r>1)for(let t=0,n=1,o=e.length;t<=s&&n<o;t++,n+=r)i.push(e[n]);else for(let t=0;t<=s;t++)i.push(e[t+1])}return i}}class Qs extends Qe{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}polarOff(){return.5}_prepareZoom(){return this._zoom||(this._zoom=new qe(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new Ks(this)}_createTickModel(){return new Zs(this)}_createLabel(){return new qs(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=C.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)*D/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,s){const i=this._op;return i.minValue<t&&(t=i.minValue),i.maxValue>e&&(e=i.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:i,max:r}=this._adjustMinMax(t,e,s);t=Math.floor(i),e=Math.ceil(r)}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*$;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],n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed?t-n: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);return this._pts[s+2]-this._pts[s+2-1]}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];C.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)}))}}var Js;Qs.type="category",Qs.defaults=Se(Qe.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});const ti={},ei={};class si extends Pe{}si.defaults=Se(Pe.defaults,{visible:!1});class ii extends Le{_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 C.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}}Js=ii,ii.OFFSET=4,ii.defaults=Se(Le.defaults,{visible:void 0,position:"default",offset:Js.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class ri extends Pe{constructor(t){super(t.chart),this.series=t}_doPrepareRender(t){const e=this.series,s=this._res=(e._visPoints.length-1)*Math.max(1,+this._op.resolution||5),i=e._minX>0?0:(e._maxX-e._minX)/s-e._minX,r=e._minY>0?0:(e._maxY-e._minY)/s-e._minY,n=e._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+i,y:t.yValue+r})));this._polar=t.isPolar(),(this["_"+this._op.type]||this._linear).call(this,n,this._points=[]),this._points.forEach((t=>{t.x-=i,t.y-=r}))}isCurved(){const t=this._op.type;return!0===this._op.curved||null==this._op.curved&&("exponential"===t||"logarithmic"===t||"power"===t)}_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){const s=t.length;if(s>1){const{m:i,a:r}=this._calcLine(t);this._polar?e.push(...t.map((t=>({x:t.x,y:i*t.x+r})))):e.push({x:t[0].x,y:i*t[0].x+r},{x:t[s-1].x,y:i*t[s-1].x+r})}}_logarithmic(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:y(t.y,0)}))),{m:r,a:n}=this._calcLine(i),o=t[0].x,a=t[s-1].x,h=(a-o)/this._res;for(let t=o;t<=a;t+=h){const s=n+Math.log(t)*r;e.push({x:t,y:s})}}}_power(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:r,a:n}=this._calcLine(i),o=Math.exp(n),a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*t**r;e.push({x:t,y:s})}}}_calcLine2(t){t.length;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){const s=t.length;if(s>1){const i=t.map((t=>({x:t.x,y:t.y}))),{m:r,a:n}=this._calcLine2(i),o=n,a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*Math.exp(r*t);e.push({x:t,y:s})}}}_polynomial(t,e){const s=t.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let e=0;e<a;e++){for(let i=0;i<s;i++)n+=t[i].x**e*t[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=t[r].x**(e+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[0].x,_=t[s-1].x,c=(_-l)/this._res;for(let t=l;t<=_;t+=c){const s=h.reduce(((e,s,i)=>e+s*t**i),0);e.push({x:t,y:s})}}}_movingAverage(t,e){const s=t.length,i=f(1,m(s-1,this._op.movingInterval));let r=i;for(;r<=s;){const s=t.slice(r-i,r).reduce(((t,e)=>t+y(e.y,0)),0);e.push({x:t[r-1].x,y:s/i}),r++}}}ri.defaults=Se(Pe.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2});const ni={x:"xValue",y:"yValue",z:"zValue"};class oi extends Gt{constructor(t,e){super(),this.series=t,this.point=e,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return this.point._vr=t,this.series._changed(),!0}}class ai extends Gt{constructor(t){super(),this.points=t,this.duration=300,this.endHandler=()=>{this.points.clean(),this.points.owner._dataPointsChanged(),this.points.owner.$_stopDeleteAni(this)},t.owner.$_setDeleteAni(this)}_doUpdate(t){return this.points.forEach((e=>{e._isDeleted()&&(e._vr=1-t)})),this.points.owner._changed(),!0}}class hi extends Ys{}const li=12;class _i extends Pe{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{ti[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 Xs(this),this._pointArgs={},this._paletteColors=Array(li).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==rt&&C.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){C.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){C.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){C.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){C.log("onDataChanged")}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return _i.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}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){var e;return null!==(e=w(this._op.xStep,this.chart.chartOptions.options.xStep))&&void 0!==e?e: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 Qs)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);isNaN(n)&&(n=s,s=t.incStep(s,i)),e.xValue=n,isFinite(n)||(e.isNull=!0)})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.xValue)&&e.push(t.xValue)}))}else this._points.forEach(((e,s)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let s=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(s)&&t&&(s=t.getValue(e.y)),e.initValues(),isNaN(e._vr)||(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),s=e._prev.yValue+(s-e._prev.yValue)*e._vr,e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=s,e.isNull=!isFinite(s)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}collectRanges(t){var e;const s=this._visPoints,i=s.length;if(i>0){const t=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(this._minY=h,this._maxY=l,this._minX=o,this._maxX=a,null===(e=this._trendline)||void 0===e?void 0:e.visible){this._trendline._prepareRender();const t=this._trendline._points.map((t=>t.y)).sort(((t,e)=>t-e));this._minY=Math.min(this._minY,t[0]),this._maxY=Math.max(this._maxY,t[t.length-1])}t.yMin=this._minY,t.yMax=this._maxY,t.xMin=this._minX,t.xMax=this._maxX,r&&(t.zMin=this._minZ=_,t.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),!isNaN(this._minY)&&t&&t.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=it(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=O}))}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)),ii.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){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]:O}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e){if(t instanceof Ys||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&this.chart.animatable()&&(s.ani=new oi(this,t),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}addPoint(t){const e=this._doAddPoint(t);if(e){if(this._points.add(e),this.chart.animatable()){const t=e._prev=e.copy();t.ani=new oi(this,e),t.ani.start()}this._dataPointsChanged()}return e}addPoints(t){const e=[];return r(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new oi(this,t),e.ani.start()})),this._dataPointsChanged()),e}_needDeleteAnimation(){return!1}removePoint(t){if(t instanceof Ys||(t=this.getPointAt(t)),t){if(this._points.contains(t)&&this._needDeleteAnimation()&&this.chart.animatable())return t._setDeleted(),new ai(this._points).start(),this._changed(),!0;if(this._points.remove(t))return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePoints(t){if(r(t)){const e=this._needDeleteAnimation()&&this.chart.animatable(),s=[];if(t.forEach((t=>{t instanceof Ys||(t=this.getPointAt(t)),t&&(e?(t._setDeleted(),s.push(t)):this._points.remove(t)&&s.push(t))})),s.length>0)return e?(new ai(this._points).start(),this._changed()):(this._doPointsRemoved(s),this._dataPointsChanged()),s.length}return 0}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders()}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new ii(t)}_createPoint(t){return new hi(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 Ns.create(t,_i.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 lt)e=t._obj;else if(t instanceof lt)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)%li+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 ye?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[ni[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=O}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDeleteAni(t){this._deleteAni&&this._deleteAni.stop(),this._deleteAni=t}$_stopDeleteAni(t){this._deleteAni===t&&(this._deleteAni=null)}isDeleting(){return!!this._deleteAni}}_i.LEGEND_MARKER="rct-legend-item-marker",_i.defaults=Se(Pe.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default",interactive:!0,paddingRate:1});class ci extends Ce{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 Ai&&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 Ai?n.push(...t.series):t instanceof _i&&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){const e=this.$_loadItem(this.chart,t,this._series.length);if(e)return this._items.push(e),this._series.push(e),this.$_add(e),e}remove(t){let e;if(t instanceof _i?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(Cs[e++%Cs.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 bi&&(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 _i._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof xi||(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 di extends _i{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new ri(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}di.defaults=Se(_i.defaults,{});class ui extends Pe{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)}}ui.defaults=Se(Pe.defaults,{radius:3});class pi extends Ys{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 gi extends Pe{_doSetSimple(t){return o(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}gi.defaults=Se(Pe.defaults,{curved:!0});class mi extends ii{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new gi(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")}}mi.defaults=Se(ii.defaults,{visible:!0,convergent:!0,align:Os,dedupeMode:Ds});class fi extends Pe{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?K(this._minDim,Ys.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=fi.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=Z(t.minValue,!0)}}fi.DEF_COUNT=10,fi.defaults=Se(Pe.defaults,{visible:!1,x:"기타"});class xi extends _i{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new fi(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:K(this._centerXDim,t),y:K(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_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=Z(v(s,e._op.center,xi.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=Z(v(i,e._op.center,xi.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)))}}xi.DEF_CENTER="50%",xi.defaults=Se(_i.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:xi.DEF_CENTER,centerY:xi.DEF_CENTER});class yi extends xi{getRadius(t,e){return K(this._radiusDim,m(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=Z(w(t._radius=e,yi.defaults.radius),!0))}(this,t.radius)}}yi.defaults=Se(xi.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class bi extends di{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)}}bi.defaults=Se(_i.defaults,{pointWidth:1,minPointWidth:0});class wi extends ii{get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new si(this.chart)).init()}}wi.defaults=Se(ii.defaults,{});class vi extends bi{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new wi(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=f(0,b(e.depth,t.getDepth(),vi.DEPTH)),this._distance=t.getDistance()+y(e.distance,0)):(this._depth=f(0,y(e.depth,vi.DEPTH)),this._distance=y(e.distance,vi.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}_getGroupBase(){return this._op.baseValue}isBased(t){return t===this._yAxisObj}}vi.DEPTH=10,vi.DISTANCE=5,vi.defaults=Se(bi.defaults,{nullAsBase:!1});class Si extends bi{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 Vi extends Si{}class Ai extends Pe{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{ei[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{ei[t.seriesType]=t}))}static collectTooltipText(t,e,s,i){let r=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,n)=>{let o;e!==s?e.needAxes()&&(o=e.getPointAt(i.xValue)):o=i,o&&(r&&(r+="<br>"),r+=t.tooltipRow.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+n+"."))})),r+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",r}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"),_i.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return Ai.collectTooltipText(this._op,this._visibles,t,e)}getTooltipParam(t,e,s){return Ai.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){this._visibles.forEach((e=>{e.collectRanges(t)}))}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,Ai.LAYOUT_MAX);return t>0?t:Ai.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=!C.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(_i._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(_i._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)}}}}Ai.LAYOUT_MAX=100,Ai.defaults=Se(Pe.defaults,{layout:"default",layoutMax:Ai.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class Pi extends Ai{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Ci extends Ai{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}}Ci.defaults=Se(Ai.defaults,{groupWidth:1,groupPadding:.1});class ki extends di{isMarker(){return!0}isXY(){return!0}}ki.defaults=Se(_i.defaults,{colorByPoint:!1});class Li extends Pe{}class Ni extends Pe{}const Mi={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Ei={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Ti={minPadding:0,maxPadding:0};class Bi extends Pe{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new Li(e)).init(),t.mask=(this._mask=new Ni(e)).init(),t.borderLine=(this._borderLine=new Pe(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return y(this._op.thickness,Bi.defaults.thickness)}getGap(){return y(this._op.gap,Bi.defaults.gap)}getGapFar(){return y(this._op.gapFar,Bi.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,Mi[t]())}else s.series=Mi.area();i(e.xAxis)?s.xAxis=_({},e.xAxis,(Ei[e.xAxis.type]||Ei.linear)(),Ti):s.xAxis=_({},Ti),i(e.yAxis)?s.yAxis=_({},e.yAxis,(Ei[e.yAxis.type]||Ei.linear)(),Ti):s.yAxis=_(Ei.linear(),Ti),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()}}Bi.defaults=Se(Pe.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Oi extends Pe{_isVisible(){return this._op.visible&&!Y(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Oi.defaults=Se(Pe.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class Ri extends Oi{}Ri.defaults=Se(Oi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Di extends Pe{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}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)}_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?mt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Tt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Di.defaults=Se(Pe.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});const Fi="vline",$i="hline",Ii="line";class zi extends Ee{_isVisible(){return this._op.visible&&!Y(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}zi.type="image";class Hi extends Ee{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||Hi.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Hi.type="shape",Hi.defaults=Se(Ee.defaults,{width:64,height:64,shape:"square"});class Gi extends Ee{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!Y(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?mt.getFormatter(s):O),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Tt.getFormatter(t):O)}(t.timeFormat)}}Gi.type="text",Gi.defaults=Se(Ee.defaults,{text:"Text"});class ji extends He{getPoints(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 Yi extends We{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 qi&&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)&&C.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?Yi.STEP_PIXELS_P:t._isX?Yi.STEP_PIXELS_X:Yi.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 qi&&(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 et(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(H(s));for(let e=1;e<t;e++)l.push(H(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=H(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=H(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=H(n-t));for(n=e;n<i;)r.push(n=H(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)?Yi.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?Yi.STEP_MULTIPLES[0]:Yi.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(H(m=i));m<r;)p.push(H(m+=l));if(!u||x>u.length-2||p.length<=a)break;l=u[++x],p.length=0}return p}}Yi.STEP_PIXELS_P=[[1/0,48]],Yi.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],Yi.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],Yi.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],Yi.defaults=Se(We.defaults,{baseRange:!1,enableDecimals:!0});class Xi extends Ue{}Xi.defaults=Se(Ue.defaults,{numberFormat:"0.##"});class Wi extends Xi{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}Wi.defaults=Se(Xi.defaults,{useSymbols:!0});class Ui extends De{getSize(t){return Math.min(.9*t,K(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=y(this._op.space,0),this._sizeDim=Z(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}Ui.defaults=Se(De.defaults,{size:"30%",space:16,gridVisible:!0});class Zi extends Fe{_isVisible(){return this._op.visible}}Zi.defaults=Se(Fe.defaults,{visible:!1});class qi extends Qe{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Zi(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){t||(t=qi.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=C.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=C.parseTuples(n)),this._baseVal=+this._op.baseValue,this._strictMin=Z(t.strictMin,!0),this._strictMax=Z(t.strictMax,!0),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new ji(this)}_createTickModel(){return new Yi(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 qi&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let a,h,{min:l,max:_}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(l=r._baseAxis.axisMin(),_=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<=l||e.options.to>=_)&&this._runBreaks.splice(t,1)}this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;if(l===_)a=[l];else if(this._runBreaks)a=this.$_calcBrokenSteps(this._runBreaks,s,l,_),l=Math.min(l,a[0]),_=Math.max(_,a[a.length-1]);else if(a=r.buildSteps(this,s,this._runBase,l,_,!1),h=a.slice(0),a.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;a.length>1&&a[0]<l;)a.shift();a.length<2&&this._fixedMin<a[0]&&a.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;a.length>2&&a[1]<=l;)a.shift();if(!isNaN(r._step))for(;a[0]>l;)a.unshift(r.getNextStep(a[0],-1))}if(l=Math.min(l,a[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;a.length>1&&_<a[a.length-1];)a.pop();a.length<2&&this._fixedMax>a[a.length-1]&&a.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;a.length>2&&a[a.length-2]>=_;)a.pop();if(!isNaN(r._step))for(;a[a.length-1]<_;)a.push(r.getNextStep(a[a.length-1],1))}_=Math.max(_,a[a.length-1])}else a.push(l+(_-l)/2);this._prevSteps=a,this._setMinMax(l,_);const c=this.$_createTicks(a,s,l,_,i);if(this._isX)if(l===_)this._unitLen=s/4;else{const t=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s);if(t){if(this._unitLen=t.len,!this._isPolar&&!this._zoom){const e=h;let s=!1;if(l=this._min=Math.min(this._calcedMin-t.min/2,l),_=this._max=Math.max(this._calcedMax+t.min/2,_),c.length>1){let t,i;if(e[0]<l){for(i=-1;i<a.length-1&&e[i+1]<a[0];)i++;for(;i>=0&&(t=e[i])>=l;){const e=this.dataToAxis(c[0].value),r=this.dataToAxis(c[1].value);if(t<e&&e-t>=r-e){const e=this._createTick(0,t);c.unshift(e),a.unshift(t),s=!0}i--}}if(e[e.length-1]>_){for(i=e.length;i>0&&e[i-1]>a[a.length-1];)i--;for(;i<e.length&&(t=e[i])<=_;){const e=this.dataToAxis(c[c.length-1].value),r=this.dataToAxis(c[c.length-2].value);if(t>=e&&t-e>=e-r){const e=this._createTick(0,t);c.push(e),a.push(t),s=!0}i++}}s&&c.forEach(((t,e)=>t.index=e))}}}else this._unitLen=1}return c}$_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){if(this._runBreaks){const s=this._sects.find((t=>e<t.to))||this._lastSect,i=s.len*(e-s.from)/(s.to-s.from);return this._op.reversed?G(t-i-s.pos):G(i+s.pos)}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return G(this._op.reversed?t-s: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?"value":"tick":this._op.startFit}$_getEndFit(){return"default"===this._op.endFit?this._isX?"value":"tick":this._op.endFit}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-K(t,s):e+K(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=H(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=_),{min:S,max:V}}$_calcXUnitLength(t){const e=[];let s=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(e.push(...t._getVisiblePoints()),s++)})),0===s&&this._series.forEach((t=>{t.visible&&!t.isXY()&&e.push(...t._getVisiblePoints())})),e.length>0){const s=e.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=s.length-1;t>0;t--)s[t]===s[t-1]&&s.splice(t,1);return this._calcUnitLen(s,t,this._min,this._max)}}_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),{len:y(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new Ui(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 Ui(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 Ui(this)._initObject(),o))}}var s}}qi.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],qi.defaults=Se(Qe.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default"});class Ki extends qi{get label(){return this._label}_createLabel(){return new Wi(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Ai&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}Ki.type="linear";const Qi=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Ji=[[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]],tr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class er extends Yi{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)&&tr.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>=Qi[e]/2&&t<Qi[e+1]/2)return this._scale=e,Ji[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=Qi[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=tr[a],t=Qi[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 sr=[{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 ir extends Xi{_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=sr.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=Tt.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)}}}ir.defaults=Se(Xi.defaults,{useBeginningFormat:!0});class rr extends qi{get label(){return this._label}_createTickModel(){return new er(this)}_createLabel(){return new ir(this)}collectValues(){this._offset=60*y(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return h(t)?t:t instanceof Date?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)}}rr.type="time",rr.subtype="date",rr.defaults=Se(qi.defaults,{baseValue:NaN});class nr extends Us{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class or extends Vi{pointLabelCount(){return 2}_createLegendMarker(t,e){return Ns.create(t,_i.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new nr(t)}_getBottomValue(t){return t.lowValue}}or.type="barrange",or.defaults=Se(Vi.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class ar extends Ys{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class hr extends vi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new ar(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}hr.defaults=Se(vi.defaults,{colorByPoint:!1,pointOffset:0});class lr extends hr{canDepth(){return!0}_createLegendMarker(t,e){return Ns.create(t,_i.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}lr.type="bar";class _r extends Ci{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}))}}_r.defaults=Se(Ci.defaults,{depth:10,distance:5});class cr extends _r{_canContain(t){return t instanceof lr}}cr.type="bargroup",cr.seriesType="bar";class dr extends Wt{constructor(t){super(t,_i.LEGEND_MARKER),this.add(this._back=new Ns(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new Qt(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){Ls.setShape(this._marker,this._shape,t,t)}}class ur extends dr{constructor(t){super(t),this.insertFirst(this._line=new Qt(t)),this.insertFirst(this._area=new Qt(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 pr extends dr{constructor(t){super(t),this.insertFirst(this._line=new Qt(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Qt(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Qt(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 gr extends Qt{constructor(t,e=O,s=O){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){C.isNumber(t)?this.setPath(Ls.line(t,e,s,i)):t&&this.setPath(Ls.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Ls.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(Ls.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Ls.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(Ls.line(e,t,s,t))}}class mr extends dr{constructor(t){super(t),this.insertFirst(this._line=new gr(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 fr extends Ys{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class xr extends ui{}xr.defaults=Se(ui.defaults,{radius:4,hoverScale:1.75});class yr extends ii{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?yr.ALIGN_GAP:0:t}getPosition(){return w(this._op.position,"default")}}yr.ALIGN_GAP=4,yr.defaults=Se(ii.defaults,{align:"center"});class br extends di{_doInit(t){super._doInit(t),t.marker=(this._marker=new xr(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)}prepareLines(t){this._lines=this._doPrepareLines(t)}get pointLabel(){return this._pointLabel}_createLabel(t){return new yr(t)}_createPoint(t){return new fr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new mr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),m(e/2,this.marker.options.radius)),s}_connectNulls(){return!1}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull&&!this._connectNulls()){let i=0;for(;i<e;){const r=[];for(;i<e&&t[i].isNull;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return!this.chart.isPolar()||t[0].isNull||t[e-1].isNull||s[s.length-1].push(t[0]),s}}br.defaults=Se(_i.defaults,{nullAsBase:!1});class wr extends Le{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}wr.defaults=Se(Le.defaults,{visible:!1,offset:8});class vr extends br{_doInit(t){super._doInit(t),t.flag=(this._flag=new wr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof Lr||this._group instanceof Nr?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&&null!=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}}vr.type=Is,vr.defaults=Se(br.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Sr extends vr{get canPolar(){return!1}_viewType(){return"line"}getLineType(){return"spline"}}Sr.type="spline";class Vr extends fr{}class Ar extends vr{_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 ur(t)}_createPoint(t){return new Vr(t)}isBased(t){return t===this._yAxisObj}_doPrepareLines(t){if(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._doPrepareLines(t)}}Ar.type=zs,Ar.defaults=Se(br.defaults,{});class Pr extends Vr{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 Cr extends yr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class kr extends br{pointLabelCount(){return 2}_createLabel(t){return new Cr(t)}_createLegendMarker(t,e){return new pr(t)}_createPoint(t){return new Pr(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)))}_doPrepareLines(t){const e=super._doPrepareLines(t),s=[];return e.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)}s.push(t,e)})),s}}kr.type="arearange",kr.defaults=Se(br.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Lr extends Ai{_canContain(t){return t instanceof vr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Lr.type="linegroup",Lr.seriesType=Is,Lr.defaults=Se(Ai.defaults,{lineType:"default"});class Nr extends Ai{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 Ar}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Nr.type="areagroup",Nr.seriesType=zs,Nr.defaults=Se(Ai.defaults,{lineType:"default"});class Mr extends Vr{}class Er extends Ar{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Mr(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 _}}Er.type="bellcurve",Er.defaults=Se(Ar.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Tr extends Ys{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 Br extends Vi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Tr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Ns.create(t,_i.LEGEND_MARKER,0,0,e,e,2)}}Br.type="boxplot",Br.defaults=Se(Vi.defaults,{tooltipText:"<b>${name}</b><br>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 Or extends Ws{}class Rr extends ki{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:K(this._minSizeDim,t),max:K(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 Or(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)}}Rr.type="bubble",Rr.defaults=Se(ki.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class Dr extends Pi{_canContain(t){return t instanceof vr}_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 C.makeIntArray(0,t.length)}}Dr.type="bump",Dr.seriesType=Is;const Fr=function(t){return isNaN(t)?0:t};class $r{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}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",Fr(t[e]),Fr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Fr(t[e].x),Fr(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}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}}class Ir extends Ys{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 zr extends Vi{canCategorized(){return!0}_createPoint(t){return new Ir(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new $r;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new Qt(t,_i.LEGEND_MARKER).setPath(s.end())}}zr.type="candlestick",zr.defaults=Se(Vi.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Hr extends wi{}Hr.defaults=Se(ii.defaults,{position:"inside"});class Gr extends hr{get pointLabel(){return this._pointLabel}_createLabel(t){return new Hr(t)}}Gr.type=Hs;class jr extends _r{_canContain(t){return t instanceof Gr}}jr.type="circlebargroup",jr.seriesType=Hs;class Yr extends Us{}class Xr extends ui{}Xr.defaults=Se(ui.defaults,{radius:4,shape:"circle"});class Wr extends Vi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Xr(this)).init(),t.lowMarker=(this._lowMarker=new Xr(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 Yr(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()}}Wr.type="dumbbell";class Ur extends Ys{}class Zr extends vi{getSegmentSize(t){return K(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Ur(t)}_createLegendMarker(t,e){const s=new $r;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new Qt(t,_i.LEGEND_MARKER).setPath(s.end())}}Zr.type="equalizer",Zr.defaults=Se(vi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class qr extends Vi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Us(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new $r).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new Qt(t,_i.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}qr.type="errorbar",qr.defaults=Se(Vi.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Kr extends pi{}class Qr extends Kr{constructor(t,e){super(t),this.points=e}}class Jr extends mi{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?Jr.ENDED_DIST:Jr.OUTSIDE_DIST:this._op.distance||0}}Jr.OUTSIDE_DIST=25,Jr.ENDED_DIST=10;class tn extends xi{getSize(t,e){return{width:f(.1*t,K(this._widthDim,t)),height:f(.1*e,K(this._heightDim,e))}}getNeckSize(t,e){return{width:C.clamp(K(this._neckWidthDim,t),this._minNeckWidth,t),height:C.clamp(K(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new Jr(t)}_createPoint(t){return new Kr(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Qr(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=q(e._width,tn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=q(e._height,tn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=q(e._neckWidth,tn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=q(e._neckHeight,tn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}tn.type="funnel",tn.defaults=Se(xi.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class en extends Ys{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 sn={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 rn extends di{getBinCount(t){const e=y(this._op.binWidth,0);if(e>0)return t/e;return y(this._op.binsNumber,0)<1?sn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new en(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 Ns.create(t,_i.LEGEND_MARKER,0,0,e,e,2)}}rn.type="histogram",rn.defaults=Se(_i.defaults,{baseValue:0,binsNumber:"squreRoot"});class nn extends ui{}nn.defaults=Se(ui.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class on extends Ys{_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 an extends vi{_doInit(t){super._doInit(t),t.marker=(this._marker=new nn(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 on(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()}}an.type="lollipop";class hn extends Ir{}class ln extends zr{_createPoint(t){return new hn(t)}_createLegendMarker(t,e){const s=new $r;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new Qt(t,_i.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}ln.type="ohlc";class _n extends fr{}class cn extends br{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new _n(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)}}}cn.type="pareto",cn.defaults=Se(br.defaults,{curved:!1});class dn extends pi{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 un extends dn{constructor(t,e){super(t),this.points=e}}class pn extends Le{getDefaultIconPos(){return"left"}}class gn extends mi{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?K(this._distanceDim,e,0):t?K(s?gn.INNER_DIST:gn.INSIDE_DIST,e):"far"===this._op.align?gn.ENDED_DIST:gn.OUTSIDE_DIST}}gn.INSIDE_DIST=Z("30%",!1),gn.INNER_DIST=Z("50%",!1),gn.OUTSIDE_DIST=25,gn.ENDED_DIST=10,gn.defaults=Se(mi.defaults,{radius:.7,rotationMode:"arc"});class mn extends Pe{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=Se(Pe.defaults,{visible:!1,length:25,ratio:mn.DEPTH_RATIO});class fn extends yi{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new pn(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?K(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new gn(t)}_createPoint(t){return new dn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new un(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=F+$*y(this._op.startAngle%360,0),this._totalRad=$*f(0,m(360,y(this._op.totalAngle,360))),this._groupPos=NaN}}fn.type="pie",fn.defaults=Se(yi.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class xn extends Ai{getPolarSize(t,e){return K(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=Z(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Z(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof fn}_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}))}}xn.type="piegroup",xn.seriesType="pie",xn.defaults=Se(Ai.defaults,{polarSize:"80%",innerSize:0});class yn extends Ys{}class bn extends ki{_createPoint(t){return new yn(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}_createLegendMarker(t,e){return new dr(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}}bn.type="scatter",bn.defaults=Se(ki.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class wn extends Ys{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 vn extends ii{}vn.defaults=Se(ii.defaults,{offset:0});class Sn extends Si{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new vn(t)}_createPoint(t){return new wn(t)}_createLegendMarker(t,e){return Ns.create(t,_i.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}}Sn.type="waterfall",Sn.defaults=Se(Si.defaults,{tooltipText:"<b>${name}</b><br>${series}:<b> ${y}</b>"});class Vn extends Yi{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}}Vn.defaults=Se(Yi.defaults,{arrangeDecimals:!0});class An extends qi{_isLog(){return!0}_createLabel(){return new Wi(this)}_createTickModel(){return new Vn(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,H(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}}}An.type="log",An.defaults=Se(qi.defaults,{logBase:10,roundThrrehold:500});class Pn extends Pe{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)}}Pn.defaults=Se(Pe.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Cn extends Pe{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"}}Cn.defaults=Se(Pe.defaults,{scope:"auto"});class kn extends Pe{_doInit(t){t.pointHovering=(this._pointHovering=new Cn(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 Ln;kn.defaults=Se(Pe.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"}(Ln||(Ln={}));class Nn extends B{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new _t,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new we,(this._chartOptions=new kn(this)).init(),(this._title=new Oi(this)).init(),(this._subtitle=new Ri(this)).init(),(this._legend=new Ps(this)).init(),(this._credits=new Pn(this)).init(),(this._tooltip=new Di(this)).init(),Nn.split_class&&(this._split=new Nn.split_class(this)).init(),(this._body=new Ss(this)).init(),(this._navigator=new Bi(this)).init(),(this._exporter=new Vs(this)).init(),this._series=new ci(this),this._xAxes=new Je(this,!0),this._yAxes=new Je(this,!1),this._gauges=new os(this),this._annotations=new Te(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},Nn.defaults)}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new Nn(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()))}getTooltipText(t,e){return Ai.collectTooltipText(this.axis.options,this.series,t,e)}getTooltipParam(t,e,s){return Ai.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 is?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}_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()}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 Ln.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Ln.RIGHT:r=s.filter((t=>t._isOpposite));break;case Ln.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Ln.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case Ln.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Ln.RIGHT:r=i.filter((t=>t._isOpposite));break;case Ln.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Ln.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 Nn.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)&&Ae(n={},r.base),i(r[s])&&(n||(n={}),Ae(n,r[s])),n?Ae(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),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 Pe||s instanceof Ce||s instanceof we)&&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.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);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<=li;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:{}};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"].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 Ae(Ae({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?Ae(Ae({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&ei[t.toLowerCase()]}_getSeriesType(t){return o(t)&&ti[t.toLowerCase()]}_getAxisType(t){return o(t)&&Re[t.toLowerCase()]}_getGaugeType(t){return o(t)&&es[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&ss[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Me[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)}}Nn.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},Qe.register(Qs,Ki,An,rr),_i.register(Ar,kr,or,lr,Er,Br,Rr,zr,Gr,Wr,Zr,qr,tn,rn,vr,Sr,an,ln,cn,fn,bn,Sn),Ai.register(Nr,cr,Dr,jr,Lr,xn),Ai.registerSeries(Nr,cr,jr,Lr,xn),Ee.register(zi,Hi,Gi);const Mn="$ctrl";class En{constructor(t,e){this._modelCallback=e,this._obj=new Nn(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Mn]=null===(t=this[Mn])||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";C.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Nn(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,C.log("chart-items:",ve),C.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[Mn].refresh()}}class Tn{constructor(t,e){this._obj=new lt(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 Bn extends T{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const On=Object.freeze({x:0,y:0,width:0,height:0});function Rn(t){return{width:t.width,height:t.height}}const Dn=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))]))},Fn=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},$n=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},In=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},zn=function(t,e){const s=Dn(t),i=Dn(e),r=Fn(s),n=Fn(i);for(const t of[...r,...n]){const e=$n(s,t),r=$n(i,t);if(!In(e,r))return!1}return!0},Hn=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 Gn{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Gn(t,t,t,t):new Gn(t,t,e,e):new Gn(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 Gn(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}}}Gn.Empty=Object.freeze(new Gn),Gn.Temp=new Gn;class jn extends Wt{constructor(t,e=O){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return jn.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}jn.IGNORE_ATTRS={width:"",height:""};class Yn extends Wt{constructor(t,e=O){super(t,e,"g"),Wt.DEBUGGING&&(this.add(this._debugRect=new Ns(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),Wt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Ns(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 Xn extends Yn{constructor(t,e,s){super(t,e),this._margins=new Gn,this._paddings=new Gn,this.add(this._background=new Ns(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 Wn extends jn{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 Un extends Yn{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 Zn extends Wt{constructor(t,e,s){super(t,s,"image"),this._bounds=On,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&&!P||(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&&(Y(t)||Y(e))&&(t>0&&Y(e)?e=t/i.width*i.height:e>0&&Y(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class qn extends jn{constructor(e,s=O){super(e),this.add(this._text=new re(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 Ns(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 re(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 Zn(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=Bt.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 re(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 Kn extends Gt{constructor(t,e,s,i){super(),this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}_doUpdate(t){if(this._axis.parent){const e=this._axis.model,s=this._prevMax-this._prevMin,i=(e.axisMax()-e.axisMin())/s;return t=i+(1-i)*t,e.setPrevRate(t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(NaN),this._axis=null}}class Qn extends Xn{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new re(t)),this._richText=new ue}rotatedWidth(){const t=this.model.getRotation()*$,e=this.getBBox();return x(p(t)*e.height)+x(u(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*$,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=Rn(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===ot||i===at;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 Jn extends Xn{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new re(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ue}_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),Rn(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 to extends Yn{constructor(t){super(t,no.TICK_CLASS),this.add(this._lineView=new gr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class eo extends qn{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)*$,e=this.getBBox();return x(p(t)*e.height)+x(u(t)*e.width)}rotatedHeight(){const t=this.rotation*$,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 so extends Wt{constructor(t){super(t,void 0),this.add(this._back=new Qt(t,"rct-crosshair-flag")),this.add(this._text=new re(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 $r,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 io extends Yn{static isThumb(t){return t.classList.contains(io.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Ns(t,io.TRACK_CLASS)),this.add(this._thumbView=new Ns(t,io.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)}}}io.CLASS_NAME="rct-axis-scrollbar",io.TRACK_CLASS="rct-axis-scrollbar-track",io.THUMB_CLASS="rct-axis-scrollbar-thumb";const ro=/\${label}.*?/g;class no extends Yn{constructor(t){super(t,no.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new gr(t,no.LINE_CLASS)),this.add(this._titleView=new Qn(t)),this.add(this._markContainer=new Wt(t,"rct-axis-ticks")),this.add(this._labelContainer=new Wt(t,"rct-axis-labels")),this.add(this._unitView=new Jn(t)),this._labelViews=new Bn(this._labelContainer,eo,"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 io(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 so(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.options.animatable&&new Kn(this,t,e,(()=>{this.invalidate()}))}}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 gr(t,no.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&&C.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 to(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(ro)?t.setLabel(s,a,e,n.replace(ro,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)*$,y=g<35*$;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*$))<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 qi)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,_=h.options.reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,u=t.get(0).rotation,g=u*$,m=+h.label.options.rows|0,f=u<-15&&u>=-90||u>15&&u<=90,x=t.count;let y,b,w;if(t.freeHiddens(),t.forEach(((t,i)=>{const n=e[t.index];t.setVis(!!n)&&(t.setContrast(null).layout(c),y=t.getBBox(),b=h.prev(n.pos),w=s?r?o+a+d[t.row]:-a-y.height-d[t.row]:r?o-a-y.height-d[t.row]:a+d[t.row],u<-15&&u>=-90?s?r?(w+=p(g)*y.height/2,t.setRotation(0,y.height/2,-u)):(w-=p(g)*y.height/2,t.setRotation(0,y.height/2,u)):r?(b-=y.width,w-=p(g)*y.height/2,t.setRotation(y.width,y.height/2,-u)):(b-=y.width,w+=p(g)*y.height/2,t.setRotation(y.width,y.height/2,u)):u>15&&u<=90?s?r?(b+=y.width,w-=p(g)*y.height/2,t.setRotation(y.width,y.height/2,-u)):(b-=y.width,w+=p(g)*y.height/2,t.setRotation(y.width,y.height/2,u)):r?(w+=p(g)*y.height/2,t.setRotation(0,y.height/2,-u)):(w-=p(g)*y.height/2,t.setRotation(0,y.height/2,u)):(b-=y.width/2,t.setRotation(y.width/2,0,r?-u:u)),t.trans(b,w))})),!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 Qs&&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;let y=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),b=o-l.prev(c.pos)-e.height/2;if(t.trans(h,b),_){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>y+1||x&&t.ty<y-1?t.setVis(!1):y=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)}}no.AXIS_CLASS="rct-axis",no.LINE_CLASS="rct-axis-line",no.TICK_CLASS="rct-axis-tick";class oo extends Wt{constructor(t,e,s){super(t,oo.STYLE),this.add(this._back=new Ns(t,oo.BACK_STYLE)),this.add(this._textView=new re(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 Gn).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}}oo.STYLE="rct-button",oo.BACK_STYLE="rct-button-background";class ao extends Wt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class ho extends Qt{setArc(t,e,s,i,r,n){this.setPath(Ls.arc(t,e,s,s,i,close?i+r:i-r,n))}}class lo extends ho{setPolyline(t){this.setPath(Ls.polygon(...t))}}class _o extends Qt{static create(t,e,s,i,r,n,o,a,h=!0){return new _o(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,n,o,a,h,l=!0){return new _o(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}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 Ls.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 Ls.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 co={};class uo extends Xn{static register(...t){t.forEach((t=>{co[t[0].type]=t[1]}))}constructor(t,e){super(t,uo.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new Wt(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._clip||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}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)}}uo.CLASS_NAME="rct-annotation";const po={};class go extends Un{static register(...t){t.forEach((t=>{po[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Ns(t,go.PANE_CLASS)),this.add(this._contentContainer=new Ut(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return go.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=_(Ot.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 xo)return t;t=t.parent}}}go.GAUGE_CLASS="rct-gauge",go.PANE_CLASS="rct-gauge-pane";class mo extends Gt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class fo extends qn{}class xo extends go{_defaultCalss(){return xo.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Ut(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))}))}}xo.GAUGE_GROUP_CLASS="rct-gauge-group";class yo{static reveal(t,e){new vo(t,e)}static grow(t,e){new Vo(t,e)}static spread(t,e){new Ao(t,e)}static fadeIn(t){new bo(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class bo extends yo{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:Gt.DURATION,fill:"none"})}}class wo extends yo{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=wo.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:Gt.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 vo extends Gt{constructor(t,e){super(),this._series=t,this._cr=wo.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 Wt}_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 So extends Gt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Wt}_stop(t){super._stop(t),this._series=null}}class Vo extends So{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Ao extends So{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Po extends So{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}var Co;class ko extends Gt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Do.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(Do.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Lo extends qn{constructor(t){super(t,"rct-point-label")}}class No extends Ut{constructor(t){super(t,"rct-point-labels"),this._labels=[new Bn(this,Lo),new Bn(this,Lo)],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(Hn(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Fs)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(zn(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});zn(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(zn(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});zn(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===$s&&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 Mo extends jn{constructor(t){super(t),this.add(this._line=new Qt(t))}setLine(t){this._line.setPath(t)}}class Eo extends jn{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Bn(this,Mo)}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 To extends Ut{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 Bo={},Oo="rct-point-hover",Ro="rct-point-unhover";class Do extends Un{static register(...t){t.forEach((t=>{Bo[t[0].type]=t[1]}))}static isPointDom(t){for(;t instanceof SVGElement;){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 To(t,"rct-series-points")),this._labelContainer=new No(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}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this.setData("index",e._seriesIndex%li),this.setData("pointcolors",e._colorByPoint()?this._getPointColors():O),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._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(Oo).addClass(Ro)}))):this._getPointPool().forEach((t=>{t.containsClass(Ro)&&t.removeClass(Ro).addClass(Oo)}))}_clearHoverClasses(t){t instanceof Wt&&t.removeClass(Oo).removeClass(Ro)}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 Wt&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.stop(),e.setBoolData(Do.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Uo&&r.push(new ko(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.stop(),t instanceof Wt&&(t.setBoolData(Do.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Uo?r.push(new ko(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof Ko&&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&&Ht(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 di&&e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new Qt(t,"rct-series-trendline")),this._trendLineView.setVis(!0)):this._trendLineView&&this._trendLineView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.model.pointLabel;this._labelOverlap={model:t,inverted:this._inverted,width:this.width,height:this.height,fit:t._overflowFit,outline:t.options.overlapOutline,contrast:t.options.overlapContrast},this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(this._inverted),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new Po(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){const{paletteMode:s}=this.model.chart.chartOptions.options,i=s===nt?Math.floor(Math.random()*li):e.index%li;t.setData("index",this.model._paletteColors[i].toString())}_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._animating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return y(this._growRate,1)}_getPosRate(){return y(this._posRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0||this.model.isDeleting()}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.line(t[r+1].px,t[r+1].py);const n=.35,o={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].px-t[r].px,y:t[r+1].py-t[r].py};let _={x:0,y:0},c=Math.sqrt(l.x*l.x+l.y*l.y);if(0===c)return void i.line(t[s].px,t[s].py);l.x/=c,l.y/=c;let d=t[r+1].px-t[r].px,u=t[r].px,p=t[r].py;for(++r;r!=s;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].px-t[r].px,l.y=t[r+1].py-t[r].py,c=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=c,l.y/=c,l.x<h.x?(_.x=h.x-l.x,_.y=h.y-l.y):(_.x=l.x-h.x,_.y=l.y-h.y);const e=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=e,_.y/=e,h.y*l.y>=0&&(_={x:1,y:0}),o.x=-_.x*d*n,o.y=-_.y*d*n;const s=u+a.x,g=p+a.y,m=t[r].px+o.x,f=t[r].py+o.y;i.curve(s,g,m,f,t[r].px,t[r].py),d=t[r+1].px-t[r].px,a.x=_.x*d*n,a.y=_.y*d*n,u=t[r].px,p=t[r].py}i.curve(u+a.x,p+a.y,t[r].px,t[r].py,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model;if(!(e instanceof di))return;const s=e.chart.isPolar(),i=e.trendline,r=e._xAxisObj,n=e._yAxisObj,o=n._vlen,a=r._vlen;let h;if(s){const t=e.chart._body.getPolar(r);h=i._points.map((e=>{const s=t.start+r.getPos(a,e.x),i=n.getPos(t.rd,e.y);return{x:t.cx+i*u(s),y:t.cy+i*p(s)}}))}else h=i._points.map((e=>{let s,i;return t?(i=a-r.getPos(a,e.x),s=n.getPos(o,e.y)):(s=r.getPos(a,e.x),i=o-n.getPos(o,e.y)),{x:s,y:i}}));if(this._trendLineView.setVis(h.length>1)){this._trendLineView.setStyleOrClass(i.options.style);const t=new $r;t.move(h[0].x,h[0].y),i.isCurved()&&!s?this._drawSpline(h.map((t=>({px:t.x,py:t.y}))),0,-1,t):(s&&i.isCurved(),t.lines(...h)),this._trendLineView.setPath(t.end(!1))}}_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[Q]?t.internalSetStyle(Q,e[Q]):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!==Bs)if(l?c!==Ts&&c!==Es||(d*=-1):c===Es&&(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}}Do.POINT_CLASS="rct-point",Do.DATA_FOCUS="focus",Do.DATA_UNFOCUS="unfocus",Do.DATA_UNHOVER="unhover",Do.LEGEND_MARKER="rct-legend-item-marker";class Fo extends Qt{constructor(t){super(t,Do.POINT_CLASS)}savePrevs(){}}class $o extends Fo{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class Io extends Wt{constructor(t){super(t,Do.POINT_CLASS)}savePrevs(){}}class zo extends Io{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Ho=class extends $o{layout(t,e,s,i,r,n,o){this.x=t,this.setPath(Ls.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class Go extends zo{constructor(t){super(t),this.add(this._topView=new Qt(t)),this.add(this._frontView=new Qt(t)),this.add(this._sideView=new Qt(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(P&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Ls.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Ls.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Bt.interpolate(o?Bt.BLACK:Bt.WHITE,l,.2)),this._sideView.setPath(Ls.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Bt.interpolate(o?Bt.WHITE:Bt.BLACK,l,.2))}}class jo extends jn{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Yo extends Do{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&&yo.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class Xo extends Yo{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Eo(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*$,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){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=this._labelLineContainer,l=s._xAxisObj,c=s._yAxisObj,d=this._reversed=c.options.reversed,g=this._depthExt,m=s._group?s._groupDistance:s.distance,x=g?m*(i?p(this._depthAngle):u(this._depthAngle)):0,b=g?m*(i?u(this._depthAngle):p(this._depthAngle)):0,w=2*l.unitPad(),v=y(0,s.options.minPointWidth),S=this._yLen=c.prev(i?t:e),V=l.prev(i?e:t),A=i?0:e,P=c.valueMin(),C=c.getPos(S,P),k=this._baseVal=s.getBaseValue(c),L=!isNaN(k),N=this._yBase=y(c.getPos(S,f(P,y(k,C))),C),M=t=>c.getPos(S,t),E=t=>l.getPos(V,t),T=this._pointOff,B=a&&_(this._labelInfo,{inverted:i,reversed:d,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:x,distY:b,side:this._side,base:this._base});a&&h.setVis(s.pointLabel.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(s.pointLabel.line._style),h.prepare(s),B.pb=new $r),this._prepareLayoutPoints(t,e),this._getPointPool().forEach(((h,_)=>{const c=h.point;if(h.setVis(!c.isNull)){const d=l.getUnitLen(V,c.xValue)*(1-w);let u=s.getPointWidth(d,v),p=M(c.yGroup),g=N;if(c.yGroup!=c.yValue){const t=k>c.yGroup,e=c.yGroup<0,s=c.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=c.yGroup-c.yValue*(i?-1:1);g=M(r)}const m=(p-g)*r;let f=E(c.xValue)-d/2,y=A-p;if(isNaN(f)){const t=l.getUnitLen(V,c.xValue)*(1-w);f=E(c.xValue)-t/2}isNaN(n+h.wSave)||(u=h.wSave+(u-h.wSave)*n),f+=s.getPointPos(d)+u/2,isNaN(n+h.xSave)||(f=h.xSave+(f-h.xSave)*n),c.xPos=f+=u*T,c.yPos=y,this._layoutPoint(h,_,f-x,A-N*(1-r)-g*r+b,u,m),i&&(y=V-E(c.xValue)+d/2,f=A,c.yPos=y-=s.getPointPos(d)+u/2+u*T,c.xPos=f+=L?M(c.yGroup)*r:M(c.yGroup*r)),B&&(B.labelView=a.get(c,0))&&(B.pointView=h,B.x=f,B.y=y,B.wPoint=u,B.hPoint=m,this._layoutLabel(o,B,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 Wo extends Yo{_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(0,s.options.minPointWidth),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 Uo extends Fo{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 Zo extends Do{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Ls[t](0-e,0-e,2*e,2*e)})),e}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!==Bs){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_getDrawer(t){return Co._drawers[t]||Co._drawers.circle}_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)}}}Co=Zo,Zo._drawers=Object.assign({circle:t=>Ls.circle(0,0,t),none:t=>[]},Co._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class qo extends Gt{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 Ko extends Do{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.stop(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new qo(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Ns.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 Qo extends uo{constructor(t){super(t,Qo.CLASS_NAME),this.addToTransform(this._imageView=new Zn(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._imageView.setImage(this.model.options.imageUrl,n.width,n.height);const o=this._imageView.getBBox();return this._inflaePaddings(o),Rn(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Qo.CLASS_NAME="rct-image-annotation";class Jo extends uo{constructor(t){super(t,Jo.CLASS_NAME),this.addToTransform(this._shapeView=new Qt(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 $i:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Ls.line(g,p,g+l.width,p));break;case Fi:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Ls.line(g,p,g,p+l.height));break;case Ii: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(Ls.line(g,p,t,s));break;default:Ls.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)}}Jo.CLASS_NAME="rct-shape-annotation";class ta extends uo{constructor(e){super(e,ta.CLASS_NAME),this.addToTransform(this._textView=new re(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ue}_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=Rn(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)}}ta.CLASS_NAME="rct-text-annotation";class ea extends Uo{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}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)),Ls.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 sa extends To{}class ia extends Do{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new sa(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Qt(t,"rct-line-series-line")),this._markers=new Bn(this._pointContainer,ea)}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 vr&&(this._needBelow=e.options.belowStyle&&e._minY<e.getBaseValue(e._yAxisObj),this._prepareBelow(e,s)),!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.prepareLines(this._visPoints)}_doAfterLayout(){this._layoutLines(!!this._polar)}_runShowEffect(t){this._polar?t&&yo.grow(this):t&&yo.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._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,e){var s,i;const r=this.control;let n=this._lowLine;if(this._needBelow)return n||(n=this._lowLine=new Qt(this.doc,"rct-line-series-line rct-line-series-line-below"),e?this._lineContainer.add(n):this._lineContainer.insertChild(n,this._line),e?(this._upperClip=r.clipCircle(),this._lowerClip=r.clipCircle()):(this._upperClip=r.clipBounds(),this._lowerClip=r.clipBounds()),this._upperClip.setAttr(Wt.ASSET_KEY,"1"),this._lowerClip.setAttr(Wt.ASSET_KEY,"1")),this._line.setClip(this._upperClip),n.setClip(this._lowerClip),!0;null==n||n.setClip(),this._line.setClip(),null===(s=this._upperClip)||void 0===s||s.remove(),null===(i=this._lowerClip)||void 0===i||i.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Bn(this._lineContainer,Qt)),i.prepare(e.length);s.length<e.length;){const t=new Kt(this.doc);t.setAttr(Wt.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),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._polar,n=this.model._yAxisObj.options.reversed;let o;(o=this._upperClip)&&(this._polar?o.setCircle(r.cx,r.cy,r.rd*this._getGrowRate()):i?n?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):n?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._polar?o.setCircle(r.cx,r.cy,r.rd*(s/e)*this._getGrowRate()):this._inverted?n?o.setBounds(0,-t,e,t):o.setBounds(0,-s,e,t-s):n?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof vr&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker._style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),o=s&&t.options.belowStyle,a=e.length;this._markers.prepare(a*n,((n,h)=>{const l=e[h%a];l.isNull||(n.point=l,r[1]=s&&l.yValue<i?o:null,this._setPointStyle(n,t,l,r)),n.point=l,n.index=h<a?0:1}))}else this._markers.prepare(0)}_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),Ls.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,C=V.prev(o?e:s),k=S.prev(A?D:o?s:e),L=o?0:s,N=t.length;t.forEach(((t,m)=>{let M,E,T,B;A?(T=A.start+S.getPos(k,t.xValue),B=V.getPos(A.rd,t.yGroup)*h,M=t.px=A.cx+B*u(T),E=t.py=A.cy+B*p(T)):(M=t.px=S.getPos(k,t.xValue),E=t.py=L-V.getPos(C,t.yGroup),o&&(M=V.getPos(C,t.yGroup),E=s-S.getPos(k,t.xValue))),t.xPos=M,t.yPos=E;const O=M,R=E,D=this._markers.get(m),F=v&&v.get(t,0);if(D&&D.setVis(!t.isNull&&(P||!a||M>=0&&M<=e&&E>=0&&E<=s))){this._prepareMakrer(D),this._layoutMarker(D,n,M,E),i._maxY==t.yGroup&&r.options.maxVisible,i._minY==t.yGroup&&r.options.minVisible;const e=0==m&&null!=_?_:m==N-1&&null!=c?c:i._maxY==t.yGroup&&null!=d?d:i._minY==t.yGroup&&null!=g?g:l;if(D.setStyle("opacity",e?"1":"0"),F){F.setContrast(null).layout(w);const t=F.getBBox(),e=D._radius;if(F.visible=!0,A){switch(b){case"inside":B-=y;break;case"foot":B-=t.height/2+y;break;default:B+=t.height+y}M=A.cx+B*u(T),E=A.cy+B*p(T)-t.height/2,this.applyAutoRotation(F,T,A.total,S.options.totalAngle)}else switch(b){case"inside":E-=t.height/2+y;break;case"foot":E+=y+(l?e:0);break;default:E-=t.height+y+(l?e:0)}switch(f){case"left":M-=t.width+(l?e:0)+x;break;case"right":M+=(l?e:0)+x;break;default:M-=t.width/2+x}this._checkLabelOverlap(F,t,O,R,e,e,M,E,!1,null),this._layoutLabelRotation(F,t,M,E)}}else F&&F.setVis(!1)}))}_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 vr&&this._needBelow;let o=this._buildLines2(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),Ot.setImportantStyle(t.dom.style,Q,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;o.indexOf("NaN")>=0&&(o=this._buildLines2(e._lines)),t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Ot.setImportantStyle(t.dom.style,Q,"none")}if(n){const n=this._lowLine,a=e._yAxisObj,h=e.getBaseValue(a);t?this.$_resetClips(s,i/2,a.getPos(i/2,h),!0):r?this.$_resetClips(s,i,a.getPos(s,h),!0):this.$_resetClips(s,i,i-a.getPos(i,h),!1),n.setPath(o),n.internalClearStyleAndClass(),n.internalSetStyle("stroke",e._runColor),n.internalSetStyleOrClass(e._style),n.internalSetStyleOrClass(e.options.belowStyle),Ot.setImportantStyle(n.dom.style,Q,"none")}}_buildLine2(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve2(t,s,i):r instanceof vr&&"step"===e?this._drawStep2(t,s,i,s?r.backDir():r.options.stepDir):this._drawLine2(t,s,i)}_buildLines2(t){const e=this.model,s=e.getLineType(),i=new $r;return"spline"===s?this._drawCurves(t,i):e instanceof vr&&"step"===s?this._drawSteps(t,i,e.options.stepDir):this._drawLines(t,i),i.end()}_drawLine2(t,e,s){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)this.model instanceof vr&&this.model.options.connectNullPoints&&t[e].isNull||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this._drawLine2(t,!1,e)))}_drawStep2(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._drawStep2(t,!1,e,s)))}_drawCurve2(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),this._drawSpline(t,0,t.length-1,s))}_drawCurves(t,e){t.forEach((t=>this._drawCurve2(t,!1,e)))}_drawCurve(t,e,s){const i=t.length;let r;if(t&&t.length>1){let n=e;for(r=e;r<i;)if(t[r].isNull){r-1>n&&this._drawSpline(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].px,t[r].py),r++)}else r++;r-1>n&&this._drawSpline(t,n,r-1,s)}}_buildAreas(t,e,s){const i=new $r;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class ra extends ia{constructor(t){super(t,ra.CLASS),this._flagView=new qn(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)}}}ra.CLASS="rct-line-series";class na extends ia{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new sa(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Qt(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,e){let s=this._lowArea;if(super._prepareBelow(t,e))return s||this._areaContainer.add(s=this._lowArea=new Qt(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.setClip(),this._area.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);let s=this._rangeAreas,i=this._rangeAreaClips;if(e){for(s||(s=this._rangeAreas=new Bn(this._areaContainer,Qt,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new Kt(this.doc);t.setAttr(Wt.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.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._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(Q,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(Q,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s._group,r=s._yAxisObj,n=r instanceof Ki?s.getBaseValue(r):NaN,o=this._polar,a=o.cx,h=o.cy,l=this._lowArea,_=new $r;if(!i||"stack"!==i.options.layout&&"fill"!==i.options.layout){_.move(y(e[0].xPos,a),y(e[0].yPos,h));for(let t=1;t<e.length;t++)_.line(y(e[t].xPos,a),y(e[t].yPos,h));this._needBelow&&!isNaN(n)&&_.circle(a,o.cy,r.getPos(o.rd,n)*this._getGrowRate());const s=_.end();t.setPath(s),null==l||l.setPath(s)}else{_.move(y(e[0].xPos,a),y(e[0].yLow,h)),_.line(y(e[0].xPos,a),y(e[0].yPos,h));for(let t=1;t<e.length;t++)_.line(y(e[t].xPos,a),y(e[t].yPos,h));_.line(y(e[e.length-1].xPos,a),y(e[e.length-1].yLow,h));for(let t=e.length-1;t>=0;t--)_.line(y(e[t].xPos,a),y(e[t].yLow,h));t.setPath(_.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),l&&(l.setBoolData("polar",!0),l.clearStyleAndClass(),l.setFill(s._runColor),l.addStyleOrClass(s._style),l.internalSetStyleOrClass(s.options.belowStyle),Ot.setImportantStyle(l.dom.style,"stroke","none"))}}class oa extends _o{constructor(t){super(t,Do.POINT_CLASS)}savePrevs(){}}class aa extends Xo{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePoints(t,e,s,i){e.chart.isPolar()?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.model.chart.isPolar()?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i)),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 Bn(this._pointContainer,oa)),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=r.getPolar(n),h=this._pointOff-n.polarOff(),l=n.getTotalAngle(),_=a.cx,c=a.cy;let d,g,m,f;i&&(d=this._labelInfo,g=t.getLabelPos(s),m=t.getLabelOff(s.getOffset()),f=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const x=s.point;if(s.setVis(!x.isNull)){const r=o.getPos(a.rd,x.yValue)*e;let y=o.getPos(a.rd,x.yGroup)*e;const b=n.getUnitLen(l,x.xValue),w=t.getPointWidth(b,0);let v=a.start+n.getPos(l,x.xValue);if(v+=w*h,v+=t.getPointPos(b),s.setSector({cx:_,cy:c,rx:y,ry:y,innerRadius:(y-r)/y,start:v-w/2,angle:w,clockwise:!0}),v=s.start+s.angle/2,x.xPos=_+s.rx*u(v),x.yPos=c+s.ry*p(v),i&&(d.labelView=i.get(x,0))){d.labelView.layout(f);const t=d.labelView.getBBox();let e;"outside"===g?(y=c+(s.ry+t.height+m)*p(v),e=_+(s.rx+t.width+m)*u(v)):"head"===g?(y=c+(s.ry-t.height/2-m)*p(v)-t.height/2,e=_+(s.rx-t.height/2-m)*u(v)):(y=c+.7*s.ry*p(v)-t.height/2,e=_+.7*s.rx*u(v)),"outside"!==g&&d.labelView.setContrast(s.dom),this.applyAutoRotation(d.labelView,v,a.total,n.options.totalAngle),d.labelView.trans(e-t.width/2,y)}}}))}}class ha extends aa{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new Bn(t,Go):new Bn(t,Ho)}_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)}}class la extends jo{constructor(t){super(t,Do.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 gr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new gr(t,"rct-boxplot-point-stem")),this.add(this._box=new Ns(t,"rct-boxplot-point-box")),this.add(this._mid=new gr(t,"rct-boxplot-point-mid")),this.add(this._min=new gr(t,"rct-boxplot-point-min")),this.add(this._max=new gr(t,"rct-boxplot-point-max"))}}class _a extends Uo{}let ca=class extends jo{constructor(t){super(t,Do.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 gr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new gr(t,"rct-candlestick-point-wick")),this.add(this._body=new Ns(t))}};class da extends Fo{layout(t,e,s){const i=new $r;i.circle(t,e,s),this.setPath(i.end())}}let ua=class extends jo{constructor(t){super(t,Do.POINT_CLASS),this.add(this._line=new gr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Qt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Qt(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),Ls.setShape(r,o.shape,a,a),Ls.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};let pa=class extends jn{constructor(t){super(t,Do.POINT_CLASS),this._segments=new Bn(this,Qt),this._decimal=0,this.add(this._back=new Qt(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(Ls.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Ls.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Ls.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}};let ga=class extends jo{constructor(t){super(t,Do.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new gr(t)),this.add(this._whiskerUp=new gr(t)),this.add(this._whiskerDown=new gr(t)),this.add(this._back=new Ns(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 ma extends Fo{}let fa=class extends $o{layout(t,e){this.setPath(Ls.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class xa extends jn{constructor(t){super(t,Do.POINT_CLASS),this.add(this._line=new gr(t,"rct-lollipop-point-bar")),this.add(this._marker=new Qt(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),Ls.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class ya extends jo{constructor(t){super(t,Do.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 gr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new gr(t,"rct-ohlc-point-tick")),this.add(this._bar=new gr(t)),this.add(this._back=new Ns(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class ba extends Qt{setOff(t){return this.off=x(t),this}}class wa extends _o{constructor(t){super(t,Do.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class va extends Wt{constructor(t){super(t,Do.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new _o(t))}setSides(t,e,s,i,r){const n=this.point,o=H(R),a=H(((t?n.startAngle:n.startAngle+n.angle)+R/2+D)%D),h=H(a+(t?n.angle:-n.angle)-1e-4+D)%D,l=o-(a+x(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=R/2&&!(h>=a&&h<R/2)||h>=3*R/2&&!(a<h&&a>3*R/2)?(this._outArcView=i.setOff(m(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*R/2&&h<=R/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=R/2&&h<=3*R/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<=R&&this._outArcView.setOff(m(this._outArcView.off,this._side1View.off)),h>=R&&h<D&&this._outArcView.setOff(m(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=Ls.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;P&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Ls.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(Ls.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(Ls.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Ls.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Ls.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Ls.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",Bt.interpolate("#000",r,.2)),this._side2View.setStyle("fill",Bt.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",Bt.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",Bt.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Do.DATA_FOCUS,t),this._side2View.setBoolData(Do.DATA_FOCUS,t),this._inArcView.setBoolData(Do.DATA_FOCUS,t),this._outArcView.setBoolData(Do.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 Sa extends Uo{setHoverRate(t,e,s){const i=this.point,r=t._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}}function Va(t,e){return new(co[e._type()])(t)}function Aa(t,e){return new(Bo[e._viewType()])(t)}Do.register([Ar,na],[kr,class extends ia{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new sa(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Qt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Qt(t,"rct-areanrange-series-line")),Ot.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)}}],[lr,ha],[or,class extends Wo{constructor(t){super(t,"rct-barrange-series"),this._bars=new Bn(this._pointContainer,Ho)}_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)}}],[Er,class extends na{constructor(t){super(t,"rct-bellcurve-series")}}],[Br,class extends Wo{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Bn(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)}}],[Rr,class extends Zo{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new Bn(t,_a)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&yo.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){t.getShape();const s=e.length;this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),o=this._getGrowRate(),a=+i.rotation||0,h=s.pointLabel,l=h.options.position,_=h.getOffset(),c=this._labelContainer._textAlign,d=this._labelViews(),g=s._xAxisObj,m=s._yAxisObj,f=this._polar=s.chart._body.getPolar(g),x=m.prev(r?t:e),y=g.prev(f?D:r?e:t),b=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:w,max:v}=s.getPixelMinMax(b),S=r?0:e,V=this._getDrawer(i.shape);let A;this._markers.forEach(((i,h)=>{const b=i.point,P=d&&(A=d.get(b,0));if(i.setVis(!b.isNull&&!isNaN(b.zValue))){const h=(i._radius=s.getRadius(b.zValue,w,v))*o;let d,C;if(f){const t=f.start+g.getPos(y,b.xValue),e=m.getPos(f.rd,b.yValue);d=f.cx+e*u(t),C=f.cy+e*p(t)}else d=g.getPos(y,b.xValue),C=S-m.getPos(x,b.yValue),r&&(d=m.getPos(x,b.yValue),C=e-g.getPos(y,b.xValue));b.xPos=d,b.yPos=C,i.setVis(!n||d>=0&&d<=t&&C>=0&&C<=e)?(i.setPath(V(h)).trans(d,C).rotate(a),P&&(A.setContrast(i.dom).layout(c),this._layoutLabelView(A,l,_,h,d,C))):P&&P.setVis(!1)}else P&&P.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}}],[zr,class extends Wo{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Bn(this._pointContainer,ca)}_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)}}],[Gr,class extends aa{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Bn(t,da)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}],[Wr,class extends Wo{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Bn(this._pointContainer,ua)}_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)}}],[Zr,class extends Xo{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Bn(this._pointContainer,pa)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_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)}}))}}],[qr,class extends Wo{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Bn(this._pointContainer,ga)}_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)}}],[tn,class extends Ko{constructor(t){super(t,"rct-funnel-series"),this._segments=new Bn(this._pointContainer,ma),this.add(this._lineContainer=new Eo(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&&yo.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=H(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=H(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 $r,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 $r,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,R,D;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),R=s(E),D=R+2*(v-R),m.move(B,M).lines(O,M,D,E,R,E),i.ny=NaN,i.nx1=R-B,i.nx2=D-B):(B=s(M),O=B+2*(v-B),R=V,D=R+g.width,m.move(B,M).lines(O,M,D,A,D,E,R,E,R,A),i.nx1=R-B,i.nx2=D-B,i.ny=x(A-M),i.nx3=R,i.nx4=D),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+(D-R))/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))}}],[rn,class extends Yo{constructor(t){super(t,"rct-histogram-series"),this._bars=new Bn(this._pointContainer,fa)}_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)}))}}],[vr,ra],[an,class extends Xo{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_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 Bn(this._pointContainer,xa)),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)}))}}],[ln,class extends Wo{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Bn(this._pointContainer,ya)}_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)}))}}],[cn,class extends ia{constructor(t){super(t,"rct-pareto-series")}}],[fn,class extends Ko{constructor(e){super(e,"rct-pie-series"),this._deep=!1,this._pb=new $r,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 ao(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new qn(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new Ut(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Eo(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&&yo.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 wa||t instanceof va)&&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 va&&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 Bn(this._pointContainer,va,null),n=this._sides=new Bn(this._sideContainer,ba,"rct-pie-series-side")):this._sectors=new Bn(this._pointContainer,wa,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%D;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=H(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,R=0;if(o&&n>=1&&!t.isDomAnimating()&&(C+=u(y)*k,R+=p(y)*k),t.trans(C,R).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 R=m.options.convergent,D=m.options.dedupeMode,F=m.options.overflow;b&&(w||0===A?"preserveOrder"!==D&&"largestFirst"!==D||b.dedupe(M,C,D):b.arrangeVertical(this,L,C,s,R,D,F)+b.arrangeVertical(this,N,C,s,R,D,F)>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===Rs?.3:h.options.align===Os?.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))}}}],[bn,class extends Zo{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Bn(t,Sa)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,yo.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=a.prev(r?t:e),w=o.prev(h?D: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=this._getDrawer(s.getShape(V)),y=C.jitter(V.xValue,d),P=C.jitter(V.yGroup,g);let k,L;if(h){const t=h.start+o.getPos(w,y),e=a.getPos(h.rd,P)*l;k=h.cx+e*u(t),L=h.cy+e*p(t)}else k=o.getPos(w,y),L=v-a.getPos(b,P),r&&(k=a.getPos(b,P),L=e-o.getPos(w,y));if(V.xPos=k,V.yPos=L,i.setVis(!!h||!n||k>=0&&k<=t&&L>=0&&L<=e)){const t=i._hoverRadius||_;i.setPath(m(t)),i.trans(k,L).rotate(c),A&&this._layoutLabelView(S,f,x,t,k,L)}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}}],[Sn,class extends Wo{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Bn(this._pointContainer,Ho),this.add(this._lineContainer=new Ut(t,"rct-waterfall-series-lines")),this._lines=new Bn(this._lineContainer,gr)}_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}))}}]),uo.register([Gi,ta],[zi,Qo],[Hi,Jo]);class Pa extends Yn{constructor(t){super(t,"rct-axis-grid"),this._lines=new Bn(this,gr)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=this.width,r=this.height,n=s.isEmpty()?[]:t.getPoints(s,s._isHorz?i:r),o=this._lines.prepare(n.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),a=o.count-1;let h;o.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",n[e]===(s._isHorz?i:r))}));const l=null==e.firstVisible?t.visible:e.firstVisible,_=null==e.lastVisible?t.visible:e.lastVisible;s._isHorz?o.forEach(((e,i)=>{h=0===i?l:i===a?_:t.visible,e.setVis(h)&&e.setVLine(s.prev(n[i]),0,r)})):o.forEach(((e,o)=>{n[o],h=0===o?l:o===a?_:t.visible,e.setVis(h)&&e.setHLine(r-s.prev(n[o]),0,i)}))}}class Ca extends Wt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Qt(t)),this._mask.setStroke("none"),this.add(this._upLine=new Qt(t)),this._upLine.setFill("none"),this.add(this._downLine=new Qt(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){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 $r;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 ka extends Wt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new qn(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 La extends ka{constructor(t,e){super(t),this.insertFirst(this._line=new(e?lo:gr)(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(Q,"none"),n&&n.trans(s.cx+a*u(s.start),s.cy+a*p(s.start))}}class Na extends ka{constructor(t,e){super(t),this.insertFirst(this._box=new(e?_o:Ms)(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:D,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*u(s.start),s.cy+t*p(s.start))}}}class Ma extends Ut{constructor(){super(...arguments),this._views=new Bn(this,Qt)}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(Ls.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(Ls.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class Ea extends Ut{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Na?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof Xe?i=this._rangePool.pop()||new Na(t,s):e instanceof Ye&&(i=this._linePool.pop()||new La(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Ta extends Qt{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 $r;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 Qs&&(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 Ba extends oo{constructor(t){super(t,"Reset Zoom",Ba.CLASS_NAME),this.setVis(!1)}}Ba.CLASS_NAME="rct-reset-zoom";class Oa extends Ut{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Ns(t,"rct-empty-view-back")),this.add(this._labelView=new qn(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 Ra extends Ut{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Bn(this,gr)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPoints(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 Da extends Ut{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new Qt(t)),this.add(this._gridContainer=new Ut(t,"rct-body-depth-grids")),this.add(this._lineView=new gr(t,"rct-body-depth-side-line")),this.add(this._endView=new gr(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(Ls.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(Ls.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 Ra(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class Fa extends Ut{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Da(t,!0)),this.add(this._ySideView=new Da(t,!1)),this.add(this._orgLineView=new gr(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 $a extends Yn{constructor(t,e){super(t,$a.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 Ns(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Ns(t,"rct-body-background")),this.add(this._depthLayer=new Fa(t)),this.add(this._image=new Zn(t,!0,"rct-body-image")),this.add(this._emptyView=new Oa(t)),this.add(this._gridRowContainer=new Ma(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Ut(t,"rct-axis-grids")),this.add(this._baseContainer=new Ut(t,"rct-axis-bases")),this.add(this._guideContainer=new Ea(t,"rct-axis-guides")),this.add(this._annotationContainer=new Ut(t,"rct-annotations")),this.add(this._seriesContainer=new Ut(t,"rct-series-container")),this.add(this._axisBreakContainer=new Ut(t,"rct-axis-breaks")),this.add(this._labelContainer=new Ut(t,"rct-label-container")),this.add(this._frontGuideContainer=new Ea(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Ut(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Ut(t,"rct-feedbacks")),this.add(this._zoomButton=new Ba(t)),this._crosshairViews=new Bn(this._feedbackContainer,Ta)}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=Xt._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(Do.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 br)){_=!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)=>e.pv&&s.pv?r?x(e.pv.pv.point.xPos-t.x)<x(s.pv.pv.point.xPos-t.x)?e:s:x(e.pv.pv.point.yPos-t.y)<x(s.pv.pv.point.yPos-t.y)?e:s: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 ki){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 Rr){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,C.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(Do.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Do.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)))}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)}animating(){let t=!1;for(const e of this._seriesViews)if(e.visible&&e._animating()){t=!0;break}return t}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 Uo&&e.endHover(t,!1),e.setBoolData(Do.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.stop()})),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=e.chart,o=this._depthExt,a=o?o.wBody:s,h=o?o.hBody:i;if(this._zoomRequested=!1,this._seriesClip||(this._seriesClip=this.control.clipBounds(),this._seriesClip2=this.control.clipBounds(),this._bodyClip=this.control.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],a,h,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,a,h,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],a,h,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],a,h,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)}_setImage(t,e){const s=this._image;s.setImage(this.model.image.options.url,t,e),s.setStyleOrClass(this.model.image._style)}_doLayout(){const t=this.control,e=this.model,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._setImage(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._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(po[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 qi)||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 Pa(t);r.set(e,s),i.add(s)}if(e instanceof qi&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new gr(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)||Aa(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)||Va(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 Ki&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new Ca(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)}))}}$a.BODY_CLASS="rct-body";class Ia extends Wt{constructor(t){super(t,za.HANDLE_STYLE),this.add(this._back=new Ns(t)),this.add(this._shape=new Qt(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 $r;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 za extends Yn{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(za.HANDLE_STYLE)}static isMask(t){return t.classList.contains(za.MASK_STYLE)}constructor(t){super(t,za.CLASS_NAME),this.add(this._back=new Ns(t,za.BACK_STYLE)),this.add(this._container=new Ut(t,null)),this.add(this._mask=new Ns(t,za.MASK_STYLE)),this.add(this._trackView=new Ns(t,za.TRACK_CLASS)),this.add(this._thumbView=new Ns(t,za.THUMB_CLASS)),this.add(this._startHandle=new Ia(t)),this.add(this._endHandle=new Ia(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=Aa(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 no(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 no(t)),i._simpleMode=!0)}}za.CLASS_NAME="rct-navigator",za.BACK_STYLE="rct-navigator-back",za.MASK_STYLE="rct-navigator-mask",za.HANDLE_STYLE="rct-navigator-handle",za.HANDLE_BACK_STYLE="rct-navigator-handle-back",za.TRACK_CLASS="rct-navigator-track",za.THUMB_CLASS="rct-navigator-thumb";class Ha extends te{constructor(t){super(),this.chart=t}}class Ga extends Ha{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 Ns(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 ja extends Ha{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 Ya extends Ha{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 Xa extends Ha{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 Wa{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;const l=this._chart.chart.exporter;if(l.isContextMenuVisible()&&l.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)})){C.makeArray(a.legend.getSources(a),!0).forEach((t=>{if(t instanceof Ys){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof Ko&&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):(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 io.isThumb(t)?new ja(this._chart,i.getScrollView(t)):za.isHandle(t)?new Ya(this._chart,i._navigatorView,t):za.isMask(t)&&r&&r.model.isZoomed()?new Xa(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Ga(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 Ua extends Ut{constructor(t){super(t,Ua.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 re(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 re(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)}}Ua.TITLE_CLASS="rct-history";class Za extends Yn{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new Ns(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new re(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const 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():On,l=Rn(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 qa extends Xn{constructor(t){super(t,qa.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Bn(this,Za)}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}}}qa.LEGEND_CLASS="rct-legend";class Ka extends Wt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new ao(t))}layout(){}}class Qa extends Wt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Ut(t,"rct-polar-axis-markers")),this._markViews=new Bn(this._markContainer,Ka),this.add(this._gridContainer=new Wt(t,"rct-polar-axis-grids")),this._labelViews=new Bn(this._labelContainer=s,eo,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(ro)?t.setLabel(s,o,e,r.replace(ro,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;this._labelContainer.setStyleOrClass(s._style);const{start:i,total:r}=s.chart._body.getPolar(e),n="auto"===s.options.rotation,o=t.length;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 Ja extends Qa{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Bn(this._gridContainer,gr,Ja.GRID_CLASS),e.insertFirst(this._startView=new gr(t,Ja.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new gr(t,Ja.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new lo(t,Ja.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/D)),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(),_=o+n.pos,c=e+u(_)*(h+a.width/2)-a.width/2,d=s+p(_)*(h+a.height/2)-a.height/2;t.trans(c,d)}})),n>2&&x(r[n-1].pos-r[n-2].pos)<D/24&&this._labelViews.get(n-1).setVis(!1)}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+u(o+n)*i,s+p(o+n)*i)})),this._lineView.setPolyline(t)}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))}}Ja.LINE_CLASS="rct-polar-xaxis-line",Ja.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Ja.GRID_CLASS="rct-polar-xaxis-grid-line";class th extends Qa{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new Bn(this._gridContainer,lo,th.GRID_LINE_STYLE),e.add(this._lineView=new gr(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s,i){const r=t.line;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=r.visible)&&this._lineView.setStyleOrClass(r._style)}_doLayout(t,e,s,i,r,n){const o=n.getStartAngle(),a=n.getTotalAngle();if(this._gridContainer.visible){const i=this._circular;this._gridLines.forEach(((h,l)=>{const _=r[l].pos;if(h.setFill("none"),i)h.setArc(e,s,_,o,a,!0);else{const t=[];n._ticks.forEach((i=>{const r=i.pos;t.push(e+u(o+r)*_,s+p(o+r)*_)})),h.setPolyline(t)}h.setStyleOrClass(t.grid.options.style)}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const o=e+u(t)*r[n].pos-i.getBBox().width/2,a=s+p(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(o,a)}))}else this._labelViews.forEach(((t,i)=>{t.setContrast(null).trans(e+2,s-r[i].pos-t.getBBox().height/2)}));this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}th.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class eh extends $a{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._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this.model.options.circular,n.xAxis.isArced()),o}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._setImage(this.width,this.height),this._seriesViews.forEach((t=>{var r;t.model.needClip(!0)&&(this._polarClip||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(e,s,i),t.getClipContainer().setClip(this._polarClip),null===(r=t.getClipContainer2())||void 0===r||r.setClip(this._polarClip)),t.resize(2*i,2*i),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.visible&&e.layout(this.width,this.height,t.getPolar(e.model.axis))))})),this._layoutAnnotations(!1,this,this.width,this.height)}_prepareAxes(t,e,s,i,r){this._xAxisContainer||(this.insertFirst(this._axisLabelContainer=new Ut(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new Ut(t,"rct_axis-lines")),this.insertFirst(this._xAxisContainer=new Ut(t,"rct-polar-axes")),this.insertFirst(this._yAxisContainer=new Ut(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new th(t,this._lineContainer,this._axisLabelContainer);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 Ja(t,this._lineContainer,this._axisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class sh extends Xn{constructor(t,e){super(t,e?sh.SUBTITLE_CLASS:sh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new re(t)),this._richText=new ue}_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),Rn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var ih,rh;sh.TITLE_CLASS="rct-title",sh.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(ih||(ih={}));class nh extends Wt{constructor(e){super(e,nh.CLASS_NAME),this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Qt(e,"rct-tooltip-back")),this.add(this._top=new Qt(e,"rct-tooltip-top")),this.add(this._textView=new re(e,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Xt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new ue,this.close(!0,!1)}show(t,e,s,i,r,n,o){const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a,s&&s.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||l.getTooltipText(t,a);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const d=this.control,u=d.contentWidth(),p=d.contentHeight(),g=this._textView,x=h.getHeaderHeight(),y=h.getTailSize(),b=h.getBorderRadius(),w=t.chart.isInverted(),v=t._yAxisObj;let S=v.options.reversed;t instanceof vi&&t.getBaseValue(v)>e.point.yValue&&(S=!S),this._richText.setFormat(c),this._richText.build(g,NaN,NaN,null,h.getTextDomain());const V=g.getBBox();let A=f(_.minWidth||0,V.width+16),P=f(_.minHeight||0,V.height+12)+x,C=t._calcedColor;t instanceof xi?(t.options.legendByPoint||t._colorByPoint())&&(C=a._calcedColor):t._colorByPoint()&&(C=getComputedStyle(e.dom).fill),this._top.setFill(C);const k="visible"===this.getStyle("visibility")?300:0,L=_.offset+y,N=n.getFocusPointView().getBounds(),M=d.getBounds();let E,T=!1;if(w&&!t.isWidget){E=r-P/2-f(0,m(r-P/2,p-P)),this._tailVisible=Math.abs(P/2-b-y/2)>Math.abs(E),T=h.isFollowPointer(t)?S?A+L>i:i+A+L>u:S?A+L>N.x-M.x+N.width:N.x-M.x-L>u-A,T&&(S=!S);const e=S?ih.LEFT:ih.RIGHT;this.drawTooltip(0,0,A,P,e,E),S?i-=A+L:i+=L,r-=P/2}else{E=i-A/2-f(0,m(i-A/2,u-A)),this._tailVisible=Math.abs(A/2-b-y/2)>Math.abs(E),T=h.isFollowPointer(t)?S?r+P+L>p:r-(P+L)<0:S?p-(N.y-M.y-d._padding.top)<P+L:M.bottom-N.bottom+L>p-P,T&&(S=!S);const e=S?ih.BOTTOM:ih.TOP;this.drawTooltip(0,0,A,P,e,E),i-=A/2,S?r+=L:r-=P+L}i=f(0,m(i,u-A)),r=f(0,m(r,p-P)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(f(0,i-20),f(0,r-20)),this.transEx(i,r,k/2,!1)):this.transEx(i,r,k,!1),0===k&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}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:Di.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Ht(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(this._tailVisible)switch(r){case ih.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 ih.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 ih.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 ih.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=r===ih.BOTTOM,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._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(_)}}nh.CLASS_NAME="rct-tooltip";class oh extends Wn{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new sh(t,!1)),this.add(this.subtitleView=new sh(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 ah extends Wn{_doInitChildren(t){this.add(this._legendView=new qa(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 hh extends Wn{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r){const n=this.views;let o;for(n.length;n.length<s.length;)o=new no(t),this.add(o),n.push(o);for(;n.length>s.length;)o=n.pop(),o.parent&&o.remove();if(n.forEach(((t,e)=>{t.prepare(s[e])})),this.setVis(n.length>0)){const t=n[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.loaded,s=[];let i=this.width,r=this.height,n=0,o=0;t=+t||0,[this.views].forEach((a=>{if(a){let h=0;a.forEach((t=>{if(t.visible){const a=t.checkExtents(e);a&&s.push(a),this.isHorz?(t.resize(i,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,r)),t.layout(),this.isHorz?(t.trans(n,this.dir===Ln.TOP?r-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Ln.RIGHT?h:i-h-t.mw,o),h+=t.mw+this._gap)}})),this.isHorz?n+=i+t:o+=r+t}}));const a=this.control.chart.body.options.zoomCallback;s.length>0&&a&&Promise.resolve().then((()=>{s.forEach((({axis:t,from:e,to:s})=>{a({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof Qs?Math.floor(e):e,to:t instanceof Qs?Math.floor(s):s})}))}))}}class lh extends Yn{constructor(e){super(e,"rct-credits"),this.add(this._textView=new re(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 _h extends Ut{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.add(this._annotationContainer=new Ut(t,"rct-annotations")),this.add(this._plotContainer=new Ut(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new $a(t,this));for(const e in Ln){const s=new hh(t,Ln[e]);this._plotContainer.add(s),this._axisSectionMap[Ln[e]]=s}_h.pane_class&&this.add(this._paneContainer=new _h.pane_class(t,this)),this.add(this._titleSectionView=new oh(t)),this.add(this._legendSectionView=new ah(t)),this.add(this._frontAnnotationContainer=new Ut(t,"rct-front-annotations")),this.add(this._creditView=new lh(t)),this.add(this._navigatorView=new za(t)),this.add(this._historyView=new Ua(t)),this.add(this._tooltipView=new nh(t))}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||([Ln.LEFT,Ln.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[Ln.TOP,Ln.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[Ln.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),y+=e.mw),(e=t[Ln.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[Ln.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0),b-=e.mh),(e=t[Ln.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=this._org={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[Ln.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[Ln.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[Ln.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[Ln.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.$_layoutAnnotations(this._inverted,e,s,M),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i,r){const{x:n,y:o}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},a=this._model.chart._tooltip.isFollowPointer(t),h=i.getTooltipPos(),l=a?r.x+h.x:n+h.x,_=a?r.y+h.y:o+h.y;this._tooltipView.show(t,e,s,l,_,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(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)}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;C.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof _i?o.hoverSeries(t):e.options.pointHovering&&t instanceof Ys&&o.hoverPoint(t)}))}}if(l instanceof As&&!(this._hoverItem instanceof As)&&(o.hoverPoint(null),o.hoverSeries(null)),!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 Pr&&!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()}pointerLeaved(t,e,s){}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 Ln){const s=this._axisSectionMap[Ln[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))}isAnimating(){return this._bodyView.animating()}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new eh(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)}$_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,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.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[Ln.LEFT].checkWidths(t,s,i),s-=n[Ln.RIGHT].checkWidths(t,s,i),i-=n[Ln.BOTTOM].checkHeights(t,s,i),i-=n[Ln.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===Ln.LEFT||t===Ln.RIGHT?s-=e.mw:t!==Ln.BOTTOM&&t!==Ln.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===Ln.LEFT||t===Ln.RIGHT?s-=e.mw:t!==Ln.BOTTOM&&t!==Ln.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.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Va(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)}))}}!function(t){t.EXPORT="$$realchart_export"}(rh||(rh={}));class ch extends Xt{constructor(t,e){super(t,e),this.addElement(this._chartView=new _h(t)),this.setPointerHandler(new Wa(this))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new En(null,((t,e)=>{this.changeModel(t,e)}))}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof Ee&&s===Pe.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!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearAssetDefs(),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===rh.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_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 dh{static getVersion(){return Dt.version}static setLicenseKey(t){Dt.code=t}static setLocale(t,e){e&&M(t,e),(t=>{t&&(N=k[L=t.substring(0,2)]),N||(N=k[L="ko"])})(t)}static registerLocale(t,e){M(t,e)}static setDebugging(t){Wt.DEBUGGING=t}static setLogging(t){C.LOGGING=t}static setAnimatable(t){Xt._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new ch(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[Mn]=o,o.chart}static createData(t,e){return new Tn(t||{},e)}}class uh{static empty(){return new uh}static create(t=0,e=0){return new uh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class ph{static empty(){return new ph}static create(t=0,e=0){return new ph(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const gh=dh.getVersion,mh=dh.setDebugging,fh=dh.setLogging,xh=dh.setAnimatable,yh=dh.configure,bh=dh.createChart,wh=dh.createData,vh=dh.setLicenseKey;t.Annotation=Ee,t.ArcElement=ho,t.AreaRangeSeries=kr,t.AreaSeries=Ar,t.AreaSeriesGroup=Nr,t.AssetCollection=we,t.Axis=Qe,t.AxisBaseLine=Zi,t.AxisCollection=Je,t.AxisGrid=He,t.AxisItem=De,t.AxisLabel=Ue,t.AxisLine=Fe,t.AxisScrollBar=Ze,t.AxisScrollView=io,t.AxisSectorLine=Ke,t.AxisTick=We,t.AxisTitle=$e,t.AxisView=no,t.BarRangeSeries=or,t.BarSeries=lr,t.BarSeriesBase=hr,t.BarSeriesGroup=cr,t.BarSeriesGroupBase=_r,t.BarSeriesPoint=ar,t.BarSeriesView=ha,t.BarSeriesViewBase=aa,t.BasedSeries=vi,t.BasedSeriesView=Xo,t.BellCurveSeries=Er,t.Body=Ss,t.BodyDepth=vs,t.BodyView=$a,t.BoxPlotSeries=Br,t.BoxPointElementEx=zo,t.BubbleSeries=Rr,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=Dr,t.CandlestickSeries=zr,t.CategoryAxis=Qs,t.CategoryAxisGrid=Ks,t.CategoryAxisLabel=qs,t.CategoryAxisTick=Zs,t.Chart=En,t.ChartControl=ch,t.ChartData=Tn,t.ChartDataCollection=_t,t.ChartElement=Yn,t.ChartItem=Pe,t.ChartObject=Nn,t.ChartOptions=kn,t.ChartText=ke,t.ChartView=_h,t.CircelBarPointLabel=Hr,t.CircleBarSeries=Gr,t.CircleBarSeriesGroup=jr,t.CircleElement=ao,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=ms,t.CircularGaugeGroup=fs,t.CircularGaugeLabel=ps,t.ClockGaugeType="clock",t.ClusterableSeries=bi,t.ClusterableSeriesGroup=Ci,t.Color=Bt,t.ConnectableSeries=di,t.ConstraintSeriesGroup=Pi,t.ContentView=Un,t.ContinuousAxis=qi,t.Credits=Pn,t.Crosshair=Oe,t.DataPoint=Ys,t.DataPointCollection=Xs,t.DataPointLabel=ii,t.Dom=Ot,t.DumbbellSeries=Wr,t.ElementPool=Bn,t.EqualizerSeries=Zr,t.ErrorBarSeries=qr,t.Exporter=Vs,t.FunnelSeries=tn,t.Gauge=rs,t.GaugeBase=is,t.GaugeGroup=ns,t.GaugeGroupView=xo,t.GaugeItem=class extends Pe{constructor(t){super(t.chart)}},t.GaugeLabel=us,t.GaugeRangeBand=ds,t.GaugeRangeLabel=cs,t.GaugeScale=_s,t.GaugeView=go,t.HeatmapSeriesType="heatmap",t.HistogramSeries=rn,t.IconedText=Le,t.ImageAnnotation=zi,t.ImageElement=Zn,t.LayerElement=Ut,t.Legend=Ps,t.LegendItem=As,t.LegendItemView=Za,t.LegendView=qa,t.LineElement=gr,t.LinePointLabel=yr,t.LineSeries=vr,t.LineSeriesBase=br,t.LineSeriesBaseView=ia,t.LineSeriesGroup=Lr,t.LineSeriesPoint=fr,t.LinearAxis=Ki,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=An,t.LollipopSeries=an,t.LowRangedSeries=Vi,t.MarkerSeries=ki,t.MarkerSeriesPointView=Uo,t.MarkerSeriesView=Zo,t.NavigatorMask=Ni,t.NavigiatorHandle=Li,t.ORG_ANGLE=F,t.OhlcSeries=ln,t.OthersGroup=fi,t.PI_2=D,t.PaneContainer=class extends Ut{},t.ParetoSeries=cn,t.PathBuilder=$r,t.PathElement=Qt,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=fn,t.PieSeriesGroup=xn,t.PieSeriesLabel=gn,t.PieSeriesText=pn,t.Point=uh,t.PointElement=Fo,t.PointHovering=Cn,t.PointLabelLineContainer=Eo,t.PointLabelLineView=Mo,t.PointLabelView=Lo,t.RAD_DEG=I,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=yi,t.RangedSeries=Si,t.RcAnimation=Gt,t.RcControl=Xt,t.RcElement=Wt,t.RcObject=T,t.RectElement=Ns,t.SVGNS=e,t.ScaleView=class extends Yn{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Ut(t,"rct-gauge-scale-ticks")),this._ticks=new Bn(this._tickContainer,gr),this.add(this._labelContainer=new Ut(t,"rct-gauge-scale-tick-labels")),this._labels=new Bn(this._labelContainer,fo)}},t.ScatterSeries=bn,t.SectionView=Wn,t.SectorElement=_o,t.Series=_i,t.SeriesAnimation=yo,t.SeriesGroup=Ai,t.SeriesMarker=ui,t.SeriesNavigator=Bi,t.SeriesView=Do,t.ShapeAnnotation=Hi,t.Size=ph,t.SplineSeries=Sr,t.Subtitle=Ri,t.SvgShapes=Ls,t.TextAnnotation=Gi,t.TextElement=re,t.TimeAxis=rr,t.Title=Oi,t.Tooltip=Di,t.TreemapSeriesType="treemap",t.Trendline=ri,t.Utils=C,t.ValueGauge=as,t.ValueGaugeView=class extends go{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?mt.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 mo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){const e=this.model;e._setValueRate(t),this._renderValue(),console.log("change",e.getValue(),t)}},t.VectorSeriesType="vector",t.WaterfallSeries=Sn,t.Widget=ts,t.WidgetSeries=xi,t.WidgetSeriesConnector=gi,t.WidgetSeriesLabel=mi,t.WidgetSeriesPoint=pi,t.WidgetSeriesView=Ko,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=Ws,t.absv=x,t.assignObj=_,t.buildValueRanges=it,t.calcPercent=K,t.configure=yh,t.copyObj=t=>t&&_({},t),t.cos=u,t.createChart=bh,t.createData=wh,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=Se,t.fixnum=H,t.getVersion=gh,t.incv=S,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=P,t.isNumber=h,t.isObject=i,t.isString=o,t.maxv=f,t.minv=m,t.parsePercentSize=Z,t.pickNum=y,t.pickProp=w,t.pickProp3=v,t.pixel=j,t.rectToSize=Rn,t.setAnimatable=xh,t.setDebugging=mh,t.setLicenseKey=vh,t.setLogging=fh,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},P={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 A="ko",C=P[A]||P[A="ko"];const k=(t,e)=>{t&&i(e)&&(C=P[t.substring(0,2)]=Object.assign(P.ko,P.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 R(t){return parseFloat(t.toPrecision(12))}function D(t){return Math.floor(1e6*t)/1e6}function F(t){return t+"px"}function $(t){return null==t||Number.isNaN(t)||""===t}function I(t){return t<10?"0"+t:String(t)}function z(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function H(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;K(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 j(t,e){return H(t,!0)||H(e,!1)}function Y(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const X="fill",W="stroke",U={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"},Z=function(t){const e=U[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return U[t]=e,e}return e};class q extends Error{}const K=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},Q=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},J="shuffle",tt="random",et="vertical-lr",st="vertical-rl",it=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const rt="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class nt{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&&nt.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,nt.month_days[nt.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()-it}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 deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=nt.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(),nt.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 isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=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)}}nt.LOGGING=!1,nt.week_days=["일","월","화","수","목","금","토"],nt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],nt.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]],nt.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let ot=0;class at{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ot++))}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 ht extends at{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 lt=function(t){return t&&"object"==typeof t};class _t extends ht{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 lt(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)&&K(C.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class ct{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 _t({},s):lt(s)&&r(s.values)&&(i=new _t(s.options,s.values)),this._map[e]=i}}}const dt="0".charCodeAt(0),ut="#".charCodeAt(0),pt=",".charCodeAt(0),gt="s".charCodeAt(0),mt="a".charCodeAt(0);class ft{static getFormatter(t){let e=ft.Formatters[t];return e||(ft.Formatters[t]=e=new ft(t)),e}static get Default(){return ft.getFormatter(ft.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)===dt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ut;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===dt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===pt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===gt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===mt){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}ft.DEFAULT_FORMAT="",ft.Formatters={};const xt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],yt=[".","/","-",":"],bt="Z".charCodeAt(0),wt="z".charCodeAt(0),vt="A".charCodeAt(0),St="a".charCodeAt(0),Vt="y".charCodeAt(0),Pt="M".charCodeAt(0),At="m".charCodeAt(0),Ct="W".charCodeAt(0),kt="w".charCodeAt(0),Lt="d".charCodeAt(0),Nt="H".charCodeAt(0),Mt="h".charCodeAt(0),Et="S".charCodeAt(0),Tt="s".charCodeAt(0);class Bt{static getFormatter(t){let e=Bt.Formatters[t];return e||(Bt.Formatters[t]=e=new Bt(t)),e}static get Default(){return Bt.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 Vt:i+=a>2?t.getFullYear():I(t.getFullYear()%100);break;case Pt:i+=a>1?I(t.getMonth()+1):t.getMonth()+1;break;case Lt:i+=a>1?I(t.getDate()):t.getDate();break;case Ct:i+=a>1?I(nt.weekOfYear(t,e)+1):nt.weekOfMonth(t,e,!0)+1;break;case kt:i+=a>1?nt.long_week_days[t.getDay()]:nt.week_days[t.getDay()];break;case Nt:i+=a>1?I(t.getHours()):t.getHours();break;case Mt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?I(e):e}else i+=a>1?I(t.getHours()):t.getHours();break;case At:i+=a>1?I(t.getMinutes()):t.getMinutes();break;case Tt:i+=a>1?I(t.getSeconds()):t.getSeconds();break;case St:case vt:t.getHours()<12?i+=C.am:i+=C.pm;break;case Et:let s=t.getMilliseconds();i+=3==a?z(s):2==a?I(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(yt.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),xt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=vt&&e<=bt||e>=St&&e<=wt)&&K(C.invalidDateFormat,t)}e.push(n)}if(r<i&&nt.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&nt.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)}}Bt.Formatters={};class Ot{static isBright(t){return new Ot(t).isBright()}static getContrast(t,e,s){return new Ot(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Ot(t),r=new Ot(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 rt?new Ot(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(nt.startsWith(t,"rgb(")&&nt.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):nt.startsWith(t,"rgba(")&&nt.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):nt.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 Ot(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}}Ot.BLACK="#000",Ot.WHITE="#fff";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 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){t.setAttribute("clip-path",`url(#${e instanceof SVGClipPathElement?e.id:e})`)}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}}var Dt;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Dt||(Dt={}));const Ft={name:"RealChart",version:"1.4.8",license:"enterprise",code:null};class $t{static decode(t){const e=$t.CHARS,s=$t.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}}$t.PAD="=",$t.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class It{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=It.xor,i=It.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=It.xor,i=It.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=It.kb,i=It._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*It.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=It._decryptBlock;let i=It._init(e),r=[],n=$t.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*It.POW24|n[a+1]*It.POW16|n[a+2]*It.POW8|n[a+3],h.right=n[a+4]*It.POW24|n[a+5]*It.POW16|n[a+6]*It.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)}}It.POW2=Math.pow(2,2),It.POW3=Math.pow(2,3),It.POW4=Math.pow(2,4),It.POW8=Math.pow(2,8),It.POW16=Math.pow(2,16),It.POW24=Math.pow(2,24),It.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 zt{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=It.decrypt(t,"dkdl"+this._getLDKey(It.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={inOutSine:t=>-(u(N*t)-1)/2},Ht=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 jt{constructor(){this.delay=0,this.duration=jt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=m(1,f(0,R(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop(!0)}finally{t>=this.duration?this._stop(!1):this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop(!0)}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=y(t,jt.DURATION),this.delay=e||0,this._easing=Gt[s],this._doStart(),this._started=+new Date,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}}jt.DURATION=700,jt.SHORT_DURATION=300;class Yt extends jt{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 Xt=function(t){return new Yt(t).start()},Wt=function(t){return isNaN(t)?0:t};class Ut{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",Wt(t[e]),Wt(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Wt(t[e].x),Wt(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}}class Zt extends at{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=zt.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!=Dt.Developer&&!zt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(Dt).includes(n))throw new Error(s);if(Ft.license=i.lic,n==Dt.Evaluation||n==Dt.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&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Zt.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}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){$(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}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 te(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new ie(this.doc()))}clipDonut(){return this.addClip(new re(this.doc()))}clipPath(){return this.addClip(new se(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&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}_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;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||K(C.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");_(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const o=this._svg=r.createElementNS(e,"svg");o.classList.add("rct-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created by RealChart v"+Ft.version,o.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Qt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute"}),this._tester=r.createElement("div"),n.appendChild(this._tester),rt&&(this._canvas=r.createElement("canvas"))}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Zt.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()}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{nt.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=F(s),r.style.height=F(i)),_(this._htmlRoot.style,{left:F(e.left-t.left),top:F(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),_(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(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(),nt.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)}}Zt.CLASS_NAME="rct-control",Zt.SHADOW_FILTER="rr-chart-shadow-filter",Zt._animatable=!0;class qt extends at{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 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 $(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 rt&&(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 rt&&(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=nt.isValidNum(t)?t:this._tx,e=nt.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=nt.isValidNum(t)?t:this._tx,e=nt.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=nt.isValidNum(t)?t:this._tx,e=nt.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&&nt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&nt.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(Z(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(Z(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(Z(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(Z(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.stop(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Xt({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=Xt({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=[];(nt.isValidNum(e)||nt.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+nt.pick(this._originX,t.getAttribute("x"),0)+" "+nt.pick(this._originY,t.getAttribute("y")||0)+")"),nt.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=nt.getNumber(this._scaleX,1),n=nt.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 Kt extends qt{constructor(t,e){super(t,e,"g")}}class Qt extends qt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class Jt extends qt{constructor(t){super(t,L,"clipPath");const e=this._id=nt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class te extends Jt{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 ee 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 se extends Jt{constructor(t){super(t),this._path=new ee(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class ie extends Jt{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 re extends Jt{constructor(t){super(t),this.add(this._donut=new ee(t))}setDonut(t,e,s,i){this._donut.setPath((new Ut).donut(t,e,s,i).end())}}class ne{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 oe,ae,he;t.TextAnchor=void 0,(oe=t.TextAnchor||(t.TextAnchor={})).START="start",oe.MIDDLE="middle",oe.END="end",t.TextLayout=void 0,(ae=t.TextLayout||(t.TextLayout={})).TOP="top",ae.MIDDLE="middle",ae.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(he||(he={}));class le extends qt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=he.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(Ot.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 _e="$_TH",ce="$_TW";class de{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]?ft.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Bt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");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 ue extends de{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 pe extends ue{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 ge={t:class extends ue{tag(){return"</t>"}},b:class extends ue{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends ue{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:pe};class me{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 de).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 ge){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 ge[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 fe=/<br.*?>|\r\n|\n/;class xe{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===et||u===st;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[ce]=y.width,x[_e]=y.height,p?(u=f(u,x[ce]),g+=x[_e]):(u+=x[ce],g=f(g,x[_e])),m||(m=x),l instanceof pe){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[_e]=g*h,r[ce]=u*h,c.push(0==s?r[ce]/2:r[ce])}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[ce]-t.getAscent(e[ce]))+t.getAscent(l[s][ce])):r=e[_e]-t.getAscent(e[_e])+t.getAscent(l[s][_e]),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[ce]=n.width,r[_e]=e[_e]=n.height,d[0]=r}switch(u){case et:d[s].setAttribute("dx",String(i)),d[s].setAttribute("y","0");break;case st: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[ce];if(e)i.setAttribute("dx",String(u===st?s-r/2:r/2));else switch(u){case et:i.setAttribute("x",String((s-r)/-2));break;case st:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][_e])}}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[ce]=y.width,u[_e]=y.height,x&&(u.textContent=" ",u[_e]*=.6,x=!1),p+=u[ce],g=f(g,u[_e]),m||(m=u),l instanceof pe){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[_e]=g*h,r[ce]=p*h,d=f(p,d),c.push(0==s?r[ce]/2:r[ce])}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[_e]-t.getAscent(e[_e])+t.getAscent(l[s][_e]))),e=l[s]);t.layoutText(l[0][_e])}}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(fe);for(let t of s)e.push((new me).parse(t))}}}class ye{constructor(t){this.source=t}hasDef(){return!0}}class be extends ye{_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 we extends be{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}}we.TYPE="lineargradient";class ve extends be{getEelement(t,s){const i=t.createElementNS(e,"radialGradient");return $(s.cx)||i.setAttribute("cx",s.cx),$(s.cy)||i.setAttribute("cy",s.cy),$(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}ve.TYPE="radialgradient";class Se extends ye{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=Se.STOCK[+s.pattern%Se.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}}Se.TYPE="pattern",Se.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 Ve extends ye{prepare(){const t=this.source;this._colors=r(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&nt.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:[]}}Ve.TYPE="colors";class Pe extends ye{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||Pe.SIZE,height:e.height||e.width||Pe.SIZE})}}Pe.TYPE="images",Pe.SIZE=20;class Ae{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=Se.TYPE:r(t.colors)?e=Ve.TYPE:r(t.images)&&(e=Pe.TYPE)),e)switch(e.toLowerCase()){case we.TYPE:return new we(t);case ve.TYPE:return new ve(t);case Se.TYPE:return new Se(t);case Ve.TYPE:return new Ve(t);case Pe.TYPE:return new Pe(t)}}}}let Ce=0;const ke=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},Le=["__proto__","constructor","prototype"],Ne=function(t,e){const s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!Le.includes(t)){const n=e[t];r(n)?s[t]=n.slice(0):n instanceof Date?s[t]=new Date(n):i(n)?n._obj instanceof _t?s[t]=n:s[t]=Ne(s[t],n):s[t]=n}return s};class Me extends at{constructor(t){super(),this.chart=t,Ce++}init(){const t=this._op=Ne({},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 Me&&(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):n instanceof Date?s[t]=new Date(n):i(n)?n instanceof _t?s[t]=n:n._obj instanceof _t?s[t]=n._obj:this[t]instanceof Me||(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 Me)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 Me?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 Me)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){if(t){const s=t._op=Ne({},t.constructor.defaults);return t.$_applyOptions(s),t._children.forEach((i=>{s[i]=e(t[i])})),s}};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 Me?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):n instanceof Date?t[s]=new Date(n):i(n)?n._obj instanceof _t?t[s]=n._obj: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 Me)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`]=H(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Me.REFRESHED="refreshed",Me.defaults={visible:!0};class Ee{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 Te extends Me{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?ft.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 xe),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(nt.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=nt.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}}Te.defaults=ke(Me.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Be extends Te{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 Pe&&(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 Pe?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Be.defaults=ke(Te.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Oe extends Me{}const Re={};class De extends Me{static register(...t){t.forEach((t=>{Re[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(Me.REFRESHED)}_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){}}De.defaults=ke(Me.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Fe extends Ee{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 De)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 $e extends Me{}$e.defaults=ke(Me.defaults,{minWidth:50});class Ie extends Me{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new $e(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 Date?Bt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):ft.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)}}Ie.defaults=ke(Me.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const ze={};class Ge extends Me{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class He extends Ge{_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)}}He.defaults=ke(Ge.defaults,{visible:void 0});class je extends Ge{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return rt?"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&&!$(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)}}je.defaults=ke(Ge.defaults,{align:"middle",offset:0,gap:5});class Ye extends Ge{_isVisible(){return this._op.visible&&!$(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ye.defaults=ke(Ge.defaults,{position:"end",gap:2});class Xe extends Ge{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 We extends Ge{_doInit(t){t.rows=(this._rows=new Xe(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}}We.defaults=ke(Ge.defaults,{visible:void 0,depthVisible:void 0});class Ue extends Be{getDefaultIconPos(){return"left"}}Ue.defaults=ke(Be.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Ze extends Ge{_doInit(t){t.label=(this._label=new Ue(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)}}Ze.defaults=ke(Ge.defaults,{front:!1,zindex:0});class qe extends Ze{}class Ke extends Ze{}class Qe extends Ge{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return nt.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:Qe.DEF_LENGTH,this._gap=this._op.gap||0}}Qe.DEF_LENGTH=7,Qe.defaults=ke(Ge.defaults,{visible:!1,gap:3});class Je extends Be{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}}Je.defaults=ke(Be.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class ts extends Ge{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)}}ts.defaults=ke(Ge.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class es{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?nt.clamp(t,this.min,this.max):nt.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 ss extends He{}class is extends Me{static register(...t){t.forEach((t=>{ze[t.type]=t,t.subtype&&(ze[t.subtype]=t)}))}_animating(){return!isNaN(this._prevRate)}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this._isX=e}_doInit(t){t.title=(this._title=new je(this)).init(),t.unitLabel=(this._unitLabel=new Ye(this)).init(),t.line=(this._line=new He(this)).init(),t.sectorLine=(this._sectorLine=new ss(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 Ie(this)).init(),t.scrollBar=(this._scrollBar=new ts(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))})),1===this._index&&console.log(t))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(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._op.position;this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&"between"===t&&this._isX,this._isOpposite="opposite"===t,this._runPos=t,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender();const e=this._series;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!nt.equalArrays(e,this._prevSeries)))for(const t of e)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&e.length>0)if(this.chart.isSplitted()){const t=[e[0].row];for(let s=1;s<e.length;s++)t.indexOf(e[s].row)<0&&t.push(e[s].row);t.forEach((t=>{let s=0,i=0;e.forEach((e=>{e.row==t&&e.isClusterable()&&(s+=y(e.groupWidth(),1))})),e.forEach((e=>{if(e.row==t&&e.isClusterable()){const t=y(e.groupWidth(),1)/s;e.setCluster(t,i),i+=t}}))}))}else{let t=0,s=0;e.forEach((e=>{e.isClusterable()&&(t+=y(e.groupWidth(),1))})),e.forEach((e=>{if(e.isClusterable()){const i=y(e.groupWidth(),1)/t;e.setCluster(i,s),s+=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+nt.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 es(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)}isAnimating(){return!isNaN(this._prevRate)}_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 Ke(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new qe(e):new Ke(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?R(m(...t)||0):NaN,max:t.length>0?R(f(...t)||0):NaN}}}is.defaults=ke(Me.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}:<b> ${yValue}</b>",animatable:!0,fixedSize:!1});class rs extends Ee{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($(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._isPolar=t.isPolar(),o}}class ns extends Me{_doPrepareRender(t){}}const os={},as={};class hs extends ns{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")}}hs.defaults=ke(ns.defaults,{size:"100%"});class ls extends hs{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{os[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}}ls.defaults=ke(hs.defaults,{duration:500});class _s extends hs{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{as[t.type]=t,as[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(ls._loadGauge(t,e,s)))):i(e)&&this.$_add(ls._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)}}_s.defaults=ke(hs.defaults,{minValue:0});class cs extends Ee{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 ls)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 _s)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(os).length&&0===Object.keys(as).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 ds extends ls{constructor(){super(...arguments),this._prevValue=0}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 y(this._runValue,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}}}ds.defaults=ke(ls.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class us extends Me{constructor(t){super(t.chart),this.scale=t}}us.defaults=ke(Me.defaults,{reversed:!1,length:7});class ps extends Be{getText(t){return nt.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class gs extends Me{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Me(e)).init(),t.tick=(this._tick=new us(this)).init(),t.label=(this._label=new ps(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(R(e));for(let e=1;e<t;e++)n.push(R(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(R(l=s));;){if(l+=o,l>=i){r.push(R(i));break}r.push(R(l))}return r}}gs.defaults=ke(Me.defaults,{position:"default",stepPixels:48,gap:8});class ms extends Me{}ms.defaults=ke(Me.defaults,{visible:!1});class fs extends Me{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new ms(e)).init(),t.tickLabel=(this._tickLabel=new Me(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:fs.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=Q(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}fs.defaults=ke(Me.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class xs extends Te{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}xs.defaults=ke(Te.defaults,{animatable:!0});class ys extends xs{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")}}ys.defaults=ke(xs.defaults,{offsetX:0,offsetY:0});class bs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ws.DEF_CENTER),this.setCenterY(ws.DEF_CENTER),this.setRadius(ws.DEF_RADIUS),this.setInnerRadius(ws.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=H(w(t,ws.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=H(w(t,ws.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(w(t,ws.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=H(w(t,ws.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=H(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 ws extends ds{_doInit(t){this._props=new bs,t.label=(this._label=new ys(this.chart)).init()}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}_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 bs)}_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)}}ws.DEF_CENTER="50%",ws.DEF_RADIUS="40%",ws.DEF_INNER="80%",ws.defaults=ke(ds.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class vs extends _s{_doInit(t){this.props=new bs,t.label=(this._label=new ys(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)}}vs.defaults=ke(_s.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Ss=class extends Me{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Ss.defaults=ke(Me.defaults,{visible:void 0});class Vs extends Te{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||Vs.DEF_TEXT}}Vs.DEF_TEXT="표시할 데이터가 없습니다.",Vs.defaults=ke(Me.defaults,{visible:void 0});class Ps extends Me{}Ps.defaults=ke(Me.defaults,{visible:!1});class As extends Me{_doInit(t){t.line=(this._line=new Ps(this.chart)).init(),t.endLine=(this._endLine=new Ps(this.chart)).init(),t.gridLine=(this._gridLine=new Ps(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}As.defaults=ke(Me.defaults,{});class Cs extends Me{_doInit(t){t.xSide=(this._xSide=new As(this.chart)).init(),t.ySide=(this._ySide=new As(this.chart)).init(),t.orgLine=(this._orgLine=new Ps(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)))}}Cs.defaults=ke(Me.defaults,{visible:!1,length:32,angle:32});class ks extends Me{constructor(t){super(t),this._annotations=new Fe(this)}_doInit(t){t.depth=(this._depth=new Cs(this.chart)).init(),t.image=(this._image=new Oe(null)).init(),t.emptyView=(this._emptyView=new Vs(this.chart)).init(),t.zoomButton=(this._zoomButton=new Ss(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof hs&&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()}}ks.defaults=ke(Me.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Ls extends Me{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)}}Ls.defaults=ke(Me.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ns extends Me{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Ms extends ns{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 Ns(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(nt.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()}}Ms.defaults=ke(ns.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 Es=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Ts=.001;class Bs{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<Ts}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?Ts:-.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?Ts:-.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?_?Ts:-.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?_?Ts:-.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?Ts:-.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=Bs[e](0,0,f(2*s,0),f(2*i,0));break;default:r=Bs.circle(s,i,f(m(s,i),0))}t.setPath(r)}}class Os extends qt{static create(t,e,s,i,r,n,o=0){return new Os(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 Rs extends ee{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Bs.box(t,e,s,i)),this}}const Ds="head",Fs="far",$s="inside",Is="none",zs="near",Gs="displayAll",Hs="largestFirst",js="hidden",Ys="line",Xs="area",Ws="circlebar";let Us=0;const Zs="_deleted";class qs{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=Us++,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[Zs]=!0}_isDeleted(){return this[Zs]}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 Ks{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 this._points.splice(e,1),!0}clean(){this._points=this._points.filter((t=>!t[Zs]))}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 Qs extends qs{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.yValue=e.zValue=this.yValue}applyValueRate(t,e){this.zValue=S(t.zValue,this.zValue,e)}}class Js extends qs{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}applyValueRate(t,e){this.lowValue=S(t.lowValue,this.lowValue,e)}}class ti extends Qe{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}ti.defaults=ke(Qe.defaults,{step:1});class ei extends Je{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}}ei.defaults=ke(Je.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class si extends We{getPoints(t){const e=t._pts,s=t._ticks.length,i=[];if(s>0){const r=Math.max(1,t.tick.options.step||1);if(r>1)for(let t=0,n=1,o=e.length;t<=s&&n<o;t++,n+=r)i.push(e[n]);else for(let t=0;t<=s;t++)i.push(e[t+1])}return i}}class ii extends is{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 es(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new si(this)}_createTickModel(){return new ti(this)}_createLabel(){return new ei(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=nt.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,s){const i=this._op;return i.minValue<t&&(t=i.minValue),i.maxValue>e&&(e=i.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:i,max:r}=this._adjustMinMax(t,e,s);t=Math.floor(i),e=Math.ceil(r)}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],n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed?t-n: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);return this._pts[s+2]-this._pts[s+2-1]}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];nt.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)}))}}var ri;ii.type="category",ii.defaults=ke(is.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});const ni={},oi={};class ai extends Me{}ai.defaults=ke(Me.defaults,{visible:!1});class hi extends Be{_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 nt.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}}ri=hi,hi.OFFSET=4,hi.defaults=ke(Be.defaults,{visible:void 0,position:"default",offset:ri.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class li extends Me{constructor(t){super(t.chart),this.series=t}_doPrepareRender(t){const e=this.series,s=this._res=(e._visPoints.length-1)*Math.max(1,+this._op.resolution||5),i=e._minX>0?0:(e._maxX-e._minX)/s-e._minX,r=e._minY>0?0:(e._maxY-e._minY)/s-e._minY,n=e._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+i,y:t.yValue+r}))).sort(((t,e)=>t.x-e.x));this._polar=t.isPolar(),(this["_"+this._op.type]||this._linear).call(this,n,this._points=[]),this._points.forEach((t=>{t.x-=i,t.y-=r}))}isCurved(){const t=this._op.type;return!0===this._op.curved||null==this._op.curved&&("exponential"===t||"logarithmic"===t||"power"===t)}_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){const s=t.length;if(s>1){const{m:i,a:r}=this._calcLine(t);this._polar?e.push(...t.map((t=>({x:t.x,y:i*t.x+r})))):e.push({x:t[0].x,y:i*t[0].x+r},{x:t[s-1].x,y:i*t[s-1].x+r})}}_logarithmic(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:y(t.y,0)}))),{m:r,a:n}=this._calcLine(i),o=t[0].x,a=t[s-1].x,h=(a-o)/this._res;for(let t=o;t<=a;t+=h){const s=n+Math.log(t)*r;e.push({x:t,y:s})}}}_power(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:r,a:n}=this._calcLine(i),o=Math.exp(n),a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*t**r;e.push({x:t,y:s})}}}_calcLine2(t){t.length;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){const s=t.length;if(s>1){const i=t.map((t=>({x:t.x,y:t.y}))),{m:r,a:n}=this._calcLine2(i),o=n,a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*Math.exp(r*t);e.push({x:t,y:s})}}}_polynomial(t,e){const s=t.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let e=0;e<a;e++){for(let i=0;i<s;i++)n+=t[i].x**e*t[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=t[r].x**(e+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[0].x,_=t[s-1].x,c=(_-l)/this._res;for(let t=l;t<=_;t+=c){const s=h.reduce(((e,s,i)=>e+s*t**i),0);e.push({x:t,y:s})}}}_movingAverage(t,e){const s=t.length,i=f(1,m(s-1,this._op.movingInterval));let r=i;for(;r<=s;){const s=t.slice(r-i,r).reduce(((t,e)=>t+y(e.y,0)),0);e.push({x:t[r-1].x,y:s/i}),r++}}}li.defaults=ke(Me.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2});const _i={x:"xValue",y:"yValue",z:"zValue"};class ci extends jt{constructor(t,e){super(),this.series=t,this.point=e,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return this.point._vr=t,this.series._changed(),!0}}class di extends jt{constructor(t){super(),this.points=t,this.duration=300,this.endHandler=()=>{this.points.clean(),this.points.owner._dataPointsChanged(),this.points.owner.$_stopDeleteAni(this)},t.owner.$_setDeleteAni(this)}_doUpdate(t){return this.points.forEach((e=>{e._isDeleted()&&(e._vr=1-t)})),this.points.owner._changed(),!0}}class ui extends qs{}const pi=12;class gi extends Me{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{ni[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 Ks(this),this._pointArgs={},this._paletteColors=Array(pi).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==J&&nt.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){nt.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){nt.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){nt.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){nt.log("onDataChanged")}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return gi.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}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 ii)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})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&e.push(t.xValue)}))}else this._points.forEach(((e,s)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let s=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(s)&&t&&(s=t.getValue(e.y)),e.initValues(),isNaN(e._vr)||(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),s=e._prev.yValue+(s-e._prev.yValue)*e._vr,e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=s,e.isNull=!isFinite(s)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}collectRanges(t){var e;const s=this._visPoints,i=s.length;if(i>0){const t=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(this._minY=h,this._maxY=l,this._minX=o,this._maxX=a,null===(e=this._trendline)||void 0===e?void 0:e.visible){this._trendline._prepareRender();const t=this._trendline._points.map((t=>t.y)).sort(((t,e)=>t-e));this._minY=Math.min(this._minY,t[0]),this._maxY=Math.max(this._maxY,t[t.length-1])}t.yMin=this._minY,t.yMax=this._maxY,t.xMin=this._minX,t.xMax=this._maxX,r&&(t.zMin=this._minZ=_,t.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),!isNaN(this._minY)&&t&&t.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=Q(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)),hi.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){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){if(t instanceof qs||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&this.chart.animatable()&&(s.ani=new ci(this,t),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}addPoint(t){const e=this._doAddPoint(t);if(e){if(this._points.add(e),this.chart.animatable()){const t=e._prev=e.copy();t.ani=new ci(this,e),t.ani.start()}this._dataPointsChanged()}return e}addPoints(t){const e=[];return r(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new ci(this,t),e.ani.start()})),this._dataPointsChanged()),e}_needDeleteAnimation(){return!1}removePoint(t){if(t instanceof qs||(t=this.getPointAt(t)),t){if(this._points.contains(t)&&this._needDeleteAnimation()&&this.chart.animatable())return t._setDeleted(),new di(this._points).start(),this._changed(),!0;if(this._points.remove(t))return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePoints(t){if(r(t)){const e=this._needDeleteAnimation()&&this.chart.animatable(),s=[];if(t.forEach((t=>{t instanceof qs||(t=this.getPointAt(t)),t&&(e?(t._setDeleted(),s.push(t)):this._points.remove(t)&&s.push(t))})),s.length>0)return e?(new di(this._points).start(),this._changed()):(this._doPointsRemoved(s),this._dataPointsChanged()),s.length}return 0}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders()}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new hi(t)}_createPoint(t){return new ui(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 Os.create(t,gi.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 _t)e=t._obj;else if(t instanceof _t)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 Ve?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[_i[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}$_setDeleteAni(t){this._deleteAni&&this._deleteAni.stop(),this._deleteAni=t}$_stopDeleteAni(t){this._deleteAni===t&&(this._deleteAni=null)}isDeleting(){return!!this._deleteAni}}gi.LEGEND_MARKER="rct-legend-item-marker",gi.defaults=ke(Me.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default",interactive:!0,paddingRate:1});class mi extends Ee{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 Ni&&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 Ni?n.push(...t.series):t instanceof gi&&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){const e=this.$_loadItem(this.chart,t,this._series.length);if(e)return this._items.push(e),this._series.push(e),this.$_add(e),e}remove(t){let e;if(t instanceof gi?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(Es[e++%Es.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 Pi&&(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 gi._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Si||(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 fi extends gi{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new li(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}fi.defaults=ke(gi.defaults,{});class xi extends Me{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)}}xi.defaults=ke(Me.defaults,{radius:3});class yi extends qs{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 bi extends Me{_doSetSimple(t){return o(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}bi.defaults=ke(Me.defaults,{curved:!0});class wi extends hi{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new bi(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")}}wi.defaults=ke(hi.defaults,{visible:!0,convergent:!0,align:Is,dedupeMode:Gs});class vi extends Me{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,qs.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=vi.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=H(t.minValue,!0)}}vi.DEF_COUNT=10,vi.defaults=ke(Me.defaults,{visible:!1,x:"기타"});class Si extends gi{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new vi(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}_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=H(v(s,e._op.center,Si.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=H(v(i,e._op.center,Si.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)))}}Si.DEF_CENTER="50%",Si.defaults=ke(gi.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Si.DEF_CENTER,centerY:Si.DEF_CENTER});class Vi extends Si{getRadius(t,e){return Y(this._radiusDim,m(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=H(w(t._radius=e,Vi.defaults.radius),!0))}(this,t.radius)}}Vi.defaults=ke(Si.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Pi extends fi{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)}}Pi.defaults=ke(gi.defaults,{pointWidth:1,minPointWidth:0});class Ai extends hi{get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new ai(this.chart)).init()}}Ai.defaults=ke(hi.defaults,{});class Ci extends Pi{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Ai(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=f(0,b(e.depth,t.getDepth(),Ci.DEPTH)),this._distance=t.getDistance()+y(e.distance,0)):(this._depth=f(0,y(e.depth,Ci.DEPTH)),this._distance=y(e.distance,Ci.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}_getGroupBase(){return this._op.baseValue}isBased(t){return t===this._yAxisObj}}Ci.DEPTH=10,Ci.DISTANCE=5,Ci.defaults=ke(Pi.defaults,{nullAsBase:!1});class ki extends Pi{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 Li extends ki{}class Ni extends Me{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{oi[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{oi[t.seriesType]=t}))}static collectTooltipText(t,e,s,i){let r=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,n)=>{let o;e!==s?e.needAxes()&&(o=e.getPointAt(i.xValue)):o=i,o&&(r&&(r+="<br>"),r+=t.tooltipRow.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+n+"."))})),r+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",r}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"),gi.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return Ni.collectTooltipText(this._op,this._visibles,t,e)}getTooltipParam(t,e,s){return Ni.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){this._visibles.forEach((e=>{e.collectRanges(t)}))}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,Ni.LAYOUT_MAX);return t>0?t:Ni.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=!nt.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(gi._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(gi._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)}}}}Ni.LAYOUT_MAX=100,Ni.defaults=ke(Me.defaults,{layout:"default",layoutMax:Ni.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class Mi extends Ni{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Ei extends Ni{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}}Ei.defaults=ke(Ni.defaults,{groupWidth:1,groupPadding:.1});class Ti extends fi{isMarker(){return!0}isXY(){return!0}}Ti.defaults=ke(gi.defaults,{colorByPoint:!1});class Bi extends Me{}class Oi extends Me{}const Ri={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Di={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Fi={minPadding:0,maxPadding:0};class $i extends Me{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new Bi(e)).init(),t.mask=(this._mask=new Oi(e)).init(),t.borderLine=(this._borderLine=new Me(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return y(this._op.thickness,$i.defaults.thickness)}getGap(){return y(this._op.gap,$i.defaults.gap)}getGapFar(){return y(this._op.gapFar,$i.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,Ri[t]())}else s.series=Ri.area();i(e.xAxis)?s.xAxis=_({},e.xAxis,(Di[e.xAxis.type]||Di.linear)(),Fi):s.xAxis=_({},Fi),i(e.yAxis)?s.yAxis=_({},e.yAxis,(Di[e.yAxis.type]||Di.linear)(),Fi):s.yAxis=_(Di.linear(),Fi),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()}}$i.defaults=ke(Me.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Ii extends Me{_isVisible(){return this._op.visible&&!$(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ii.defaults=ke(Me.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class zi extends Ii{}zi.defaults=ke(Ii.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Gi extends Me{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}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)}_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?ft.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Bt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Gi.defaults=ke(Me.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});const Hi="vline",ji="hline",Yi="line";class Xi extends De{_isVisible(){return this._op.visible&&!$(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Xi.type="image";class Wi extends De{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||Wi.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Wi.type="shape",Wi.defaults=ke(De.defaults,{width:64,height:64,shape:"square"});class Ui extends De{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!$(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?ft.getFormatter(s):L),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Bt.getFormatter(t):L)}(t.timeFormat)}}Ui.type="text",Ui.defaults=ke(De.defaults,{text:"Text"});class Zi extends We{getPoints(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 qi extends Qe{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 er&&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)&&nt.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?qi.STEP_PIXELS_P:t._isX?qi.STEP_PIXELS_X:qi.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 er&&(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 q(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(R(s));for(let e=1;e<t;e++)l.push(R(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=R(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=R(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=R(n-t));for(n=e;n<i;)r.push(n=R(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)?qi.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?qi.STEP_MULTIPLES[0]:qi.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(R(m=i));m<r;)p.push(R(m+=l));if(!u||x>u.length-2||p.length<=a)break;l=u[++x],p.length=0}return p}}qi.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],qi.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],qi.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],qi.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],qi.defaults=ke(Qe.defaults,{baseRange:!1,enableDecimals:!0});class Ki extends Je{}Ki.defaults=ke(Je.defaults,{numberFormat:"0.##"});class Qi extends Ki{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}Qi.defaults=ke(Ki.defaults,{useSymbols:!0});class Ji extends Ge{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=H(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}Ji.defaults=ke(Ge.defaults,{size:"30%",space:16,gridVisible:!0});class tr extends He{_isVisible(){return this._op.visible}}tr.defaults=ke(He.defaults,{visible:!1});class er extends is{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new tr(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=er.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=nt.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=nt.parseTuples(n)),this._baseVal=+this._op.baseValue,this._strictMin=H(t.strictMin,!0),this._strictMax=H(t.strictMax,!0),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Zi(this)}_createTickModel(){return new qi(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 er&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let a,h,{min:l,max:_}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(l=r._baseAxis.axisMin(),_=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<=l||e.options.to>=_)&&this._runBreaks.splice(t,1)}this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;if(l===_)a=[l];else if(this._runBreaks)a=this.$_calcBrokenSteps(this._runBreaks,s,l,_),l=Math.min(l,a[0]),_=Math.max(_,a[a.length-1]);else if(a=r.buildSteps(this,s,this._runBase,l,_,!1),h=a.slice(0),a.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;a.length>1&&a[0]<l;)a.shift();a.length<2&&this._fixedMin<a[0]&&a.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;a.length>2&&a[1]<=l;)a.shift();if(!isNaN(r._step))for(;a[0]>l;)a.unshift(r.getNextStep(a[0],-1))}if(l=Math.min(l,a[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;a.length>1&&_<a[a.length-1];)a.pop();a.length<2&&this._fixedMax>a[a.length-1]&&a.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;a.length>2&&a[a.length-2]>=_;)a.pop();if(!isNaN(r._step))for(;a[a.length-1]<_;)a.push(r.getNextStep(a[a.length-1],1))}_=Math.max(_,a[a.length-1])}else a.push(l+(_-l)/2);this._prevSteps=a,this._setMinMax(l,_);const c=this.$_createTicks(a,s,l,_,i);if(this._isX)if(l===_)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s);if(e){if(this._unitLen=e.len,!this._zoom||t){const s=h;let i=!1;if(t?isNaN(this._fixedMax)&&(_=this._max=Math.max(this._calcedMax+e.min,_)):(l=this._min=Math.min(this._calcedMin-e.min/2,l),_=this._max=Math.max(this._calcedMax+e.min/2,_)),c.length>1){let e,r;if(s[0]<l){for(r=-1;r<a.length-1&&s[r+1]<a[0];)r++;for(;r>=0&&(e=s[r])>=l;){const t=this.dataToAxis(c[0].value),s=this.dataToAxis(c[1].value);if(e<t&&t-e>=s-t){const t=this._createTick(0,e);c.unshift(t),a.unshift(e),i=!0}r--}}if(s[s.length-1]>_){for(r=s.length;r>0&&s[r-1]>a[a.length-1];)r--;for(;r<s.length&&(e=s[r])<=_;){const t=this.dataToAxis(c[c.length-1].value),s=this.dataToAxis(c[c.length-2].value);if(e>=t&&e-t>=t-s){const t=this._createTick(0,e);c.push(t),a.push(e),i=!0}r++}}else if(t&&_>s[s.length-1])for(;(e=a[a.length-1])<_;){const t=this.dataToAxis(c[c.length-1].value),s=this.dataToAxis(c[c.length-2].value);if(!(R(_-t)>R(t-s)))break;{const r=this._createTick(0,e+R(t-s));c.push(r),a.push(r.value),i=!0}}i&&c.forEach(((t,e)=>t.index=e))}}}else this._unitLen=1}return c}$_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){if(this._runBreaks){const s=this._sects.find((t=>e<t.to))||this._lastSect,i=s.len*(e-s.from)/(s.to-s.from);return this._op.reversed?D(t-i-s.pos):D(i+s.pos)}{let s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return this._op.reversed&&(s=t-s,isNaN(this._prevRate)||(s+=this._prevSize-t)),D(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=R(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=_),{min:S,max:V}}$_calcXUnitLength(t){const e=[];let s=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(e.push(...t._getVisiblePoints()),s++)})),0===s&&this._series.forEach((t=>{t.visible&&!t.isXY()&&e.push(...t._getVisiblePoints())})),e.length>0){const s=e.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=s.length-1;t>0;t--)s[t]===s[t-1]&&s.splice(t,1);return this._calcUnitLen(s,t,this._min,this._max)}}_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),{len:y(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new Ji(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 Ji(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 Ji(this)._initObject(),o))}}var s}}er.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],er.defaults=ke(is.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default"});class sr extends er{get label(){return this._label}_createLabel(){return new Qi(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Ni&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}sr.type="linear";const ir=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],rr=[[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]],nr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class or extends qi{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)&&nr.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>=ir[e]/2&&t<ir[e+1]/2)return this._scale=e,rr[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=ir[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=nr[a],t=ir[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 ar=[{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 hr extends Ki{_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=ar.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=Bt.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)}}}hr.defaults=ke(Ki.defaults,{useBeginningFormat:!0});class lr extends er{get label(){return this._label}_createTickModel(){return new or(this)}_createLabel(){return new hr(this)}collectValues(){this._offset=60*y(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return h(t)?t:t instanceof Date?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)}}lr.type="time",lr.subtype="date",lr.defaults=ke(er.defaults,{baseValue:NaN});class _r extends Js{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class cr extends Li{pointLabelCount(){return 2}_createLegendMarker(t,e){return Os.create(t,gi.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new _r(t)}_getBottomValue(t){return t.lowValue}}cr.type="barrange",cr.defaults=ke(Li.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class dr extends qs{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class ur extends Ci{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new dr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}ur.defaults=ke(Ci.defaults,{colorByPoint:!1,pointOffset:0});class pr extends ur{canDepth(){return!0}_createLegendMarker(t,e){return Os.create(t,gi.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}pr.type="bar";class gr extends Ei{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}))}}gr.defaults=ke(Ei.defaults,{depth:10,distance:5});class mr extends gr{_canContain(t){return t instanceof pr}}mr.type="bargroup",mr.seriesType="bar";class fr extends qt{constructor(t){super(t,gi.LEGEND_MARKER),this.add(this._back=new Os(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new ee(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){Bs.setShape(this._marker,this._shape,t,t)}}class xr extends fr{constructor(t){super(t),this.insertFirst(this._line=new ee(t)),this.insertFirst(this._area=new ee(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 yr extends fr{constructor(t){super(t),this.insertFirst(this._line=new ee(t)),this._line.setFill("none"),this.insertFirst(this._line2=new ee(t)),this._line2.setFill("none"),this.insertFirst(this._area=new ee(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 br extends ee{constructor(t,e=L,s=L){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){nt.isNumber(t)?this.setPath(Bs.line(t,e,s,i)):t&&this.setPath(Bs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Bs.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(Bs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Bs.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(Bs.line(e,t,s,t))}}class wr extends fr{constructor(t){super(t),this.insertFirst(this._line=new br(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 vr extends qs{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Sr extends xi{}Sr.defaults=ke(xi.defaults,{radius:4,hoverScale:1.75});class Vr extends hi{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Vr.ALIGN_GAP:0:t}getPosition(){return w(this._op.position,"default")}}Vr.ALIGN_GAP=4,Vr.defaults=ke(hi.defaults,{align:"center"});class Pr extends fi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Sr(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._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Vr(t)}_createPoint(t){return new vr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new wr(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}_connectNulls(){return!1}_doBuildLines(t){const e=t.length,s=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls())s.push(t.slice());else{let i=0;for(;i<e;){const r=[];for(;i<e&&t[i].isNull;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}return s}}Pr.defaults=ke(gi.defaults,{nullAsBase:!1});class Ar extends Be{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}Ar.defaults=ke(Be.defaults,{visible:!1,offset:8});class Cr extends Pr{_doInit(t){super._doInit(t),t.flag=(this._flag=new Ar(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 Br||this._group instanceof Or?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}}Cr.type=Ys,Cr.defaults=ke(Pr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class kr extends Cr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}kr.type="spline";class Lr extends vr{}class Nr extends Cr{_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 xr(t)}_createPoint(t){return new Lr(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t){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)}}Nr.type=Xs,Nr.defaults=ke(Pr.defaults,{});class Mr extends Lr{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 Er extends Vr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class Tr extends Pr{pointLabelCount(){return 2}_createLabel(t){return new Er(t)}_createLegendMarker(t,e){return new yr(t)}_createPoint(t){return new Mr(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){const e=super._doBuildLines(t),s=[];return e.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)}s.push(t,e)})),s}}Tr.type="arearange",Tr.defaults=ke(Pr.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Br extends Ni{_canContain(t){return t instanceof Cr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Br.type="linegroup",Br.seriesType=Ys,Br.defaults=ke(Ni.defaults,{lineType:"default"});class Or extends Ni{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 Nr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}Or.type="areagroup",Or.seriesType=Xs,Or.defaults=ke(Ni.defaults,{lineType:"default"});class Rr extends Lr{}class Dr extends Nr{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Rr(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 _}}Dr.type="bellcurve",Dr.defaults=ke(Nr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Fr extends qs{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 $r extends Li{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Fr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Os.create(t,gi.LEGEND_MARKER,0,0,e,e,2)}}$r.type="boxplot",$r.defaults=ke(Li.defaults,{tooltipText:"<b>${name}</b><br>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 Ir extends Qs{}class zr extends Ti{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 Ir(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)}}zr.type="bubble",zr.defaults=ke(Ti.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class Gr extends Mi{_canContain(t){return t instanceof Cr}_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 nt.makeIntArray(0,t.length)}}Gr.type="bump",Gr.seriesType=Ys;class Hr extends qs{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 jr extends Li{canCategorized(){return!0}_createPoint(t){return new Hr(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Ut;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new ee(t,gi.LEGEND_MARKER).setPath(s.end())}}jr.type="candlestick",jr.defaults=ke(Li.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Yr extends Ai{}Yr.defaults=ke(hi.defaults,{position:"inside"});class Xr extends ur{get pointLabel(){return this._pointLabel}_createLabel(t){return new Yr(t)}}Xr.type=Ws;class Wr extends gr{_canContain(t){return t instanceof Xr}}Wr.type="circlebargroup",Wr.seriesType=Ws;class Ur extends Js{}class Zr extends xi{}Zr.defaults=ke(xi.defaults,{radius:4,shape:"circle"});class qr extends Li{_doInit(t){super._doInit(t),t.marker=(this._marker=new Zr(this)).init(),t.lowMarker=(this._lowMarker=new Zr(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 Ur(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()}}qr.type="dumbbell";class Kr extends qs{}class Qr extends Ci{getSegmentSize(t){return Y(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Kr(t)}_createLegendMarker(t,e){const s=new Ut;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new ee(t,gi.LEGEND_MARKER).setPath(s.end())}}Qr.type="equalizer",Qr.defaults=ke(Ci.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class Jr extends Li{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Js(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Ut).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new ee(t,gi.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}Jr.type="errorbar",Jr.defaults=ke(Li.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class tn extends yi{}class en extends tn{constructor(t,e){super(t),this.points=e}}class sn extends wi{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?sn.ENDED_DIST:sn.OUTSIDE_DIST:this._op.distance||0}}sn.OUTSIDE_DIST=25,sn.ENDED_DIST=10;class rn extends Si{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:nt.clamp(Y(this._neckWidthDim,t),this._minNeckWidth,t),height:nt.clamp(Y(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new sn(t)}_createPoint(t){return new tn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new en(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=j(e._width,rn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=j(e._height,rn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=j(e._neckWidth,rn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=j(e._neckHeight,rn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}rn.type="funnel",rn.defaults=ke(Si.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class nn extends qs{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 on={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 an extends fi{getBinCount(t){const e=y(this._op.binWidth,0);if(e>0)return t/e;return y(this._op.binsNumber,0)<1?on[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new nn(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 Os.create(t,gi.LEGEND_MARKER,0,0,e,e,2)}}an.type="histogram",an.defaults=ke(gi.defaults,{baseValue:0,binsNumber:"squreRoot"});class hn extends xi{}hn.defaults=ke(xi.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class ln extends qs{_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 _n extends Ci{_doInit(t){super._doInit(t),t.marker=(this._marker=new hn(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 ln(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()}}_n.type="lollipop";class cn extends Hr{}class dn extends jr{_createPoint(t){return new cn(t)}_createLegendMarker(t,e){const s=new Ut;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new ee(t,gi.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}dn.type="ohlc";class un extends vr{}class pn extends Pr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new un(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=ke(Pr.defaults,{curved:!1});class gn extends yi{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 mn extends gn{constructor(t,e){super(t),this.points=e}}class fn extends Be{getDefaultIconPos(){return"left"}}class xn extends wi{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?Y(this._distanceDim,e,0):t?Y(s?xn.INNER_DIST:xn.INSIDE_DIST,e):"far"===this._op.align?xn.ENDED_DIST:xn.OUTSIDE_DIST}}xn.INSIDE_DIST=H("30%",!1),xn.INNER_DIST=H("50%",!1),xn.OUTSIDE_DIST=25,xn.ENDED_DIST=10,xn.defaults=ke(wi.defaults,{radius:.7,rotationMode:"arc"});class yn extends Me{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,yn.DEPTH_RATIO)))}}yn.DEPTH_RATIO=.6,yn.defaults=ke(Me.defaults,{visible:!1,length:25,ratio:yn.DEPTH_RATIO});class bn extends Vi{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new fn(this.chart)).init(),t.depth=(this._depth=new yn(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 xn(t)}_createPoint(t){return new gn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new mn(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}}bn.type="pie",bn.defaults=ke(Vi.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class wn extends Ni{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=H(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=H(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof bn}_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}))}}wn.type="piegroup",wn.seriesType="pie",wn.defaults=ke(Ni.defaults,{polarSize:"80%",innerSize:0});class vn extends qs{}class Sn extends Ti{_createPoint(t){return new vn(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}_createLegendMarker(t,e){return new fr(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}}Sn.type="scatter",Sn.defaults=ke(Ti.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Vn extends qs{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 Pn extends hi{}Pn.defaults=ke(hi.defaults,{offset:0});class An extends ki{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Pn(t)}_createPoint(t){return new Vn(t)}_createLegendMarker(t,e){return Os.create(t,gi.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}}An.type="waterfall",An.defaults=ke(ki.defaults,{tooltipText:"<b>${name}</b><br>${series}:<b> ${y}</b>"});class Cn extends qi{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}}Cn.defaults=ke(qi.defaults,{arrangeDecimals:!0});class kn extends er{_isLog(){return!0}_createLabel(){return new Qi(this)}_createTickModel(){return new Cn(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,R(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}}}kn.type="log",kn.defaults=ke(er.defaults,{logBase:10,roundThrrehold:500});class Ln extends Me{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)}}Ln.defaults=ke(Me.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Nn extends Me{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"}}Nn.defaults=ke(Me.defaults,{scope:"auto"});class Mn extends Me{_doInit(t){t.pointHovering=(this._pointHovering=new Nn(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 En;Mn.defaults=ke(Me.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"}(En||(En={}));class Tn extends ht{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new ct,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Ae,(this._chartOptions=new Mn(this)).init(),(this._title=new Ii(this)).init(),(this._subtitle=new zi(this)).init(),(this._legend=new Ms(this)).init(),(this._credits=new Ln(this)).init(),(this._tooltip=new Gi(this)).init(),Tn.split_class&&(this._split=new Tn.split_class(this)).init(),(this._body=new ks(this)).init(),(this._navigator=new $i(this)).init(),(this._exporter=new Ls(this)).init(),this._series=new mi(this),this._xAxes=new rs(this,!0),this._yAxes=new rs(this,!1),this._gauges=new cs(this),this._annotations=new Fe(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},Tn.defaults)}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new Tn(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()))}getTooltipText(t,e){return Ni.collectTooltipText(this.axis.options,this.series,t,e)}getTooltipParam(t,e,s){return Ni.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 hs?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}_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()}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 En.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case En.RIGHT:r=s.filter((t=>t._isOpposite));break;case En.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case En.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case En.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case En.RIGHT:r=i.filter((t=>t._isOpposite));break;case En.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case En.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 Tn.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)&&Ne(n={},r.base),i(r[s])&&(n||(n={}),Ne(n,r[s])),n?Ne(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),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 Me||s instanceof Ee||s instanceof Ae)&&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.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);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:{}};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"].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 Ne(Ne({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?Ne(Ne({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&oi[t.toLowerCase()]}_getSeriesType(t){return o(t)&&ni[t.toLowerCase()]}_getAxisType(t){return o(t)&&ze[t.toLowerCase()]}_getGaugeType(t){return o(t)&&os[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&as[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Re[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)}}Tn.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},is.register(ii,sr,kn,lr),gi.register(Nr,Tr,cr,pr,Dr,$r,zr,jr,Xr,qr,Qr,Jr,rn,an,Cr,kr,_n,dn,pn,bn,Sn,An),Ni.register(Or,mr,Gr,Wr,Br,wn),Ni.registerSeries(Or,mr,Wr,Br,wn),De.register(Xi,Wi,Ui);const Bn="$ctrl";class On{constructor(t,e){this._modelCallback=e,this._obj=new Tn(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Bn]=null===(t=this[Bn])||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";nt.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Tn(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,nt.log("chart-items:",Ce),nt.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[Bn].refresh()}}class Rn{constructor(t,e){this._obj=new _t(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 Dn extends at{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const Fn=Object.freeze({x:0,y:0,width:0,height:0});function $n(t){return{width:t.width,height:t.height}}const In=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))]))},zn=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},Gn=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},Hn=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},jn=function(t,e){const s=In(t),i=In(e),r=zn(s),n=zn(i);for(const t of[...r,...n]){const e=Gn(s,t),r=Gn(i,t);if(!Hn(e,r))return!1}return!0},Yn=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 Xn{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Xn(t,t,t,t):new Xn(t,t,e,e):new Xn(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 Xn(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}}}Xn.Empty=Object.freeze(new Xn),Xn.Temp=new Xn;class Wn extends qt{constructor(t,e=L){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Wn.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Wn.IGNORE_ATTRS={width:"",height:""};class Un extends qt{constructor(t,e=L){super(t,e,"g"),qt.DEBUGGING&&(this.add(this._debugRect=new Os(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 Os(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 Zn extends Un{constructor(t,e,s){super(t,e),this._margins=new Xn,this._paddings=new Xn,this.add(this._background=new Os(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 qn extends Wn{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 Kn extends Un{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 Qn extends qt{constructor(t,e,s){super(t,s,"image"),this._bounds=Fn,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&&!rt||(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&&($(t)||$(e))&&(t>0&&$(e)?e=t/i.width*i.height:e>0&&$(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class Jn extends Wn{constructor(e,s=L){super(e),this.add(this._text=new le(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 Os(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 le(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 Qn(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=Ot.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 le(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 to extends jt{constructor(t,e,s,i,r){super(),this._axis=t,this._prevSize=e,this._prevMin=s,this._prevMax=i,this.start(r)}_doUpdate(t){if(this._axis.parent){const e=this._axis.model,s=this._prevMax-this._prevMin,i=(e.axisMax()-e.axisMin())/s;return t=i+(1-i)*t,e.setPrevRate(this._prevSize,t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(this._prevSize,NaN),this._axis=null}}class eo extends Zn{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new le(t)),this._richText=new xe}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=$n(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===et||i===st;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 so extends Zn{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new le(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new xe}_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),$n(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 io extends Un{constructor(t){super(t,ho.TICK_CLASS),this.add(this._lineView=new br(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class ro extends Jn{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 no extends qt{constructor(t){super(t,void 0),this.add(this._back=new ee(t,"rct-crosshair-flag")),this.add(this._text=new le(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 Ut,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 oo extends Un{static isThumb(t){return t.classList.contains(oo.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Os(t,oo.TRACK_CLASS)),this.add(this._thumbView=new Os(t,oo.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)}}}oo.CLASS_NAME="rct-axis-scrollbar",oo.TRACK_CLASS="rct-axis-scrollbar-track",oo.THUMB_CLASS="rct-axis-scrollbar-thumb";const ao=/\${label}.*?/g;class ho extends Un{constructor(t){super(t,ho.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new br(t,ho.LINE_CLASS)),this.add(this._titleView=new eo(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 so(t)),this._labelViews=new Dn(this._labelContainer,ro,"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 oo(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 no(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.options.animatable&&new to(this,s.chart.isInverted()?this.mw:this.mh,t,e,(()=>{this.invalidate()}))}}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 br(t,ho.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&&nt.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 io(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(ao)?t.setLabel(s,a,e,n.replace(ao,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 er)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 ii&&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)}}ho.AXIS_CLASS="rct-axis",ho.LINE_CLASS="rct-axis-line",ho.TICK_CLASS="rct-axis-tick";class lo extends qt{constructor(t,e,s){super(t,lo.STYLE),this.add(this._back=new Os(t,lo.BACK_STYLE)),this.add(this._textView=new le(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 Xn).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}}lo.STYLE="rct-button",lo.BACK_STYLE="rct-button-background";class _o extends qt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class co extends ee{setArc(t,e,s,i,r,n){this.setPath(Bs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class uo extends co{setPolyline(t){this.setPath(Bs.polygon(...t))}}class po extends ee{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 Bs.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 Bs.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 go={};class mo extends Zn{static register(...t){t.forEach((t=>{go[t[0].type]=t[1]}))}constructor(t,e){super(t,mo.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)}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)}}mo.CLASS_NAME="rct-annotation";const fo={};class xo extends Kn{static register(...t){t.forEach((t=>{fo[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Os(t,xo.PANE_CLASS)),this.add(this._contentContainer=new Kt(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return xo.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 wo)return t;t=t.parent}}}xo.GAUGE_CLASS="rct-gauge",xo.PANE_CLASS="rct-gauge-pane";class yo extends jt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class bo extends Jn{}class wo extends xo{_defaultCalss(){return wo.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Kt(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))}))}}wo.GAUGE_GROUP_CLASS="rct-gauge-group";class vo{static reveal(t,e){new Po(t,e)}static grow(t,e){new Co(t,e)}static spread(t,e){new ko(t,e)}static fadeIn(t){new So(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class So extends vo{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:jt.DURATION,fill:"none"})}}class Vo extends vo{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=Vo.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:jt.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 Po extends jt{constructor(t,e){super(),this._series=t,this._cr=Vo.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 Ao extends jt{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 Co extends Ao{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class ko extends Ao{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Lo extends Ao{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}var No;class Mo extends jt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Io.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(Io.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Eo extends Jn{constructor(t){super(t,"rct-point-label")}}class To extends Kt{constructor(t){super(t,"rct-point-labels"),this._labels=[new Dn(this,Eo),new Dn(this,Eo)],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(Yn(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Hs)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(jn(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});jn(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(jn(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});jn(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===js&&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 Bo extends Wn{constructor(t){super(t),this.add(this._line=new ee(t))}setLine(t){this._line.setPath(t)}}class Oo extends Wn{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Dn(this,Bo)}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 Ro extends Kt{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 Do={},Fo="rct-point-hover",$o="rct-point-unhover";class Io extends Kn{static register(...t){t.forEach((t=>{Do[t[0].type]=t[1]}))}static isPointDom(t){for(;t instanceof SVGElement;){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 Ro(t,"rct-series-points")),this._labelContainer=new To(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===tt,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(Fo).addClass($o)}))):this._getPointPool().forEach((t=>{t.containsClass($o)&&t.removeClass($o).addClass(Fo)}))}_clearHoverClasses(t){t instanceof qt&&t.removeClass(Fo).removeClass($o)}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.stop(),e.setBoolData(Io.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Ko&&r.push(new Mo(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.stop(),t instanceof qt&&(t.setBoolData(Io.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Ko?r.push(new Mo(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof ta&&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&&Ht(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 fi&&e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new ee(t,"rct-series-trendline")),this._trendLineView.setVis(!0)):this._trendLineView&&this._trendLineView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.model.pointLabel;this._labelOverlap={model:t,inverted:this._inverted,width:this.width,height:this.height,fit:t._overflowFit,outline:t.options.overlapOutline,contrast:t.options.overlapContrast},this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(this._inverted),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new Lo(this,(()=>{this.invalidate()}))}_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._animating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return y(this._growRate,1)}_getPosRate(){return y(this._posRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0||this.model.isDeleting()}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.line(t[r+1].px,t[r+1].py);const n=.35,o={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].px-t[r].px,y:t[r+1].py-t[r].py};let _={x:0,y:0},c=Math.sqrt(l.x*l.x+l.y*l.y);if(0===c)return void i.line(t[s].px,t[s].py);l.x/=c,l.y/=c;let d=t[r+1].px-t[r].px,u=t[r].px,p=t[r].py;for(++r;r!=s;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].px-t[r].px,l.y=t[r+1].py-t[r].py,c=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=c,l.y/=c,l.x<h.x?(_.x=h.x-l.x,_.y=h.y-l.y):(_.x=l.x-h.x,_.y=l.y-h.y);const e=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=e,_.y/=e,h.y*l.y>=0&&(_={x:1,y:0}),o.x=-_.x*d*n,o.y=-_.y*d*n;const s=u+a.x,g=p+a.y,m=t[r].px+o.x,f=t[r].py+o.y;i.curve(s,g,m,f,t[r].px,t[r].py),d=t[r+1].px-t[r].px,a.x=_.x*d*n,a.y=_.y*d*n,u=t[r].px,p=t[r].py}i.curve(u+a.x,p+a.y,t[r].px,t[r].py,t[r].px,t[r].py)}_drawClosedSpline(t,e,s){const i=t.length;if(i<3)return void e.line(t[1].px,t[1].py);const r=.17,n=s?e=>t[(e+i)%i]:e=>e<0?t[0]:e>=i?t[i-1]:t[e];for(let t=0,o=i-(s?0:1);t<o;t++){const s=n(t-1),i=n(t),o=n(t+1),a=n(t+2),h=i.px+(o.px-s.px)*r,l=i.py+(o.py-s.py)*r,_=o.px-(a.px-i.px)*r,c=o.py-(a.py-i.py)*r;e.curve(h,l,_,c,o.px,o.py)}}$_renderTrendline(t){const e=this.model;if(!(e instanceof fi))return;const s=e.chart.isPolar(),i=e.trendline,r=e._xAxisObj,n=e._yAxisObj,o=n._vlen,a=r._vlen;let h;if(s){const t=e.chart._body.getPolar(r);h=i._points.map((e=>{const s=t.start+r.getPos(a,e.x),i=n.getPos(t.rd,e.y);return{x:t.cx+i*u(s),y:t.cy+i*p(s)}}))}else h=i._points.map((e=>{let s,i;return t?(i=a-r.getPos(a,e.x),s=n.getPos(o,e.y)):(s=r.getPos(a,e.x),i=o-n.getPos(o,e.y)),{x:s,y:i}}));if(this._trendLineView.setVis(h.length>1)){this._trendLineView.setStyleOrClass(i.options.style);const t=new Ut;t.move(h[0].x,h[0].y),i.isCurved()&&!s?this._drawSpline(h.map((t=>({px:t.x,py:t.y}))),0,-1,t):(s&&i.isCurved(),t.lines(...h)),this._trendLineView.setPath(t.end(!1))}}_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[X]?t.internalSetStyle(X,e[X]):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!==$s)if(l?c!==Fs&&c!==Ds||(d*=-1):c===Ds&&(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}}Io.POINT_CLASS="rct-point",Io.DATA_FOCUS="focus",Io.DATA_UNFOCUS="unfocus",Io.DATA_UNHOVER="unhover",Io.LEGEND_MARKER="rct-legend-item-marker";class zo extends ee{constructor(t){super(t,Io.POINT_CLASS)}savePrevs(){}}class Go extends zo{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class Ho extends qt{constructor(t){super(t,Io.POINT_CLASS)}savePrevs(){}}class jo extends Ho{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Yo=class extends Go{layout(t,e,s,i,r,n,o){this.x=t,this.setPath(Bs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class Xo extends jo{constructor(t){super(t),this.add(this._topView=new ee(t)),this.add(this._frontView=new ee(t)),this.add(this._sideView=new ee(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(rt&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Bs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Bs.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Ot.interpolate(o?Ot.BLACK:Ot.WHITE,l,.2)),this._sideView.setPath(Bs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Ot.interpolate(o?Ot.WHITE:Ot.BLACK,l,.2))}}class Wo extends Wn{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Uo extends Io{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&&vo.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class Zo extends Uo{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Oo(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){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=this._labelLineContainer,l=s._xAxisObj,c=s._yAxisObj,d=this._yReversed,g=this._depthExt,m=s._group?s._groupDistance:s.distance,x=g?m*(i?p(this._depthAngle):u(this._depthAngle)):0,b=g?m*(i?u(this._depthAngle):p(this._depthAngle)):0,w=2*l.unitPad(),v=y(0,s.options.minPointWidth),S=this._yLen=c.prev(i?t:e),V=l.prev(i?e:t),P=t=>c.getPos(S,t),A=t=>l.getPos(V,t),C=i?0:e,k=c.valueMin(),L=c.getPos(S,k),N=this._baseVal=s.getBaseValue(c),M=!isNaN(N),E=this._yBase=y(P(f(k,y(N,L))),L),T=this._pointOff,B=a&&_(this._labelInfo,{inverted:i,reversed:d,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:x,distY:b,side:this._side,base:this._base});a&&h.setVis(s.pointLabel.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(s.pointLabel.line._style),h.prepare(s),B.pb=new Ut),this._prepareLayoutPoints(t,e),this._getPointPool().forEach(((h,_)=>{const c=h.point;if(h.setVis(!c.isNull)){const d=l.getUnitLen(V,c.xValue)*(1-w);let u=s.getPointWidth(d,v),p=P(c.yGroup),g=E;if(c.yGroup!=c.yValue){const t=N>c.yGroup,e=c.yGroup<0,s=c.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=c.yGroup-c.yValue*(i?-1:1);g=P(r)}const m=(p-g)*r;let f=A(c.xValue)-d/2,y=C-p;if(isNaN(f)){const t=l.getUnitLen(V,c.xValue)*(1-w);f=A(c.xValue)-t/2}isNaN(n+h.wSave)||(u=h.wSave+(u-h.wSave)*n),f+=s.getPointPos(d)+u/2,isNaN(n+h.xSave)||(f=h.xSave+(f-h.xSave)*n),c.xPos=f+=u*T,c.yPos=y,this._layoutPoint(h,_,f-x,C-E*(1-r)-g*r+b,u,m),i&&(y=V-A(c.xValue)+d/2,f=C,c.yPos=y-=s.getPointPos(d)+u/2+u*T,c.xPos=f+=M?P(c.yGroup)*r:P(c.yGroup*r)),B&&(B.labelView=a.get(c,0))&&(B.pointView=h,B.x=f,B.y=y,B.wPoint=u,B.hPoint=m,this._layoutLabel(o,B,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 qo extends Uo{_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(0,s.options.minPointWidth),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 Ko extends zo{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 Qo extends Io{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Bs[t](0-e,0-e,2*e,2*e)})),e}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!==$s){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_getDrawer(t){return No._drawers[t]||No._drawers.circle}_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)}}}No=Qo,Qo._drawers=Object.assign({circle:t=>Bs.circle(0,0,t),none:t=>[]},No._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Jo extends jt{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 ta extends Io{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.stop(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new Jo(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Os.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 ea extends mo{constructor(t){super(t,ea.CLASS_NAME),this.addToTransform(this._imageView=new Qn(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._imageView.setImage(this.model.options.imageUrl,n.width,n.height);const o=this._imageView.getBBox();return this._inflaePaddings(o),$n(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}ea.CLASS_NAME="rct-image-annotation";class sa extends mo{constructor(t){super(t,sa.CLASS_NAME),this.addToTransform(this._shapeView=new ee(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 ji:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Bs.line(g,p,g+l.width,p));break;case Hi:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Bs.line(g,p,g,p+l.height));break;case Yi: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(Bs.line(g,p,t,s));break;default:Bs.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)}}sa.CLASS_NAME="rct-shape-annotation";class ia extends mo{constructor(e){super(e,ia.CLASS_NAME),this.addToTransform(this._textView=new le(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new xe}_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=$n(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)}}ia.CLASS_NAME="rct-text-annotation";class ra extends Ko{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}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)),Bs.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 na extends Ro{}class oa extends Io{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new na(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new ee(t,"rct-line-series-line")),this._markers=new Dn(this._pointContainer,ra),this.add(this._tester=new ee(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 Cr&&(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&&vo.grow(this):t&&vo.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 ee(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 Dn(this._lineContainer,ee)),i.prepare(e.length);s.length<e.length;){const t=new te(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=R(f(0,m((M-x(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(Bs.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Bs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Bs.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Bs.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():Bs.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(Bs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Bs.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():Bs.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){const s=t instanceof Cr&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker._style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),o=s&&t.options.belowStyle,a=e.length;this._markers.prepare(a*n,((n,h)=>{const l=e[h%a];l.isNull||(n.point=l,r[1]=s&&l.yValue<i?o:null,this._setPointStyle(n,t,l,r)),n.point=l,n.index=h<a?0:1}))}else this._markers.prepare(0)}_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),Bs.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,P=this._polar=i.chart._body.getPolar(S),A=!!P,{cx:C,cy:k,rd:L,start:N,total:M}=P||{},E=V.prev(o?e:s),T=S.prev(P?M:o?s:e),B=o?0:s,O=t.length,R=V.axisMax(),D=this._yReversed,F=V instanceof sr?i.getBaseValue(V):NaN,$=F>V.axisMin(),I=V.getPos(L,F);t.forEach(((t,r)=>{let m,z,G,H;P?(G=N+S.getPos(T,t.xValue),H=D?isNaN(t.yGroup)?$?I:L:$?I+(V.getPos(L,t.yGroup)-I)*h:L-V.getPos(L,R-t.yGroup)*h:isNaN(t.yGroup)?$?I:0:$?I+(V.getPos(L,t.yGroup)-I)*h:V.getPos(L,t.yGroup)*h,m=t.px=C+H*u(G),z=t.py=k+H*p(G),t.angle=G):(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,Y=z,X=this._markers.get(r),W=v&&v.get(t,0);if(X&&X.setVis(!t.isNull&&(A||!a||m>=0&&m<=e&&z>=0&&z<=s))){this._prepareMakrer(X),this._layoutMarker(X,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(X.setStyle("opacity",e?"1":"0"),W){W.setContrast(null).layout(w);const e=W.getBBox(),s=X._radius;if(W.visible=!0,P){switch(b){case"inside":D?t.yValue<F?H-=y:H+=y:t.yValue<F?H+=y:H-=y;break;case"foot":D?t.yValue<F?H-=e.height/2+y:H+=e.height/2+y:t.yValue<F?H+=e.height/2+y:H-=e.height/2+y;break;default:D?t.yValue<F?H+=e.height/2+y:H-=e.height/2+y:t.yValue<F?H-=e.height/2+y:H+=e.height/2+y}m=C+H*u(G),z=k+H*p(G)-e.height/2,this.applyAutoRotation(W,G,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,Y,s,s,m,z,!1,null),this._layoutLabelRotation(W,e,m,z)}}else W&&W.setVis(!1)}))}_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 Cr&&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,X,"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,X,"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,X,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Cr&&"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 Ut;return"spline"===i?this._drawCurves(t,e,r):s instanceof Cr&&"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 Cr&&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),this._drawSpline(t,0,t.length-1,s))}_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 sr?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),this._drawClosedSpline(c,s,!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),this._drawClosedSpline(c,s,!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 Ut;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 aa extends oa{constructor(t){super(t,aa.CLASS),this._flagView=new Jn(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 P=h>p&&m-h>p?h-p:h>x?m-d:0,A=l>g&&f>l+g?l-g:l>y?f-u:0;switch(_){case"top":h=P,l=b?l-u-o:0;break;case"bottom":h=P,l=w?l+o:f-u;break;case"left":h=v?h-d-o:0,l=A;break;case"right":h=S?h+o:m-d,l=A}i.trans(h,l)}}}aa.CLASS="rct-line-series";class ha extends oa{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new na(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new ee(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 ee(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 Dn(this._areaContainer,ee,"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 te(s)));for(;i.length<e.length;)i.push(this.control.addClip(new te(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(X,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(X,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 sr?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:d,cyclic:g}=l,x=new Ut,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,P=!1,A=!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 Ut).push(x.end());if(r)g?x.circle(_,c,l):a&&x.push(...Bs.arc(_,c,l,l,k,L,!0)),S=x.end(),P=!0,g?N.circle(_,c,l):N.push(...Bs.arc(_,c,l,l,k,L,!0)),V=N.end(),A=!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(...Bs.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),P=!0}else S=x.end();t.setPath(S),t.setAttr("fill-rule",P?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",A?"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,W,"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,W,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new se(this.doc)));const t=Bs.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 la extends po{constructor(t){super(t,Io.POINT_CLASS)}savePrevs(){}}class _a extends Zo{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){this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),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 Dn(this._pointContainer,la)),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 sr?t.getBaseValue(o):NaN,f=g>o.axisMin(),x=o.getPos(d,g),y=this._pointOff,b=n.getTotalAngle();let w,v,S,V,P;i&&(w=this._labelInfo,v=t.getLabelPos(s),S=t.getLabelOff(s.getOffset()),V=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const A=s.point;if(s.setVis(!A.isNull)){const r=o.getPos(d,A.yGroup)*e,C=n.getUnitLen(b,A.xValue)*(1-h),k=t.getPointWidth(C,0);let L,N,M=l.start+n.getPos(b,A.xValue)-C/2;if(M+=k*y,M+=t.getPointPos(C)+k/2,a?f?(L=x+(o.getPos(d,A.yGroup)-x)*e,N=x):(L=d,N=o.getPos(d,A.yGroup*e)):f?(L=x+(o.getPos(d,A.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,A.xPos=_+s.rx*u(M),A.yPos=c+s.ry*p(M),i&&(P=w.labelView=i.get(A,0))){P.layout(V);const{width:t,height:e}=P.getBBox(),i=s.ry,r=s.innerRadius*d;let o,h;o=a?f?A.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?A.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&&P.setContrast(s.dom),this.applyAutoRotation(P,M,l.total,n.options.totalAngle),P.trans(o-t/2,h-e/2)}}}))}}class ca extends _a{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new Dn(t,Xo):new Dn(t,Yo)}_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)}}class da extends Wo{constructor(t){super(t,Io.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 br(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new br(t,"rct-boxplot-point-stem")),this.add(this._box=new Os(t,"rct-boxplot-point-box")),this.add(this._mid=new br(t,"rct-boxplot-point-mid")),this.add(this._min=new br(t,"rct-boxplot-point-min")),this.add(this._max=new br(t,"rct-boxplot-point-max"))}}class ua extends Ko{}let pa=class extends Wo{constructor(t){super(t,Io.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 br(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new br(t,"rct-candlestick-point-wick")),this.add(this._body=new Os(t))}};class ga extends zo{layout(t,e,s){const i=new Ut;i.circle(t,e,s),this.setPath(i.end())}}let ma=class extends Wo{constructor(t){super(t,Io.POINT_CLASS),this.add(this._line=new br(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new ee(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new ee(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),Bs.setShape(r,o.shape,a,a),Bs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};let fa=class extends Wn{constructor(t){super(t,Io.POINT_CLASS),this._segments=new Dn(this,ee),this._decimal=0,this.add(this._back=new ee(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(Bs.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Bs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Bs.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}};let xa=class extends Wo{constructor(t){super(t,Io.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new br(t)),this.add(this._whiskerUp=new br(t)),this.add(this._whiskerDown=new br(t)),this.add(this._back=new Os(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 ya extends zo{}let ba=class extends Go{layout(t,e){this.setPath(Bs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class wa extends Wn{constructor(t){super(t,Io.POINT_CLASS),this.add(this._line=new br(t,"rct-lollipop-point-bar")),this.add(this._marker=new ee(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),Bs.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class va extends Wo{constructor(t){super(t,Io.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 br(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new br(t,"rct-ohlc-point-tick")),this.add(this._bar=new br(t)),this.add(this._back=new Os(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class Sa extends ee{setOff(t){return this.off=x(t),this}}class Va extends po{constructor(t){super(t,Io.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class Pa extends qt{constructor(t){super(t,Io.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new po(t))}setSides(t,e,s,i,r){const n=this.point,o=R(N),a=R(((t?n.startAngle:n.startAngle+n.angle)+N/2+M)%M),h=R(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=Bs.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;rt&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Bs.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(Bs.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(Bs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Bs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Bs.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Bs.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",Ot.interpolate("#000",r,.2)),this._side2View.setStyle("fill",Ot.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",Ot.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",Ot.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Io.DATA_FOCUS,t),this._side2View.setBoolData(Io.DATA_FOCUS,t),this._inArcView.setBoolData(Io.DATA_FOCUS,t),this._outArcView.setBoolData(Io.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 Aa extends Ko{setHoverRate(t,e,s){const i=this.point,r=t._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}}function Ca(t,e){return new(go[e._type()])(t)}function ka(t,e){return new(Do[e._viewType()])(t)}Io.register([Nr,ha],[Tr,class extends oa{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new na(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new ee(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new ee(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 P,A,C;this._prepareMakrer(S),a?(P=f.px2=l.getPos(_,f.lowValue),A=f.py2=v.get(i).ty+S._radius):(P=f.px2=f.xPos,A=f.py2=f.yLow);const k=P,L=A;if(S&&S.setVis(!f.isNull&&P>=0&&P<=e&&A>=0&&A<=s)){if(this._layoutMarker(S,n,P,A),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":A-=w;break;case"foot":A-=t.height/2+w;break;default:A+=t.height+w}P=m.cx+A*u(C),A=m.cy+A*p(C)-t.height/2,this.applyAutoRotation(V,C,m.total,h.options.totalAngle)}else switch(x){case"inside":A-=t.height/2+w;break;case"foot":A+=w+(o?e:0);break;default:A-=t.height+w+(o?e:0)}switch(y){case"left":P-=t.width+(o?e:0)+b;break;case"right":P+=(o?e:0)+b;break;default:P-=t.width/2+b}this._checkLabelOverlap(V,t,k,L,e,e,P,A,!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)}}],[pr,ca],[cr,class extends qo{constructor(t){super(t,"rct-barrange-series"),this._bars=new Dn(this._pointContainer,Yo)}_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)}}],[Dr,class extends ha{constructor(t){super(t,"rct-bellcurve-series")}}],[$r,class extends qo{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Dn(this._pointContainer,da)}_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)}}],[zr,class extends Qo{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new Dn(t,ua)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&vo.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){t.getShape();const s=e.length;this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),o=this._getGrowRate(),a=+i.rotation||0,h=s.pointLabel,l=h.options.position,_=h.getOffset(),c=this._labelContainer._textAlign,d=this._labelViews(),g=s._xAxisObj,m=s._yAxisObj,f=this._polar=s.chart._body.getPolar(g),x=m.prev(r?t:e),y=g.prev(f?M:r?e:t),b=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:w,max:v}=s.getPixelMinMax(b),S=r?0:e,V=this._getDrawer(i.shape);let P;this._markers.forEach(((i,h)=>{const b=i.point,A=d&&(P=d.get(b,0));if(i.setVis(!b.isNull&&!isNaN(b.zValue))){const h=(i._radius=s.getRadius(b.zValue,w,v))*o;let d,C;if(f){const t=f.start+g.getPos(y,b.xValue),e=m.getPos(f.rd,b.yValue);d=f.cx+e*u(t),C=f.cy+e*p(t)}else d=g.getPos(y,b.xValue),C=S-m.getPos(x,b.yValue),r&&(d=m.getPos(x,b.yValue),C=e-g.getPos(y,b.xValue));b.xPos=d,b.yPos=C,i.setVis(!n||d>=0&&d<=t&&C>=0&&C<=e)?(i.setPath(V(h)).trans(d,C).rotate(a),A&&(P.setContrast(i.dom).layout(c),this._layoutLabelView(P,l,_,h,d,C))):A&&A.setVis(!1)}else A&&A.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}}],[jr,class extends qo{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Dn(this._pointContainer,pa)}_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)}}],[Xr,class extends _a{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Dn(t,ga)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}],[qr,class extends qo{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Dn(this._pointContainer,ma)}_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)}}],[Qr,class extends Zo{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Dn(this._pointContainer,fa)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_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)}}))}}],[Jr,class extends qo{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Dn(this._pointContainer,xa)}_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)}}],[rn,class extends ta{constructor(t){super(t,"rct-funnel-series"),this._segments=new Dn(this._pointContainer,ya),this.add(this._lineContainer=new Oo(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&&vo.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=R(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=R(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-P):y+(V-y)*(t-b)/(P-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 Ut,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,P=d?w-S:b+S,A=[],C=new Ut,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,R,D;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),R=s(E),D=R+2*(v-R),m.move(B,M).lines(O,M,D,E,R,E),i.ny=NaN,i.nx1=R-B,i.nx2=D-B):(B=s(M),O=B+2*(v-B),R=V,D=R+g.width,m.move(B,M).lines(O,M,D,P,D,E,R,E,R,P),i.nx1=R-B,i.nx2=D-B,i.ny=x(P-M),i.nx3=R,i.nx4=D),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+(D-R))/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),A.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(A,c,E):(null==r?void 0:r.arrangeVertical(this,A,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))}}],[an,class extends Uo{constructor(t){super(t,"rct-histogram-series"),this._bars=new Dn(this._pointContainer,ba)}_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)}))}}],[Cr,aa],[_n,class extends Zo{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_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 Dn(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)}))}}],[dn,class extends qo{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Dn(this._pointContainer,va)}_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)}))}}],[pn,class extends oa{constructor(t){super(t,"rct-pareto-series")}}],[bn,class extends ta{constructor(e){super(e,"rct-pie-series"),this._deep=!1,this._pb=new Ut,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 _o(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Jn(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new Kt(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Oo(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&&vo.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 Va||t instanceof Pa)&&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 Pa&&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 Dn(this._pointContainer,Pa,null),n=this._sides=new Dn(this._sideContainer,Sa,"rct-pie-series-side")):this._sectors=new Dn(this._pointContainer,Va,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=R(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,_),P=m.getAlign();let A=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||A||P||(A="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,R=0;if(o&&n>=1&&!t.isDomAnimating()&&(C+=u(y)*k,R+=p(y)*k),t.trans(C,R).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,A,r,V,o?k:0)):(n=-1===P?this.$_layoutLabelAligned(!1,m,B,A,O,S,f,r,V,o?k:0):1==P?this.$_layoutLabelEnded(!1,m,B,A,O,S,f,r,V,o?k:0,E,e,s):this.$_layoutLabelOutside(!1,m,B,A,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 R=m.options.convergent,D=m.options.dedupeMode,F=m.options.overflow;b&&(w||0===P?"preserveOrder"!==D&&"largestFirst"!==D||b.dedupe(M,C,D):b.arrangeVertical(this,L,C,s,R,D,F)+b.arrangeVertical(this,N,C,s,R,D,F)>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===P?this.$_layoutLabelAligned(!0,r,B,A,O,S,f,n,V,t?k:0):1==P?this.$_layoutLabelEnded(!0,r,B,A,O,S,f,n,V,t?k:0,E,e,s):this.$_layoutLabelOutside(!0,r,B,A,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 P,A,C,k=g+p(c)*f;if(v?(P=d+u(Math.PI)*m-h,A=P-S.width-a,C=d+u(Math.PI)*x-h,S.width):(P=d+u(0)*m+h,A=P+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-P),e,b-P,0).end()):r.setLine(n.reset(0,e).line(b-P,0).end()),r.setPos(P,k),!_&&r.trans(P,w)}return t||(s.setPos(A,k-S.height/2),!_&&s.trans(A,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 P=S<f;!t&&!g&&s.layout(i||(P?"right":"left"));const A=s.getBBox(),C=V-A.height/2;let k,L,N,M=x+p(m)*b;if(P?(k=h+_+a,N=h+_-A.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-A.height/2),!g&&s.trans(N,M-A.height/2)),P}$_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 P=S<g;let A,C;return P?(A=S-.2*h,C=A):(A=S+.2*h,C=A),r&&r.setVis(f>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,A-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,A-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+y,v+b)),t||(P?C-=c.width+a:C+=a,V-=c.height/2,s.setPos(C,V),!_&&s.trans(C+y,V+b)),P}$_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===zs?.3:h.options.align===Is?.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))}}}],[Sn,class extends Qo{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Dn(t,Aa)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,vo.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=a.prev(r?t:e),w=o.prev(h?M:r?e:t),v=r?0:e;let S;this._markers.forEach(((i,m)=>{const V=i.point,P=y&&(S=y.get(V,0));if(i.setVis(!V.isNull)){const m=this._getDrawer(s.getShape(V)),y=nt.jitter(V.xValue,d),A=nt.jitter(V.yGroup,g);let C,k;if(h){const t=h.start+o.getPos(w,y),e=a.getPos(h.rd,A)*l;C=h.cx+e*u(t),k=h.cy+e*p(t)}else C=o.getPos(w,y),k=v-a.getPos(b,A),r&&(C=a.getPos(b,A),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),P&&this._layoutLabelView(S,f,x,t,C,k)}else P&&P.setVis(!1)}else P&&P.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}}],[An,class extends qo{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Dn(this._pointContainer,Yo),this.add(this._lineContainer=new Kt(t,"rct-waterfall-series-lines")),this._lines=new Dn(this._lineContainer,br)}_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}))}}]),mo.register([Ui,ia],[Xi,ea],[Wi,sa]);class La extends Un{constructor(t){super(t,"rct-axis-grid"),this._lines=new Dn(this,br)}_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.getPoints(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 Na extends qt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new ee(t)),this._mask.setStroke("none"),this.add(this._upLine=new ee(t)),this._upLine.setFill("none"),this.add(this._downLine=new ee(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 Ut;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 Ma extends qt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Jn(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 Ea extends Ma{constructor(t,e){super(t),this.insertFirst(this._line=new(e?uo:br)(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(X,"none"),n&&n.trans(s.cx+a*u(s.start),s.cy+a*p(s.start))}}class Ta extends Ma{constructor(t,e){super(t),this.insertFirst(this._box=new(e?po:Rs)(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 Ba extends Kt{constructor(){super(...arguments),this._views=new Dn(this,ee)}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(Bs.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(Bs.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class Oa extends Kt{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Ta?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof Ke?i=this._rangePool.pop()||new Ta(t,s):e instanceof qe&&(i=this._linePool.pop()||new Ea(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Ra extends ee{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 Ut;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 ii&&(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 Da extends lo{constructor(t){super(t,"Reset Zoom",Da.CLASS_NAME),this.setVis(!1)}}Da.CLASS_NAME="rct-reset-zoom";class Fa extends Kt{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Os(t,"rct-empty-view-back")),this.add(this._labelView=new Jn(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 $a extends Kt{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Dn(this,br)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPoints(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 Ia extends Kt{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new ee(t)),this.add(this._gridContainer=new Kt(t,"rct-body-depth-grids")),this.add(this._lineView=new br(t,"rct-body-depth-side-line")),this.add(this._endView=new br(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(Bs.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(Bs.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 $a(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class za extends Kt{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Ia(t,!0)),this.add(this._ySideView=new Ia(t,!1)),this.add(this._orgLineView=new br(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 Ga extends Un{constructor(t,e){super(t,Ga.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 Os(t)),this._hitTester.setFill("transparent"),this.add(this._background=new ee(t,"rct-body-background")),this.add(this._depthLayer=new za(t)),this.add(this._image=new Qn(t,!0,"rct-body-image")),this.add(this._emptyView=new Fa(t)),this.add(this._gridRowContainer=new Ba(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Kt(t,"rct-axis-grids")),this.add(this._baseContainer=new Kt(t,"rct-axis-bases")),this.add(this._guideContainer=new Oa(t,"rct-axis-guides")),this.add(this._annotationContainer=new Kt(t,"rct-annotations")),this.add(this._seriesContainer=new Kt(t,"rct-series-container")),this.add(this._axisBreakContainer=new Kt(t,"rct-axis-breaks")),this.add(this._labelContainer=new Kt(t,"rct-label-container")),this.add(this._frontGuideContainer=new Oa(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Kt(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Kt(t,"rct-feedbacks")),this.add(this._zoomButton=new Da(t)),this._crosshairViews=new Dn(this._feedbackContainer,Ra)}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=Zt._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(Io.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 Pr)){_=!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)=>e.pv&&s.pv?r?x(e.pv.pv.point.xPos-t.x)<x(s.pv.pv.point.xPos-t.x)?e:s:x(e.pv.pv.point.yPos-t.y)<x(s.pv.pv.point.yPos-t.y)?e:s: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 Ti){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 zr){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,nt.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(Io.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Io.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)))}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)}animating(){let t=!1;for(const e of this._seriesViews)if(e.visible&&e._animating()){t=!0;break}return t}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 Ko&&e.endHover(t,!1),e.setBoolData(Io.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.stop()})),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(Bs.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(fo[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 er)||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 La(t);r.set(e,s),i.add(s)}if(e instanceof er&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new br(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)||ka(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)||Ca(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 sr&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new Na(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)}))}}Ga.BODY_CLASS="rct-body";class Ha extends qt{constructor(t){super(t,ja.HANDLE_STYLE),this.add(this._back=new Os(t)),this.add(this._shape=new ee(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 Ut;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 ja extends Un{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(ja.HANDLE_STYLE)}static isMask(t){return t.classList.contains(ja.MASK_STYLE)}constructor(t){super(t,ja.CLASS_NAME),this.add(this._back=new Os(t,ja.BACK_STYLE)),this.add(this._container=new Kt(t,null)),this.add(this._mask=new Os(t,ja.MASK_STYLE)),this.add(this._trackView=new Os(t,ja.TRACK_CLASS)),this.add(this._thumbView=new Os(t,ja.THUMB_CLASS)),this.add(this._startHandle=new Ha(t)),this.add(this._endHandle=new Ha(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=ka(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 ho(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 ho(t)),i._simpleMode=!0)}}ja.CLASS_NAME="rct-navigator",ja.BACK_STYLE="rct-navigator-back",ja.MASK_STYLE="rct-navigator-mask",ja.HANDLE_STYLE="rct-navigator-handle",ja.HANDLE_BACK_STYLE="rct-navigator-handle-back",ja.TRACK_CLASS="rct-navigator-track",ja.THUMB_CLASS="rct-navigator-thumb";class Ya extends ne{constructor(t){super(),this.chart=t}}class Xa extends Ya{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 Os(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 Wa extends Ya{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 Ua extends Ya{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 Za extends Ya{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 qa{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;const l=this._chart.chart.exporter;if(l.isContextMenuVisible()&&l.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)})){nt.makeArray(a.legend.getSources(a),!0).forEach((t=>{if(t instanceof qs){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof ta&&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):(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 oo.isThumb(t)?new Wa(this._chart,i.getScrollView(t)):ja.isHandle(t)?new Ua(this._chart,i._navigatorView,t):ja.isMask(t)&&r&&r.model.isZoomed()?new Za(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Xa(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 Ka extends Kt{constructor(t){super(t,Ka.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 le(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 le(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)}}Ka.TITLE_CLASS="rct-history";class Qa extends Un{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new Os(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new le(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const 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():Fn,l=$n(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 Ja extends Zn{constructor(t){super(t,Ja.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Dn(this,Qa)}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}}}Ja.LEGEND_CLASS="rct-legend";class th extends qt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new _o(t))}layout(){}}class eh extends qt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Kt(t,"rct-polar-axis-markers")),this._markViews=new Dn(this._markContainer,th),this.add(this._gridContainer=new qt(t,"rct-polar-axis-grids")),this._labelViews=new Dn(this._labelContainer=s,ro,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(ao)?t.setLabel(s,o,e,r.replace(ao,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 sh extends eh{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Dn(this._gridContainer,br,sh.GRID_CLASS),e.insertFirst(this._startView=new br(t,sh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new br(t,sh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new uo(t,sh.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||nt.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))}}sh.LINE_CLASS="rct-polar-xaxis-line",sh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",sh.GRID_CLASS="rct-polar-xaxis-grid-line";class ih extends eh{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new Dn(this._gridContainer,uo,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new br(t,"rct-polar-yaxis-line")),e.add(this._baseView=new uo(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof er&&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 rh extends Ga{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(Bs.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 Kt(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new Kt(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new Kt(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new Kt(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new Kt(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new ih(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 sh(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class nh extends Zn{constructor(t,e){super(t,e?nh.SUBTITLE_CLASS:nh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new le(t)),this._richText=new xe}_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),$n(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var oh,ah;nh.TITLE_CLASS="rct-title",nh.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(oh||(oh={}));class hh extends qt{constructor(e){super(e,hh.CLASS_NAME),this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ee(e,"rct-tooltip-back")),this.add(this._top=new ee(e,"rct-tooltip-top")),this.add(this._textView=new le(e,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Zt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new xe,this.close(!0,!1)}show(t,e,s,i,r,n,o){const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a,s&&s.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||l.getTooltipText(t,a);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const d=this.control,u=d.contentWidth(),p=d.contentHeight(),g=this._textView,x=h.getHeaderHeight(),y=h.getTailSize(),b=h.getBorderRadius(),w=t.chart.isInverted(),v=t._yAxisObj;let S=v.options.reversed;t instanceof Ci&&t.getBaseValue(v)>e.point.yValue&&(S=!S),this._richText.setFormat(c),this._richText.build(g,NaN,NaN,null,h.getTextDomain());const V=g.getBBox();let P=f(_.minWidth||0,V.width+16),A=f(_.minHeight||0,V.height+12)+x,C=t._calcedColor;t instanceof Si?(t.options.legendByPoint||t._colorByPoint())&&(C=a._calcedColor):t._colorByPoint()&&(C=getComputedStyle(e.dom).fill),this._top.setFill(C);const k="visible"===this.getStyle("visibility")?300:0,L=_.offset+y,N=n.getFocusPointView().getBounds(),M=d.getBounds();let E,T=!1;if(w&&!t.isWidget){E=r-A/2-f(0,m(r-A/2,p-A)),this._tailVisible=Math.abs(A/2-b-y/2)>Math.abs(E),T=h.isFollowPointer(t)?S?P+L>i:i+P+L>u:S?P+L>N.x-M.x+N.width:N.x-M.x-L>u-P,T&&(S=!S);const e=S?oh.LEFT:oh.RIGHT;this.drawTooltip(0,0,P,A,e,E),S?i-=P+L:i+=L,r-=A/2}else{E=i-P/2-f(0,m(i-P/2,u-P)),this._tailVisible=Math.abs(P/2-b-y/2)>Math.abs(E),T=h.isFollowPointer(t)?S?r+A+L>p:r-(A+L)<0:S?p-(N.y-M.y-d._padding.top)<A+L:M.bottom-N.bottom+L>p-A,T&&(S=!S);const e=S?oh.BOTTOM:oh.TOP;this.drawTooltip(0,0,P,A,e,E),i-=P/2,S?r+=L:r-=A+L}i=f(0,m(i,u-P)),r=f(0,m(r,p-A)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(f(0,i-20),f(0,r-20)),this.transEx(i,r,k/2,!1)):this.transEx(i,r,k,!1),0===k&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}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:Gi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Ht(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(this._tailVisible)switch(r){case oh.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 oh.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 oh.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 oh.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=r===oh.BOTTOM,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._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(_)}}hh.CLASS_NAME="rct-tooltip";class lh extends qn{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new nh(t,!1)),this.add(this.subtitleView=new nh(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 _h extends qn{_doInitChildren(t){this.add(this._legendView=new Ja(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 ch extends qn{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r){const n=this.views;let o;for(n.length;n.length<s.length;)o=new ho(t),this.add(o),n.push(o);for(;n.length>s.length;)o=n.pop(),o.parent&&o.remove();if(n.forEach(((t,e)=>{t.prepare(s[e])})),this.setVis(n.length>0)){const t=n[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===En.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===En.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 ii?Math.floor(e):e,to:t instanceof ii?Math.floor(s):s})}))}))}}class dh extends Un{constructor(e){super(e,"rct-credits"),this.add(this._textView=new le(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 uh extends Kt{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.add(this._annotationContainer=new Kt(t,"rct-annotations")),this.add(this._plotContainer=new Kt(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Ga(t,this));for(const e in En){const s=new ch(t,En[e]);this._plotContainer.add(s),this._axisSectionMap[En[e]]=s}uh.pane_class&&this.add(this._paneContainer=new uh.pane_class(t,this)),this.add(this._titleSectionView=new lh(t)),this.add(this._legendSectionView=new _h(t)),this.add(this._frontAnnotationContainer=new Kt(t,"rct-front-annotations")),this.add(this._creditView=new dh(t)),this.add(this._navigatorView=new ja(t)),this.add(this._historyView=new Ka(t)),this.add(this._tooltipView=new hh(t))}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 P=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.mh-V.model.getGap()-V.model.getGapFar()),r-=P=V.mh));const A=this._legendSectionView;let C,k,L=0,N=0;if(A.visible)switch(A.resizeByMeasured().layout(),L=A.height,N=A.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-=P,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||([En.LEFT,En.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[En.TOP,En.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[En.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),y+=e.mw),(e=t[En.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[En.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0),b-=e.mh),(e=t[En.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=this._org={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[En.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[En.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[En.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[En.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),A.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)}A.trans(y,b)}this.$_layoutAnnotations(this._inverted,e,s,M),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i,r){const{x:n,y:o}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},a=this._model.chart._tooltip.isFollowPointer(t),h=i.getTooltipPos(),l=a?r.x+h.x:n+h.x,_=a?r.y+h.y:o+h.y;this._tooltipView.show(t,e,s,l,_,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(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)}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;nt.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof gi?o.hoverSeries(t):e.options.pointHovering&&t instanceof qs&&o.hoverPoint(t)}))}}if(l instanceof Ns&&!(this._hoverItem instanceof Ns)&&(o.hoverPoint(null),o.hoverSeries(null)),!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 Mr&&!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()}pointerLeaved(t,e,s){}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 En){const s=this._axisSectionMap[En[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))}isAnimating(){return this._bodyView.animating()}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new rh(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)}$_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,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.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[En.LEFT].checkWidths(t,s,i),s-=n[En.RIGHT].checkWidths(t,s,i),i-=n[En.BOTTOM].checkHeights(t,s,i),i-=n[En.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===En.LEFT||t===En.RIGHT?s-=e.mw:t!==En.BOTTOM&&t!==En.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===En.LEFT||t===En.RIGHT?s-=e.mw:t!==En.BOTTOM&&t!==En.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.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Ca(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)}))}}!function(t){t.EXPORT="$$realchart_export"}(ah||(ah={}));class ph extends Zt{constructor(t,e){super(t,e),this.addElement(this._chartView=new uh(t)),this.setPointerHandler(new qa(this))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new On(null,((t,e)=>{this.changeModel(t,e)}))}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof De&&s===Me.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!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}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===ah.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_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 gh{static getVersion(){return Ft.version}static setLicenseKey(t){Ft.code=t}static setLocale(t,e){e&&k(t,e),(t=>{t&&(C=P[A=t.substring(0,2)]),C||(C=P[A="ko"])})(t)}static registerLocale(t,e){k(t,e)}static setDebugging(t){qt.DEBUGGING=t}static setLogging(t){nt.LOGGING=t}static setAnimatable(t){Zt._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new ph(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[Bn]=o,o.chart}static createData(t,e){return new Rn(t||{},e)}}class mh{static empty(){return new mh}static create(t=0,e=0){return new mh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class fh{static empty(){return new fh}static create(t=0,e=0){return new fh(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const xh=gh.getVersion,yh=gh.setDebugging,bh=gh.setLogging,wh=gh.setAnimatable,vh=gh.configure,Sh=gh.createChart,Vh=gh.createData,Ph=gh.setLicenseKey;t.Annotation=De,t.ArcElement=co,t.AreaRangeSeries=Tr,t.AreaSeries=Nr,t.AreaSeriesGroup=Or,t.AssetCollection=Ae,t.Axis=is,t.AxisBaseLine=tr,t.AxisCollection=rs,t.AxisGrid=We,t.AxisItem=Ge,t.AxisLabel=Je,t.AxisLine=He,t.AxisScrollBar=ts,t.AxisScrollView=oo,t.AxisSectorLine=ss,t.AxisTick=Qe,t.AxisTitle=je,t.AxisView=ho,t.BarRangeSeries=cr,t.BarSeries=pr,t.BarSeriesBase=ur,t.BarSeriesGroup=mr,t.BarSeriesGroupBase=gr,t.BarSeriesPoint=dr,t.BarSeriesView=ca,t.BarSeriesViewBase=_a,t.BasedSeries=Ci,t.BasedSeriesView=Zo,t.BellCurveSeries=Dr,t.Body=ks,t.BodyDepth=Cs,t.BodyView=Ga,t.BoxPlotSeries=$r,t.BoxPointElementEx=jo,t.BubbleSeries=zr,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=Gr,t.CandlestickSeries=jr,t.CategoryAxis=ii,t.CategoryAxisGrid=si,t.CategoryAxisLabel=ei,t.CategoryAxisTick=ti,t.Chart=On,t.ChartControl=ph,t.ChartData=Rn,t.ChartDataCollection=ct,t.ChartElement=Un,t.ChartItem=Me,t.ChartObject=Tn,t.ChartOptions=Mn,t.ChartText=Te,t.ChartView=uh,t.CircelBarPointLabel=Yr,t.CircleBarSeries=Xr,t.CircleBarSeriesGroup=Wr,t.CircleElement=_o,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=ws,t.CircularGaugeGroup=vs,t.CircularGaugeLabel=ys,t.ClockGaugeType="clock",t.ClusterableSeries=Pi,t.ClusterableSeriesGroup=Ei,t.Color=Ot,t.ConnectableSeries=fi,t.ConstraintSeriesGroup=Mi,t.ContentView=Kn,t.ContinuousAxis=er,t.Credits=Ln,t.Crosshair=Ie,t.DataPoint=qs,t.DataPointCollection=Ks,t.DataPointLabel=hi,t.Dom=Rt,t.DumbbellSeries=qr,t.ElementPool=Dn,t.EqualizerSeries=Qr,t.ErrorBarSeries=Jr,t.Exporter=Ls,t.FunnelSeries=rn,t.Gauge=ls,t.GaugeBase=hs,t.GaugeGroup=_s,t.GaugeGroupView=wo,t.GaugeItem=class extends Me{constructor(t){super(t.chart)}},t.GaugeLabel=xs,t.GaugeRangeBand=fs,t.GaugeRangeLabel=ms,t.GaugeScale=gs,t.GaugeView=xo,t.HeatmapSeriesType="heatmap",t.HistogramSeries=an,t.IconedText=Be,t.ImageAnnotation=Xi,t.ImageElement=Qn,t.LayerElement=Kt,t.Legend=Ms,t.LegendItem=Ns,t.LegendItemView=Qa,t.LegendView=Ja,t.LineElement=br,t.LinePointLabel=Vr,t.LineSeries=Cr,t.LineSeriesBase=Pr,t.LineSeriesBaseView=oa,t.LineSeriesGroup=Br,t.LineSeriesPoint=vr,t.LinearAxis=sr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=kn,t.LollipopSeries=_n,t.LowRangedSeries=Li,t.MarkerSeries=Ti,t.MarkerSeriesPointView=Ko,t.MarkerSeriesView=Qo,t.NavigatorMask=Oi,t.NavigiatorHandle=Bi,t.ORG_ANGLE=E,t.OhlcSeries=dn,t.OthersGroup=vi,t.PI_2=M,t.PaneContainer=class extends Kt{},t.ParetoSeries=pn,t.PathBuilder=Ut,t.PathElement=ee,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=bn,t.PieSeriesGroup=wn,t.PieSeriesLabel=xn,t.PieSeriesText=fn,t.Point=mh,t.PointElement=zo,t.PointHovering=Nn,t.PointLabelLineContainer=Oo,t.PointLabelLineView=Bo,t.PointLabelView=Eo,t.RAD_DEG=B,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=Vi,t.RangedSeries=ki,t.RcAnimation=jt,t.RcControl=Zt,t.RcElement=qt,t.RcObject=at,t.RectElement=Os,t.SVGNS=e,t.ScaleView=class extends Un{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Kt(t,"rct-gauge-scale-ticks")),this._ticks=new Dn(this._tickContainer,br),this.add(this._labelContainer=new Kt(t,"rct-gauge-scale-tick-labels")),this._labels=new Dn(this._labelContainer,bo)}},t.ScatterSeries=Sn,t.SectionView=qn,t.SectorElement=po,t.Series=gi,t.SeriesAnimation=vo,t.SeriesGroup=Ni,t.SeriesMarker=xi,t.SeriesNavigator=$i,t.SeriesView=Io,t.ShapeAnnotation=Wi,t.Size=fh,t.SplineSeries=kr,t.Subtitle=zi,t.SvgShapes=Bs,t.TextAnnotation=Ui,t.TextElement=le,t.TimeAxis=lr,t.Title=Ii,t.Tooltip=Gi,t.TreemapSeriesType="treemap",t.Trendline=li,t.Utils=nt,t.ValueGauge=ds,t.ValueGaugeView=class extends xo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?ft.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 yo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){const e=this.model;e._setValueRate(t),this._renderValue(),console.log("change",e.getValue(),t)}},t.VectorSeriesType="vector",t.WaterfallSeries=An,t.Widget=ns,t.WidgetSeries=Si,t.WidgetSeriesConnector=bi,t.WidgetSeriesLabel=wi,t.WidgetSeriesPoint=yi,t.WidgetSeriesView=ta,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=Qs,t.absv=x,t.assignObj=_,t.buildValueRanges=Q,t.calcPercent=Y,t.configure=vh,t.copyObj=t=>t&&_({},t),t.cos=u,t.createChart=Sh,t.createData=Vh,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=ke,t.fixnum=R,t.getVersion=xh,t.incv=S,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=rt,t.isNumber=h,t.isObject=i,t.isString=o,t.maxv=f,t.minv=m,t.parsePercentSize=H,t.pickNum=y,t.pickProp=w,t.pickProp3=v,t.pixel=F,t.rectToSize=$n,t.setAnimatable=wh,t.setDebugging=yh,t.setLicenseKey=Ph,t.setLogging=bh,t.sin=p,t.toStr=function(t){return null==t?null:String(t)}}));