realchart 0.9.7 → 0.9.9
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/dist/index.d.ts +641 -900
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/realchart-style.css +112 -81
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v0.9.
|
|
3
|
+
* RealChart v0.9.9
|
|
4
4
|
* Copyright (C) 2023-2023 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";let e=0;class s{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.$_destroyed=!0,this.$_destroying=!0,this._doDestory()),null}_doDestory(){}get destroying(){return this.$_destroying}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 i extends s{wrapper(){return this._wrapper}wrapperOrThis(){return this._wrapper||this}createWrapper(t){const e=this._wrapper=new t;return e.$_c=this,e}setWrapper(t){return this._wrapper=t,t.$_c=this,t}isWrapper(t){return t===this._wrapper}}class r extends s{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 n="http://www.w3.org/2000/svg",a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},h=Array.isArray,o=function(t){return"string"==typeof t},l=function(t){return"number"==typeof t},c=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},u=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},d=function(t,e){return void 0!==t?t:e},_=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},g=(t,e)=>{const s=Object.assign({},t);for(const i in e){const r=e[i];a(r)&&a(t[i])?s[i]=g(t[i],r):s[i]=r}return s};class p{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}p._debugging=!1;const m={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},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",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let w=m.ko;const f=void 0,x="%".charCodeAt(0),y=2*Math.PI,b=-Math.PI/2,V=2*Math.PI/360,v=360/Math.PI/2,P=Math.ceil;function S(t){return parseFloat(t.toPrecision(12))}function k(t){return null==t?null:String(t)}function A(t){return t+"px"}function E(t){return null==t||Number.isNaN(t)||""===t}function L(t,e){const s={};return s[t]=e,s}function C(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)===x?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;D(w.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 M(t,e){return C(t,!0)||C(e,!1)}function T(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}class N extends Error{}const R=function(t,e){if(!t)throw new N(e)};var O;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(O||(O={}));const D=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))};var B,I,F;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(B||(B={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(I||(I={})),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(F||(F={}));const $=[F.LEFT,F.RIGHT],G=[F.TOP,F.BOTTOM];var H;!function(t){t.CHART="chart",t.PLOT="plot"}(H||(H={}));const z=function(t,e,s){let i,r;return h(t)&&(i=[],t.forEach((t=>{if(a(t)&&o(t.color)){const n={fromValue:c(t.fromValue,r?r.toValue:e),toValue:c(t.toValue,s),color:t.color};n.fromValue<n.toValue&&(i.push(n),r=n)}})),i=i.sort(((t,e)=>t.fromValue-e.fromValue))),i};let j=651212;class W{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,a=s.pageYOffset||n.scrollTop||r.scrollTop,h=s.pageXOffset||n.scrollLeft||r.scrollLeft,o=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=i.left+h-l,u=i.top+a-o;return{x:Math.round(c),y:Math.round(u)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)W.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const a={},h={};return a[e]=s,h[e]=i,t.animate([a,h],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+j++}static stopAnimation(t){if(t)try{t.finish()}catch(t){p.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}}const Y=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});let U=!1,X=!1;"undefined"!=typeof window&&(U=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,X=!!window.chrome&&!U,Object.prototype.toString.call(HTMLElement).indexOf("Constructor")>0||!X&&!U&&navigator.userAgent.indexOf("Safari"),navigator.userAgent.toLocaleLowerCase().indexOf("samsungbrowser"),navigator.userAgent.toLocaleLowerCase().indexOf("miuibrowser"));const q=/"([^"]*(?="))"/,K=/'([^']*(?='))'/,Z='"'.charCodeAt(0),Q="'".charCodeAt(0);class J{static now(){return+new Date}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),a=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,o=e+Math.ceil((a+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===o?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=t.getDate()+i-1;return e+Math.floor(r/7)}static stopEvent(t,e=!1){t.preventDefault?(t.preventDefault(),t.stopPropagation()):t.returnValue=!1,e&&t.stopImmediatePropagation()}static getErrorStack(t){const e=t.stack;return e?e.split("\n").map((t=>t+"<br/>")):""}static getBaseClassName(t){return Object.getPrototypeOf(t.constructor).name}static isObject(t){return t&&"object"==typeof t&&!h(t)}static assign(t,e){this.isObject(e)&&Object.assign(t,e)}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&&!h(t))return Object.assign({},t)}static checkArray(t){return h(t)?t:void 0}static makeArray(t,e=!1){return null!=t?h(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return h(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(h(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 h(t)?t:null!=t?[t]:null}static copyArray(t){return h(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 isValidNumber(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 getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static checkEnumValue(t,e,s){const i=Object.keys(t);for(let s=i.length-1;s>=0;s--)if(t[i[s]]===e)return e;return s}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()-Y}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=Math.max(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=Math.max(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 pickNum(...t){const e=t.length;for(let s=0;s<e;s++)if(!isNaN(t[s])&&null!==t[s])return t[s];return NaN}static included(t,...e){const s=e.length;for(let i=0;i<s;i++)if(e[i]==t)return!0;return!1}static compareTextValue(t,e,s,i){if(t===e)return!0;let r=String(t),n=null==e?void 0:String(e);return!r&&!n||!(!r||!n)&&(s||(r=r.toLowerCase(),n=n.toLowerCase()),i?n.indexOf(r)>=0:r==n)}static cast(t,e){return t instanceof e?t:null}static irandom(t,e){if(void 0!==e){const s=t>>0,i=e>>0;return Math.random()*(i-s)+s>>>0}{const e=t>>0;return Math.random()*e>>0}}static irandomExcept(t,e,s){if(0===t&&1===e&&isNaN(s))throw new Error("Invalid irandom2");for(;;){const i=this.irandom(e,s);if(i!==t)return i}}static brandom(){return Math.random()>.5}static srandom(t,e){let s="";const i=this.irandom(t,e);for(let t=0;t<i;t++)s+=String.fromCharCode(this.irandom(97,123));return s}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[Math.random()*t.length>>0]}static iarandom(t,e,s){const i=new Array;for(let s=t;s<e;s++)i.push(s);for(;i.length>s;)i.splice(J.irandom(i.length),1);return i}static alert(t){window.alert(t)}static toInt(t,e){const s=parseInt(t,e||10);return isNaN(s)?0:s}static toFloat(t){const e=parseFloat(t);return isNaN(e)?0:e}static toEven(t){return 1&t?t+1:t}static hex(t,e=2,s="0"){e=Math.max(e||2,1);const i=t.toString(16);return s=s||"0",new Array(e-i.length+1).join(s)+i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return 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 equalObjects(t,e){if(t===e)return!0;if(!t&&!e)return!0;if(!t||!e)return!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s]!==e[s])return!1;for(var s in e)if(e.hasOwnProperty(s)&&t[s]!==e[s])return!1;return!0}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 incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(s,J.month_days[J.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 getTextLength2(t){let e=0,s=0,i=0;for(;i=t.charCodeAt(s++);e+=i>>7?2:1);return e}static getClassName(t){if(t&&t.constructor)return t.constructor.name||function(t){let e=t.toString();return e=e.substring(9),e=e.substring(0,e.indexOf("(")),e}(t.constructor)}static isInteger(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===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 capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let s=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const i=t.charAt(e);i>="A"&&i<="Z"&&(s+=" "),s+=i}return s}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=h(t)?[]:{};for(let s of Object.keys(t))e[s]=J.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 hasSetter(t,e){for(;t;){const s=Reflect.getOwnPropertyDescriptor(t,e);if(s)return s.writable||!!s.set;t=Object.getPrototypeOf(t)}return!1}static dataUriToBinary(t){const e=";base64,",s=t.indexOf(e)+8,i=t.substring(s),r=window.atob(i),n=r.length,a=new Uint8Array(new ArrayBuffer(n));for(let t=0;t<n;t++)a[t]=r.charCodeAt(t);return a}static assignProps(t,e){let s=!1;if(e)for(let i in e)e[i]!==t[i]&&(t[i]=e[i],s=!0);return s}static assignStyleAndProps(t,e){let s=!1;if(e)for(let i in e)("style"===i||t.hasOwnProperty(i))&&(t[i]=e[i],s=!0);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 isUnique(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)if(t[s]===t[s-1])return!1;return!0}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),console.log(t,+new Date-s+"ms")}static clamp(t,e,s){return Math.max(e,Math.min(s,t))}static makeIntArray(t,e){const s=new Array(Math.max(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static setInterval(t,e){return setInterval(t,e)}static clearInterval(t){clearInterval(t)}static isStringArray(t){return h(t)&&t.every((t=>"string"==typeof t))}static isNumberArray(t){return h(t)&&t.every((t=>"number"==typeof t))}static makeLineSeparator(t){if(h(t)){if(t.length>0){let e=t[0];for(let s=1,i=t.length;s<i;s++)e+="|"+t[s];return new RegExp(e,"g")}}else if(t)return new RegExp(t,"g")}static stripQuotes(t){const e=t.charCodeAt(0);return e===Z?t=t.replace(q,"$1"):e===Q&&(t=t.replace(K,"$1")),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 watch(){return new tt}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=Math.abs(t);if(i>=1e3){let r=e.length-1;for(;r;){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]}}}}}J.week_days=["일","월","화","수","목","금","토"],J.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],J.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]],J.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();class tt{constructor(){this._started=+new Date}elapsed(t=!1){const e=+new Date-this._started;return t&&(this._started=+new Date),e}elapsedText(t=!1,e="ms."){return this.elapsed(t)+e}}function et(t){return{width:t.width,height:t.height}}class st{static create(t,e,s,i){return J.isObject(t)?new st(t.x,t.y,t.width,t.height):E(e)?new st(t,t,t,t):E(s)?new st(t,e,t,e):new st(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return t=this,!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height));var t}clone(){return new st(this.x,this.y,this.width,this.height)}getInner(){return new st(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}var it;st.Empty=new st,st.Temp=new st,function(t){t.CIRCLE="circle",t.DIAMOND="diamond",t.RECTANGLE="rectangle",t.SQUARE="square",t.TRIANGLE="triangle",t.ITRIANGLE="itriangle",t.STAR="star"}(it||(it={}));const rt=J.getEnumValues(it),nt=.001;class at{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e++)s.push("L",t[e++],t[e]);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,"L",t+s,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static square(t,e,s,i){const r=Math.min(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"L",t+r,e,"L",t+r,e+r,"L",t,e+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 arc(t,e,s,i,r,n,a,h=!1){const o=Math.cos(r),l=Math.sin(r),c=Math.cos(n-=nt),u=Math.sin(n),d=n-r-Math.PI<nt?0:1,_=a?1:0,g=[];return g.push("M",t+s*o,e+i*l,"A",s,i,0,d,_,t+s*c,e+i*u),h&&g.push("Z"),g}static sector(t,e,s,i,r,n,a,h){const o=2*Math.PI-Math.abs(a-n)<nt;let l=Math.abs(a-n)-Math.PI<nt?0:1;const c=h?1:0,u=Math.cos(n),d=Math.sin(n),_=Math.cos(a-=o?c?nt:-.001:0),g=Math.sin(a),p=s*r,m=i*r,w=[];return w.push("M",t+s*u,e+i*d,"A",s,i,0,l,c,t+s*_,e+i*g),o?w.push("M",t+p*_,e+m*g):w.push("L",t+p*_,e+m*g),isNaN(p)||w.push("A",p,m,0,l,1-c,t+p*u,e+m*d),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){const r=t+s/2,n=e+i/2,a=s/2,h=i/2,o=s/4,l=i/4,c=2*Math.PI/5,u=c/2,d=[];let _=-Math.PI/2;d.push("M",r+a*Math.cos(_),n+h*Math.sin(_));for(let t=0;t<5;t++)d.push("L",r+a*Math.cos(_),n+h*Math.sin(_)),d.push("L",r+o*Math.cos(_+u),n+l*Math.sin(_+u)),_+=c;return d.push("Z"),d}static setShape(t,e,s){let i;switch(e){case it.SQUARE:case it.RECTANGLE:case it.DIAMOND:case it.TRIANGLE:case it.ITRIANGLE:case it.STAR:i=at[e](0,0,2*s,2*s);break;default:i=at.circle(s,s,s)}t.setPath(i)}}class ht extends i{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.loaded=!1,this._windowResizeHandler=t=>{this._windowResized()},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._keyPressHandler=t=>{},this._wheelHandler=t=>{},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this.$_initControl(t||document,e,s||ht.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestory(){this._unresigterEventHandlers(this._dom),W.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}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}setData(t,e,s){E(e)?(delete this._svg.dataset[t],s&&delete this._dom.dataset[t]):(this._svg.dataset[t]=e,s&&(this._dom.dataset[t]=e))}clearDefs(){W.clearChildren(this._defs)}clearTemporaryDefs(){const t=this._defs,e=t.children;for(let s=0;s<e.length;s++)e[s].hasAttribute(ot.TEMP_KEY)&&t.removeChild(e[s])}appendDom(t){t&&this._htmlRoot.append(t)}addElement(t){t&&this._root.add(t)}removeElement(t){this._root.removeChild(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)}}getBounds(){return this._dom.getBoundingClientRect()}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 ut(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipRect(t){return this.clipBounds(t.x,t.y,t.width,t.height)}clipPath(){const t=new _t(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.dom.getBoundingClientRect();return{x:e+i.x-r.x,y:s+i.y-r.y}}_setTesting(){this._testing=!0,ot.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){t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),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)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}$_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||D(w.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden",padding:"20px","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const a=this._svg=i.createElementNS(n,"svg");a.classList.add("rct-root"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const h=i.createElement("desc");h.textContent="Created by RealChart v0.9.7",a.appendChild(h);const o=this._defs=i.createElementNS(n,"defs");this._initDefs(i,o),a.appendChild(o),r.appendChild(a),this._root=new ct(this),a.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(n,"filter");const i=t.createElementNS(n,"feDropShadow");s.setAttribute("id",ht.SHADOW_FILTER),i.setAttribute("dx","1"),i.setAttribute("dy","1"),i.setAttribute("flood-olor","#000"),i.setAttribute("flood-opacity","0.75"),i.setAttribute("stdDeviation","1.5"),s.appendChild(i),e.appendChild(s)}_render(){this.$_render()}$_requestRender(){window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):setTimeout((()=>{this.$_render()}),0)}updateNow(){this.$_render()}$_render(){if(+new Date<=this._toAnimation)this.$_requestRender();else{console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;Object.assign(this._htmlRoot.style,{left:A(e.left-t.left),top:A(e.top-t.top)}),this._doRender({x:0,y:0,width:s,height:i}),this._doRenderBackground(this._container.firstElementChild,s,i)}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s){}_windowResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}}ht.CLASS_NAME="rct-control",ht.SHADOW_FILTER="rr-chart-shadow-filter",ht._animatable=!0;class ot extends s{constructor(t,e,s=f){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(n,s||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDestory(){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 zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._translateX}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._translateY}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotaion(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}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent&&this._parent.removeChild(this),this}appendElement(t,e){const s=t.createElementNS(n,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(n,e);return this._dom.insertBefore(i,s),i}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return 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}setBounds(t,e,s,i){return this.translate(t,e),this.resize(s,i),this}setRect(t){return this.translate(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return st.create(this._translateX,this._translateY,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}getBBounds(){return this._dom.getBBox()}controlToElement(t,e){return this.control.containerToElement(this,t,e)}move(t,e){return this.x=t,this.y=e,this}movep(t){return this.x=t.x,this.y=t.y,this}isDomAnimating(){return this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}translate(t,e){return t===this._translateX&&e===this._translateY||(J.isValidNumber(t)&&(this._translateX=t),J.isValidNumber(e)&&(this._translateY=e),this._updateTransform()),this}translatep(t){return this.translate(t.x,t.y)}translateEx(t,e,s=0,i=!0){if(t=J.isNumber(t)?t:this._translateX,e=J.isNumber(e)?e:this._translateY,t!==this._translateX||e!==this._translateY){if(s>0){const r=this._dom.animate([{transform:`translate(${this._translateX}px,${this._translateY}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()}))}this._translateX=t,this._translateY=e,this._updateTransform()}return this}translateX(t){return t!==this._translateX&&J.isValidNumber(t)&&(this._translateX=t,this._updateTransform()),this}translateY(t){return t!==this._translateY&&J.isValidNumber(t)&&(this._translateY=t,this._updateTransform()),this}resize(t,e,s=!0){return t!==this._width&&s&&this.setAttr("width",this._width=t),e!==this._height&&s&&this.setAttr("height",this._height=e),this}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)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(e);this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(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(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]}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t)this._styles[i]!==t[i]&&(s[i]=this._styles[i]=t[i],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._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this._dom.classList.add(t):a(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)}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}setData(t,e){this.dom.dataset[t]=d(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(ot.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}_testing(){return ot.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._translateX,s=this._translateY,i=[];(J.isValidNumber(e)||J.isValidNumber(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),J.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+J.pick(this._originX,t.getAttribute("x"),0)+" "+J.pick(this._originY,t.getAttribute("y")||0)+")");const r=J.getNumber(this._scaleX,1),n=J.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}ot.TESTING=!1,ot.DEBUGGING=!1,ot.TEMP_KEY="_temp_";class lt extends ot{constructor(t,e){super(t,e,"g")}}class ct extends ot{constructor(t){super(t.doc(),null),this._control=t}get control(){return this._control}}class ut extends ot{constructor(t,e,s,i,r,n=0,a=0){super(t,f,"clipPath");const h=this._id=J.uniqueKey()+"-";this.setAttr("id",h);const o=this._rect=new ot(t,null,"rect");o.setAttr("fill","none"),n>0&&o.setAttr("rx",String(n)),a>0&&this.dom.setAttribute("rx",String(a)),isNaN(e)||o.setBounds(e,s,i,r),this.add(o)}get id(){return this._id}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}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 dt extends ot{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}renderShape(t,e,s,i){let r;switch(t){case"squre":case"diamond":case"triangle":case"itriangle":r=at[t](e-i,s-i,2*i,2*i);break;default:r=at.circle(e,s,i)}this.setPath(r)}}class _t extends ot{constructor(t){super(t,f,"clipPath");const e=this._id=J.uniqueKey()+"-";this.setAttr("id",e),this._path=new dt(t),this.add(this._path)}get id(){return this._id}setPath(t){this._path.setPath(t)}}class gt{constructor(t){this.source=t}}class pt extends gt{_setStops(t,e){const s=t.createElementNS(n,"stop"),i=t.createElementNS(n,"stop"),r=this.source.color,a=E(this.source.opacity)?1:this.source.opacity,o=h(r)?r[0]:r,l=h(r)&&r.length>1?r[1]:"white",c=h(a)?a[0]:a,u=h(a)&&a.length>1?a[1]:a;e.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",l),s.setAttribute("stop-opacity",c),i.setAttribute("offset","1"),i.setAttribute("stop-color",o),i.setAttribute("stop-opacity",u),e.appendChild(s),e.appendChild(i)}}class mt extends pt{getEelement(t){const e=t.createElementNS(n,"linearGradient");let{x1:s,x2:i,y1:r,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,e),this.source.dir){case"up":r=1;break;case"right":i=1;break;case"left":s=1;break;default:a=1}return e.setAttribute("x1",s),e.setAttribute("y1",r),e.setAttribute("x2",i),e.setAttribute("y2",a),e}}mt.TYPE="lineargradient";class wt extends pt{getEelement(t){const e=this.source,s=t.createElementNS(n,"radialGradient");return E(e.cx)||s.setAttribute("cx",e.cx),E(e.cy)||s.setAttribute("cy",e.cy),E(e.rd)||s.setAttribute("rd",e.rd),this._setStops(t,s),s}}wt.TYPE="radialgradient";class ft{constructor(){this._items=[]}get count(){return this._items.length}get(t){return this._items[t]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(e)}}register(t,e){this._items.forEach((s=>{e.addDef(s.getEelement(t))}))}unregister(t,e){this._items.forEach((t=>{e.removeDef(t.source.id)}))}$_loadItem(t){if(a(t)&&t.type&&t.id)switch(t.type.toLowerCase()){case mt.TYPE:return new mt(t);case wt.TYPE:return new wt(t)}}}const xt="0".charCodeAt(0),yt="#".charCodeAt(0),bt=",".charCodeAt(0),Vt="s".charCodeAt(0),vt="a".charCodeAt(0);class Pt{static getFormatter(t){let e=Pt.Formatters[t];return e||(Pt.Formatters[t]=e=new Pt(t)),e}static get Default(){return Pt.getFormatter(Pt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_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)===xt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===yt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===xt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===bt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===Vt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===vt){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s.maximumFractionDigits||delete s.maximumFractionDigits,s}}}Pt.DEFAULT_FORMAT="",Pt.Formatters={};const St="$_TH";class kt{get type(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;if(s&&e){let i=this.text;for(let r=0;r<s.length;r+=3)i=i.replace(s[r],e(t,s[r+1],s[r+2]));return i}return this.text}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;){const s=t.indexOf("${",e);if(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),a=n.indexOf(";");a>0?this._literals.push(r,n.substring(0,a),n.substring(a+1)):this._literals.push(r,n,""),e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class At extends kt{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf("<",r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.innerHTML=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))}}}const Et={t:class extends At{get type(){return"t"}},b:class extends At{get type(){return"b"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends At{get type(){return"i"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}}};class Lt{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 kt).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){const s=t[i],r=t[i+1];if("<"==s){let s;if(r in Et){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+r+">",a=t.indexOf(n,e+1);if(a>=0){const e=t.substring(i,a+n.length);s=(new Et[r]).parse(e),i+=e.length}}}if(!s){e(t.substring(i));break}this._words.push(s)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}getText(t,e){let s="";for(let i of this._words)s+=i.getText(t,e);return s}}class Ct{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&(this._format=t,t&&this.$_parse(t))}lines(){return this._lines.slice()}build(t,e,s,i,r){const n=t.doc,a=c(this.lineHeight,1),h=this._lines,o=h.length,l=[];let u;t.clearDom(),i=i||t;for(let e=0;e<o;e++){const s=h[e];let o=0,c=0,u=null;for(let e of s.words){const s=e.prepareSpan(t.appendElement(n,"tspan"),i,r),a=s.getBBox();o+=a.width,s.$_TW=a.width,c=Math.max(c,s[St]=a.height),u||(u=s)}l.push(u),s[St]=c*a}u=h[0][St];for(let e=1;e<l.length;e++)if(l[e]){const s=t.insertElement(n,"tspan",l[e]);let i=Math.floor(u-t.getAscent(u))+t.getAscent(h[e][St]);s.setAttribute("x","0"),s.setAttribute("dy",String(i)),s.innerHTML="​",u=h[e][St]}t.layoutText(h[0][St])}$_parse(t){const e=this._lines=[];if(t){const s=t.split(/<br.*?>|\r\n|\n/);for(let t of s)e.push((new Lt).parse(t))}}}let Mt=0;class Tt extends s{constructor(t,e=!0){super(),this.chart=t,this._visible=e,Mt++}get visible(){return this._visible}set visible(t){var e;t!==this._visible&&(this._visible=t,null===(e=this.chart)||void 0===e||e._visibleChanged(this))}load(t){if(void 0!==t&&!this._doLoadSimple(t)){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t)),this._doLoad(t)}return this}save(){const t={visible:this.visible};return this._doSave(t),t}getProp(t,e){}setProp(t,e){}setProps(t){}prepareRender(){this._doPrepareRender(this.chart)}_changed(){var t;null===(t=this.chart)||void 0===t||t._modelChanged(this)}_doLoadSimple(t){if("boolean"==typeof t)return this.visible=t,!0}_getDefObjProps(t){}_doLoad(t){for(const e in t){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof Tt?this[e].load(s):h(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):a(s)?this[e]=Object.assign({},this._getDefObjProps(e),s):this[e]=s)}}_doLoadProp(t,e){return!1}_doSave(t){}_doPrepareRender(t){}}var Nt,Rt,Ot,Dt,Bt,It,Ft,$t,Gt;!function(t){t.NONE="none",t.OUTLINE="outline",t.BACKGROUND="background"}(Nt||(Nt={}));class Ht extends Tt{constructor(){super(...arguments),this.effect=Nt.NONE,this.autoContrast=!0}}class zt extends Ht{constructor(t,e){super(t,e),this.numberSymbols="k,M,G,T,P,E",this.numberFormat="#,##0.#"}get numberSymbols(){return this._numberSymbols}set numberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?Pt.getFormatter(t):null)}get text(){return this._text}set text(t){this.setText(t)}setText(t){return t!==this._text&&(this._text=t,t?(this._richTextImpl||(this._richTextImpl=new Ct),this._richTextImpl.setFormat(t)):this._richTextImpl=null),!isNaN(this.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this.lineHeight),this}isVisible(){return this.visible&&!!this._text}buildSvg(t,e,s,i,r){this._richTextImpl.build(t,e,s,i,r)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}$_getNumberText(t,e,s){if(J.isValidNumber(t)){const i=this._numSymbols&&e&&J.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i=!1){let r=t||this.$_getNumberText(e,s,i)||e;return this.prefix&&(r=this.prefix+r),this.suffix&&(r+=this.suffix),r}}class jt extends Tt{}!function(t){t.AUTO="auto",t.LINE="line"}(Rt||(Rt={}));class Wt extends Tt{constructor(){super(...arguments),this.minWidth=50}}class Yt extends Tt{constructor(t){super(t.chart),this.axis=t,this.type=Rt.AUTO,this.showAlways=!0,this.followPointer=!0,this.numberFormat="#,##0.#",this.flag=new Wt(t.chart),this.visible=!1}isBar(){return!this.axis.isContinuous()&&this.type===Rt.AUTO}getFlag(t,e){return Pt.getFormatter(this.numberFormat).toStr(this.axis.getValueAt(t,e))}}class Ut extends Tt{constructor(t,e=!0){super(null==t?void 0:t.chart,e),this.axis=t}}class Xt extends Ut{constructor(t){super(t,!0)}}class qt extends Ut{constructor(){super(...arguments),this.gap=5}isVisible(){return this.visible&&!E(this.text)}_doLoadSimple(t){if(o(t))return this.text=t,!0}}class Kt extends Ut{constructor(t){super(t,null),this.circular=!1,this.startVisible=!0,this.endVisible=!0}isVisible(){return null==this.visible?!this.axis._isX:this.visible}getPoints(t){const e=this.axis;return e._ticks.map((s=>e.getPosition(t,s.value,!1)))}}class Zt extends zt{constructor(t){super(t,!0),this.align=B.LEFT,this.verticalAlign=I.TOP}}!function(t){t.LINE="line",t.RANGE="range",t.AREA="area"}(Ot||(Ot={}));class Qt extends Ut{constructor(t){super(t),this.front=!0,this.zindex=0,this.label=new Zt(t.chart)}}class Jt extends Qt{}class te extends Qt{}class ee extends Ut{constructor(t){super(t),this.length=7,this.margin=3}}!function(t){t.NONE="none",t.ROTATE="rotate",t.STEP="step",t.ROWS="rows"}(Dt||(Dt={}));class se extends zt{constructor(t){super(t&&t.chart,!0),this.axis=t,this.step=0,this.startStep=0,this.rows=0,this.autoArrange=Dt.ROTATE,this.wrap=!1,this.numberFormat=null}getRotation(){return this.rotation||0}}!function(t){t.NORMAL="normal",t.OPPOSITE="opposite",t.BASE="base"}(Bt||(Bt={}));class ie extends Tt{constructor(t,e){super(t),this.title=new qt(this),this.line=new Xt(this),this.grid=this._createGrid(),this.guides=[],this.crosshair=new Yt(this),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this.position=Bt.NORMAL,this.reversed=!1,this.marginNear=0,this.marginFar=0,this.name=e,this.tick=this._createTickModel(),this.label=this._createLabelModel()}isEmpty(){return this._series.length<1}getBaseValue(){return NaN}isBased(){return!1}disconnect(){this._series=[],this._values=[]}collectValues(){this._series.forEach((t=>{t.collectValues(this,this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}prepareRender(){this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isOpposite=this.position===Bt.OPPOSITE,this._doPrepareRender();const t=this._series,e=this._values;if(this._range=this._doCalcluateRange(e),this._isX){let e=0,s=0;t.forEach((t=>{t.clusterable()&&(e+=c(t.groupWidth,1))})),t.forEach((t=>{if(t.clusterable()){const i=c(t.groupWidth,1)/e;t.setCluster(i,s),s+=i}}))}}buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._length=t)}calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPosition(t,e.value)))}getLabelLength(t,e){return this.getUnitLength(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}parseValue(t){return parseFloat(t)}contains(t){return t>=this._range.min&&t<=this._range.max}_doLoadProp(t,e){if("guide"===t)return h(e)?this.$_loadGuides(e):a(e)&&this.$_loadGuides([e]),!0}_createGrid(){return new Kt(this)}$_loadGuides(t){for(let e=0;e<t.length;e++){const s=t[e];let i;if("range"===s.type)i=new te(this);else i=new Jt(this);i.load(s),this.guides.push(i)}}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalcluateRange(t){return{min:t.length>0?S(Math.min(...t)||0):NaN,max:t.length>0?S(Math.max(...t)||0):NaN}}}class re{constructor(t,e){this._items=[],this._map=new Map,this.chart=t,this.isX=e}get count(){return this._items.length}get first(){return this._items[0]}get items(){return this._items.slice(0)}load(t){const e=this.chart,s=this._items;h(t)?t.forEach(((t,i)=>s.push(this.$_loadAxis(e,t,i)))):a(t)&&s.push(this.$_loadAxis(e,t,0))}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()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t.prepareRender()))}buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e.buildTicks(t)))}connect(t){const e=this._items,s=this.isX?t.xAxis:t.yAxis;let i;return l(s)&&s>=0&&e.length?i=e[s]:o(s)&&(i=e.find((t=>t.name===s))),i||(i=e[0]),i&&i._connect(t),i}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}$_loadAxis(t,e,s){var i,r;let n=t._getAxisType(e.type);if(!n){let a;if(h(e.categories))a="category";else if(this.isX){for(const i of t._getSeries().items())if(i.canCategorized()){if(e.name&&i.xAxis===e.name){a="category";break}if(l(i.xAxis)&&i.xAxis===s){a="category";break}}!a&&(null===(i=t.first)||void 0===i?void 0:i.canCategorized())&&(a="category")}else a=null===(r=t._getSeries().first)||void 0===r?void 0:r.defaultYAxisType();a&&(n=t._getAxisType(a))}n||(n=t._getAxisType("linear"));const a=new n(t,e.name);return a._isX=this.isX,a.load(e),a}}class ne extends Tt{constructor(t){super(t),this._guides=[],this._frontGuides=[],this.startAngle=0,this.circular=!0,this.image=new jt(null),this.radius="45%",this.centerX="50%",this.centerY="50%"}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(t,!0))}get centerX(){return this._centerX}set centerX(t){t!==this._centerX&&(this._centerX=t,this._cxDim=C(t,!0))}get centerY(){return this._centerY}set centerY(t){t!==this._centerY&&(this._centerY=t,this._cyDim=C(t,!0))}calcRadius(t,e){return T(this._radiusDim,Math.min(t,e))}setPolar(t,e){return this._cx=T(this._cxDim,t),this._cy=T(this._cyDim,e),this._rd=T(this._radiusDim,Math.min(t,e)),this}getStartAngle(){return b+V*this.startAngle}getPolar(t){return this.chart.isPolar()?{start:this.getStartAngle(),cx:this._cx,cy:this._cy,rd:this._rd,deg:t?2*Math.PI/t._runPoints.length:0}:f}_doPrepareRender(t){super._doPrepareRender(t);const e=this._guides=[],s=this._frontGuides=[];t._getXAxes().forEach((t=>{t.guides.forEach((t=>{t.front?s.push(t):e.push(t)}))}))}}class ae extends Tt{_doLoad(t){super._doLoad(t)}_doPrepareRender(t){}}class he extends Tt{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}he.MARKER_SIZE=10,function(t){t.BOTTOM="bottom",t.TOP="top",t.RIGHT="right",t.LEFT="left",t.PLOT="plot",t.SUBPLOT="subplot"}(It||(It={})),function(t){t.AUTO="auto",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Ft||(Ft={})),function(t){t.START="start",t.CENTER="center",t.END="end"}($t||($t={}));class oe extends ae{constructor(t){super(t,void 0),this.location=It.BOTTOM,this.layout=Ft.AUTO,this.alignBase=H.PLOT,this.gap=6,this.itemGap=8,this.markerGap=4,this.lineGap=4,this.offsetX=0,this.offsetY=0,this.itemsAlign=$t.CENTER,this.visible=void 0}items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return this.visible||!1!==this.visible&&this._items.length>1}getLocatiion(){return this._location}getLayout(){if(this.layout!==Ft.AUTO||this._location===It.PLOT)return this.layout;switch(this._location){case It.BOTTOM:case It.TOP:return Ft.HORIZONTAL;default:return Ft.VERTICAL}}getMaxWidth(t){return T(this._maxWidthDim,t,t)}getMaxHeight(t){return T(this._maxHeightDim,t,t)}_doLoad(t){super._doLoad(t),this._maxWidthDim=C(this.maxWidth,!0),this._maxHeightDim=C(this.maxHeight,!0)}_doPrepareRender(t){super._doPrepareRender(t),this._location=J.checkEnumValue(It,this.location,It.BOTTOM),this._items=this.$_collectItems()}$_collectItems(){return this.chart._getLegendSources().map((t=>new he(this,t)))}}class le extends ot{static create(t,e,s,i,r,n,a=0){return new le(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=f,s=f){super(t,e,"rect"),this.rect=s,this.setAttr("shapeRendering","cripsEdges")}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},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 ce extends dt{constructor(t,e=f){super(t,e)}setBox(t,e,s,i){return this.setPath(at.box(t,e,s,i)),this}}!function(t){t.DEFAULT="default",t.SPLINE="spline",t.STEP="step"}(Gt||(Gt={}));let ue=0;class de{static swap(t){const e=[];for(let s=0;s<t.length;s++)e.push({xPos:t[s].yPos,yPos:t[s].xPos});return e}constructor(t){this.pid=ue++,this.visible=!0,this.getValueOf=(t,e)=>this[e]||this.source[e],this.source=t}get yAbs(){return Math.abs(this.yValue)}get xAbs(){return Math.abs(this.xValue)}ariaHint(){return this.x+", "+this.yValue}labelCount(){return 1}assignTo(t){this._assignTo(t)}getProp(t){return null==(e=this.source)||isNaN(e)?this.source:this.source[t];var e}parse(t){const e=this.source;h(e)?this._readArray(t,e):a(e)?(this._readObject(t,e),(h(e.drillDown)||a(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e)}getLabel(t){return this.y}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}_assignTo(t){return Object.assign(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue})}_colorIndex(){return 2}_readArray(t,e){if(null==e)this.isNull=!0;else{const s=+t.colorField;isNaN(s)||(this.color=e[s]),e.length>1?(this.x=e[c(t.xField,0)],this.y=e[c(t.yField,1)]):this.y=e[c(t.yField,0)]}}_readObject(t,e){var s,i,r,n;null==e?this.isNull=!0:(this.x=(s=e[t.xField],i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=_(e[t.yField],e.y,e.value),this.color=d(e[t.colorField],e.color))}_readSingle(t){this.y=t}}class _e{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}contains(t){return this._points.indexOf(t)>=0}load(t){h(t)?this._points=this._owner.createPoints(t):this._points=[]}getProps(t){return this._points.map((e=>e.getProp(t)))}getValues(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++);}getPoints(){return this._points}}class ge extends Tt{constructor(t){super(t.chart),this.series=t,this.text="<b>${name}</b><br>${series}:<b> ${yValue}</b>",this.offset=8,this.hideDelay=ge.HIDE_DELAY,this.minWidth=100,this.minHeight=40}getValue(t,e,s,i){const r=t.getPointTooltip(e,s);if(l(r)){const t=i||this.numberFormat;return t?Pt.getFormatter(t).toStr(r):r}return r}}var pe,me,we;ge.HIDE_DELAY=700,function(t){t.DEFAULT="default",t.POINT="point",t.EDGE="edge"}(pe||(pe={}));class fe extends ee{constructor(){super(...arguments),this.position=pe.POINT,this.step=1,this.showLast=!1}getPosition(){return this.position===pe.POINT||this.position===pe.EDGE?this.position:this.axis._isX?pe.POINT:pe.EDGE}}class xe extends se{getTick(t,e){return null!=e?this._getText(e,e,!1):""}}class ye extends Kt{getPoints(){const t=this.axis._pts,e=this.axis._ticks.length,s=[];if(e>0)for(let i=0;i<=e;i++)s.push(t[i+1]);return s}}class be extends ie{constructor(){super(...arguments),this._map={},this._catPad=0,this.padding=0,this.categoryPadding=.1}getCategories(){return this._cats}getCategory(t){return this._cats[t]}categoryAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return e-2;return-1}getWdith(t,e){return 0}axisMin(){return this._min}axisMax(){return this._max}categoryPad(){return this._catPad}type(){return"category"}isContinuous(){return!1}_createGrid(){return new ye(this)}_createTickModel(){return new fe(this)}_createLabelModel(){return new xe(this)}collectValues(){this.$_collectCategories(this._series),this._series.length>0?super.collectValues():this._values=J.makeIntArray(0,this._categories.length)}_doPrepareRender(){this._cats=[],this._weights=[],this._minPad=u(this.minPadding,this.padding,0),this._maxPad=u(this.maxPadding,this.padding,0),this._catPad=c(this.categoryPadding,0)}_doBuildTicks(t,e,s){const i=this.label;let r=this._cats=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this.tick.step||1,h=[];for(t=this._min=Math.floor(t),e=this._max=Math.ceil(e);r.length<=e;)r.push(String(r.length)),n.push(1);r=this._cats=r.slice(t,e+1),n=n.slice(t,e+1);const o=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);if(o>0){const s=this._pts=[0];let l=this._minPad;for(let i=t;i<=e;i++)n[i-t],s.push(l/o),l+=n[i-t];s.push(l/o),s.push((l+this._maxPad)/o);for(let e=1;e<s.length-2;e+=a){const s=t+e-1;h.push({pos:NaN,value:s,label:i.getTick(e-1,r[e-1])})}}else this._pts=[];return h}calcPoints(t,e){super.calcPoints(t,e);const s=this._pts;if(e>0)for(let t=0;t<s.length;t++)s[t]/=this._length;for(let e=0;e<s.length;e++)s[e]*=t;let i;i=this.tick.getPosition()===pe.EDGE?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=i}getPosition(t,e,s=!0){e-=this._min,s&&(e+=.5);const i=Math.floor(e),r=this._pts[i+1]+(this._pts[i+2]-this._pts[i+1])*(e-i);return this.reversed?t-r:r}getValueAt(t,e){return 1}getUnitLength(t,e){const s=Math.floor(e-this._min);return this._pts[s+2]-this._pts[s+1]}getValue(t){return l(t)?t:this._map[t]}$_collectCategories(t){const e=this.categories,s=this._categories=[];if(h(e)&&e.length>0)this._len=0,e.forEach((t=>{let e,i=null==t?1:c(t.weight,1);e=null==t?null:o(t)?t:t.name||t.label,this._len+=i,s.push({c:e,w:i})}));else if(h(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)s.find((t=>t.c===e))||s.push({c:e,w:1})}this._map={},s.forEach(((t,e)=>this._map[t.c]=e))}}!function(t){t.AUTO="auto",t.INSIDE="inside",t.OUTSIDE="outside",t.HEAD="head",t.FOOT="foot",t.INSIDE_FIRST="insideFirst",t.OUTSIDE_FIRST="outsideFirst"}(me||(me={}));class Ve extends zt{constructor(t){super(t,!1),this.position=me.AUTO,this.offset=4,this.distance=25}getText(t){if(J.isValidNumber(t)){return this._getText(null,t,Math.abs(t)>1e3,!0)}return t}_doLoad(t){super._doLoad(t)}}!function(t){t.LINEAR="linear",t.LOGARITHMIC="logarithmic",t.POLYNOMIAL="polynomial",t.POWER="power",t.EXPONENTIAL="exponential",t.MOVING_AVERAGE="movingAverage"}(we||(we={}));class ve{}const Pe={interval:5,type:"simple"};class Se extends Tt{constructor(t){super(t.chart),this.series=t,this.type=we.LINEAR,this.lineType=Gt.DEFAULT,this.movingAverage=new ve,this.visible=!1}_doPrepareRender(t){(this["$_"+this.type]||this.$_linear).call(this,this.series._runPoints,this._points=[])}_getDefObjProps(t){if("movingAverage"===t)return Pe}$_linear(t,e){const s=t.length;if(s>1){let i=0,r=0,n=0,a=0,h=0;t.forEach((t=>{i+=t.xValue,r+=t.yValue,n+=t.xValue*t.xValue,a+=t.yValue+t.yValue,h+=t.xValue*t.yValue}));const o=(s*h-i*r)/(s*n-i*i),l=(r-o*i)/s;e.push({x:t[0].xValue,y:o*t[0].xValue+l}),e.push({x:t[s-1].xValue,y:o*t[s-1].xValue+l})}}$_logarithmic(t,e){}$_polynomial(t,e){}$_power(t,e){}$_exponential(t,e){}$_movingAverage(t,e){const s=this.movingAverage,i=t.length,r=Math.max(1,Math.min(i,s.interval));let n=r-1;for(;n<=i;){n+=1;const s=t.slice(n-r,n).reduce(((t,e)=>t+e.yValue),0);n<=i&&e.push({x:t[n-1].xValue,y:s/r})}}}class ke extends Tt{static _loadSeries(t,e,s){let i=t._getSeriesType(e.type);i||(i=t._getSeriesType(s||t.type));const r=new i(t,e.name);return r.load(e),r}constructor(t,e){super(t),this.index=-1,this.zOrder=0,this.clipped=!1,this.displayInLegend=!0,this.name=e,this.pointLabel=new Ve(t),this.trendline=new Se(this),this.tooltip=new ge(this),this._points=new _e(this),this._pointArgs=this._createPointArgs()}contains(t){return this._points.contains(t)}getPoints(){return this._points}getLabeledPoints(){return this._points.getPoints()}getVisiblePoints(){return this._points.getPoints()}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}displayName(){return this.label||this.name}legendMarker(t){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,he.MARKER_SIZE)),this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return this.label||this.name}ignoreAxisBase(t){return!1}canMixWith(t){return!0}getBaseValue(t){return NaN}canMinPadding(t){return!0}canMaxPadding(t){return!0}hasMarker(){return!1}setShape(t){}createPoints(t){return t.map(((t,e)=>{const s=this._createPoint(t);return s.index=e,s.parse(this),s.isNull||(s.isNull=null==t||null==s.y),s}))}getXStart(){let t=this._xAxisObj.parseValue(this.xStart);return isNaN(t)?this._xAxisObj.parseValue(this.chart.xStart):t}getXStep(){return d(this.xStep,this.chart.xStep)}getValue(t,e){const s=t.source;if(null==s)return NaN;s[this._getField(e)]}prepareRender(){this._calcedColor=void 0,this._xAxisObj=this.group?this.group._xAxisObj:this.chart._connectSeries(this,!0),this._yAxisObj=this.group?this.group._yAxisObj:this.chart._connectSeries(this,!1),this._runPoints=this._points.getPoints(),this._doPrepareRender()}collectCategories(t){if(t instanceof be){let e=t.categoryField;return null!=e?this._points.getProps(e):this._points.getValues(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.getXStart()||0,i=this.getXStep()||1;o(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let a=t.getValue(r.x);isNaN(a)&&(a=s,s=t.incStep(s,i)),isNaN(a)?r.isNull=!0:(r.xValue=a,e&&e.push(a))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t.getValue(s.y);isNaN(i)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectVisibles(){const t=this._runPoints.filter((t=>t.visible)),e=t.length;if(e>0){let s=t[0].yValue,i=s;t[0].vindex=0;for(let r=1;r<e;r++){const e=t[r];e.vindex=r,e.yValue>i?i=e.yValue:e.yValue<s&&(s=e.yValue)}t.forEach(((t,e)=>{t.vindex=e,i=Math.max(t.yValue,i)})),this._pointArgs.yMin=this._minValue=s,this._pointArgs.yMax=this._maxValue=i}return t}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t)))}reference(t,e){}isVisible(t){return this._xAxisObj.contains(t.x)&&this._yAxisObj.contains(t.y)}getLegendSources(t){!1!==this.displayInLegend&&t.push(this)}getLabelPosition(t){return t}getLabelOff(t){return t}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))}_createPointArgs(){return{}}_preparePointArgs(t){t.series=this.name||this.index,t.count=this._points.count}_getPointCallbackArgs(t,e){e.assignTo(t)}getPointStyle(t){if(this.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointStyleCallback(this._pointArgs)}getPointTooltip(t,e){switch(e){case"series":return this.displayName();case"name":return this._xAxisObj instanceof be?this._xAxisObj.getCategory(t.index):t.x;case"x":return t.x||(this._xAxisObj instanceof be?this._xAxisObj.getCategory(t.index):"");case"y":return t.y;case"xValue":return t.xValue;case"yValue":return t.yValue;default:return e}}pointClicked(t){if(this.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this.onPointClick(this._pointArgs)}_createPoint(t){return new de(t)}_createLegendMarker(t,e){return le.create(t,ke.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_getField(t){return t===this._xAxisObj?this.xField:this.yField}_colorByPoint(){return!1}_doLoad(t){super._doLoad(t);const e=this._loadData(t);h(e)&&e.length>0&&this._doLoadPoints(e)}_loadData(t){return t[this.dataProp||"data"]}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){let t,e;!1===this.pointColors?t=this.color:h(this.pointColors)?e=this.pointColors:this._colorByPoint()?e=this.chart.colors:t=this.color,this._runPoints.forEach(((s,i)=>{!s.color&&e&&(s.color=t||e[i%e.length])})),this._preparePointArgs(this._pointArgs)}prepareAfter(){this.trendline.visible&&this.trendline.prepareRender()}}ke.LEGEND_MARKER="rct-legend-item-marker";class Ae{constructor(t){this._map={},this._items=[],this._visibles=[],this._series=[],this._visibleSeries=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(){return!this._items.find((t=>!t.isEmpty()))}items(){return this._items.slice(0)}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}visibleSeries(){return this._visibleSeries.slice(0)}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}getSeries(t){return this._map[t]}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}load(t){const e=this.chart,s=this._items=[],i=this._series=[],r=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach(((t,e)=>{t.index=e,t instanceof $e?i.push(...t.series):t instanceof ke&&i.push(t)})),this._widget=!0,i.forEach((t=>{!this._widget||t instanceof Oe||(this._widget=!1),t.name&&(r[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}}))}updateData(t){}prepareRender(){const t=this._visibleSeries=[];let e=0;this._series.forEach((s=>{s.visible&&t.push(s),s.hasMarker()&&s.setShape(rt[e++%rt.length])}));const s=this._visibleSeries.filter((t=>t.clusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof Be&&(t._single=1===s)})),this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let i=h(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getSeriesType(e.type||t.type),!i)throw new Error("Invalid series type: "+e.type+", "+t.type);const r=new i(t,e.name||`Series ${s+1}`);return r.load(e),r.index=s,r}}var Ee,Le,Ce,Me,Te;!function(t){t.DEFAULT="default",t.VISIBLE="visible",t.HIDDEN="hidden"}(Ee||(Ee={}));class Ne extends Tt{constructor(t){super(t.chart),this.series=t,this.radius=3}}class Re extends de{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return d(this.x,this.y)}}class Oe extends ke{constructor(){super(...arguments),this.boundsAnimation=!0,this.legendByPoint=!1}getCenter(t,e){return{x:T(this._centerXDim,t),y:T(this._centerYDim,e)}}getLabelPosition(){const t=this.pointLabel.position;return t===me.AUTO?me.INSIDE:t}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this.legendByPoint?!1!==this.displayInLegend&&this._runPoints.forEach((e=>{t.push(e)})):super.getLegendSources(t)}_doLoad(t){super._doLoad(t),this._centerXDim=C(_(this.centerX,this.center,Oe.CENTER),!0),this._centerYDim=C(_(this.centerY,this.center,Oe.CENTER),!0)}}Oe.CENTER="50%";class De extends Oe{constructor(){super(...arguments),this.radius=De.DEF_RADIUS,this.startAngle=0,this.totalAngle=360,this.clockwise=!0}getRadius(t,e){return T(this._radiusDim,Math.min(t,e))}_doLoad(t){super._doLoad(t),this._radiusDim=C(d(this.radius,De.DEF_RADIUS),!0)}}De.DEF_RADIUS="40%";class Be extends ke{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0,this.pointWidth=1}get groupWidth(){return this.pointWidth}getPointWidth(t){const e=this.group;let s=t;return e?(s*=e._clusterWidth,s*=1-2*e.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,s}getPointPos(t){const e=this.group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.groupPadding,s-=s*e.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}getLabelPosition(t){return t===me.AUTO?me.OUTSIDE_FIRST:t}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this.pointPadding)?this._single?.25:this.group?.1:.2:this.pointPadding}}class Ie extends Be{constructor(){super(...arguments),this.baseValue=0,this.nullAsBase=!1}_doPrepareRender(){super._doPrepareRender(),this._base=c(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this.baseValue}}class Fe extends Be{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&e.push(s)}))}}!function(t){t.DEFAULT="default",t.OVERLAP="overlap",t.STACK="stack",t.FILL="fill"}(Le||(Le={}));class $e extends Tt{constructor(){super(...arguments),this.layoutMax=100,this.index=-1,this._series=[],this._visibles=[],this.layout=Le.DEFAULT,this.displayInLegend=!0}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(){return this._series.length<1}canCategorized(){return!0}defaultYAxisType(){return"linear"}clusterable(){return!1}getBaseValue(t){return NaN}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.layout){case Le.STACK:this.$_collectStack(t,e);break;case Le.FILL:this.$_collectFill(t,e);break;case Le.DEFAULT:case Le.OVERLAP:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}pointValuesPrepared(t){this._series.forEach((e=>e.pointValuesPrepared(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}ignoreAxisBase(t){for(const e of this._visibles)if(e.ignoreAxisBase(t))return!0}getLegendSources(t){!1!==this.displayInLegend&&this._series.forEach((e=>e.getLegendSources(t)))}canMinPadding(t){return!0}canMaxPadding(t){return this.layout!==Le.FILL}getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e.getVisiblePoints()))),t}_doLoadProp(t,e){if("children"===t)return this.$_loadSeries(this.chart,e),!0}prepareRender(){this._visibles=this._series.filter((t=>t.visible)),super.prepareRender()}_doPrepareRender(t){const e=this._visibles.sort(((t,e)=>(t.zOrder||0)-(e.zOrder||0)));this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),e.length>0&&(e.forEach((t=>t.prepareRender())),this._doPrepareSeries(e))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,e){const s=this._seriesType();h(e)?e.forEach(((e,i)=>this.$_add(ke._loadSeries(t,e,s)))):a(e)&&this.$_add(ke._loadSeries(t,e,s))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t.group=this,t.index=this._series.length-1}$_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),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i),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.layoutMax||100,r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){let s=0;for(const e of t)s+=e.yValue||0;let r=0;for(const e of t)r=e.yGroup=(e.yValue||0)/s*i+r;e.push(i)}else for(const t of r.values()){let r=0;for(const e of t)r+=Math.abs(e.yValue)||0;let n=0,a=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?a=e.yGroup=(e.yValue||0)+a:n=e.yGroup=(e.yValue||0)+n;e.push(a,n)}}}class Ge extends $e{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class He extends $e{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this.groupWidth=1,this.groupPadding=.1}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}!function(t){t.NORMAL="normal",t.MIXED="mixed",t.RANDOM="random"}(Ce||(Ce={}));class ze extends Tt{constructor(t){super(null),this.assets=new ft,t&&this.load(t)}activate(t){}deactivate(t){}_doLoadProp(t,e){if("assets"===t)return this.assets.load(e),!0}}class je{constructor(){this._items=[]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(e)}}$_loadItem(t){if(a(t)&&t.name)return new ze(t)}}class We extends Tt{constructor(){super(...arguments),this.text="Title",this.alignBase=H.PLOT,this.align=B.CENTER}isVisible(){return this.visible&&!E(this.text)}_doLoadSimple(t){if(o(t))return this.text=t,!0}}!function(t){t.BOTTOM="bottom",t.RIGHT="right",t.LEFT="left",t.TOP="top"}(Me||(Me={}));class Ye extends We{constructor(){super(...arguments),this.position=Me.BOTTOM,this.verticalAlign=I.BOTTOM,this.text=""}}class Ue extends ee{constructor(){super(...arguments),this.stepPixels=72,this.integral=!1}buildSteps(t,e,s,i,r=!1){let n;return this._step=NaN,n=r?this._getStepsByPixels(t,c(.85*this.stepPixels,60),e,s,i):Array.isArray(this.steps)?this.steps.slice(0):this._baseAxis instanceof Ke?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s,i):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s,i):this.stepPixels>0?this._getStepsByPixels(t,this.stepPixels,e,s,i):s!==i?[s,i]:[s],n}getNextStep(t,e){return t+e*this._step}_findBaseAxis(){if(null!=this.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this.baseAxis);e!==t&&e instanceof Ke&&(this._baseAxis=e,e.tick._baseAxis=null)}}_getStepsByCount(t,e,s,i){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),isNaN(e)&&this.integral;let r=(i-s)/(t-1);const n=Math.pow(10,Math.floor(Math.log10(r))),a=[];if(r=this._step=Math.ceil(r/n)*n,isNaN(e))s>Math.floor(s/n)*n?s=Math.floor(s/n)*n:s<Math.ceil(s/n)*n&&(s=Math.ceil(s/n)*n);else{for(R(s<e&&i>e,"base error"),t=Math.max(3,t);;){if(!(P((e-s)/r)+P((i-e)/r)+1>t))break;r+=n}s=e-P((e-s)/r)*r}a.push(s);for(let e=1;e<t;e++)a.push(S(a[e-1]+r));return a}_getStepsByInterval(t,e,s,i){const r=[];let n;if(isNaN(e))for(r.push(n=s);n<i;)r.push(n+=t);else{for(r.push(n=e);n>s;)r.unshift(n-=t);for(n=e;n<i;)r.push(n+=t)}return this._step=t,r}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i,r){i>=s?i=s:r<=s&&(r=s);const n=r-i,a=[];if(0===n)return isNaN(i)?[]:[i];let h=Math.floor(t/e)+1,o=n/(h-1);const l=Math.pow(10,Math.floor(Math.log10(o))),c=this._getStepMultiples(l);let u,d=0;if(o/=l,c)if(o>c[d]){for(;d<c.length-1;d++)if(o>c[d]&&o<c[d+1]){o=c[++d];break}}else o=c[d];if(o*=l,isNaN(s))i>Math.floor(i/o)*o?i=Math.floor(i/o)*o:i<Math.ceil(i/o)*o&&(i=Math.ceil(i/o)*o);else{for(R(i<=s&&r>=s,"base error"),h=Math.max(3,h);d<c.length;){if(!(P((s-i)/o)+P((r-s)/o)+1>h))break;o=d<c.length-1?c[d+1]*l:2*o,d++}i=s-P((s-i)/o)*o}for(this._step=o,a.push(S(u=i));u<r;)a.push(S(u+=o));return a}}class Xe extends se{constructor(){super(...arguments),this.useSymbols=!0}getTick(t,e){return this._getText(null,e,this.useSymbols&&this.axis.tick._step>100)}}class qe extends Ut{constructor(){super(...arguments),this.enabled=!0,this.size="30%",this.space=16}getSize(t){return T(this._sizeDim,t)}_doLoad(t){super._doLoad(t),this.space=c(this.space,0),this._sizeDim=C(this.size,!1)}}!function(t){t.DEFAULT="default",t.TICK="tick",t.VALUE="value"}(Te||(Te={}));class Ke extends ie{constructor(){super(...arguments),this.nullable=!0,this.padding=.05,this.startFit=Te.DEFAULT,this.endFit=Te.DEFAULT,this.breaks=[]}getBaseValue(){return this.baseValue}axisMin(){return this._min}axisMax(){return this._max}hasBreak(){return null!=this._runBreaks}runBreaks(){return this._runBreaks&&this._runBreaks.slice(0,1)}getStartFit(){return this.startFit===Te.DEFAULT?this._isX?Te.VALUE:Te.TICK:this.startFit}getEndFit(){return this.endFit===Te.DEFAULT?this._isX?Te.VALUE:Te.TICK:this.endFit}isContinuous(){return!0}contains(t){return!isNaN(t)}isBased(){return!!this.tick._baseAxis}_createTickModel(){return new Ue(this)}_createLabelModel(){return new Xe(this)}_doLoadProp(t,e){return"break"===t?(this.$_loadBreaks(e),!0):super._doLoadProp(t,e)}_doPrepareRender(){this._hardMin=this.minValue,this._hardMax=this.maxValue,this._base=parseFloat(this.baseValue),this._unitLen=NaN,this.tick._findBaseAxis()}_doBuildTicks(t,e,s){if(isNaN(t)||isNaN(e))return[];const i=this.tick;let{min:r,max:n}=this._adjustMinMax(this._calcedMin=t,this._calcedMax=e),a=this._base;isNaN(a)&&r<0&&n>0&&(a=0);let h=i.buildSteps(s,a,r,n,!1);const o=[];if(isNaN(this.strictMin)&&this.getStartFit()!==Te.VALUE){for(;h.length>2&&h[1]<=r;)h.shift();if(!isNaN(i._step))for(;h[0]>r;)h.unshift(i.getNextStep(h[0],-1));r=h[0]}else for(;h.length>1&&r>h[0];)h.shift();if(isNaN(this.strictMax)&&this.getEndFit()!==Te.VALUE){for(;h.length>2&&h[h.length-2]>=n;)h.pop();if(!isNaN(i._step))for(;h[h.length-1]<n;)h.push(i.getNextStep(h[h.length-1],1));n=h[h.length-1]}else for(;n<h[h.length-1]&&h.length>1;)h.pop();this._setMinMax(r,n),this._runBreaks&&(h=this.$_getBrokenSteps(this._runBreaks,s,r,n));for(let t=0;t<h.length;t++){const e=this._createTick(s,t,h[t]);o.push(e)}return o}_getTickLabel(t,e){return this.label.getTick(t,e)||String(e)}_createTick(t,e,s){return{pos:NaN,value:s,label:this._getTickLabel(e,s)}}calcPoints(t,e){super.calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this.tick.buildSteps(t.len,void 0,t.from,t.to,!0)}$_getBrokenSteps(t,e,s,i){let r=0,n=s;const a=[n],h=this._sects=[];e-=t.reduce(((t,e)=>t+e.space),0),t.forEach((t=>{const s=t.getSize(e),i={from:n,to:t.from,pos:r,len:s};r+=s,h.push(i,t._sect={from:t.from,to:t.to,pos:r,len:t.space}),r+=t.space;this.$_buildBrokenSteps(i).forEach((t=>{t>i.from&&t<=i.to&&a.push(t)})),t.space>0&&a.push(t.to)}));const o=t[t.length-1];if(i>o.to){const t={from:o.to,to:i,pos:r,len:this._length-r};h.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&a.push(e)}))}return this._lastSect=h[h.length-1],a}getPosition(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.reversed?t-i-s.pos:i+s.pos}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return this.reversed?t-s:s}}getValueAt(t,e){return this._isHorz?this.reversed&&(e=t-e):this.reversed||(e=t-e),(this._max-this._min)*e/t+this._min}getUnitLength(t,e){return isNaN(this._unitLen)&&(this._unitLen=this.$_calcUnitLength(t)),this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_adjustMinMax(t,e){this._minBased=this._maxBased=!1,this._series.forEach((s=>{const i=s.getBaseValue(this);isNaN(i)||(isNaN(this._hardMin)&&i<=t?(t=i,this._minBased=!0):isNaN(this._hardMax)&&i>=e&&(e=i,this._maxBased=!0)),this._minBased||s.canMinPadding(this)||(this._minBased=!0),this._maxBased||s.canMaxPadding(this)||(this._maxBased=!0)}));let s=0,i=0;isNaN(this.strictMin)?this._hardMin<t?t=this._hardMin:this._minBased||(s=u(this.minPadding,this.padding,0)):t=this.strictMin,isNaN(this.strictMax)?(this._hardMax>e&&(e=this._hardMax),this._maxBased||(i=u(this.maxPadding,this.padding,0))):e=this.strictMax;let r=Math.max(0,e-t);return t-=r*(this._minPad=s),e+=r*(this._maxPad=i),{min:t,max:e}}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}$_calcUnitLength(t){const e=[];this._series.forEach((t=>{t.visible&&t.clusterable()&&e.push(...t.getVisiblePoints())}));const s=this._isX,i=e.map((t=>s?t.xValue:t.yValue)).sort();let r=i[1]-i[0];for(let t=2;t<i.length;t++)r=Math.min(i[t]-i[t-1]);return t*=r/(this._max-this._min),this._unitLen=c(t,1)}$_loadBreak(t){if(a(t)&&"from"in t&&"to"in t)return new qe(this).load(t)}$_loadBreaks(t){if(h(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.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.to=e.to}const e=this.breaks.sort(((t,e)=>t.from-e.from)).filter((t=>t.to>t.from));if(this._runBreaks=null,e.length>0){const i=this._runBreaks=[];i.push(Object.assign(new qe(this),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],a=e[r];s=n,a.from<s.to?t(n,a):i.push(Object.assign(new qe(this),a))}}var s}}class Ze extends Ke{type(){return"linear"}_adjustMinMax(t,e){const s=super._adjustMinMax(t,e),i=this._series;return 1===i.length&&i[0]instanceof $e&&i[0].layout===Le.FILL&&(s.max=i[0].layoutMax),s}}class Qe extends Ue{_getStepMultiples(t){return t<=.1?[1/t]:[1,2,3,4,5,10]}}const Je=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ts=[".","/","-",":"],es="Z".charCodeAt(0),ss="z".charCodeAt(0),is="A".charCodeAt(0),rs="a".charCodeAt(0),ns="y".charCodeAt(0),as="M".charCodeAt(0),hs="m".charCodeAt(0),os="W".charCodeAt(0),ls="w".charCodeAt(0),cs="d".charCodeAt(0),us="H".charCodeAt(0),ds="h".charCodeAt(0),_s="S".charCodeAt(0),gs="s".charCodeAt(0),ps=function(t){return t<10?"0"+t:String(t)},ms=function(t){return t<10?"00"+t:t<100?"0":String(t)};class ws{static getFormatter(t){let e=ws.Formatters[t];return e||(ws.Formatters[t]=e=new ws(t)),e}static get Default(){return ws.getFormatter(w.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||w.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 a=s[r],h=a.length;switch(a.charCodeAt(0)){case ns:i+=h>2?t.getFullYear():ps(t.getFullYear()%100);break;case as:i+=h>1?ps(t.getMonth()+1):t.getMonth()+1;break;case cs:i+=h>1?ps(t.getDate()):t.getDate();break;case os:i+=h>1?ps(J.weekOfYear(t,e)):J.weekOfMonth(t,e,!0);break;case ls:i+=h>1?J.long_week_days[t.getDay()]:J.week_days[t.getDay()];break;case us:i+=h>1?ps(t.getHours()):t.getHours();break;case ds:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=h>1?ps(e):e}else i+=h>1?ps(t.getHours()):t.getHours();break;case hs:i+=h>1?ps(t.getMinutes()):t.getMinutes();break;case gs:i+=h>1?ps(t.getSeconds()):t.getSeconds();break;case rs:case is:t.getHours()<12?i+=w.am:i+=w.pm;break;case _s:let s=t.getMilliseconds();i+=3==h?ms(s):2==h?ps(s):s.toString().substr(0,h);break;default:i+=a}}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(ts.indexOf(n)>=0)e.push(n),r++;else{let a=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(a,r),Je.indexOf(n)<0){let e=n.charCodeAt(0);(e>=is&&e<=es||e>=rs&&e<=ss)&&D(w.invalidDateFormat,t)}e.push(n)}if(r<i&&J.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&J.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||w.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}ws.Formatters={};const fs=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],xs=[[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]];class ys extends Ue{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}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=fs[e]&&t<fs[e+1]/2)return this.scale=e,xs[e];this.scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],a=r-i;if(0===a)return n;const h=this.axis,o=new Date(h._calcedMin);let l=Math.floor(t/this.stepPixels)+1,c=Math.max(1,Math.floor(a/(l-1)));const u=this._getStepMultiples(c),d=fs[this.scale];if(c/=d,u)if(c>u[0]){let t=0;for(;t<u.length-1;t++)if(c>u[t]&&c<u[t+1]){c=u[t+1];break}}else c=u[0];const _=h.date(i),g=h.date(r);let p,m=_;if(7===this.scale){const t=o.getFullYear();let e=m.getFullYear();this._step=c=Math.ceil(c),m=new Date(e,0),e<t&&e+c>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=c,m=new Date(e,0)}while(m<=g)}else if(6===this.scale){let t=m.getFullYear(),e=m.getMonth();this._step=c=Math.ceil(c),m=new Date(t,e),m<o&&new Date(t,e+c)>o&&(m=new Date(o.getFullYear(),o.getMonth()));do{n.push(+m),e+=c,m=new Date(t,e)}while(m<=g)}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=c=Math.ceil(c),m=new Date(t,e,s),m<o&&new Date(t,e,s+i*c)>o&&(m=new Date(o.getFullYear(),o.getMonth(),o.getDate()));do{n.push(+m),s+=c*i,m=new Date(t,e,s)}while(m<=g)}else{switch(this._step=c,c*=d,this.scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}p=m.getTime();const t=o.getTime();p<t&&p+c>t&&(p=t);do{n.push(p),p+=c}while(p<=r)}return n}}const bs=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd"},{format:"MM-dd",beginningFormat:"YYYY-MM"},{format:"W주 w",beginningFormat:"YYYY-MM"},{format:"YYYY-MM",beginningFormat:"YYYY-MM"},{format:"YYYY"}];class Vs extends se{constructor(){super(...arguments),this.useBeginningFormat=!0,this.startOfWeek=0}_doLoad(t){super._doLoad(t);const e=o(this.timeFormat)?this.timeFormat:void 0,s=o(this.beginningFormat)?this.beginningFormat:void 0,i=this.timeFormats,r=this.useBeginningFormat;if(this._formats=bs.map((t=>Object.assign(t))),h(i))for(let t=0;t<i.length;t++){const n=this._formats[t];if(e)n.format=e,n.beginningFormat=s||e;else{const e=i[t];o(e)?(n.format=e,r||(n.beginningFormat=e)):a(e)&&(o(e.format)&&(n.format=e.format),o(e.beginningFormat)?n.beginningFormat=e.beginningFormat:r||(n.beginningFormat=n.format))}}}getTick(t,e){const s=this.axis,i=this._formats,r=s.tick.scale,n=s.date(e);switch(r){case 7:return ws.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 6:return 0===t||0===n.getMonth()?ws.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):ws.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 5:case 4:return 0===t||1===n.getDate()?ws.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):ws.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 3:return 0===t||0===n.getHours()?ws.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):ws.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 2:return 0===t||0===n.getMinutes()?ws.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):ws.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 1:return 0===t||0===n.getSeconds()?ws.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):ws.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 0:return 0===t||0===n.getMilliseconds()?ws.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):ws.getFormatter(i[r].format).toStr(n,this.startOfWeek)}}}class vs extends Ke{constructor(t,e){super(t,e),this.timeOffset=0,this.baseValue=NaN}type(){return"time"}_createTickModel(){return new ys(this)}_createLabelModel(){return new Vs(this)}_doLoad(t){super._doLoad(t),t&&t.label||this.label.load(null)}collectValues(){this._offset=60*c(this.timeOffset,0)*60*1e3,super.collectValues()}_adjustMinMax(t,e){return super._adjustMinMax(t,e)}parseValue(t){return l(t)?t+this._offset:t instanceof Date?t.getTime():o(t)?new Date(t).getTime():0}getValue(t){return+t}incStep(t,e){if(!o(e))return t+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"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}}}date(t){return new Date(t)}}class Ps extends ae{constructor(t){super(t),this.index=-1,this.size="100%"}get left(){return this._left}set left(t){t!==this._left&&(this._leftDim=C(this._left=t,!0))}get right(){return this._right}set right(t){t!==this._right&&(this._rightDim=C(this._right=t,!0))}get top(){return this._top}set top(t){t!==this._top&&(this._topDim=C(this._top=t,!0))}get bottom(){return this._bottom}set bottom(t){t!==this._bottom&&(this._bottomDim=C(this._bottom=t,!0))}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=C(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=C(this._height=t,!0))}get size(){return this._size}set size(t){t!==this._size&&(this._sizeDim=C(this._size=t,!0))}getSize(t,e){return{width:T(this._widthDim||this._sizeDim,t,t),height:T(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return T(this._leftDim,t)}getRight(t){return T(this._rightDim,t)}getTop(t){return T(this._topDim,t)}getBottom(t){return T(this._bottomDim,t)}}class Ss extends Ps{constructor(){super(...arguments),this.gindex=-1,this.duration=500}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t,e.name);return r.load(e),r}setGroup(t,e){this.group=t,this.gindex=e}}class ks extends Ps{constructor(){super(...arguments),this._gauges=[],this._visibles=[],this.minValue=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]}_doLoadProp(t,e){if("children"===t)return this.$_loadGauges(this.chart,e),!0}prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super.prepareRender(),this._prepareChildren(this._visibles)}_prepareChildren(t){t.forEach(((t,e)=>{this._setGroup(t,e),t.prepareRender()}))}$_loadGauges(t,e){const s=this._gaugesType();h(e)?e.forEach(((e,i)=>this.$_add(Ss._loadGauge(t,e,s)))):a(e)&&this.$_add(Ss._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)}}class As{constructor(t){this._map={},this._items=[],this._visibles=[],this._gauges=[],this.chart=t}get count(){return this._items.length}get firstGauge(){return this._gauges[0]}visibles(){return this._visibles}getGauge(t){const e=this._map[t];if(e instanceof Ss)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],i=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(i[t.name]=t),t instanceof ks)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(i[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,s){let i=h(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getGaugeType(e.type||t.gaugeType),!i)throw new Error("Invalid gauge type: "+e.type);const r=new i(t,e.name||`Gauge ${s+1}`);return r.load(e),r.index=s,r}}class Es extends Ss{constructor(){super(...arguments),this.minValue=0,this.value=0,this.animatable=!0}updateValue(t){t!==this.value&&(this.value=t,this._changed())}getLabel(t,e){return this._runValue=e,t.text||(t.prefix||"")+"${value}"+(t.suffix||"")}getParam(t){switch(t){case"value":return this._runValue;case"min":return this.minValue;case"max":return this.maxValue}}}class Ls extends Tt{constructor(t){super(t.chart),this.scale=t,this.reversed=!1,this.length=7}}class Cs extends Tt{constructor(t,e=!0){super(t.chart,e),this.gauge=t,this._gap=8,this.position=Ms.DEFAULT,this.stepPixels=48,this.line=new Tt(t.chart,!0),this.tick=new Ls(this),this.tickLabel=new Tt(t.chart)}get gap(){return this._gap}set gap(t){this._gap=c(t,0)}buildSteps(t,e,s=NaN){s=c(s,e);const{min:i,max:r}=this._adjustMinMax(Math.min(e,s),Math.max(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)}_adjustMinMax(t,e){const s=this.gauge;return isNaN(s.minValue)||(t=s.minValue),isNaN(s.maxValue)||(e=s.maxValue),this._min=Math.min(t,e),this._max=Math.max(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.minValue,i=e.maxValue;return isNaN(s)&&(s=Math.min(...t)),isNaN(i)&&(i=Math.max(...t)),this._min=Math.min(s,i),this._max=Math.max(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){let i;return i=Array.isArray(this.steps)?this.steps.slice(0):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s):this.stepPixels>0?this._getStepsByPixels(t,this.stepPixels,e,s):[e,s],i}_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,e>Math.floor(e/r)*r?e=Math.floor(e/r)*r:e<Math.ceil(e/r)*r&&(e=Math.ceil(e/r)*r),n.push(e);for(let e=1;e<t;e++)n.push(S(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 a=n/(Math.floor(t/e)+1-1);const h=Math.pow(10,Math.floor(Math.log10(a))),o=this._getStepMultiples(h);let l,c=0;if(a/=h,o)if(a>o[c]){for(;c<o.length-1;c++)if(a>o[c]&&a<o[c+1]){a=o[++c];break}}else a=o[c];for(a*=h,s>Math.floor(s/a)*a?s=Math.floor(s/a)*a:s<Math.ceil(s/a)*a&&(s=Math.ceil(s/a)*a),this._step=a,r.push(S(l=s));l<i;)r.push(S(l+=a));return r}}var Ms,Ts,Ns,Rs;!function(t){t.DEFAULT="default",t.OPPOSITE="opposite",t.INSIDE="inside"}(Ms||(Ms={}));class Os extends Tt{constructor(t){super(t.chart,!1),this.gauge=t,this.position=Ms.DEFAULT,this.thickness=7,this.gap=5,this.itemGap=0,this.rangeLabel=new Tt(t.chart,!1),this.tickLabel=new Tt(t.chart,!0)}get ranges(){return this.$_internalRanges().slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}$_internalRanges(){return this._runRanges||(this._runRanges=z(this._ranges,this.gauge.minValue,this.gauge.maxValue)||[]),this._runRanges}}class Ds extends zt{constructor(t){super(t,!0),this.animatable=!0}}class Bs extends Cs{}class Is extends Ds{constructor(){super(...arguments),this.offsetX=0,this.offsetY=0}getOffset(t,e){return{x:T(this._offsetXDim,t,0),y:T(this._offsetYDim,e,0)}}load(t){return super.load(t),this._offsetXDim=C(this.offsetX,!0),this._offsetYDim=C(this.offsetY,!0),this}}class Fs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX($s.DEF_CENTER),this.setCenterY($s.DEF_CENTER),this.setRadius($s.DEF_RADIUS),this.setInnerRadius($s.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=C(d(t,$s.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=C(d(t,$s.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(d(t,$s.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=C(d(t,$s.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=C(t,!0))}getCenter(t,e){return{x:T(this._centerXDim,t,t/2),y:T(this._centerYDim,e,e/2)}}getExtents(t){const e=T(this._radiusDim,t,t/2);return{radius:e,inner:Math.min(e,this._innerDim?T(this._innerDim,e):0),value:this._valueDim?T(this._valueDim,e):e}}prepareAngles(t,e){const s=c(t%360,0),i=Math.max(0,Math.min(360,c(e,360)));this._startRad=b+V*s,this._handRad=V*s,this._sweepRad=V*i}}class $s extends Es{constructor(t){super(t),this.props=new Fs,this.maxValue=100,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.label=new Is(t)}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}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}setGroup(t,e){super.setGroup(t,e),t&&!this.childProps&&(this.childProps=new Fs)}_doPrepareRender(t){super._doPrepareRender(t);const e=this.group;e?this.childProps.prepareAngles(e.startAngle,e.sweepAngle):this.props.prepareAngles(this.startAngle,this.sweepAngle)}}$s.DEF_CENTER="50%",$s.DEF_RADIUS="40%",$s.DEF_INNER="80%";class Gs extends ks{constructor(){super(...arguments),this.props=new Fs,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.itemGap=4,this.labelGap=10}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}getCenter(t,e){return this.props.getCenter(t,e)}getExtents(t){return this.props.getExtents(t)}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this.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}))}}}class Hs extends Tt{constructor(t){super(t.chart,!0),this.gauge=t}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}isRanged(){const t=this.$_internalRanges();return t&&t.length>0}rangeCount(){const t=this.$_internalRanges();return t?t.length:0}getRange(t){const e=this.$_internalRanges();if(e)for(const s of e)if(t>=s.fromValue&&t<s.toValue)return s}$_internalRanges(){return this._runRanges||(this._runRanges=z(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class zs extends Hs{constructor(t){super(t),this.segmentGap=0}get segmentThickness(){return this._segmentThickness}set segmentThickness(t){t!==this._segmentThickness&&(this._segmentThickness=t,this._thickDim=C(this.segmentThickness,!0))}getSegmentThickness(t){return T(this._thickDim,t,t)}}class js extends Hs{constructor(t){super(t),this.stroked=!1,this.thickness="100%"}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=C(this.thickness,!0))}getThickness(t){return T(this._thickDim,t,t)}}class Ws extends Tt{constructor(t){super(t.chart,!1)}}class Ys extends Tt{constructor(t){super(t.chart,!1),this.radius=3,this.length="100%",this.offset=0}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(t,!0))}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=C(t,!0))}get offset(){return this._offset}set offset(t){t!==this._offset&&(this._offset=t,this._offsetDim=C(t,!0))}getExtents(t){return{radius:T(this._radiusDim,t,0),length:T(this._lengthDim,t,0),offset:T(this._offsetDim,t,0)}}}class Us extends Tt{constructor(t){super(t.chart,!1),this.radius=5}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(t,!0))}getRadius(t){return T(this._radiusDim,t,0)}}class Xs extends Cs{constructor(){super(...arguments),this.stepPixels=92}_getStepMultiples(t){return[1,3,6,12]}}class qs extends Gs{constructor(t){super(t),this.innerRadius="50%"}_type(){return"circlegroup"}_gaugesType(){return"circle"}}class Ks extends Tt{constructor(t){super(t.chart),this.thickness=7}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=C(this.thickness,!0))}getThickness(t){return T(this._thickDim,t,t)}}class Zs extends Tt{constructor(t,e,s){super(t.chart),this.thickness=e,this.length=s}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=C(t,!0))}getLength(t){return T(this._lengthDim,t,t)}}class Qs extends Zs{constructor(){super(...arguments),this.animatable=!1,this.duration=200}}class Js extends Tt{constructor(t,e){super(t.chart),this.length=e}}class ti extends Tt{constructor(t){super(t.chart),this.step=1,this.offset=1}}class ei extends Tt{constructor(t,e){super(t.chart),this.raidus=e}}class si extends zt{constructor(t){super(t.chart,!0),this.position="top",this.text="RealChart Clock<br>ver1.0"}}class ii extends de{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class ri extends de{}class ni extends Ie{constructor(){super(...arguments),this.borderRaidus=0,this.colorByPoint=!1}_type(){return"bar"}canCategorized(){return!0}_colorByPoint(){return this.colorByPoint}_createPoint(t){return new ri(t)}_getGroupBase(){return this.group?this.group.baseValue:this.baseValue}}class ai extends He{constructor(){super(...arguments),this.baseValue=0}_type(){return"bargroup"}_seriesType(){return"bar"}_canContain(t){return t instanceof ni}getBaseValue(t){return t._isX?NaN:c(this.baseValue,t.getBaseValue())}_doPrepareSeries(t){if(this.layout===Le.DEFAULT){const e=t.length>1?t.map((t=>t.pointWidth)).reduce(((t,e)=>t+e),0):t[0].pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.pointWidth/e,t._childPos=s,s+=t._childWidth}))}else this.layout,Le.STACK}}class hi extends dt{constructor(t,e=f,s=f){super(t,e),this.setAttr("shapeRendering","cripsEdges"),s&&this.setLine(s)}setLine(t,e,s,i){J.isNumber(t)?this.setPath(at.line(t,e,s,i)):t&&this.setPath(at.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(at.line(t,e,t,s))}setVLineC(t,e,s){this.setPath(at.line(t,e,t,s))}setHLine(t,e,s){this.setPath(at.line(e,t,s,t))}setHLineC(t,e,s){this.setPath(at.line(e,t,s,t))}}class oi extends ot{constructor(t,e){super(t,ke.LEGEND_MARKER),this._size=e,this.add(this._line=new hi(t)),this._line.setHLine(e/2,0,2*e),this.add(this._marker=new dt(t)),this._marker.translate(e/2,0),this.setShape(it.CIRCLE,12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,at.setShape(this._marker,t,(this._size=e)/2),this._marker.translate(e/2,0),this._line.setHLine(e/2,0,2*e))}}class li extends de{}class ci extends Ne{constructor(){super(...arguments),this.radius=4,this.firstVisible=Ee.DEFAULT,this.lastVisible=Ee.DEFAULT,this.minVisible=Ee.DEFAULT,this.maxVisible=Ee.DEFAULT}}class ui extends ke{constructor(){super(...arguments),this.marker=new ci(this),this.nullAsBase=!1}getShape(t){return t&&t.shape||this.marker.shape||this._shape}getRadius(t){return c(t.radius,this.marker.radius)}_createPoint(t){return new li(t)}hasMarker(){return!0}setShape(t){this._shape=t}}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Ts||(Ts={}));class di extends ui{constructor(){super(...arguments),this.lineType=Gt.DEFAULT,this.stepDir=Ts.FORWARD,this.connectNullPoints=!1,this.baseValue=0}_type(){return"line"}getLineType(){return this.lineType}_createLegendMarker(t,e){return new oi(t,e)}legendMarker(t){const e=super.legendMarker(t);return e.setShape(this.getShape(null),Math.min(he.MARKER_SIZE,2*this.marker.radius)),e}}class _i extends li{}class gi extends di{_type(){return"area"}_createPoint(t){return new _i(t)}_doPrepareRender(){super._doPrepareRender(),this._base=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t._isX?NaN:this._base}}class pi extends _i{parse(t){super.parse(t),this.y=this.high=d(this.high,this.low),this.lowValue=parseFloat(this.low),this.highValue=this.yValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.highValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.high=e[c(t.highField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.high=d(e[t.lowField],e.high)}_readSingle(t){super._readSingle(t),this.low=this.y}}class mi extends $e{constructor(){super(...arguments),this.baseValue=0}_type(){return"linegroup"}_seriesType(){return"line"}_canContain(t){return t instanceof di}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class wi extends $e{constructor(){super(...arguments),this.baseValue=0}_type(){return"areagroup"}_seriesType(){return"area"}_canContain(t){return t instanceof gi}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class fi extends _i{}class xi extends de{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.minValue}_assignTo(t){return Object.assign(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue})}_readArray(t,e){const s=e.length>5?1:0;this.min=e[c(t.minField,0+s)],this.low=e[c(t.lowField,1+s)],this.mid=e[c(t.midField,2+s)],this.high=e[c(t.highField,3+s)],this.y=e[c(t.yField,4+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.min=d(e[t.minField],e.min),this.low=d(e[t.lowField],e.low),this.mid=d(e[t.midField],e.mid),this.high=d(e[t.highField],e.high),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue)||isNaN(this.highValue))}}class yi extends de{getLabel(t){return this.z}parse(t){super.parse(t),this.zValue=parseFloat(this.z)}_assignTo(t){return Object.assign(super._assignTo(t),{z:this.z,zValue:this.zValue})}_readArray(t,e){if(null===e)this.isNull=!0;else{const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.z=e[c(t.zProp,1+s)],s>0&&(this.x=e[c(t.xField,0)])}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=d(e[t.zProp],e.z))}_readSingle(t){super._readSingle(t),this.z=this.y}}!function(t){t.WIDTH="width",t.AREA="area"}(Ns||(Ns={}));class bi extends de{parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high})}_readArray(t,e){const s=e.length>4?1:0;this.low=e[c(t.lowField,0+s)],this.open=e[c(t.openField,1+s)],this.close=e[c(t.closeField,2+s)],this.y=this.high=e[c(t.highField,3+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.row),this.open=d(e[t.openField],e.open),this.close=d(e[t.closeField],e.close),this.high=d(e[t.highField],e.high),isNaN(this.high)?isNaN(this.y)||(this.high=this.y):this.y=this.high}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.high=this.y}}class Vi extends Fe{_type(){return"candlestick"}canCategorized(){return!0}_createPoint(t){return new bi(t)}_getBottomValue(t){return t.lowValue}}class vi extends Ne{constructor(){super(...arguments),this.radius=4,this.shape=it.CIRCLE}}class Pi extends de{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.lowValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class Si extends de{}class ki extends de{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.isNull||(this.isNull=isNaN(this.lowValue))}}class Ai extends Re{}class Ei extends Oe{constructor(t,e){super(t,e),this.width=Ei.DEF_WIDTH,this.height=Ei.DEF_HEIGHT,this.neckWidth=Ei.DEF_NECK_WIDTH,this.neckHeight=Ei.DEF_NECK_HEIGHT,this.reversed=!1,this.legendByPoint=!1}getSize(t,e){return{width:Math.max(.1*t,T(this._widthDim,t)),height:Math.max(.1*e,T(this._heightDim,e))}}getNeckSize(t,e){return{width:J.clamp(T(this._neckWidthDim,t),.1*t,t),height:J.clamp(T(this._neckHeightDim,e),.1*e,e)}}_type(){return"funnel"}_createPoint(t){return new Ai(t)}load(t){return super.load(t),this._widthDim=M(this.width,Ei.DEF_WIDTH),this._heightDim=M(this.height,Ei.DEF_HEIGHT),this._neckWidthDim=M(this.neckWidth,Ei.DEF_NECK_WIDTH),this._neckHeightDim=M(this.neckHeight,Ei.DEF_NECK_HEIGHT),this}}Ei.DEF_WIDTH="85%",Ei.DEF_HEIGHT="90%",Ei.DEF_NECK_WIDTH="30%",Ei.DEF_NECK_HEIGHT="30%";class Li extends de{parse(t){super.parse(t),this.heatValue=parseFloat(this.heat),this.isNull||(this.isNull=isNaN(this.heatValue))}_assignTo(t){return Object.assign(super._assignTo(t),{heat:this.heat,heatValue:this.heatValue})}_readArray(t,e){const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.heat=e[c(t.heatField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.heat=d(e[t.heatField],e.color)}_readSingle(t){super._readSingle(t)}getLabel(t){return this.heat}}class Ci extends de{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return Object.assign(super._assignTo(t),{min:this.min,max:this.max})}}!function(t){t.SQURE_ROOT="squreRoot",t.STURGES="struges",t.RICE="rice"}(Rs||(Rs={}));const Mi={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 Ti extends Ne{constructor(){super(...arguments),this.radius=4,this.shape=it.CIRCLE}}class Ni extends de{}class Ri extends bi{}class Oi extends de{}class Di extends Re{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get endAngle(){return this.startAngle+this.angle}parse(t){super.parse(t),this.sliced=this.source.sliced}_assignTo(t){return Object.assign(super._assignTo(t),{sliced:this.sliced})}}class Bi extends zt{constructor(){super(null,!0)}}class Ii extends De{constructor(){super(...arguments),this.groupSize=1,this.labelDistance=25,this.sliceOffset="7%",this.autoSlice=!0,this.sliceDuration=300,this.borderRadius=0,this.innerText=new Bi}hasInner(){return this._innerDim&&this._innerDim.size>0}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return this._sliceDim?T(this._sliceDim,t):0}_type(){return"pie"}_createPoint(t){return new Di(t)}_doLoad(t){super._doLoad(t),this._innerDim=C(this.innerRadius,!0),this._sliceDim=C(this.sliceOffset,!0)}_doPrepareRender(){super._doPrepareRender();let t=c(this.startAngle%360,0),e=Math.max(0,Math.min(360,c(this.totalAngle,360)));this._startRad=b+V*t,this._totalRad=V*e,this._groupPos=NaN}}class Fi extends $e{constructor(){super(...arguments),this.polarSize="80%",this.innerSize=0}getPolarSize(t,e){return T(this._polarDim,Math.min(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}_type(){return"piegroup"}_seriesType(){return"pie"}needAxes(){return!1}_canContain(t){return t instanceof Ii}_doLoad(t){super._doLoad(t),this._polarDim=C(this.polarSize,!0)||{size:80,fixed:!1},this._innerDim=C(this.innerSize,!0)}_doPrepareSeries(t){if(this.layout===Le.STACK||this.layout===Le.FILL){const e=t.map((t=>t.groupSize)).reduce(((t,e)=>t+c(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=c(t.groupSize,1)/e}))}}}class $i extends de{}class Gi extends de{_assignTo(t){return Object.assign(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){super._readArray(t,e),this.id=k(e[parseInt(t.idField)]),this.group=k(e[parseInt(t.groupField)])}_readObject(t,e){super._readObject(t,e),this.id=k(e[t.idField]),this.group=k(e[t.groupField])}}class Hi{constructor(t){this.point=t}getArea(){return{x:this.x,y:this.y,width:this.width,height:this.height}}setArea(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}getTotal(){return this.children.reduce(((t,e)=>t+e.value),0)}}var zi,ji,Wi,Yi;!function(t){t.SQUARIFY="squarify",t.STRIP="strip",t.SLICE="slice",t.SLICE_DICE="sliceDice"}(zi||(zi={}));class Ui extends de{_assignTo(t){return Object.assign(super._assignTo(t),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})}_readArray(t,e){const s=e.length>3?1:0;this.y=e[c(t.yField,0+s)],this.length=e[c(t.lengthField,1+s)],this.angle=e[c(t.angleField,2+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.length=d(e[t.lengthField],e.length),this.angle=d(e[t.angleField],e.angle),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.length=this.angle=this.y}parse(t){super.parse(t),this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))}}!function(t){t.CENTER="center",t.START="start",t.END="end"}(ji||(ji={})),function(t){t.NONE="none",t.CLOSE="close",t.OPEN="open"}(Wi||(Wi={}));class Xi extends de{constructor(){super(...arguments),this.low=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._intermediate=this.source.intermediate,this._isSum&&(this.y=0),this.save=this.y}}class qi extends Ds{constructor(t){super(t),this.maxWidth="30%",this.maxHeight="30%",this.gap="5%"}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=C(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=C(t,!0))}get maxWidth(){return this._maxWidth}set maxWidth(t){t!==this._maxWidth&&(this._maxWidth=t,this._maxWidthDim=C(t,!0))}get maxHeight(){return this._maxHeight}set maxHeight(t){t!==this._maxHeight&&(this._maxHeight=t,this._maxHeightDim=C(t,!0))}get gap(){return this._gap}set gap(t){t!==this._gap&&(this._gap=t,this._gapDim=C(t,!0))}getWidth(t){return T(this._widthDim,t)}getHeight(t){return T(this._heightDim,t)}getMaxWidth(t){return T(this._maxWidthDim,t)}getMaxHeight(t){return T(this._maxHeightDim,t)}getGap(t){return T(this._gapDim,t,0)}}class Ki extends Es{constructor(t){super(t),this.reversed=!1,this.scale=new Bs(this),this.label=new qi(this.chart)}isVertical(){return this.group?this.group.vertical:this.vertical}scaleVisible(){return!this.group&&this.scale.visible}}!function(t){t.BAR="bar",t.needle="needle"}(Yi||(Yi={}));class Zi extends Tt{constructor(t){super(t.chart,!0),this.gauge=t}}class Qi extends Tt{constructor(t){super(t.chart,!0),this.gauge=t}}class Ji{constructor(){this.opposite=!1,this.gap=10}}class tr extends ks{constructor(t){super(t),this.vertical=!0,this.itemLabel=new Ji,this.scale=new Bs(this),this.itemGap=10,this.label=new qi(t),this.label.gap=10}}class er extends tr{_type(){return"lineargroup"}_gaugesType(){return"linear"}}class sr extends Tt{constructor(t){super(t.chart),this.gauge=t,this.vertical=!1}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=C(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=C(t,!0))}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}$_internalRanges(){return this._runRanges||(this._runRanges=z(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class ir extends Tt{constructor(t){super(t.chart)}}class rr extends Tt{constructor(t){super(t.chart)}}class nr extends tr{_type(){return"bulletgroup"}_gaugesType(){return"bullet"}}const ar={bar:ai,line:mi,area:wi,pie:Fi,bargroup:ai,linegroup:mi,areagroup:wi,piegroup:Fi,bump:class extends Ge{_type(){return"bump"}_seriesType(){return"line"}_canContain(t){return t instanceof di}_doConstraintYValues(t){const e={};t.forEach((t=>{t._runPoints.forEach((t=>{const s=t.xValue;let i=e[s];i?i.push(t):e[s]=[t]}))}));for(const t in e){const s=e[t].sort(((t,e)=>t.yValue-e.yValue));for(let t=s.length-1;t>=0;t--)s[t].yValue=s[t].yGroup=t}return J.makeIntArray(0,t.length)}}},hr={area:gi,arearange:class extends ui{constructor(){super(...arguments),this.curved=!1}_type(){return"arearange"}_createPoint(t){return new pi(t)}getLineType(){return this.curved?Gt.SPLINE:Gt.DEFAULT}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}},bar:ni,barrange:class extends Fe{_type(){return"barrange"}pointLabelCount(){return 2}_createPoint(t){return new ii(t)}_getBottomValue(t){return t.lowValue}},bellcurve:class extends gi{constructor(){super(...arguments),this.sigmas=3,this.pointsInSigma=5,this.curved=!1}_type(){return"bellcurve"}getLineType(){return this.curved?Gt.SPLINE:Gt.DEFAULT}_createPoint(t){return new fi(t)}_loadData(t){const e=super._loadData(t);if(h(e))return this.$_loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.name===this.source||t.index===this.source))return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=t._runPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this.$_loadTable(e);this._doLoadPoints(s),this._runPoints=this._points.getPoints(),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}$_loadTable(t){const e=t.length;if(e<1)return;const s=t.reduce(((t,e)=>t+e),0)/e,i=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-s,2)))/(e-1)),r=i/this.pointsInSigma,n=s-this.sigmas*i,a=s+this.sigmas*i;let h=s;const o=[];for(o.push(this.$_getDenstiy(s,i,h));h>n;)h-=r,o.unshift(this.$_getDenstiy(s,i,h));for(h=s;h<a;)h+=r,o.push(this.$_getDenstiy(s,i,h));return o}$_getDenstiy(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}}},boxplot:class extends Fe{_type(){return"boxplot"}pointLabelCount(){return 2}_createPoint(t){return new xi(t)}_getBottomValue(t){return t.minValue}},bubble:class extends ke{constructor(t,e){super(t,e),this.sizeMode=Ns.AREA,this.minSize=8,this.maxSize="20%",this.colorByPoint=!1,this.radius=3}getPixelMinMax(t){return{min:T(this._minDim,t),max:T(this._maxDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return this.sizeMode==Ns.AREA&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_type(){return"bubble"}ignoreAxisBase(t){return!0}_createPoint(t){return new yi(t)}_colorByPoint(){return this.colorByPoint}load(t){return super.load(t),this._minDim=C(this.minSize,!0),this._maxDim=C(this.maxSize,!0),this}_doPrepareRender(){super._doPrepareRender(),this._zMin=Number.MAX_VALUE,this._zMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{t.isNull||isNaN(t.zValue)||(this._zMin=Math.min(this._zMin,t.zValue),this._zMax=Math.max(this._zMax,t.zValue))})),this._noSize=this._zMin===this._zMax}},candlestick:Vi,dumbbell:class extends Be{constructor(){super(...arguments),this.marker=new vi(this)}_type(){return"dumbbell"}canCategorized(){return!0}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+Math.max(0,this.marker.radius)}_createPoint(t){return new Pi(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=t.lowValue;!isNaN(s)&&e.push(s)}))}},equalizer:class extends Ie{constructor(){super(...arguments),this.segmentSize=10,this.segmentGap=4,this.segmented=!1,this.backSegments=!1}getSegmentSize(t){return T(this._segmentDim,t)}_type(){return"equalizer"}canCategorized(){return!0}_createPoint(t){return new Si(t)}_doLoad(t){super._doLoad(t),this._segmentDim=C(this.segmentSize,!1)}},errorbar:class extends Fe{constructor(){super(...arguments),this.pointPadding=.3}_type(){return"errorbar"}clusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new ki(t)}_getBottomValue(t){return t.lowValue}},funnel:Ei,heatmap:class extends ke{getColor(t){}_type(){return"heatmap"}canMixWith(t){return!1}canCategorized(){return!0}defaultYAxisType(){return"category"}_createPoint(t){return new Li(t)}_doPrepareRender(){super._doPrepareRender(),this._heatMin=Number.MAX_VALUE,this._heatMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{isNaN(t.heatValue)||(this._heatMin=Math.min(this._heatMin,t.heatValue),this._heatMax=Math.max(this._heatMax,t.heatValue))}))}},histogram:class extends ke{constructor(){super(...arguments),this.binsNumber=Rs.SQURE_ROOT,this.baseValue=0}getBinCount(t){const e=c(this.binWidth,0);if(e>0)return t/e;return c(this.binsNumber,0)<1?Mi[this.binsNumber||Rs.SQURE_ROOT](t):void 0}_type(){return"histogram"}ignoreAxisBase(t){return t===this._xAxisObj}_createPoint(t){return new Ci(t)}_doLoadPoints(t){function e(t){let e;return e=h(t)?t[c(this.yField,0)]:a(t)?_(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=[];let i=[];for(let s=0;s<t.length;s++){const r=e(t[s]);isNaN(r)||i.push(r)}if(i.length>0){i=i.sort(((t,e)=>t-e)),this.minValue<i[0]&&i.unshift(this.minValue),this.maxValue>i[i.length-1]&&i.push(this.maxValue);const t=i.length,e=i[0],r=i[t-1],n=this.getBinCount(t),a=this._binInterval=(r-e)/n;let h=0,o=e,l=o+a;for(let e=0;e<n;e++){let c=0;if(e==n-1)c=t-h;else for(;h<t&&i[h]<l;)c++,h++;s.push({x:o,y:c,min:o,max:e===n-1?r:l}),o=l,l=o+a}}super._doLoadPoints(s)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._runPoints[this._runPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}},line:di,lollipop:class extends Ie{constructor(){super(...arguments),this.marker=new Ti(this)}_type(){return"lollipop"}canCategorized(){return!0}getLabelOff(t){return t+this.marker.radius}_createPoint(t){return new Ni(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}},ohlc:class extends Vi{_type(){return"ohlc"}_createPoint(t){return new Ri(t)}},pareto:class extends ui{constructor(){super(...arguments),this.curved=!1}_type(){return"pareto"}getLineType(){return this.curved?Gt.SPLINE:Gt.DEFAULT}_createPoint(t){return new Oi(t)}_referOtherSeries(t){if(t.name===this.source||t.index===this.source)return t.referBy(this),!0}reference(t,e){e._isX||(this.$_loadPoints(t._runPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values))}$_loadPoints(t){const e=[],s=t.reduce(((t,e)=>t+c(e.yValue,0)),0);let i=0;t.forEach((t=>{t.isNull||e.push({x:t.xValue,y:i+=100*t.yValue/s})})),this._doLoadPoints(e),this._runPoints=this._points.getPoints()}},pie:Ii,scatter:class extends ke{constructor(t,e){super(t,e),this.radius=5,this.jitterX=0,this.jitterY=0}_type(){return"scatter"}ignoreAxisBase(t){return!0}_createPoint(t){return new $i(t)}},treemap:class extends ke{constructor(){super(...arguments),this.idField="id",this.groupField="group",this.algorithm=zi.SQUARIFY,this.alternate=!0,this._map={}}buildMap(t,e){function s(t){if(t.children){let e=0;t.children.forEach(((t,i)=>{s(t),e+=t.value})),t.value=e,t.children=t.children.sort(((t,e)=>e.value-t.value)),t.children.forEach(((t,e)=>{t.index=e}))}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this.startDir||e>t,r=this._leafs=[];return this._roots.forEach(((t,e)=>{s(t)})),this._roots=this._roots.sort(((t,e)=>e.value-t.value)),this._roots.forEach(((t,e)=>{t.index=e})),(this[this.algorithm]||this.squarify).call(this,this._roots,t,e,i),this._leafs}_type(){return"treemap"}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new Gi(t)}getLabeledPoints(){return this._leafs.map((t=>t.point))}_doPrepareRender(){super._doPrepareRender(),this._roots=this.$_buildTree(this._runPoints)}$_buildTree(t){const e=[],s=[],i=this._map;t.forEach((t=>{if(t.id||!t.isNull){const r=new Hi(t);t.id&&(i[t.id]=r),t.group?s.push(r):e.push(r)}}));for(let t=s.length-1;t>=0;t--){const r=s[t],n=i[r.point.group];(r.parent=n)?(n.children||(n.children=[]),n.children.push(r),r.children&&s.splice(t,1)):(e.push(r),s.splice(t,1))}return e}$_squarifyRow(t,e,s,i){const r=e.width*e.height,n=e.width,a=e.height;let h=e.x,o=e.y,l=Number.MAX_VALUE,c=0;const u=[];for(;t.length>0;){let d,_,g,p,m;if(d=t.shift(),c+=d.value,p=c*r/i,1===s?(_=p/a,g=a*d.value/c):(g=p/n,_=n*d.value/c),m=Math.max(_/g,g/_),t.length>0&&m>l)return t.unshift(d),c-=d.value,p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),1===s?(e.x+=_,e.width-=_):(e.y+=g,e.height-=g),i-c;if(0===t.length)return p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.push(d),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),0;l=m,u.push(d)}}$_squarify(t,e,s,i){const r=t.slice(0);let n=s?1:0,a=t.reduce(((t,e)=>t+e.value),0);do{a=this.$_squarifyRow(r,e,n,a),i&&(n=1-n)}while(a>0);t.forEach((t=>{t.children&&this.$_squarify(t.children,t.getArea(),!s,!0)}))}squarify(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!0)}strip(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!1)}$_sliceNext(t,e,s,i){if(t.x=e.x,t.y=e.y,1===s){const s=e.height*t.value/i;t.width=e.width,t.height=s,e.y+=s,e.height-=s}else{const s=e.width*t.value/i;t.height=e.height,t.width=s,e.x+=s,e.width-=s}t.children&&this.$_slice(t.children,t.getArea(),0===s,!0)}$_slice(t,e,s,i){let r=t.reduce(((t,e)=>t+e.value),0),n=s?1:0;t.forEach((t=>{this.$_sliceNext(t,e,n,r),r-=t.value,i&&(n=1-n)}))}slice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!1)}sliceDice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!0)}},vector:class extends ke{constructor(){super(...arguments),this.origin=ji.CENTER,this.maxLength=20,this.startAngle=0,this.arrowHead=Wi.CLOSE}_type(){return"vector"}ignoreAxisBase(t){return!0}_createPoint(t){return new Ui(t)}_doLoad(t){super._doLoad(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length>0){const e=this.maxLength,s=this.origin,i=t.map((t=>t.length)).reduce(((t,e)=>Math.max(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case ji.START:case ji.END:t._off=t._len/2;break;default:t._off=0}}))}}},waterfall:class extends Fe{constructor(t,e){super(t,e)}_type(){return"waterfall"}canCategorized(){return!0}_createPoint(t){return new Xi(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length<1)return;let e,s,i=t[0],r=i.y=i._isSum?0:i.y,n=r,a=r,h=r,o=0;for(let l=1,c=t.length;l<c;l++){if(i=t[l],i._isSum){const e=t[l-1],r=!0===i._intermediate||l<c-1&&!1!==i._intermediate,n=i.save=i.y=r?h:a;i.yGroup=i.yValue=i.y,r?h<0?(o=e.low,s=o-n):(s=e.y,o=s-n):(o=t[0].low,s=o+n),h=0}else e=i.y,e<0?n<0?(s=r+n,o=s+e):(s=r,o=s+e):(o=r,s=o+e),h+=e,a+=e;n=i.y,i.y=r=s,i.low=o}}_getBottomValue(t){return t.y=t.save,NaN}}},or={category:be,linear:Ze,time:vs,date:vs,log:class extends Ke{type(){return"log"}_createTickModel(){return new Qe(this)}_doCalcluateRange(t){const e=super._doCalcluateRange(t);return e.min=Math.log10(e.min),e.max=Math.log10(e.max),e}_createTick(t,e,s){return super._createTick(t,e,Math.pow(10,s))}getPosition(t,e){return e=e>0?Math.log10(e):0,super.getPosition(t,e)}}},lr={circle:class extends $s{constructor(t){super(t),this.bandRim=new Os(this),this.scaleRim=new Xs(this,!1),this.rim=new zs(this),this.valueRim=new js(this),this.marker=new Ws(this),this.hand=new Ys(this),this.pin=new Us(this)}_type(){return"circle"}getExtents(t){const e=super.getExtents(t),s=this.scaleRim,i=this.bandRim;let r=e.radius;if(i.visible&&i.position===Ms.DEFAULT){r+=i.thickness+i.gap,e.band=r}if(s.visible&&s.position===Ms.DEFAULT){r+=Math.max(1,s.tick.length||0)+s.gap,e.scale=r}return e}},linear:class extends Ki{constructor(t){super(t),this.markerType=Yi.BAR,this.bar=new Zi(this),this.needle=new Qi(this),this.band=new Os(this)}_type(){return"linear"}},bullet:class extends Ki{constructor(t){super(t),this.band=new sr(this),this.targetBar=new ir(this),this.actualBar=new rr(this)}getRanges(t,e){return z(this.ranges,t,e)}_type(){return"bullet"}_doLoad(t){super._doLoad(t)}},clock:class extends Ss{constructor(t){super(t),this._active=!0,this.centerX=$s.DEF_CENTER,this.centerY=$s.DEF_CENTER,this.radius=$s.DEF_RADIUS,this.rim=new Ks(this),this.hourHand=new Zs(this,7,"60%"),this.minuteHand=new Zs(this,5,"85%"),this.secondHand=new Qs(this,2,"95%"),this.tick=new Js(this,10),this.minorTick=new Js(this,5),this.tickLabel=new ti(this),this.pin=new ei(this,5),this.label=new si(this)}get active(){return this._active}set active(t){t!==this._active&&(this._active=t,this._changed())}getTime(){return this.time instanceof Date?this.time:o(this.time)?new Date(this.time):isNaN(this.time)?void 0:new Date(this.time)}getExtendts(t,e){const s=Math.min(t,e);return{cx:T(this._centerXDim,t,t/2),cy:T(this._centerYDim,e,e/3),rd:T(this._radiusDim,s,s/2)}}_type(){return"clock"}_doLoad(t){super._doLoad(t),this._centerXDim=C(d(this.centerX,$s.DEF_CENTER),!0),this._centerYDim=C(d(this.centerY,$s.DEF_CENTER),!0),this._radiusDim=C(d(this.radius,$s.DEF_RADIUS),!0)}}},cr={circle:qs,linear:er,bullet:nr,circlegroup:qs,lineargroup:er,bulletgroup:nr};class ur extends Tt{constructor(){super(...arguments),this.text="RealChart v1.0",this.url="http://realgrid.com",this.floating=!1,this.align=B.RIGHT,this.verticalAlign=I.BOTTOM,this.offsetX=2,this.offsetY=1}}class dr extends Tt{constructor(){super(...arguments),this.paletteMode=Ce.NORMAL,this.animatable=!0,this.xStart=0,this.xStep=1,this.axisGap=8,this.credits=new ur(null)}}class _r extends r{constructor(t){super(),this.type="bar",this.gaugeType="circle",this.polar=!1,this._assets=new ft,this._themes=new je,this._options=new dr(this),this._title=new We(this),this._subtitle=new Ye(this),this._legend=new oe(this),this._series=new Ae(this),this._xAxes=new re(this,!0),this._yAxes=new re(this,!1),this._gauges=new As(this),this._body=new ne(this),t&&this.load(t),this._polar=!0===this.polar}startAngle(){return this.body.getStartAngle()}get xStart(){return+this._options.xStart}get xStep(){return+this._options.xStep}get xStepUnit(){}animatable(){return!1!==this._options.animatable}get assets(){return this._assets}get options(){return this._options}get title(){return this._title}get subtitle(){return this._subtitle}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){return this._gauges.firstGauge}get legend(){return this._legend}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}get body(){return this._body}needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}isGauge(){return this._gaugeOnly}isPolar(){return this._polar}isWidget(){return this._series.isWidget()}isInverted(){return!this._polar&&this._inverted}isEmpty(){return this._series.isEmpty()&&0===this._gauges.count}seriesByName(t){return this._series.getSeries(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){return this._gauges.getGauge(t)}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getAxes(t){const e=this._xAxes.items,s=this._yAxes.items;let i;if(this.isInverted())switch(t){case F.LEFT:i=e.filter((t=>!t._isOpposite));break;case F.RIGHT:i=e.filter((t=>t._isOpposite));break;case F.BOTTOM:i=s.filter((t=>!t._isOpposite));break;case F.TOP:i=s.filter((t=>t._isOpposite))}else switch(t){case F.LEFT:i=s.filter((t=>!t._isOpposite));break;case F.RIGHT:i=s.filter((t=>t._isOpposite));break;case F.BOTTOM:i=e.filter((t=>!t._isOpposite));break;case F.TOP:i=e.filter((t=>t._isOpposite))}return i||[]}_getLegendSources(){return this._series.getLegendSources()}$_assignTemplates(t){if(null!=t.template){let e=this._templates[t.template];if(e)return g(e,t)}return t}load(t){console.time("load chart"),this.$_loadTemplates(t.templates),["type","gaugeType","polar","inverted"].forEach((e=>{e in t&&(this[e]=t[e])})),this.type=this.type||"bar",this.gaugeType=this.gaugeType||"circle",this._assets.load(t.assets),this._themes.load(t.themes),this._options.load(t.options),this._title.load(t.title),this._subtitle.load(t.subtitle),this._legend.load(t.legend),this._series.load(t.series),this._gauges.load(t.gauges||t.gauge),this._gaugeOnly=0==this._series.count&&this._gauges.count>0,this._gaugeOnly||(this._xAxes.load(t.xAxes||t.xAxis||{}),this._yAxes.load(t.yAxes||t.yAxis||{})),this._body.load(t.plot),this._inverted=this.inverted,console.log("chart-items:",Mt),console.timeEnd("load chart")}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}prepareRender(){this._xAxes.disconnect(),this._yAxes.disconnect(),this._series.prepareRender(),this._xAxes.collectValues(),this._yAxes.collectValues(),this._xAxes.collectReferentsValues(),this._yAxes.collectReferentsValues(),this._xAxes.prepareRender(),this._yAxes.prepareRender(),this._series.prepareAfter(),this._legend.prepareRender(),this._gauges.prepareRender()}layoutAxes(t,e,s,i){this._xAxes.buildTicks(s?e:t),this._yAxes.buildTicks(s?t:e),this.$_calcAxesPoints(t,e,s,0)}calcAxesPoints(t,e,s){this.$_calcAxesPoints(t,e,s,1)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{t.calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{t.calcPoints(r,i)}))}update(){}$_loadTemplates(t){if(a(t)){const e=this._templates={};for(const s in t){const i=t[s];a(i)&&(e[s]=Object.assign({},i))}this.assignTemplates=this.$_assignTemplates.bind(this)}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&ar[t.toLowerCase()]}_getSeriesType(t){return o(t)&&hr[t.toLowerCase()]}_getAxisType(t){return o(t)&&or[t.toLowerCase()]}_getGaugeType(t){return o(t)&&lr[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&cr[t.toLowerCase()]}getAxesGap(){return this._options.axisGap||0}_modelChanged(t){this._fireEvent("onModelChanged",t)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}class gr extends s{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}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()}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),this._owner.add(i),i}prepare(t,e,s){const i=this._owner.doc,r=this._pool,n=this._views;for(;n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(i);n.push(e),null==s||s(e,n.length-1,t)}return e&&this.forEach(e),this}reprepare(t,e,s,i,r,n){const a=this._owner.doc,h=this._pool,o=this._views,l=[];for(let t=this._removes.length-1;t>=0;t--)if(!this._removes[t].parent){const e=this._removes.splice(t,1)[0];h.push(e)}for(let i=0,n=e.length;i<n;i++){const h=e[i];let c=-1;if(t)for(let e=0,i=o.length;e<i;e++){const i=o[e][t];if(s&&i===h[s]||!s&&i===h){l.push(o[e]),c=e;break}}if(c>=0){const t=o.splice(c,1)[0];t.parent||this._owner.add(t)}else{const t=this.$_create(a,i,n);l.push(t),null==r||r(t,i,n)}}for(let t=0,e=o.length;t<e;t++){const s=o[t];s.removing||(this.removeDelay>0?this._removes.push(s.removeLater(this.removeDelay)):h.push(s.remove()),null==i||i(s,t,e))}return this._views=l,n&&this.forEach(n),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 of t)this.free(s,e)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}}const pr=function(t){return isNaN(t)?0:t};class mr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return t&&this._path.push("Z"),this._path.join(" ")}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return l(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return l(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return l(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),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 l(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(l(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",pr(t[e]),pr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",pr(t[e].x),pr(t[e].y));return this}polygon(...t){return this.lines(...t),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}}const wr=Math.pow,fr=Math.sqrt,xr=Math.sin,yr=Math.cos,br=Math.PI,Vr=1.70158,vr=1.525*Vr,Pr=Vr+1,Sr=2*br/3,kr=2*br/4.5,Ar=function(t){const e=7.5625,s=2.75;return t<1/s?e*t*t:t<2/s?e*(t-=1.5/s)*t+.75:t<2.5/s?e*(t-=2.25/s)*t+.9375:e*(t-=2.625/s)*t+.984375},Er={inQuad:t=>t*t,outQuad:t=>1-(1-t)*(1-t),inOutQuad:t=>t<.5?2*t*t:1-wr(-2*t+2,2)/2,inCubic:t=>t*t*t,outCubic:t=>1-wr(1-t,3),outCubic2:t=>1-wr(1-t,4),inOutCubic:t=>t<.5?4*t*t*t:1-wr(-2*t+2,3)/2,inQuart:t=>t*t*t*t,outQuart:t=>1-wr(1-t,4),inOutQuart:t=>t<.5?8*t*t*t*t:1-wr(-2*t+2,4)/2,inQuint:t=>t*t*t*t*t,outQuint:t=>1-wr(1-t,5),inOutQuint:t=>t<.5?16*t*t*t*t*t:1-wr(-2*t+2,5)/2,inSine:t=>1-yr(t*br/2),outSine:t=>xr(t*br/2),inOutSine:t=>-(yr(br*t)-1)/2,inExpo:t=>0===t?0:wr(2,10*t-10),outExpo:t=>1===t?1:1-wr(2,-10*t),inOutExpo:t=>0===t?0:1===t?1:t<.5?wr(2,20*t-10)/2:(2-wr(2,-20*t+10))/2,inCirc:t=>1-fr(1-wr(t,2)),outCirc:t=>fr(1-wr(t-1,2)),inOutCirc:t=>t<.5?(1-fr(1-wr(2*t,2)))/2:(fr(1-wr(-2*t+2,2))+1)/2,inBack:t=>Pr*t*t*t-Vr*t*t,outBack:t=>1+Pr*wr(t-1,3)+Vr*wr(t-1,2),inOutBack:t=>t<.5?wr(2*t,2)*(7.189819*t-vr)/2:(wr(2*t-2,2)*((vr+1)*(2*t-2)+vr)+2)/2,inElastic:t=>0===t?0:1===t?1:-wr(2,10*t-10)*xr((10*t-10.75)*Sr),outElastic:t=>0===t?0:1===t?1:wr(2,-10*t)*xr((10*t-.75)*Sr)+1,inOutElastic:t=>0===t?0:1===t?1:t<.5?-wr(2,20*t-10)*xr((20*t-11.125)*kr)/2:wr(2,-20*t+10)*xr((20*t-11.125)*kr)/2+1,inBounce:t=>1-Ar(1-t),outBounce:Ar,inOutBounce:t=>t<.5?(1-Ar(1-2*t))/2:(1+Ar(2*t-1))/2};class Lr{constructor(){this.delay=0,this.duration=Lr.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=Math.min(1,Math.max(0,S(t/this.duration)));this._easing&&(e=this._easing(e));try{!1===this._doUpdate(e)&&this._stop()}finally{t>=this.duration?this._stop():this._started&&window.requestAnimationFrame(this._handler)}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=c(t,Lr.DURATION),this.delay=e||0,this._easing=Er[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}}Lr.DURATION=700,Lr.SHORT_DURATION=300;class Cr{static empty(){return new Cr}static create(t=0,e=0){return new Cr(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new Cr(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}Cr.EMPTY=new Cr;class Mr extends ot{constructor(t,e=f){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Mr.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Mr.IGNORE_ATTRS={width:"",height:""};class Tr{static isBright(t){return new Tr(t).isBright()}static getContrast(t,e,s){return new Tr(t).getContrast(e,s)}static interpolate(t,e,s){const i=(16711680&t)>>16,r=(65280&t)>>8,n=255&t;return(i+(((16711680&e)>>16)-i)*s<<16)+(r+(((65280&e)>>8)-r)*s<<8)+(n+((255&e)-n)*s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(J.startsWith(t,"rgb(")&&J.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):J.startsWith(t,"rgba(")&&J.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):J.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 Tr(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var Nr,Rr,Or;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Nr||(Nr={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Rr||(Rr={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Or||(Or={}));class Dr extends ot{constructor(t,e=f){super(t,e,"text"),this._layout=Rr.TOP,this._overflow=Or.WRAP,this._dirty=!0,this._text="",this.anchor=Nr.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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.75*t}layoutText(t){const e=this.getBBounds(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Rr.MIDDLE:i=Math.floor(s/2);break;case Rr.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.setAttr("y",i)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(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,a=s.length;do{r=Math.ceil((n+a)/2);i.getSubStringLength(0,r)>t?a=r-1:n=r}while(n<a);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(Tr.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBounds(){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}}class Br extends Mr{constructor(t,e=f){super(t),this.add(this._text=new Dr(t,e)),this._text.anchor=Nr.START}get text(){return this._text.text}get anchor(){return this._text.anchor}set anchor(t){this._text.anchor=t}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setSvg(t){return this._text.svg=t,this}setModel(t,e,s){var i,r,n,a;const h=e.effect;return this._model=e,this._text.setStyleOrClass(e.style),h===Nt.BACKGROUND?(null===(i=this._outline)||void 0===i||i.remove(),this._back||(this._back=new le(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.backgroundStyle)):h===Nt.OUTLINE?(null===(r=this._back)||void 0===r||r.remove(),this._outline||(this._outline=new Dr(t),this._outline.anchor=Nr.START),this.insertFirst(this._outline),this._outline.setStyleOrClass(e.style)):(null===(n=this._back)||void 0===n||n.remove(),null===(a=this._outline)||void 0===a||a.remove()),this}setContrast(t){if(t&&this._model.autoContrast&&this._text.setContrast(t,this._model.darkStyle||"rct-label-dark",this._model.brightStyle||"rct-label-bright"),this._outline&&this._outline.parent){const t=Tr.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:"2px"})}return this}layout(){if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom),e=this._text.getBBounds(),s=parseFloat(t.paddingLeft)||0,i=parseFloat(t.paddingTop)||0;this._back.setBounds(-s,-i,e.width+s+(parseFloat(t.paddingRight)||0),e.height+i+(parseFloat(t.paddingBottom)||0),3)}return this}}class Ir{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Ir(t,t,t,t):new Ir(t,t,e,e):new Ir(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 Ir(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=c(t.paddingLeft,0),this.right=c(t.paddingRight,0),this.top=c(t.paddingTop,0),this.bottom=c(t.paddingBottom,0),this}applyMargin(t){return this.left=c(t.marginLeft,0),this.right=c(t.marginRight,0),this.top=c(t.marginTop,0),this.bottom=c(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}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}Ir.Empty=Object.freeze(new Ir),Ir.Temp=new Ir;class Fr extends ot{constructor(t,e=f){super(t,e,"g"),ot.DEBUGGING&&(this.add(this._debugRect=new le(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t.style)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),e!==this.model&&(this.model=e,this._doModelChanged());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),ot.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new le(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()}_doModelChanged(){}}class $r extends Fr{constructor(t,e,s){super(t,e),this._margins=new Ir,this._paddings=new Ir,this.add(this._background=new le(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this.setStyleOrClass(e.style),e!==this.model&&(this.model=e,this._doModelChanged()),this._setBackgroundStyle(this._background);const n=getComputedStyle(this.dom),a=getComputedStyle(this._background.dom),h=this._paddings,o=this._margins;h.applyPadding(n),this._borderRadius=parseFloat(a.borderRadius)||0,o.applyMargin(n);const l=this._doMeasure(t,e,s,i,r);return this.mw=l.width+=o.left+o.right+h.left+h.right,this.mh=l.height+=o.top+o.bottom+h.top+h.bottom,l}layout(t){super.layout(t);const e=this._margins;return this._background.setBounds(e.left+this._getBackOffset(),e.top,this.width-e.left-e.right,this.height-e.top-e.bottom,this._borderRadius),this}_getBackOffset(){return 0}}class Gr{static slide(t,e){new zr(t,e)}static fadeIn(t){new Hr(t,{prop:"opacity",start:"0",end:"1"})}static grow(t,e){new Wr(t,e)}constructor(t,e){const s=this._createAnimation(t,e);s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Hr extends Gr{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:Lr.DURATION,fill:"none"})}}class zr extends Gr{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Lr.DURATION,fill:"none"}}$_clipRect(t){return t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height).setTemporary()}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:A(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:A(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class jr extends Lr{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_doStop(){this._series=null}}class Wr extends jr{_doUpdate(t){return!!this._series.parent&&(this._series.setViewRate(t),!0)}_doStop(){this._series.parent&&this._series.setViewRate(NaN),super._doStop()}}class Yr extends Br{constructor(t){super(t,"rct-point-label")}}class Ur extends lt{constructor(t){super(t,"rct-point-labels"),this._labels=[new gr(this,Yr),new gr(this,Yr)],this._maps=[],this.setStyle("pointerEvents","none")}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r){const n=r.text,a=r.style;e.point=i,e.setModel(t,r,null),n?(r.buildSvg(e._text,NaN,NaN,r,i.getValueOf),e.setStyles(a),e._outline&&r.buildSvg(e._outline,NaN,NaN,r,i.getValueOf)):e.setText(r.getText(i.getLabel(s))).setStyles(a)}prepare(t,e){const s=e.model,i=s.pointLabel;if(i.visible){const r=s.pointLabelCount(),n=this._labels,a=s.getLabeledPoints(),h=this._maps,o=i.style;n[0].prepare(a.length),h[0]={},n[1].prepare(r>1?a.length:0),h[1]={},a.forEach(((s,r)=>{for(let a=0;a<s.labelCount();a++){const o=n[a].get(r);o.setVisible(e.isPointVisible(s))&&(this.prepareLabel(t,o,a,s,i),h[a][s.pid]=o)}})),this.setStyleOrClass(o)}else this.clear()}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class Xr extends Mr{constructor(t){super(t),this.add(this._line=new dt(t))}setLine(t){this._line.setPath(t)}}class qr extends Mr{constructor(t){super(t,"rct-point-label-lines"),this._lines=new gr(this,Xr)}prepare(t){const e=this._lines,s=t.getPoints(),i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.count).forEach(((t,e)=>{const i=s.get(e);t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class Kr extends lt{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform","")),this.inverted}}class Zr extends Fr{constructor(t,e){super(t,"rct-series "+e),this._inverted=!1,this._animatable=!0,this._viewRate=NaN,this._animations=[],this.add(this._pointContainer=new Kr(t,"rct-series-points")),this.add(this._labelContainer=new Ur(t))}invertable(){return!0}getClipContainer(){return this._pointContainer}setViewRate(t){isNaN(t)&&isNaN(this._viewRate)||t===this._viewRate||(this._viewRate=t,isNaN(t)?this.control.invalidateLayout():this._doViewRateChanged(t))}setPosRate(t){}isPointVisible(t){return t.visible&&!t.isNull}_doViewRateChanged(t){}_setChartOptions(t,e){this._inverted=t,this._animatable=e}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.visible&&this._labelContainer.setVisible(!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)}findPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e)}_doPointClicked(t){}_getColor(){return this.model._calcedColor}prepareSeries(t,e){this.setData("index",e.index%12),this.setBoolData("pointcolors",e._colorByPoint()),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e.style),e.color&&(this.internalSetStyle("fill",e.color),this.internalSetStyle("stroke",e.color)),e._calcedColor=getComputedStyle(this.dom).fill,this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_prepareStyleOrClass(t){}_doMeasure(t,e,s,i,r){return this.setClip(void 0),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new dt(t,"rct-series-trendline")),this._trendLineView.setVisible(!0)):this._trendLineView&&this._trendLineView.setVisible(!1),Cr.create(s,i)}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(),this._afterRender(),this._animatable&&this._runShowEffect(!this.control.loaded)}_collectVisPoints(t){return t.collectVisibles()}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointStyle(t,e,s,i){t.setAttr("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&(t.internalSetStyle("fill",s.color),t.internalSetStyle("stroke",s.color));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVisible(this.model.pointLabel.visible&&!this._animating()),this._labelContainer.visible&&this._labelContainer}_getViewRate(){return c(this._viewRate,1)}_animating(){return!isNaN(this._viewRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_afterRender(){}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(){const t=this.model,e=t._xAxisObj,s=t._yAxisObj,i=t.trendline._points.map((t=>({x:e.getPosition(e._length,t.x),y:s._length-s.getPosition(s._length,t.y)}))),r=new mr;r.move(i[0].x,i[0].y),r.lines(...i),this._trendLineView.setPath(r.end(!1))}_layoutLabel(t){let{inverted:e,x:s,y:i,hPoint:r,labelView:n,labelOff:a}=t;const h=t.reversed?r<=0:r<0,o=n.getBBounds();let l=!0;switch(e?i-=o.height/2:s-=o.width/2,t.labelPos){case me.INSIDE:e?s-=r/2+a:i+=(r-o.height)/2+a;break;case me.HEAD:e?h?s+=o.width-a:s-=o.width+a:h?i-=o.height+a:i+=a;break;case me.FOOT:e?s-=h?r+o.width+a:r-a:i+=h?r+a:r-o.height-a;break;case me.OUTSIDE:default:e?h?s-=o.width+a:s+=a:h?i+=a:i-=o.height+a,l=!1}n.setContrast(l&&t.pointView.dom),n.layout().translate(s,i)}}Zr.POINT_CLASS="rct-point",Zr.DATA_FOUCS="focus",Zr.LEGEND_MARKER="rct-legend-item-marker";class Qr extends dt{constructor(t){super(t,Zr.POINT_CLASS),this.labelViews=[]}}let Jr=class extends Qr{layout(t,e){this.setPath(at.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class tn extends Zr{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e){this._preparePointViews(t,e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPointViews(t,e)}_runShowEffect(t){t&&Gr.grow(this)}_doViewRateChanged(t){this._layoutPointViews(this.width,this.height)}}class en extends tn{_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof be?2*h.categoryPad():0,u=i?t:e,d=i?e:t,_=i?0:e,g=o.axisMin(),p=o.getPosition(u,g),m=s.getBaseValue(o),w=c(o.getPosition(u,Math.max(g,m)),p),f=!isNaN(m),x=a&&Object.assign(this._labelInfo,{inverted:i,reversed:o.reversed,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const c=h.getUnitLength(d,n.xValue)*(1-l),g=s.getPointWidth(c),m=(o.getPosition(u,n.yValue)-w)*r;let y,b;y=h.getPosition(d,n.xValue)-c/2,b=_,n.xPos=y+=s.getPointPos(c)+g/2,n.yPos=b-=f&&w!==p?o.getPosition(u,n.yGroup*r):o.getPosition(u,n.yGroup)*r,this._layoutPointView(t,e,y,b+m,g,m),x&&(x.labelView=a.get(n,0))&&(i&&(b=d-h.getPosition(d,n.xValue)+c/2,y=_,n.yPos=b-=s.getPointPos(c)+g/2,n.xPos=y+=f?o.getPosition(u,n.yGroup)*r:o.getPosition(u,n.yGroup*r)),x.pointView=t,x.x=y,x.y=b,x.wPoint=g,x.hPoint=m,this._layoutLabel(x))}}))}}class sn extends tn{_layoutPointViews(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof be?2*h.categoryPad():0,c=i?t:e,u=i?e:t,d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const g=h.getUnitLength(u,n.xValue)*(1-l),p=s.getPointWidth(g),m=(o.getPosition(c,n.yValue)-o.getPosition(c,this._getLowValue(n)))*r;let w=h.getPosition(u,n.xValue)-g/2,f=d;n.xPos=w+=s.getPointPos(g)+p/2,n.yPos=f-=o.getPosition(c,n.yGroup)*r,this._layoutPointView(t,e,w,f,p,m),a&&(i&&(f=u-h.getPosition(u,n.xValue)+g/2,w=d,n.yPos=f-=s.getPointPos(g)+p/2,n.xPos=w+=o.getPosition(c,n.yGroup)*r),_.pointView=t,_.hPoint=m,_.x=w,_.y=f,(_.labelView=a.get(n,0))&&(_.hPoint=m,this._layoutLabel(_)),(_.labelView=a.get(n,1))&&(i?_.x-=m:_.y+=m,_.hPoint=-m,this._layoutLabel(_)))}}))}}class rn extends Lr{constructor(t){super(),this.series=t,this.duration=300}_doUpdate(t){return!!this.series&&(this.series._zombieRate=this.series._zombie.visible?t:1-t,this.series._resizeZombie(),!0)}_doStop(){this.series&&(this.series._zombie=null,this.series._zombieAni=null,this.series.control.invalidateLayout(),this.series=null)}}class nn extends Zr{togglePointVisible(t){var e;this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(200)}isPointVisible(t){return t===this._zombie||super.isPointVisible(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 rn(this),this._zombieAni.start())}_createPointLegendMarker(t,e,s){return le.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){s._legendMarker||s.setLegendMarker(this._createPointLegendMarker(t,s,he.MARKER_SIZE)),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class an{constructor(t){this._chart=t}handleDown(t){}handleUp(t){}handleMove(t){this._chart.chartView().pointerMoved(t.pointX,t.pointY,t.target)}handleClick(t){const e=this._chart.chartView(),s=t.target;let i,r,n;if(r=e.legendByDom(s))if(r.source instanceof de){const t=r.source,e=this._chart.model.seriesByPoint(t);if(e){e.setPointVisible(t,!t.visible);const s=this._chart.chartView().findSeriesView(e);s instanceof nn&&s.togglePointVisible(t)}}else r.source.visible=!r.source.visible;else(n=e.seriesByDom(s))?n.clicked(s):(i=e.creditByDom(s))&&i.clicked(s)}handleDblClick(t){}handleWheel(t){}}class hn{static empty(){return new hn}static create(t=0,e=0){return new hn(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}get isEmpty(){return 0===this.x||0===this.y}clone(){return new hn(this.x,this.y)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y}setEmpty(){return this.x=this.y=0,this}set(t,e){return this.x=t,this.y=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t}toString(){return"{x: "+this.x+", y: "+this.y+"}"}}class on extends $r{constructor(t){super(t,on.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Dr(t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this.rotation=0,this._textView.text=e.text,et(this._textView.getBBounds())}_doLayout(t){const e=this._paddings,s=this._margins;t||this.setRotaion(0,this.height/2,this.model.axis.position===Bt.OPPOSITE?90:270),this._textView.translateY(s.top+e.top)}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}on.TITLE_CLASS="rct-axis-title";class ln extends Fr{constructor(t){super(t,dn.TICK_CLASS),this.add(this._lineView=new hi(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLineC(0,0,this.height):this._lineView.setHLineC(0,0,this.width)}}class cn extends Dr{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}get rotatedWidth(){const t=this.rotation*V,e=this.getBBounds();return Math.abs(Math.sin(t)*e.height)+Math.abs(Math.cos(t)*e.width)}get rotatedHeight(){const t=this.rotation*V,e=this.getBBounds();return Math.abs(Math.cos(t)*e.height)+Math.abs(Math.sin(t)*e.width)}}class un extends ot{constructor(t){super(t,void 0),this.add(this._back=new dt(t,"rct-crosshair-flag")),this.add(this._text=new Dr(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text)return this._text.text=e,!0;if(e){const e=this._text.getBBounds(),s=new mr,i=Math.max(t.flag.minWidth||0,e.width+8);s.rect(0,0,i,e.height+4),this._back.setPath(s.end()),this._text.translate(i/2,2)}}}class dn extends Fr{constructor(t){super(t,dn.AXIS_CLASS),this._markViews=[],this._labelViews=[],this._zoom=1,this._scrollPos=0,this.add(this._lineView=new hi(t,dn.LINE_CLASS)),this.add(this._titleView=new on(t)),this.add(this._markContainer=new ot(t,"rct-axis-ticks")),this.add(this._labelContainer=new ot(t,"rct-axis-labels"))}checkHeight(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(t,i)&&(r+=this.$_measureLabelsHorz(i,this._labelViews,e)),(this._titleView.visible=i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).height,r+=i.title.gap),r}checkWidth(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(t,i)&&(r+=this.$_measureLabelsVert(this._labelViews)),(this._titleView.visible=i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).height,r+=i.title.gap),r}prepareGuides(t,e,s){let i=this.model.guides.filter((t=>!t.front));e.addAll(t,i),i=this.model.guides.filter((t=>t.front)),s.addAll(t,i)}showCrosshair(t,e){let s=this._crosshairView;s||this.add(this._crosshairView=s=new un(this.doc)),s.setVisible(!0),s.setText(this.model.crosshair,e);const i=s.getBBounds();this.model._isHorz?s.translate(t-i.width/2,this.model.tick.length):s.translate(this.width-this.model.tick.length-i.width,t-i.height/2)}hideCrosshiar(){this._crosshairView&&this._crosshairView.visible&&this._crosshairView.setVisible(!1)}setZoom(t){t=Math.max(0,c(t,1)),this._zoom}_doMeasure(t,e,s,i,r){const n=e._isHorz,a=this._titleView,h=this._labelViews;let o=0;return this._lineView.visible=e.line.visible,this._markLen=e.tick.length||0,this._markLen>0&&(o+=e.tick.margin||0),o+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(t,e)?o+=this._labelSize=n?this.$_measureLabelsHorz(e,h,s):this.$_measureLabelsVert(h):this._labelSize=0,a.visible&&(o+=a.mh,o+=e.title.gap||0),Cr.create(n?s:o,n?o:i)}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._ticks,r=t._markPoints,n=this._titleView,a=this._labelViews,h=this._markLen,o=this.width,l=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?l:0,0,o):this._lineView.setVLine(s?0:o,0,l)),this._markContainer.visible&&(e?this._markViews.forEach(((t,e)=>{t.resize(1,h),t.layout().translate(r[e],s?l-h:0)})):this._markViews.forEach(((t,e)=>{t.resize(h,1),t.layout().translate(s?0:o-h,l-r[e])})));const c=h+(t.tick.margin||0);if(this._labelContainer.visible&&(e?this.$_layoutLabelsHorz(a,i,s,o,l,c):this.$_layoutLabelsVert(a,i,s,o,l,c)),n.visible){const i=this._labelSize,r=t.title.gap||0;if(n.resizeByMeasured().layout(e),e){const t=s?0:c+i+r;n.translate(o/2,t)}else{const t=s?c+i+r+n.height/2:o-c-i-r-n.height/2;n.translate(t,(l-n.height)/2)}}}$_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 ln(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}$_prepareLabels(t,e){const s=this._labelContainer;if(s.visible=e.label.visible){const i=e._ticks,r=i.length,n=this._labelViews;for(;n.length<r;){const e=new cn(t,"rct-axis-label");e.anchor=Nr.START,s.add(e),n.push(e)}for(;n.length>r;)n.pop().remove();return n.forEach(((t,e)=>{t.value=i[e].value,t.text=i[e].label})),n.length}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_measureLabelsHorz(t,e,s){const i=t.label;let r,n=i.step>>0,a=i.rows>>0,h=i.rotation%360,o=!1;if(n>0||a>0||h>0||h<0);else{for(let i=0;i<e.length-1;i++){const r=t.getLabelLength(s,e[i].value);if(e[i].getBBounds().width>=r){o=!0;break}}if(o){switch(i.autoArrange){case Dt.ROTATE:h=-45;break;case Dt.ROWS:a=this.$_getRows(e);break;case Dt.STEP:n=this.$_getStep(e)}o=!1}}if(n>1){const t=Math.max(0,i.startStep||0);e.forEach((t=>t.index=-1));for(let s=t;s<e.length;s+=n)e[s].index=s;e.forEach((t=>t.setVisible(t.index>=0))),e=e.filter((t=>t.visible))}else e.forEach(((t,e)=>{t.index=e,t.setVisible(!0)}));if(a>1?(e.forEach(((t,e)=>t.row=e%a)),this._labelRowPts=[]):(e.forEach((t=>t.row=0)),this._labelRowPts=[0]),h=o?-45:h||0,e.forEach((t=>{t.rotation=h})),a>1){const t=this._labelRowPts;for(let e=0;e<a;e++)t.push(0);isNaN(h)||0==h?e.forEach((e=>{t[e.row]=Math.max(t[e.row],e.getBBounds().height)})):e.forEach((e=>{t[e.row]=Math.max(t[e.row],e.rotatedHeight)})),t.unshift(0);for(let e=2;e<t.length;e++)t[e]+=t[e-1];return t[t.length-1]}if(isNaN(h)||0==h){r=e[0].getBBounds().height;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].getBBounds().height)}else{r=e[0].rotatedHeight;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].rotatedHeight)}return r}$_measureLabelsVert(t){let e=t[0].getBBounds().width;for(let s=1;s<t.length;s++)e=Math.max(e,t[s].getBBounds().width);return e}$_layoutLabelsHorz(t,e,s,i,r,n){const a=this._labelRowPts;t.forEach((t=>{if(t.visible){const i=t.rotation,h=i*V,o=t.getBBounds(),l=Math.floor(t.getAscent(o.height));let c=e[t.index].pos,u=s?r-n-o.height-a[t.row]:n+a[t.row];i<-15&&i>=-90?(t.anchor=Nr.END,c+=-Math.sin(h)*l/2-1,u+=Math.cos(h)*l-l):i>15&&i<=90?(t.anchor=Nr.START,c-=Math.sin(h)*l/2-1,u+=Math.cos(h)*l-l):t.anchor=Nr.MIDDLE,t.translate(c,u)}}))}$_layoutLabelsVert(t,e,s,i,r,n){const a=s?n:i-n;t.forEach(((t,i)=>{if(t.visible){const n=t.getBBounds(),h=s?a:a-n.width;t.translate(h,r-e[i].pos-n.height/2)}}))}}dn.AXIS_CLASS="rct-axis",dn.LINE_CLASS="rct-axis-line",dn.TICK_CLASS="rct-axis-tick";class _n extends ot{constructor(t,e){super(t,e,"image"),this._dirty=!0,this.setAttr("preserveAspectRatio","none")}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,s){return!!t&&(this.setAttr("href",t),this.resize(e,s),!0)}getBBounds(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}_doSizeChanged(){this._dirty=!0}}class gn extends ot{constructor(t,e,s,i,r){super(t,e,"circle"),"number"==typeof s&&this.setCircle(s,i,r)}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class pn extends dt{static create(t,e,s,i,r,n,a,h,o=!0){return new pn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:a,angle:h,clockwise:o})}static createInner(t,e="",s,i,r,n,a,h,o,l=!0){return new pn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:h,angle:o,clockwise:l})}constructor(t,e=f,s=f){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 at.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 at.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)}}class mn extends Fr{constructor(t,e){super(t,e),this._inverted=!1,this._animatable=!0,this.add(this._backElement=new le(t,mn.BACKGROUND_CLASS))}_setChartOptions(t,e){this._inverted=t,this._animatable=e}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}}_prepareStyleOrClass(t){this._backElement.setStyleOrClass(t.style)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){const t=this.width,e=this.height;this._backElement.resizeRect(t,e),this._renderGauge(t,e)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof vn)return t;t=t.parent}}}mn.BACKGROUND_CLASS="rct-gauge-background";class wn extends Lr{constructor(t,e,s){super(),this.view=t,this.from=e,this.to=s}_doUpdate(t){return this.view._runValue=this.from+(this.to-this.from)*t,this.view._renderValue(),!0}}class fn extends mn{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?Pt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null),super._doLayout(),this._checkValueAnimation()}_checkValueAnimation(){const t=this.model;this._animatable&&t.animatable&&t.value!==this._prevValue&&(this._ani=new wn(this,this._prevValue,t.value).start((()=>this._runValue=NaN)),this._prevValue=t.value)}}class xn extends Fr{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new lt(t,"rct-gauge-scale-ticks")),this._ticks=new gr(this._tickContainer,hi),this.add(this._labelContainer=new lt(t,"rct-gauge-scale-tick-labels")),this._labels=new gr(this._labelContainer,Dr)}}class yn extends xn{_createLine(t,e){return new hi(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,h=e._steps,o=h.length;let l=a?e.gap:s,c=a?i:e.gap;if(this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.setStyleOrClass(e.tick.style),this._ticks.prepare(o)),a?l+=e.tick.length:c+=e.tick.length,this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(o),o>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?s:o-1-s]),t=Math.max(e.getBBounds().width)})),l+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?o-1-s:s]),t=Math.max(e.getBBounds().height)})),c+=t}return{width:l,height:c}}_doLayout(){const t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)}$_layoutHorz(t,e,s){const i=this._line,r=t.tick,n=t._steps,a=e/(n.length-1),h=t.position===Ms.OPPOSITE,o=h?-r.length:r.length;let l=h?s-t.gap:t.gap,c=0;i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setHLineC(l,c,c+e)),this._tickContainer.setVisible(r.visible)&&this._ticks.forEach((t=>{t.setVLineC(c,l,l+o),c+=a})),this._labelContainer.visible&&(l=h?0:l+o,c=0,this._labels.forEach(((t,e)=>{t.anchor=e<n.length-1?Nr.MIDDLE:Nr.END,t.translate(c,l),c+=a})))}$_layoutVert(t,e,s){const i=this._line,r=t.tick,n=t._steps,a=this.height/(n.length-1),h=t.position===Ms.OPPOSITE,o=h?r.length:-r.length;let l=0,c=h?t.gap:e-t.gap;if(i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setVLineC(c,l,l+s)),this._tickContainer.setVisible(r.visible)&&this._ticks.forEach(((t,e)=>{t.setHLineC(l,c,c+o),l+=a})),this._labelContainer.visible){const s=h?Nr.START:Nr.END;c=h?c+o:e-t.gap+o,l=0,this._labels.forEach(((t,e)=>{t.anchor=s,t.layout=e<n.length-1?Rr.MIDDLE:Rr.BOTTOM,t.translate(c,l),l+=a}))}}}class bn extends fn{constructor(t,e){super(t,e)}_renderGauge(t,e){const s=this.model,i=c(this._runValue,s.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),t,e),this._renderValue()}_renderValue(){const t=this.model,e=t.label,s=t.scale,i=this.labelView(),r=c(this._runValue,t.value),n=Object.assign({},this._rBand);if(this._renderScale(n),this.background().setRect(n),this._renderBand(t,n,r),this._rLabel.height=n.height,this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&s.position===Ms.OPPOSITE){const t=i.getBBounds();i.ty+t.height>this.height&&i.translateY(Math.max(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const h=this._rBand=st.create(0,0,n,a);if(this._vertical=!t.group&&d(r,a>n),e.visible){const r=e._runPos=d(e.position,this._vertical?"top":"left"),o=e._runVert="top"===r||"bottom"===r,l=e._runGap=e.getGap(o?a:n);let u=o?n:e.getWidth(n),_=o?e.getHeight(a):a;const g=o?n:e.getMaxWidth(n),p=o?e.getMaxHeight(a):a,m=this._rLabel=st.create(0,0,n,a);e.setText(t.getLabel(e,e.animatable?i:t.value)),s.text=e.text,e.buildSvg(s,c(u,g),c(_,p),t,this.valueOf);const w=s.getBBounds();switch(o?(m.height=c(_,w.height),h.height=Math.max(0,h.height-(m.height+l))):(m.width=c(u,w.width),h.width=Math.max(0,h.width-(m.width+l))),r){case"top":h.y=m.height+l;break;case"bottom":m.y=h.height+l;break;case"right":m.x=h.width+l;break;default:h.x=m.width+l}}else this._rLabel=null}_renderLabel(t,e,s,i){if(s.visible){const t=this._rLabel,i=s.getBBounds();let r=t.x,n=t.y;switch(e._runPos){case"top":case"bottom":r+=t.width/2;break;case"right":r=this.width-t.width,s.anchor=Nr.START,n+=Math.max(0,(t.height-i.height)/2);break;default:s.anchor=Nr.END,r+=t.width,n+=Math.max(0,(t.height-i.height)/2)}s.translate(r,n)}}_renderScale(t){const e=this.model,s=e.label,i=e.scale,r=this.scaleView(),n=c(this._runValue,e.value),a=this._vertical?t.height:t.width;let h,o;if(i._vertical=this._vertical,i._reversed=e.reversed,i.buildSteps(a,n),r.setVisible(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(h=0,o=t.y,t.width=Math.max(0,t.width-e.width),i.position===Ms.OPPOSITE?h=t.x+t.width:(s._runVert||(h=t.x),t.x+=e.width)):(h=t.x,t.height=Math.max(0,t.height-e.height),i.position===Ms.OPPOSITE?s._runVert?(o=t.y,t.y+=e.height):(this._rLabel.y=t.y+=e.height,o=t.y-e.height):o=t.y+t.height),r.resizeByMeasured().layout().translate(h,o)}}}class Vn extends fn{constructor(t,e){super(t,e),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?Pt.getFormatter(s||t.label.numberFormat).toStr(i):i}}_setBackgroundStyle(t){}}class vn extends mn{constructor(t,e){super(t,e),this.add(this._gaugeContainer=new lt(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_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))}))}}class Pn extends xn{setExtends(t,e){this._center=t,this._exts=e}_createLine(t,e){return new gn(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length;return this._line.setVisible(e.line.visible)&&this._line.internalSetStyleOrClass(e.line.style),this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick.style),this._ticks.prepare(n)),this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.internalSetStyleOrClass(e.tickLabel.style),this._labels.prepare(n,(t=>{t.layout=Rr.MIDDLE}))),{width:s,height:i}}_doLayout(t){const e=this.model.gauge,s=e.props,i=this._center.x,r=this._center.y,n=this._exts.scale,a=n-this.model.tick.length,h=s._sweepRad,o=e.maxValue-e.minValue;let l,c,u,d;if(this._line.visible&&this._line.setCircle(i,r,a),this._tickContainer.visible&&this._ticks.forEach(((t,e,o)=>{const _=e/o*h+s._startRad;l=i+Math.cos(_)*a,c=r+Math.sin(_)*a,u=i+Math.cos(_)*n,d=r+Math.sin(_)*n,t.setLine(l,c,u,d)})),this._labelContainer.visible){this._labels.get(0).text=String(e.maxValue);const t=n+.5*this._labels.get(0).getBBounds().height;this._labels.forEach(((e,n,a)=>{const l=n/a*h+s._startRad;u=i+Math.cos(l)*t,d=r+Math.sin(l)*t,e.text=String(n*o/a),e.translate(u,d)}))}}}let Sn=class extends Fr{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new gr(this,pn),this.add(this._labelContainer=new lt(t,"rct-circle-gauge-band-tick-labels")),this._labels=new gr(this._labelContainer,Dr)}setExtends(t,e){this._center=t,this._exts=e}_doLayout(t){const e=this.model,s=e.gauge,i=s.props,r=this._center.x,n=this._center.y,a=this._exts.band,h=s.clockwise,o=1-e.thickness/a,l=e.ranges,c=i._sweepRad,u=s.maxValue-s.minValue;let d=i._startRad;this._sectorViews.prepare(l.length).forEach(((t,e)=>{const s=(l[e].toValue-l[e].fromValue)*c/u;t.setSector({cx:r,cy:n,rx:a,ry:a,innerRadius:o,start:d,angle:s,clockwise:h}),t.setStyle("fill",l[e].color),d+=s}))}};class kn extends dt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new mr).circle(0,0,s).end())),this.internalSetStyleOrClass(t.style),this}}class An extends dt{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new mr;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t.style),this}}class En extends Vn{constructor(t,e){super(t,e),this.add(this._background=new pn(t,"rct-circle-gauge-back")),this.add(this._scaleView=new Pn(t)),this.add(this._bandView=new Sn(t)),this.add(this._segContainer=new lt(t,void 0)),this._segments=new gr(this._segContainer,pn,"rct-circle-gauge-segment"),this.add(this._valueView=new pn(t,"rct-circle-gauge-value")),this.add(this._innerView=new pn(t,"rct-circle-gauge-inner")),this.add(this._handContainer=new lt(t,void 0)),this.add(this._textView=new Dr(t,"rct-circle-gauge-label"))}_prepareGauge(t,e){this._background.setVisible(e.rim.visible),e.rim.isRanged()?this._segments.prepare(e.rim.rangeCount()):this._segments.prepare(0),this._scaleView.setVisible(e.scaleRim.visible),this._bandView.setVisible(e.bandRim.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new An(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new kn(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.labelVisible())&&this._textView.setStyleOrClass(e.label.style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(Math.min(t,e));this.$_renderBackground(s,i,r),this._renderValue()}_renderValue(){const t=this.model,e=t.getProps(),s=c(this._runValue,t.value),i=c((s-t.minValue)/(t.maxValue-t.minValue),0),r=this._center,n=this._exts,a=t.valueRim.getThickness(n.radius-n.inner),h=this._textView;if(this._valueView.visible){const h=t.valueRim,o=h.getRange(s),l=n.value-(h.stroked?a/2:0);this._valueView.setStyleOrClass(h.style),o&&this._valueView.setStyle(h.stroked?"stroke":"fill",o.color),t.valueRim.stroked&&(this._valueView.setStyle("fill","none"),this._valueView.setStyle("strokeWidth",A(a))),this._valueView.setBoolData("stroked",h.stroked),this._valueView.setSectorEx({cx:r.x,cy:r.y,rx:l,ry:l,innerRadius:(n.value-a)/n.value,start:e._startRad,angle:e._sweepRad*i,clockwise:t.clockwise},t.valueRim.stroked)}if(this._handView){const s=(e._handRad+e._sweepRad*i)*v;this._handView.render(t.hand,n.radius).translatep(r).rotate(t.clockwise?s:-s)}if(h.visible)if(t.label.setText(t.getLabel(t.label,t.label.animatable?s:t.value)),h.text=t.label.text,t.label.buildSvg(h,NaN,NaN,t,this.valueOf),h.setBoolData("grouped",!!t.group),t.group)this.$_layoutGroupedLabel(t,h,n);else{const e=h.getBBounds(),s=t.label.getOffset(this.width,this.height);h.translate(r.x+s.x,r.y-e.height/2+s.y)}}$_renderSegments(t,e){const s=this.model,i=s.getProps(),r=t.x,n=t.y,a=e.radius,h=s.clockwise,o=e.inner/e.radius,l=s.rim.ranges,c=i._sweepRad,u=s.maxValue-s.minValue;let d=i._startRad;this._segments.forEach(((t,e)=>{const s=(l[e].toValue-l[e].fromValue)*c/u;t.setSector({cx:r,cy:n,rx:a,ry:a,innerRadius:o,start:d,angle:s,clockwise:h}),t.setStyle("fill",l[e].color),d+=s}))}$_renderBackground(t,e,s){const i=t.getProps(),r=i._startRad;this._center=e,this._exts=s,this._background.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:s.inner/s.radius,start:r,angle:i._sweepRad,clockwise:t.clockwise}),!this._segments.isEmpty&&this.$_renderSegments(e,s),this._scaleView.visible&&(t.scaleRim.buildSteps(s.scale*i._sweepRad,NaN),this._scaleView.measure(this.doc,t.scaleRim,this.width,this.height,0),this._scaleView.setExtends(e,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.measure(this.doc,t.bandRim,this.width,this.height,0),this._bandView.setExtends(e,s),this._bandView.layout()),this._innerView.internalSetStyleOrClass(t.innerStyle);let n=s.inner;const a=getComputedStyle(this._innerView.dom),h=parseFloat(a.strokeWidth);h>1&&(n-=h/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,n).translate(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBounds(),r=this._background.getBBounds(),n=+t.group.labelGap||0;e.anchor=Nr.END,e.translate(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class Ln extends Lr{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class Cn extends dt{constructor(t){super(t,Zr.POINT_CLASS)}}class Mn extends ot{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.dom.style.transform=`translate(${e}px, ${e}px) rotate(-90deg) scale(1, -1)`:this.dom.style.transform=""),this.inverted}}class Tn extends Zr{constructor(t,e){super(t,e),this._needBelow=!1,this.insertFirst(this._lineContainer=new Mn(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new dt(t,"rct-line-series-line")),this._markers=new gr(this._pointContainer,Cn)}getClipContainer(){return null}_getPointPool(){return this._markers}_prepareSeries(t,e){e instanceof di&&this._prepareBelow(e),this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.model,this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this._layoutLines(this._visPoints)}_runShowEffect(t){this._polar?t&&Gr.grow(this):t&&Gr.slide(this,{from:function(t){const e=t.model._xAxisObj.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines(this._visPoints.slice())}_markersPerPoint(){return 1}_prepareBelow(t){const e=this.control;let s=this._lowLine;if(this._needBelow=t.belowStyle&&t._minValue<t.baseValue,this._needBelow)return s||(this._lineContainer.insertChild(s=this._lowLine=new dt(this.doc),this._line),this._upperClip=e.clipBounds(),this._lowerClip=e.clipBounds()),this._line.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.setClip(),this._line.setClip()}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,e-s,e,t):n.setBounds(0,e-t,e,t-s):r?n.setBounds(0,0+s,t,e-s):n.setBounds(0,0,t,s)),(n=this._lowerClip)&&(this._inverted?r?n.setBounds(0,e-t,e,t-s):n.setBounds(0,e-s,e,t):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof di&&this._needBelow,i=s?t.baseValue:NaN,r=t.marker,n=[r.style,null];if(this._pointContainer.visible=r.visible){const r=this._markersPerPoint(),a=e.length;this._markers.prepare(a*r,((r,h)=>{const o=e[h%a];o.isNull||(r.point=o,n[1]=s&&o.yValue<i?t.belowStyle:null,this._setPointStyle(r,t,o,n))}))}}_layoutMarker(t,e,s){const i=this.model,r=t.point,n=t._radius=i.getRadius(r);at.setShape(t,i.getShape(r),n),t.translate(e-=n,s-=n)}_layoutMarkers(t,e,s){const i=this.model,r=this._inverted,n=this._polar=i.chart.body.getPolar(i),a=this._getViewRate(),h=i.marker.visible,o=i.pointLabel.offset,l=this._labelViews(),c=i._xAxisObj,u=i._yAxisObj,d=r?e:s,_=r?s:e,g=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];let i,p;if(n){const t=n.start+e*n.deg,r=u.getPosition(n.rd,s.yGroup)*a;i=s.xPos=n.cx+r*Math.cos(t),p=s.yPos=n.cy+r*Math.sin(t)}else i=s.xPos=c.getPosition(_,s.xValue),p=s.yPos=g-u.getPosition(d,s.yGroup),r&&(i=u.getPosition(d,s.yGroup),p=g-c.getPosition(_,s.xValue));const m=this._markers.get(e),w=l&&l.get(s,0);if(m&&m.setVisible(!s.isNull)){if(this._layoutMarker(m,i,p),w){const t=w.getBBounds();w.visible=!0,w.translate(i-t.width/2,p-t.height-o-(h?m._radius:0))}}else w&&(w.visible=!1)}}_layoutLines(t){const e=this.model,s=e instanceof di&&this._needBelow,i=new mr;let r,n=0;for(;n<t.length;){const e=t[n++];if(!e.isNull){i.move(e.xPos,e.yPos);break}}if(this._linePts=t,n<t.length-1&&(this._buildLines(t,n,i),this._line.setPath(r=i.end(this._polar)),this._line.clearStyleAndClass(),this._line.setStyle("stroke",e.color),this._line.addStyleOrClass(e.style),W.setImportantStyle(this._line.dom.style,"fill","none"),s)){const t=e._yAxisObj,s=e.baseValue;this._inverted?this.$_resetClips(this.width,this.height,t.getPosition(this.width,s),!0):this.$_resetClips(this.width,this.height,this.height-t.getPosition(this.height,s),!1),this._lowLine.setPath(r),this._lowLine.clearStyleAndClass(),this._lowLine.setStyle("stroke",e.color),this._lowLine.addStyleOrClass(e.style),this._lowLine.addStyleOrClass(e.belowStyle),W.setImportantStyle(this._lowLine.dom.style,"fill","none")}}_buildLines(t,e,s){const i=this.model,r=i.getLineType();r===Gt.SPLINE?this._drawCurve(t,e-1,s):i instanceof di&&r===Gt.STEP?this._drawStep(t,e,s,i.stepDir):this._drawLine(t,e,s)}_drawLine(t,e,s){const i=t.length;let r=e;for(;r<i;)if(t[r].isNull){do{r++}while(r<i&&t[r].isNull);r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else s.line(t[r].xPos,t[r].yPos),r++}_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.$_drawCurve(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else r++;r-1>n&&this.$_drawCurve(t,n,r-1,s)}}$_drawCurve(t,e,s,i){let r=e;if(1===Math.abs(s-e))return void i.line(t[r+1].xPos,t[r+1].yPos);const n=.23,a={x:0,y:0},h={x:0,y:0},o={x:0,y:0},l={x:t[r+1].xPos-t[r].xPos,y:t[r+1].yPos-t[r].yPos},c={x:0,y:0},u={x:0,y:0},d={x:0,y:0};let _={x:0,y:0},g=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=g,l.y/=g;let p=t[r+1].xPos-t[r].xPos,m=t[r].xPos,w=t[r].yPos;for(++r;r!=s;r++){o.x=-l.x,o.y=-l.y,l.x=t[r+1].xPos-t[r].xPos,l.y=t[r+1].yPos-t[r].yPos,g=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=g,l.y/=g,l.x<o.x?(_.x=o.x-l.x,_.y=o.y-l.y):(_.x=l.x-o.x,_.y=l.y-o.y);const s=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=s,_.y/=s,o.y*l.y>=0&&(_={x:1,y:0}),a.x=-_.x*p*n,a.y=-_.y*p*n,r===e+1?i.quad(t[r].xPos+a.x,t[r].yPos+a.y,t[r].xPos,t[r].yPos):(c.x=m+h.x,c.y=w+h.y,u.x=t[r].xPos+a.x,u.y=t[r].yPos+a.y,d.x=(c.x+u.x)/2,d.y=(c.y+u.y)/2,i.quad(c.x,c.y,d.x,d.y),i.quad(u.x,u.y,t[r].xPos,t[r].yPos)),p=t[r+1].xPos-t[r].xPos,h.x=_.x*p*n,h.y=_.y*p*n,m=t[r].xPos,w=t[r].yPos}i.quad(m+h.x,w+h.y,t[r].xPos,t[r].yPos)}_drawStep(t,e,s,i){const r=t.length;let n=e;for(;n<r;)if(t[n].isNull){do{n++}while(n<r&&t[n].isNull);n<r&&(s.move(t[n].xPos,t[n].yPos),n++)}else i===Ts.BACKWARD?(s.line(t[n-1].xPos,t[n].yPos),s.line(t[n].xPos,t[n].yPos)):(s.line(t[n].xPos,t[n-1].yPos),s.line(t[n].xPos,t[n].yPos)),n++}}class Nn extends Tn{constructor(t){super(t,Nn.CLASS)}}Nn.CLASS="rct-line-series";class Rn extends Tn{constructor(t,e){super(t,e||"rct-area-series"),this._lineContainer.insertFirst(this._area=new dt(t,"rct-area-series-area"))}_layoutLines(t){super._layoutLines(t),this._polar?this._layoutPolar(this._area,t):this._layoutArea(this._area,t)}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._lineContainer.insertChild(e=this._lowArea=new dt(this.doc,"rct-area-series-area"),this._area),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model._yAxisObj,r=s;for(let e=0,n=t.length;e<n;e++){const n=t[e];n.yLow=r-i.getPosition(s,n.yGroup-n.yValue)}}_layoutArea(t,e){const s=this.model,i=this._needBelow?this._lowArea:void 0,r=s.group,n=s.chart.isInverted(),a=s._yAxisObj,h=n?this.width:this.height,o=a.axisMin(),l=s.getBaseValue(a),u=this.height-a.getPosition(h,c(Math.max(o,l),o)),d=new mr;let _,g=0;for(;g<e.length&&e[g].isNull;)g++;if(!r||r.layout!==Le.STACK&&r.layout!==Le.FILL){d.move(e[g].xPos,u),d.line(e[g].xPos,e[g].yPos),this._buildLines(e,g+1,d);const t=d._path;for(g=6;g<t.length;)"M"===t[g]?(t.splice(g,0,"L",t[g-2],u),g+=3,t.splice(g,0,"M",t[g+1],u),t[g+3]="L",g+=6):"Q"===t[g]?g+=4:g+=3;d.line(t[t.length-2],u)}else{const t=g;for(d.move(e[g].xPos,e[g].yLow),d.line(e[g].xPos,e[g].yPos),g++;g<e.length;)d.line(e[g].xPos,e[g].yPos),g++;for(g=e.length-1,d.line(e[g].xPos,e[g].yLow);g>=t;)d.line(e[g].xPos,e[g].yLow),g--}t.setPath(_=d.end()),t.internalClearStyleAndClass(),s.color&&t.setStyle("fill",s.color),s.style&&t.internalSetStyleOrClass(s.style),i&&(i.setPath(_),i.internalClearStyleAndClass(),s.color&&i.setStyle("fill",s.color),s.belowStyle&&i.internalSetStyleOrClass(s.belowStyle))}_layoutPolar(t,e){const s=this.model,i=s.group,r=s._yAxisObj,n=r instanceof Ze?s.getBaseValue(r):NaN,a=this.height;r.getPosition(a,J.isNotEmpty(n)?n:r.axisMax());const h=new mr;if(!i||i.layout!==Le.STACK&&i.layout!==Le.FILL){h.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);t.setPath(h.end())}else{h.move(e[0].xPos,e[0].yLow),h.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);h.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)h.line(e[t].xPos,e[t].yLow);t.setPath(h.end())}t.clearStyleAndClass(),t.setStyle("fill",s.color),t.addStyleOrClass(s.style)}}class On extends pn{constructor(t){super(t,Zr.POINT_CLASS)}}class Dn extends Mr{constructor(t){super(t,Zr.POINT_CLASS+" rct-boxplot-point")}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.minValue,r=e/2;const n=0+s-s*(t.lowValue-t.minValue)/i,a=0+s-s*(t.highValue-t.minValue)/i,h=s*(t.highValue-t.lowValue)/i;t.color&&this._box.setStyle("fill",t.color),this._stemUp.setVLine(r,0,a),this._stemDown.setVLine(r,n,s),this._min.setHLine(0,e/4,3*e/4),this._max.setHLine(0+s,e/4,3*e/4),this._box.setBox(0,a,e,h),this._mid.setHLine(0+s-s*(t.midValue-t.minValue)/i,0,e)}_doInitChildren(t){this.add(this._stemUp=new hi(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new hi(t,"rct-boxplot-point-stem")),this.add(this._box=new le(t,"rct-boxplot-point-box")),this.add(this._mid=new hi(t,"rct-boxplot-point-mid")),this.add(this._min=new hi(t,"rct-boxplot-point-min")),this.add(this._max=new hi(t,"rct-boxplot-point-max"))}}let Bn=class extends dt{constructor(t){super(t,Zr.POINT_CLASS)}};let In=class extends Mr{constructor(t){super(t,Zr.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue;const r=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,n=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i,a=Math.min(n,r),h=Math.max(1,Math.abs(r-n)),o=t.close<t.open;this._body.setStyle("fill",o?"":t.color),this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,s),this._body.setBox(-e/2,a,e,h),this._body.setClass(o?"rct-candlestick-point-fall":"")}_doInitChildren(t){this.add(this._wickUpper=new hi(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new hi(t,"rct-candlestick-point-wick")),this.add(this._body=new le(t))}};class Fn extends Mr{constructor(t){super(t,Zr.POINT_CLASS),this.add(this._line=new hi(t)),this.add(this._hmarker=new dt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new dt(t,"rct-dumbbell-point-marker"))}layout(){const t=this.point,e=this.width,s=this.height,i=e/2;t.color&&(this._line.setStyle("stroke",t.color),this._hmarker.setStyle("fill",t.color),this._lmarker.setStyle("fill",t.color)),this._line.setVLineC(i,0,s),this._hmarker.renderShape(t.shape,i,0,t.radius),this._lmarker.renderShape(t.shape,i,s,t.radius)}}let $n=class extends Mr{constructor(t){super(t,Zr.POINT_CLASS),this._backs=new gr(this,dt),this._segments=new gr(this,dt),this._decimal=0}prepareSegments(t,e,s,i,r){this._decimal=i,this._backs.prepare(t?e:0).forEach(((t,e)=>{t.setClass(r)})),this._segments.prepare(Math.round(s)).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._backs.forEach(((e,r)=>{e.setPath(at.rectangle(0,s-t[2*r],i,n(-1,t[2*r]-t[2*r+1])))})),this._segments.forEach(((a,h,o)=>{h===o-1&&this._decimal>0?a.setPath(at.rectangle(e,s-t[2*h],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(at.rectangle(e,s-t[2*h],i,n(-1,t[2*h]-t[2*h+1])))}))}};let Gn=class extends Mr{constructor(t){super(t,Zr.POINT_CLASS),this.add(this._stem=new hi(t)),this.add(this._whiskerUp=new hi(t)),this.add(this._whiskerDown=new hi(t))}layout(){const t=this.width,e=this.height,s=t/2;this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t)}};class Hn extends dt{constructor(t){super(t,Zr.POINT_CLASS)}}class zn extends le{constructor(t){super(t,Zr.POINT_CLASS)}}let jn=class extends Qr{layout(t,e){this.setPath(at.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};let Wn=class extends Mr{constructor(t){super(t,Zr.POINT_CLASS),this.add(this._line=new hi(t)),this.add(this._marker=new dt(t,"rct-lollipop-point-marker"))}layout(){this._line.setVLineC(0,0,this.height),this._marker.renderShape(this.point.shape,0,0,this.point.radius)}};class Yn extends Mr{constructor(t){super(t,Zr.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue,r=-e/2;const n=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,a=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i;this._back.setBox(r,0,e,s),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,this.width),this._bar.setVLine(0,0,0+s),this._bar.setClass(t.close<t.open?"rct-ohlc-point-bar-fall":"rct-ohlc-point-bar")}_doInitChildren(t){this.add(this._tickOpen=new hi(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new hi(t,"rct-ohlc-point-tick")),this.add(this._bar=new hi(t)),this.add(this._back=new le(t,"rct-ohlc-point-back")),W.setImportantStyle(this._back.dom.style,"fill","transparent")}}class Un extends pn{constructor(t){super(t,Zr.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class Xn extends dt{constructor(t){super(t,Zr.POINT_CLASS)}}class qn extends dt{constructor(t){super(t,Zr.POINT_CLASS)}get point(){return this.node.point}render(){this.setPath(at.rect(this.node))}}class Kn extends dt{constructor(t){super(t,Zr.POINT_CLASS)}layout(t,e,s){const i=this.point._len,r=this.point._off,n=.5;let a;switch(t){case Wi.NONE:a=[0,-.5*i,0,n*i];break;case Wi.OPEN:const t=.15,e=.45,s=.2;a=[0,-e*i,-t*i,-s*i,0,-.5*i,t*i,-s*i,0,-e*i,0,n*i];break;default:const r=.1,h=.3;a=[0,-h*i,-r*i,-h*i,0,-.5*i,r*i,-h*i,0,-h*i,0,n*i]}const h=["M",a[0],a[1]+r];for(let t=2;t<a.length;t+=2)h.push("L",a[t],a[t+1]+r);this.rotation=e,this.setPath(h)}}class Zn extends Qr{layout(t,e){this.setPath(at.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}}class Qn extends Fr{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._barViews=new gr(this,le),this.add(this._labelContainer=new lt(t,"rct-linear-gauge-band-tick-labels")),this._labels=new gr(this._labelContainer,Dr)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=n.isVertical();n.scale;const h=this._thick=e.position===Ms.INSIDE?a?s:i:c(e.thickness,0)+(this._gap=c(e.gap,0));let o=a?h:s,l=a?i:h;const u=this._ranges=e.ranges;if(this._labelContainer.setVisible(e.tickLabel.visible&&u.length>0)){const t=[u[0].fromValue].concat(u.map((t=>t.toValue)));if(this._labelContainer.internalSetStyleOrClass(e.tickLabel.style),this._labels.prepare(u.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().width)})),o+=e}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().height)})),l+=e}}return{width:o,height:l}}_doLayout(t){const e=this.model.gauge,s=e.scale,i=s._max-s._min;this.$_layoutBars(e,i,this._ranges)&&this._labelContainer.visible&&this.$_layoutLabels(e,i,this._ranges)}$_layoutBars(t,e,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty){const i=t.isVertical(),r=this.width,n=this.height,a=i?n:r;let h=0;return this._barViews.prepare(s.length).forEach(((t,r)=>{const o=s[r],l=a*(o.toValue-o.fromValue)/e;i?t.setBounds(0,n-h-l,this._thick,l):t.setBounds(h,0,l,this._thick),t.setStyle("fill",o.color),h+=l})),!0}}$_layoutLabels(t,e,s){const i=t.isVertical(),r=this.width,n=this.height,a=i?n:r,h=this._thick;this._labels.get(0).translate(0,h);for(let t=1;t<=s.length;t++){const i=a*s[t-1].toValue/e;this._labels.get(t).translate(i,h)}}}class Jn extends bn{constructor(t,e){super(t,e),this.add(this._background=new le(t,"rct-linear-gauge-background")),this.add(this._bandView=new Qn(t)),this.add(this._scaleView=new yn(t)),this.add(this._valueView=new le(t,"rct-linear-gauge-value")),this.add(this._labelView=new Dr(t))}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderScale(t){const e=this.model.band,s=this._bandView;if(super._renderScale(t),s.setVisible(e.visible)){const i=+e.gap||0,r=s.measure(this.doc,e,t.width,t.height,1);s.resizeByMeasured().layout(),this._vertical?e.position===Ms.INSIDE?s.translate(t.x,t.y):e.position===Ms.OPPOSITE?(s.translate(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.translate(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):e.position===Ms.INSIDE?s.translate(t.x,t.y):e.position===Ms.OPPOSITE?(s.translate(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.translate(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=t.reversed,r=t.group?t.group.scale:t.scale,n=r._max-r._min;if(this._valueView.setVisible(n>0&&!isNaN(t.value)))if(this._vertical){const t=e.height*(s-r._min)/n;i?e.y:(e.y,e.height),this._valueView.setBounds(e.x,e.y+e.height-t,e.width,t)}else{const t=e.width*(s-r._min)/n,a=i?e.x+e.width-t:e.x;this._valueView.setBounds(a,e.y,t,e.height)}}}class ta extends vn{constructor(t,e){super(t,e),this.insertFirst(this._scaleView=new yn(t)),this.insertFirst(this._textView=new Dr(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVisible(e.label.visible)&&this._textView.setStyleOrClass(e.label.style),this._scaleView.setVisible(e.scale.visible)&&this._scaleView.setStyleOrClass(e.scale.style),super._prepareGauge(t,e)}_doRenderGauges(t,e,s,i){const r=this.model,n=this._textView,a=st.create(0,0,s,i);if(n.visible){n.text=r.label.text,r.label.buildSvg(n,NaN,NaN,r,null);const t=this._textView.getBBounds().height+r.label.getGap(i);a.y+=t,a.height-=t,n.translate(this.width/2,0)}this.$_renderScale(r,a),r.vertical?this.$_layoutVert(this.doc,r,e,a):this.$_layoutHorz(this.doc,r,e,a)}$_renderScale(t,e){const s=t.scale,i=this.width,r=[];this._gaugeViews.forEach(((e,s)=>{r.push(c(e._runValue,t.get(s).value))})),s.buildGroupSteps(i,r)}$_layoutHorz(t,e,s,i){i.height,i.width,s.count,i.y}$_layoutVert(t,e,s,i){const r=i.width,n=(i.height-e.itemGap*(s.count-1))/s.count,a=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(t,e.get(i),r,n,0),s.resize(r,n),s.layout(),s.translate(a,h),h+=n+e.itemGap}))}}class ea extends bn{constructor(t){super(t,"rct-bullet-gage"),this.add(this._background=new le(t,"rct-bullet-gauge-background")),this.add(this._barContainer=new lt(t,void 0)),this._barViews=new gr(this._barContainer,le),this.add(this._valueView=new le(t,"rct-bullet-gauge-value")),this.add(this._targetView=new le(t,"rct-bullet-gauge-target")),this.add(this._scaleView=new yn(t)),this.add(this._labelView=new Dr(t))}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderBand(t,e,s){const i=t.reversed,r=this._vertical,n=t.group?t.group.scale:t.scale,a=n._max-n._min,h=t.getRanges(n._min,n._max);if(h)if(this._barContainer.setRect(e),r){let t=i?0:e.height;this._barViews.prepare(h.length).forEach(((s,r)=>{const n=h[r],o=e.height*(n.toValue-n.fromValue)/a;s.setBounds(0,i?t:t-o,e.width,o),s.setStyle("fill",n.color),t+=i?o:-o}))}else{let t=i?e.width:0;this._barViews.prepare(h.length).forEach(((s,r)=>{const n=h[r],o=e.width*(n.toValue-n.fromValue)/a;s.setBounds(i?t-o:t,0,o,e.height),s.setStyle("fill",n.color),t+=i?-o:o}))}if(this._valueView.setVisible(a>0&&!isNaN(t.value)))if(r){const r=e.height*(s-t.scale._min)/a,n=i?e.y:e.y+e.height-r;this._valueView.setBounds(e.x+e.width/3,n,e.width/3,r)}else{const r=e.width*(s-t.scale._min)/a,n=i?e.x+e.width-r:e.x;this._valueView.setBounds(n,e.y+e.height/3,r,e.height/3)}if(this._targetView.setVisible(!isNaN(t.targetValue)))if(r&&e.width>10){let s=e.height*(t.targetValue-t.scale._min)/a;s=i?e.y+s:e.y+e.height-s,this._targetView.setBounds(e.x+5,s-1,e.width-10,3)}else if(!r&&e.height>10){let s=e.width*(t.targetValue-t.scale._min)/a;s=i?e.x+e.width-s:e.x+s,this._targetView.setBounds(s-1,e.y+5,3,e.height-10)}}}const sa={area:Rn,arearange:class extends Tn{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Mn(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new dt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new dt(t,"rct-areanrange-series-line")),W.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}_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=this._inverted,n=i._yAxisObj,a=r?e:s,h=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=h-n.getPosition(a,s.lowValue)}if(i.marker.visible){const e=this._markers;for(let s=0,i=t.length;s<i;s++){const h=t[s],o=e.get(s+i);let l,c;h.isNull?o.visible=!1:(o.visible=!0,r?(l=n.getPosition(a,h.lowValue),c=e.get(s).ty):(l=h.xPos,c=h.yLow),this._layoutMarker(o,l,c))}}}_layoutLines(t){super._layoutLines(t);const e=t.map((t=>({xPos:t.xPos,yPos:t.yLow,isNull:t.isNull}))).slice().reverse(),s=new mr;let i=0;for(;i<e.length&&e[i].isNull;)i++;s.move(e[i].xPos,e[i].yPos),this._buildLines(e,i+1,s),this._lowerLine.setPath(s.end(!1)),this._lowerLine.setStyle("stroke",this.model.color),this.$_layoutArea(this._area,this._linePts,e)}$_layoutArea(t,e,s){const i=new mr;let r=0;for(;r<e.length&&e[r].isNull;)r++;const n=e.length;let a,h,o,l=r++;for(;r<n;)if(e[r].isNull){for(a=r,a>l&&(h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i));r<n&&e[r].isNull;)r++;l=r}else r++;r>l&&(a=r,h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i)),t.setPath(i.end())}},bar:class extends en{constructor(t){super(t,"rct-bar-series"),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePointViews(t,e,s){e.chart.isPolar()?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints)}_layoutPointViews(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}$_parepareBars(t,e,s){this._bars||(this._bars=new gr(this._pointContainer,Jr)),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 gr(this._pointContainer,On)),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._getViewRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart.body,n=t._xAxisObj,a=t._yAxisObj,h=r.getPolar(t),o=i&&Object.assign(this._labelInfo,{labelPos:t.getLabelPosition(s.position),labelOff:t.getLabelOff(s.offset)});this._sectors.forEach(((s,r)=>{const l=s.point,c=a.getPosition(h.rd,l.yGroup)*e,u=n.getUnitLength(2*Math.PI,l.xValue),d=t.getPointWidth(u);if(s.setSector({cx:h.cx,cy:h.cy,rx:c,ry:c,start:h.start+r*h.deg,angle:d,clockwise:!0}),i&&(o.labelView=i.get(l,0))){const t=s.start+s.angle,e=s.cx+s.rx/2*Math.cos(t),i=s.cy+s.ry/2*Math.sin(t),r=o.labelView.getBBounds();o.labelView._text.anchor=Nr.MIDDLE,o.labelView.translate(e-r.width/2,i-r.height/2)}}))}},barrange:class extends sn{constructor(t){super(t,"rct-barrange-series"),this._bars=new gr(this._pointContainer,Jr)}_getPointPool(){return this._bars}_preparePointViews(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}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i+n)}},bellcurve:class extends Rn{constructor(t){super(t,"rct-bellcurve-series")}},boxplot:class extends sn{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new gr(this._pointContainer,Dn)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePointViews(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},bubble:class extends Zr{constructor(t){super(t,"rct-bubble-series"),this._markers=new gr(this._pointContainer,Bn)}_getPointPool(){return this._markers}invertable(){return!1}_prepareSeries(t,e){this.$_prepareMarkser(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Gr.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkser(t,e){const s=(t._xAxisObj._length<t._yAxisObj._length?t._xAxisObj:t._yAxisObj)._length,i=e.length;t.getPixelMinMax(s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];r.shape=t.shape,this._setPointStyle(s,t,r)}))}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=this._getViewRate();s.pointLabel.offset;const n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=i?t:e,l=i?e:t,c=(s._xAxisObj._length<s._yAxisObj._length?s._xAxisObj:s._yAxisObj)._length,{min:u,max:d}=s.getPixelMinMax(c),_=e;let g,p;this._markers.forEach(((t,e)=>{const c=t.point;if(t.setVisible(!c.isNull&&!isNaN(c.zValue))){const e=(c.radius=s.getRadius(c.zValue,u,d))*r;let m,w,f;w=c.xPos=a.getPosition(l,c.xValue),f=c.yPos=_-h.getPosition(o,c.yValue),i&&(w=h.getPosition(o,c.yGroup),f=_-a.getPosition(l,c.xValue)),m=at.circle(0,0,e),t.setPath(m),t.translate(w,f),n&&(g=n.get(c,0))&&(g.setContrast(t.dom),g.layout(),p=g.getBBounds(),g.setVisible(p.width<=c.radius)&&g.translate(w-p.width/2,f-p.height/2))}}))}},candlestick:class extends sn{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new gr(this._pointContainer,In)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}},dumbbell:class extends sn{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new gr(this._pointContainer,Fn)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},equalizer:class extends en{constructor(t){super(t,"rct-equalizer-series"),this._bars=new gr(this._pointContainer,$n)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(e,s)}_layoutPointViews(t,e){const s=(this._inverted?t:e)*this._getViewRate();this.$_buildSegments(this.model,s),super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){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.backSegments,i=t._yAxisObj.axisMax(),r=t.segmented,n=t.segmentGap||0,a=this._pts=[];let h,o,l=0;for(o=t.maxCount>0?t.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),h=(e-n*(o-1))/o;a.length<2*o;)a.push(l,l+h),l+=h+n;a[a.length-1]=e;const c=a.length/2;this._bars.forEach((n=>{const o=n.point;if(n.setVisible(!o.isNull)){const l=o.yValue/i;let u=-1,d=0;for(let t=0;t<c-1;t++)if(l>=a[2*t]/e&&l<a[2*(t+1)]/e){u=t+1,d=!r&&l<a[2*t+1]/e?l*e-a[2*t]:h;break}u<0&&(u=c,d=h),n.prepareSegments(s,c,u,d,t.backStyle)}}))}},errorbar:class extends sn{constructor(t){super(t,"rct-errorbar-series"),this._bars=new gr(this._pointContainer,Gn)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},funnel:class extends nn{constructor(t){super(t,"rct-funnel-series"),this._segments=new gr(this._pointContainer,Hn),this.add(this._lineContainer=new qr(t))}_getPointPool(){return this._segments}_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&&Gr.slide(this,{from:this.model.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVisible(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=t.length;let s=0,i=0;if(t.forEach((t=>{s+=t.yValue*(t===this._zombie?this._zombieRate:1)})),e>1||e>0&&!this._zombie){let r=0;for(;r<e-1;r++){const e=t[r],n=S(e.yValue*(e===this._zombie?this._zombieRate:1)/s)||0;e.yRate=100*n,e.yPos=i,e.height=n,i+=n}t[r].yPos=i,t[r].height=1-i}else if(1==e){const e=t[0],s=S(this._zombieRate);i=1-s,e.yRate=100*s,e.yPos=i,e.height=s,e.yPos=i,e.height=1-i}}$_layoutSegments(t,e){function s(t){return c?p+(y-p)*(w-t)/(w-b):p+(y-p)*(t-m)/(b-m)}const i=this.model,r=this._labelViews(),n=i.getLabelPosition()===me.INSIDE,a=i.pointLabel,h=a.offset,o=r&&a.distance||0,l=this._lineContainer,c=i.reversed,u=i.getSize(t,e),d=i.getNeckSize(u.width,u.height),_=new mr,g=i.getCenter(t,e),p=g.x-u.width/2,m=g.y-u.height/2,w=m+u.height,f=p+u.width/2,x=u.height-d.height,y=p+(u.width-d.width)/2,b=c?w-x:m+x;let V;this._lineContainer.setVisible(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVisible(!i.isNull)){const a=i.yPos*u.height,g=(i.yPos+i.height)*u.height,p=c?w-a:m+a,v=c?w-g:m+g;let P,S,k,A;if(a>=x?(P=y,S=P+d.width,_.move(P,p).lines(S,p,S,v,P,v),t.ny=t.nx1=NaN):g<x?(P=s(p),S=P+2*(f-P),k=s(v),A=k+2*(f-k),_.move(P,p).lines(S,p,A,v,k,v),t.ny=NaN,t.nx1=k-P,t.nx2=A-P):(P=s(p),S=P+2*(f-P),k=y,A=k+d.width,_.move(P,p).lines(S,p,A,b,A,v,k,v,k,b),t.ny=b-p,t.nx1=k-P,t.nx2=A-P),t.setPath(_.close(!0)),i.xPos=f,i.yPos=p+(v-p)/2,r&&(V=r.get(i,0))){const e=l.get(i);if(e.setVisible(!n)){const s=t.getBBounds();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):Math.abs(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/Math.abs(t.ny)),this.$_layoutLabel(V,s,e,h,o,r,n)}else this.$_layoutLabelInner(V,i.xPos,i.yPos);V.setContrast(n&&t.dom)}else null===(e=l.get(i))||void 0===e||e.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=t.getBBounds();n+=e.width/2,s.setLine((new mr).move(0,0).line(r,0).end()),s.translate(n,a),n+=r+i,t.translate(n,a-h.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBounds();t.translate(e-i.width/2,s-i.height/2)}},heatmap:class extends Zr{constructor(t){super(t,"rct-heatmap-series"),this._cells=new gr(this._pointContainer,zn)}_getPointPool(){return this._cells}_prepareSeries(t,e){this.$_parepareCells(e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)}_runShowEffect(t){t&&Gr.slide(this)}$_parepareCells(t,e){this._cells.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutCells(t,e){const s=this.model,i=s.chart.isInverted();s.pointLabel.offset;const r=this._labelViews(),n=s._xAxisObj,a=s._yAxisObj,h=i?t:e,o=i?e:t,l=new Tr(this._getColor());this._cells.forEach((t=>{const c=t.point;if(t.setVisible(!c.isNull)){const u=n.getUnitLength(o,c.xValue),d=u,_=a.getUnitLength(h,c.yValue),g=_,p=i?0:e;let m,w,f;if(m=(c.xPos=n.getPosition(o,c.xValue))-u/2,w=(c.yPos=p-a.getPosition(h,c.yValue))-_/2,t.setBounds(m,w,d,g),t.setStyle("fill",l.brighten(1-c.heatValue/s._heatMax).toString()),r&&(f=r.get(c,0))){const t=f.getBBounds();i?(w=o-n.getPosition(o,c.xValue),m=p,w-=t.height/2,m+=a.getPosition(h,c.yValue)-t.width/2):(m+=(d-t.width)/2,w+=(g-t.height)/2),f.translate(m,w)}}}))}},histogram:class extends tn{constructor(t){super(t,"rct-histogram-series"),this._bars=new gr(this._pointContainer,jn)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=i?t:e,c=i?e:t,u=o.getPosition(l,s.getBaseValue(o)),d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const s=t.point,n=h.getPosition(c,s.min),g=h.getPosition(c,s.max),p=o.getPosition(l,s.yValue),m=g-n+(g>n?-1:1),w=p-u;let f=n+(g-n)/2,x=d;s.xPos=f,s.yPos=x-=p,this._layoutPointView(t,e,f,x+w,m,w*r),_&&(_.labelView=a.get(s,0))&&(i&&(x=c-f,f=d,s.yPos=x,s.xPos=f+=o.getPosition(l,s.yGroup)),_.pointView=t,_.x=f,_.y=x,_.wPoint=m,_.hPoint=w,this._layoutLabel(_))}))}$_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._getViewRate();this._bars.forEach(((a,h)=>{const o=a.point,l=s.getPosition(t,o.min),c=s.getPosition(t,o.max),u=l+(c-l)/2,d=i.getPosition(e,a.point.yValue)*n,_=Math.max(1,c-l-1);o.xPos=u,o.yPos=r-d,a.wPoint=_,a.hPoint=d,a.layout(u,r)}))}},line:Nn,lollipop:class extends en{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i-n,0,n),t.layout()}$_parepareBars(t,e,s){this._bars||(this._bars=new gr(this._pointContainer,Wn)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}},ohlc:class extends sn{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new gr(this._pointContainer,Yn)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this.$_prepareSticks(e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutSticks(t,e){const s=this.model;this._inverted;const i=this._getViewRate(),r=s.pointLabel.offset,n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=this.height;this._sticks.forEach(((l,c)=>{const u=l.point;if(l.setVisible(!u.isNull)){const c=a.getUnitLength(t,u.xValue),d=s.getPointWidth(c),_=(u.xPos=a.getPosition(t,u.xValue))-d/2,g=u.yPos=o-h.getPosition(e,u.yValue)*i,p=d,m=Math.abs(o-h.getPosition(e,u.lowValue)-g)*i;let w;if(l.setBounds(_,g,p,m),l.layout(),n&&(w=n.get(u,0))){const t=w.getBBounds();w.translate(_+(p-t.width)/2,g-t.height-r)}}}))}},pareto:class extends Tn{constructor(t){super(t,"rct-pareto-series")}},pie:class extends nn{constructor(t){super(t,"rct-pie-series"),this._sectors=new gr(this._pointContainer,Un,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new gn(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Br(t,"rct-pie-series-inner")),this._textView.anchor=Nr.MIDDLE,this.add(this._lineContainer=new qr(t))}_getPointPool(){return this._sectors}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVisible(e.hasInner()&&e.innerText.isVisible())&&(this._textView.setModel(t,e.innerText,null),e.innerText.buildSvg(this._textView._text,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rd=this.model.getRadius(t,e),this._rdInner=this.model.getInnerRadius(this._rd)}$_calcGroup(t,e){const s=this.model,i=s.group,r=Math.floor(i?i.getPolarSize(t,e)/2:s.getRadius(t,e)),n=i?i.getInnerRadius(r)*r:s.getInnerRadius(r),a=r-n;this._rd=n+(s._groupPos+s._groupSize)*a,this._rdInner=(n+s._groupPos*a)/this._rd}_runShowEffect(t){t&&Gr.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.translate(0,0),this.$_slice(e,!0,!1))}))}_doPointClicked(t){if(t instanceof Un){const e=this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0),!this.model.autoSlice&&this.control.invalidateLayout()}}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_resizeZombie(){this._renderSeries(this.width,this.height)}$_prepareSectors(t,e,s){this._sectors.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=t.length,s=this.model.clockwise?1:-1,i=t.filter((t=>(t.visible||t===this._zombie)&&!t.isNull)).map((t=>t===this._zombie?t.yValue*this._zombieRate:t.yValue)).reduce(((t,e)=>t+e),0),r=this.model._totalRad*this._getViewRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=S(t===this._zombie?t.yValue*this._zombieRate:t.yValue)/i||0,t.startAngle=n,n+=t.angle=s*t.yRate*r)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r}}$_layoutSectors(t,e,s){const i=this.model,r=i.clockwise,n=this._getViewRate(),a=i.getCenter(e,s),h=this._cx=a.x,o=this._cy=a.y,l=this._rd,c=this._rdInner,u=i.pointLabel,d=this._labelViews(),_=i.getLabelPosition()===me.INSIDE,g=u.offset,p=u.distance||0,m=this._lineContainer,w=this._slicedOff=i.getSliceOffset(l)*n;let f;if(this._textView.visible){const t=this._textView.getBBounds();this._textView.translate(h,o-t.height/2)}(this._circle.visible=this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{var e,s;const a=t.point;if(a.isNull)t.setVisible(!1),d&&(f=d.get(a,0))&&f.setVisible(!1),null===(s=m.get(a))||void 0===s||s.setVisible(!1);else{const s=a.startAngle;let u=0,x=0;if(a.sliced&&n>=1&&!t.isDomAnimating()){const t=s+a.angle/2;u+=Math.cos(t)*w,x+=Math.sin(t)*w}t.translate(u,x).setVisible(!0);const y=a.startAngle+a.angle/2;if(a.xPos=h+Math.cos(y)*(w+.7*l),a.yPos=o+Math.sin(y)*(w+.7*l),t.setPieSector(d,null,{cx:h,cy:o,rx:l,ry:l,innerRadius:c,start:s,angle:Math.abs(a.angle),clockwise:i.clockwise}),d&&(f=d.get(a,0))){const e=m.get(a);e.setVisible(!_)?this.$_layoutLabel(a,f,e,g,p,a.sliced?w:0,r):(e.visible=!1,this.$_layoutLabelInner(a,f,g,0,a.sliced?w:0)),f.setContrast(_&&t.dom).setVisible(!0)}else null===(e=m.get(a))||void 0===e||e.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=e.getBBounds(),o=t.startAngle+t.angle/2;let l=this._cx,c=this._cy,u=this._rd+.8*r,d=Math.cos(o)*n,_=Math.sin(o)*n,g=l+Math.cos(o)*this._rd,p=c+Math.sin(o)*this._rd,m=l+Math.cos(o)*u,w=c+Math.sin(o)*u;const f=m<l;let x;x=f?m-.2*r:m+.2*r,s&&s.setVisible(u>0)&&(s.setLine((new mr).move(0,0).quad(m-g,w-p,x-g,w-p).end()),s.move(g,p),!e.isDomAnimating()&&s.translate(g+d,p+_)),f?(x-=h.width+i,w-=h.height/2):(x+=i,w-=h.height/2),e.move(x,w),!e.isDomAnimating()&&e.layout().translate(x+d,w+_)}$_layoutLabelInner(t,e,s,i,r){const n=e.getBBounds(),a=this._rdInner*this._rd,h=a>0?a+(this._rd-a)/2:.7*this._rd,o=t.startAngle+t.angle/2;let l=this._cx+Math.cos(o)*h,c=this._cy+Math.sin(o)*h;e.move(l-n.width/2,c-n.height/2),l=this._cx+Math.cos(o)*(r+h),c=this._cy+Math.sin(o)*(r+h),e.layout().translate(l-n.width/2,c-n.height/2)}$_slice(t,e,s){const i=this.model,r=i.autoSlice?i.sliceDuration:0,n=t.point,a=n.startAngle+n.angle/2,h=this._labelViews(),o=i.pointLabel,l=this._lineContainer,c=i.getLabelPosition()===me.INSIDE;(n.sliced=e)?t.translateEx(Math.cos(a)*this._slicedOff,Math.sin(a)*this._slicedOff,r):t.translateEx(0,0,r);const u=h.get(n,0);if(u){const t=!c&&l.get(n);if(s&&(c?this.$_layoutLabelInner(n,u,o.offset,o.distance,this._slicedOff):this.$_layoutLabel(n,u,t,o.offset,o.distance,this._slicedOff,i.clockwise)),e){let e=u.tx,s=u.ty;u.translate(u.x,u.y),u.translateEx(e,s,r),t&&(e=t.tx,s=t.ty,t.translate(t.x,t.y),t.translateEx(e,s,r))}else u.translate(u.tx,u.ty),u.translateEx(u.x,u.y,r),t&&(t.translate(t.tx,t.ty),t.translateEx(t.x,t.y,r))}}},scatter:class extends Zr{constructor(t){super(t,"rct-scatter-series"),this._markers=new gr(this._pointContainer,Xn)}_getPointPool(){return this._markers}invertable(){return!1}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Gr.slide(this)}$_prepareMarkers(t,e){const s=t.color,i=e.length;this._pointContainer.setStyle("fill",s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(t,e){const s=this.model,i=this._inverted;s.pointLabel.offset;const r=this._labelViews(),n=s._xAxisObj,a=s._yAxisObj,h=i?t:e,o=i?e:t,l=e;let c,u;this._markers.forEach(((t,e)=>{const d=t.point;if(t.setVisible(!d.isNull)){const e=s.shape,_=s.radius;let g,p,m;switch(p=d.xPos=n.getPosition(o,d.xValue),m=d.yPos=l-a.getPosition(h,d.yValue),i&&(p=a.getPosition(h,d.yGroup),m=l-n.getPosition(o,d.xValue)),e){case"square":case"diamond":case"triangle":case"itriangle":g=at[e](0-_,0-_,2*_,2*_);break;default:g=at.circle(0,0,_)}t.setPath(g),t.translate(p,m),r&&(c=r.get(d,0))&&(u=c.getBBounds(),c.translate(p-u.width/2,m-u.height/2))}}))}},treemap:class extends Zr{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new gr(this._pointContainer,qn)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){const s=this.model;s.pointLabel;const i=this._labelViews(),r=s.buildMap(t,e),n=new Tr(s._calcedColor);let a;i.prepare(this.doc,this),this._nodeViews.prepare(r.length,((t,e,s)=>{const h=r[e],o=h.parent;let l=n;if(o&&(!o._color&&o.point.color?l=o._color=new Tr(o.point.color):o._color&&(l=o._color)),t.node=h,t.setStyle("fill",l.brighten(h.index/s).toString()),t.render(),h.point.xPos=h.x+h.width/2,h.point.yPos=h.y+h.height/2,i&&(a=i.get(h.point,0))){const t=a.getBBounds();a.setVisible(h.width>=t.height&&h.height>=t.height)&&a.translate(h.x+h.width/2-t.width/2,h.y+h.height/2-t.height/2)}}))}_runShowEffect(t){t&&new zr(this)}},vector:class extends Zr{constructor(t){super(t,"rct-vector-series"),this._arrows=new gr(this._pointContainer,Kn)}_getPointPool(){return this._arrows}_prepareSeries(t,e){this.$_prepareArrows(e,this._visPoints)}_renderSeries(t,e){const s=this.model,i=s.startAngle,r=s.arrowHead,n=s._xAxisObj,a=s._yAxisObj;this._arrows.forEach((t=>{const e=t.point;if(t.setVisible(!e.isNull)){const s=e.xPos=n.getPosition(this.width,e.xValue),h=e.yPos=this.height-a.getPosition(this.height,e.yValue);t.translate(s,h),t.layout(r,e.angleValue+i,!1)}}))}_runShowEffect(t){t&&Gr.fadeIn(this)}$_prepareArrows(t,e){this._arrows.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}},waterfall:class extends sn{constructor(t){super(t,"rct-waterfall-series"),this._bars=new gr(this._pointContainer,Zn),this.add(this._lineContainer=new lt(t,"rct-waterfall-series-lines")),this._lines=new gr(this._lineContainer,hi)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){const a=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i),e>0){const t=this._lines.get(e-1),h=a._isSum?i-n:a.y>=0?i:i-n;t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPointViews(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPointViews(t,e)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r),t.setStyleOrClass(r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"")})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}},ia={circle:En,linear:Jn,bullet:ea,clock:class extends mn{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1,this.add(this._faceView=new gn(t,"rct-clock-gauge-face")),this.add(this._rimView=new pn(t,"rct-clock-gauge-rim")),this.add(this._labelView=new Dr(t,"rct-clock-gauge-label")),this._labelView.layout=Rr.MIDDLE,this.add(this._tickContainer=new lt(t,"rct-clock-gauge-ticks")),this.add(this._tickLabelContainer=new lt(t,"rct-clock-gauge-tick-labels")),this.add(this._hourView=new dt(t,"rct-clock-gauge-hour")),this.add(this._minuteView=new dt(t,"rct-clock-gauge-minute")),this.add(this._secondView=new dt(t,"rct-clock-gauge-second")),this.add(this._pinView=new gn(t,"rct-clock-gauge-pin")),this._tickViews=new gr(this._tickContainer,hi,"rct-clock-gauge-tick"),this._minorTickViews=new gr(this._tickContainer,hi,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new gr(this._tickLabelContainer,Dr,"rct-clock-gauge-tick-label")}_prepareGauge(t,e){this._tickViews.prepare(e.tick.visible?12:0),this._minorTickViews.prepare(e.minorTick.visible?48:0);const s=Math.round(12/Math.max(1,Math.floor(e.tickLabel.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Rr.MIDDLE}))}_renderGauge(t,e){const s=this.model,i=this._exts=s.getExtendts(t,e);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const t=this._prevSec;this.$_renderHands(this.model,this._exts),Math.abs(t-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.animatable&&this.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,{cx:i,cy:r,rd:n}=e,a=this._rimThick=this._rimView.visible?this.model.rim.getThickness(n):0;this._faceView.setCircle(i,r,n),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim.style),this._rimView.setSector({cx:i,cy:r,rx:n,ry:n,innerRadius:1-a/n,start:0,angle:2*Math.PI,clockwise:!0}));const h=n-a;let o=h-this.model.tick.length,l=b,c=y/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c})),!this._minorTickViews.isEmpty){let t=0;o=h-this.model.minorTick.length,l=b,c=y/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=c,t++),e.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=y/12*t;l=b,this._tickLabelViews.get(0).text="12",o=h-(this.model.tick.length+this.model.tickLabel.offset||0),o-=.5*this._tickLabelViews.get(0).getBBounds().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.translate(i+Math.cos(l)*o,r+Math.sin(l)*o),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVisible(t.label.visible)&&(s.internalSetStyleOrClass(t.label.style),t.label.buildSvg(s,NaN,NaN,null,null),"bottom"===t.label.position?s.translate(i,r+o/2):s.translate(i,r-o/2))}$_getNow(){const t=this.model.timezone;let e=this.model.getTime()||new Date;if(!isNaN(t)){const s=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(s)}return e}$_renderHands(t,e){const s=this.$_getNow(),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),{cx:a,cy:h,rd:o}=e,l=new mr;let c,u,d,_;c=t.hourHand,u=this._hourView,u.setVisible(c.visible)&&(_=y*(i/12+r/60/12+n/60/60/12),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*v)),c=t.minuteHand,u=this._minuteView,u.setVisible(c.visible)&&(_=y*(r/60+n/60/60),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*v)),c=t.secondHand,u=this._secondView,u.setVisible(c.visible)&&(_=this._secRate<1?y*(this._aniSec+this._secRate)/60:y*n/60,d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*v),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new Ln(this);e.duration=this.model.secondHand.duration||200,e.start()}}},circlegroup:class extends vn{_createPool(t){return new gr(t,En)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.getCenter(s,i),h=n.getExtents(Math.min(s,i));n.setChildExtents(h),s=i=2*h.radius,e.forEach(((t,e)=>{t.measure(r,n.getVisible(e),s,i,0),t.resize(s,i),t.layout()})),t.translate(a.x-h.radius,a.y-h.radius)}},lineargroup:class extends ta{_createPool(t){return new gr(t,Jn)}},bulletgroup:class extends ta{_createPool(t){return new gr(t,ea)}}};class ra extends Fr{constructor(t){super(t,"rct-axis-grid"),this._lines=new gr(this,hi)}_doMeasure(t,e,s,i,r){return this._pts=e.getPoints(e.axis._isHorz?s:i),this._lines.prepare(this._pts.length,(t=>{t.setClass("rct-axis-grid-line")})),Cr.create(s,i)}_doLayout(){const t=this.model.axis,e=this.width,s=this.height,i=this._pts,r=this._lines;0===i[0]&&r.first.setClass("rct-axis-grid-line-start"),i[i.length-1]===(t._isHorz?e:s)&&r.last.setClass("rct-axis-grid-line-end"),t._isHorz?r.forEach(((t,e)=>{t.setVLineC(i[e],0,s)})):r.forEach(((t,r)=>{t.setHLineC(s-i[r],0,e)}))}}class na extends ot{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new dt(t)),this._mask.setStyle("stroke","none"),this.add(this._upLine=new dt(t)),this._upLine.setStyle("fill","none"),this.add(this._downLine=new dt(t)),this._downLine.setStyle("fill","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 mr;if(s){let t=0,s=0,n=i/2,a=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(a,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s);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(a,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,a=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,a);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,a);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,a);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,a);this._mask.setPath(r.end())}}}class aa extends ot{constructor(t){super(t,"rct-axis-guide"),this.add(this._label=new Dr(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t){this.model=t,this._label.text=t.label.text,this._label.setStyles(t.label.style)}}class ha extends aa{constructor(t){super(t),this.insertFirst(this._line=new hi(t,"rct-axis-guide-line"))}prepare(t){super.prepare(t),this._line.setStyles(t.style)}layout(t,e){const s=this.model,i=s.label,r=this._label;let n,a,h,o;if(this.vertical()){const r=s.axis.getPosition(t,s.value,!0);switch(this._line.setVLineC(r,0,e),i.align){case B.CENTER:n=r,h=Nr.MIDDLE;break;case B.RIGHT:n=r,h=Nr.START;break;default:n=r,h=Nr.END}switch(i.verticalAlign){case I.BOTTOM:a=e,o=Rr.BOTTOM;break;case I.MIDDLE:a=e/2,o=Rr.MIDDLE;break;default:a=0,o=Rr.TOP}}else{const l=e-s.axis.getPosition(e,s.value,!0);switch(this._line.setHLineC(l,0,t),i.align){case B.CENTER:n=t/2,h=Nr.MIDDLE;break;case B.RIGHT:n=t,h=Nr.END;break;default:n=0,h=Nr.START}switch(i.verticalAlign){case I.BOTTOM:a=l+1,o=Rr.TOP;break;case I.MIDDLE:a=l,o=Rr.MIDDLE;break;default:a=l-r.getBBounds().height,o=Rr.TOP}}r.anchor=h,r.layout=o,r.translate(n,a)}}class oa extends aa{constructor(t){super(t),this.insertFirst(this._box=new ce(t,"rct-axis-guide-range"))}prepare(t){super.prepare(t)}layout(t,e){const s=this.model,i=this._label;if(this.vertical()){const r=s.axis.getPosition(t,s.start,!0),n=s.axis.getPosition(t,s.end,!0);let a,h,o,l;switch(s.label.align){case B.CENTER:a+=(n-r)/2,o=Nr.MIDDLE;break;case B.RIGHT:a=n,o=Nr.END;break;default:a=r,o=Nr.START}switch(s.label.verticalAlign){case I.BOTTOM:h=e,l=Rr.BOTTOM;break;case I.MIDDLE:h=e/2,l=Rr.MIDDLE;break;default:h=0,l=Rr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(r,0,n,e)}else{const r=e-this.model.axis.getPosition(e,Math.min(s.start,s.end),!0),n=e-this.model.axis.getPosition(e,Math.max(s.start,s.end),!0);let a,h,o,l;switch(s.label.align){case B.CENTER:a=t/2,o=Nr.MIDDLE;break;case B.RIGHT:a=t,o=Nr.END;break;default:a=0,o=Nr.START}switch(s.label.verticalAlign){case I.BOTTOM:h=r,l=Rr.BOTTOM;break;case I.MIDDLE:h=n+(r-n)/2,l=Rr.MIDDLE;break;default:h=n,l=Rr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(0,n,t,r)}}}class la extends lt{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(let e=t.length-1;e>=0;e--){const e=t.pop();e.remove(),e instanceof oa?this._rangePool.push(e):this._linePool.push(e)}R(0===t.length,"GuideContainer.prepare")}addAll(t,e){e.forEach((e=>{if(e instanceof te){let s=this._rangePool.pop()||new oa(t);this.add(s),s.prepare(e),this._views.push(s)}else if(e instanceof Jt){let s=this._linePool.pop()||new ha(t);this.add(s),s.prepare(e),this._views.push(s)}}))}add(t){return this._views.push(t),super.add(t)}}class ca extends dt{constructor(t){super(t),this.setStyle("pointerEvents","none")}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,a=n._isHorz,h=new mr;if(this._bar){const o=n._isHorz?i:r;let l=-1;if(t?l=t.point.xValue:this._model.showAlways&&(l=n.reversed?n.categoryAt(a?i-e:s):n.categoryAt(a?e:r-s)),l>=0){const t=n.getPosition(o,l),e=n.getUnitLength(o,l);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,i,e)}}else(t||this._model.showAlways)&&(a?h.vline(e,0,r):h.hline(s,0,i));this.setPath(h.end())}}class ua extends Fr{constructor(t,e){super(t,ua.BODY_CLASS),this._gridViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._focused=null,this._owner=e,this.add(this._background=new le(t,"rct-plot-background")),this.add(this._image=new _n(t,"rct-plot-image")),this.add(this._gridContainer=new lt(t,"rct-grids")),this.add(this._guideContainer=new la(t,"rct-guides")),this.add(this._seriesContainer=new lt(t,"rct-series-container")),this.add(this._axisBreakContainer=new lt(t,"rct-axis-breaks")),this.add(this._frontGuideContainer=new la(t,"rct-front-guides")),this.add(this._feedbackContainer=new lt(t,"rct-feedbacks")),this._crosshairLines=new gr(this._feedbackContainer,ca)}prepareSeries(t,e){this._animatable=ht._animatable&&e.animatable(),this.$_prepareSeries(t,e,e._getSeries().visibleSeries()),this.$_prepareGauges(t,e,e._getGauges().visibles())}prepareGuideContainers(){this._guideContainer.prepare(),this._frontGuideContainer.prepare()}pointerMoved(t,e){const s=this.width,i=this.height,r=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let n,a;if(e instanceof SVGElement&&(e.classList.contains(Zr.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(Zr.POINT_CLASS)))for(let t=this._seriesViews.length-1;t>=0;t--)if(a=this._seriesViews[t].pointByDom(e),a){n=this._seriesViews[t];break}return this._crosshairLines.forEach((e=>{e.setVisible(r)&&e.layout(a,t.x,t.y,s,i)})),a?this.$_setFocused(n.model,a):this.$_setFocused(null,null),r}$_setFocused(t,e){if(e!=this._focused)return this._focused&&this._focused.unsetData(Zr.DATA_FOUCS),this._focused=e,this._focused?(this._focused.setData(Zr.DATA_FOUCS),this._owner.showTooltip(t,e.point)):this._owner.hideTooltip(),!0}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesViews.find((e=>e.model===t))}_doMeasure(t,e,s,i,r){const n=e.chart;if(this._polar=n.isPolar(),this._background.setStyleOrClass(e.style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._seriesViews.forEach(((e,n)=>{e.measure(t,this._series[n],s,i,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,s,i,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,n)=>{e.measure(t,this._gauges[n],s,i,r)})),Cr.create(s,i)}_doLayout(){const t=this.width,e=this.height,s=this._image;if(this._background.resize(t,e),s.setVisible(s.setImage(this.model.image.url,t,e))&&s.setStyleOrClass(this.model.image.style),this._seriesViews.forEach((s=>{this._owner.clipSeries(s.getClipContainer(),0,0,t,e,s.invertable()),s.resize(t,e),s.layout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.reversed?s.translate(t-i._sect.pos,0):s.translate(i._sect.pos,0):r.reversed?s.translate(0,i._sect.pos):s.translate(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)})),[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.layout(t,e)))}))}this.$_preppareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().translatep(s.getPosition(t,e))}))}$_createSeriesView(t,e){return new(sa[e._type()])(t)}$_createGaugeView(t,e){return new(ia[e._type()])(t)}$_prepareGrids(t,e){const s=e.needAxes(),i=this._gridContainer,r=this._gridViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.isVisible()||(r.get(t).remove(),r.delete(t));[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{if(s&&e.grid.isVisible()&&!r.has(e)){const s=new ra(t);r.set(e,s),i.add(s)}}))))}$_prepareSeries(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._seriesMap,a=this._seriesViews;for(const t of n.keys())s.indexOf(t)<0&&n.delete(t);this._series=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((e=>{const s=n.get(e)||this.$_createSeriesView(t,e);s._setChartOptions(r,this._animatable),i.add(s),n.set(e,s),a.push(s),s.prepareSeries(t,e)}))}$_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,a=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&n.delete(t);this._gauges=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((e=>{const s=n.get(e)||this.$_createGaugeView(t,e);s._setChartOptions(r,this._animatable),i.add(s),n.set(e,s),a.push(s),s.prepareGauge(t,e)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof Ze&&r.push(...t.runBreaks()||[])}))));i.length<r.length;){const e=new na(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_preppareCrosshairs(t){const e=this._crosshairLines,s=[];[t._getXAxes(),t._getYAxes()].forEach((t=>t.forEach((t=>{t.crosshair.visible&&s.push(t.crosshair)})))),e.prepare(s.length,((t,e)=>{t.setModel(s[e])}))}}ua.BODY_CLASS="rct-plot";class da extends lt{constructor(t){super(t,da.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVisible(!1)}setHistory(t,e){if(this.setVisible(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Dr(t,"rct-history-item");e.anchor=Nr.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Dr(t);e.anchor=Nr.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let a=0;a<r;a++)e[a].text=t[a].name,e[a].translateX(n),a<r-1&&(n+=e[a].width+i,s[a].translateX(n),n+=s[a].width+i)}}da.TITLE_CLASS="rct-history";class _a extends Fr{constructor(t){super(t,"rct-legend-item"),this.add(this._label=new Dr(t,"rct-legend-item-label")),this._label.anchor=Nr.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){W.setData(this._label.dom,"hidden",e.source.visible?"":1),W.setData(this._marker.dom,"hidden",e.source.visible?"":1),this._label.text=e.text();const n=this._marker.getBBounds(),a=et(this._label.getBBounds());return this._gap=c(e.legend.markerGap,0),Cr.create(n.width+this._gap+a.width,Math.max(n.height,a.height))}_doLayout(){const t=this._marker.getBBounds();this._marker.translate(0,(this.height-t.height)/2),this._label.translate(t.width+this._gap,(this.height-this._label.getBBounds().height)/2)}}class ga extends $r{constructor(t){super(t,ga.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new gr(this,_a)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyles)}_doMeasure(t,e,s,i,r){const n=e.items(),a=this._vertical=e.getLayout()===Ft.VERTICAL;return this._ipr=c(e.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap=e.location!==It.PLOT?c(e.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,a,this._ipr,s,i)}_doLayout(){const t=this.model,e=this._rowViews,s=this._sizes,i=t.itemsAlign,r=t.lineGap||0,n=t.itemGap||0,a=this._margins,h=this._paddings,o=this._vertical,l=a.left+h.left,c=a.top+h.top;let u,d=l,_=c;this._itemViews.forEach((t=>{t._marker.setStyle("fill",t.model.source.legendColor()),t._marker.setStyle("stroke",t.model.source.legendColor()),t.resizeByMeasured().layout()})),e.forEach(((t,e)=>{o?(_=c,i!==$t.CENTER&&i!==$t.END||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.top+a.bottom+h.top+h.bottom,i===$t.CENTER?_+=(this.height-u)/2:_+=this.height-u),t.forEach((t=>{t.translate(d,_),_+=t.height+n})),d+=s[e]+r):(d=l,i!==$t.CENTER&&i!==$t.END||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.left+a.right+h.left+h.right,i===$t.CENTER?d+=(this.width-u)/2:d+=this.width-u),t.forEach((t=>{t.translate(d,_),d+=t.width+n})),_+=s[e]+r)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const a=e.items(),h=this._itemViews,o=e.itemGap||0,l=e.lineGap||0,c=h.count,u=this._rowViews=[],d=this._sizes=[];let _,g,p,m;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t)),e.measure(t,a[s],r,n,1)}));let w=0,f=0;if(s){for(;w<c;)m=h.get(w),f%i==0?(u.push(p=[m]),g=m.mh,f++,w++):(g+=o+m.mh,g<=n?(p.push(m),f++,w++):f=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{s+=t.mh,e=Math.max(e,t.mw)})),s+=o*(t.length-1),g=Math.max(g,s),_+=e,d.push(e)})),_+=l*(u.length-1)}else{for(;w<c;)m=h.get(w),f%i==0?(u.push(p=[m]),_=m.mw,f++,w++):(_+=o+m.mw,_<=r?(p.push(m),f++,w++):f=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=Math.max(s,t.mh)})),e+=o*(t.length-1),_=Math.max(_,e),g+=s,d.push(s)})),g+=l*(u.length-1)}return Cr.create(_,g)}}ga.LEGEND_CLASS="rct-legend";class pa extends ot{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new gn(t))}layout(){}}class ma extends ot{constructor(t,e){super(t,e),this.add(this._markContainer=new lt(t,"rct-polar-axis-markers")),this._markViews=new gr(this._markContainer,pa),this.add(this._gridContainer=new ot(t,"rct-polar-axis-grids")),this.add(this._labelContainer=new lt(t,"rct-polar-axis-labels")),this._labelViews=new gr(this._labelContainer,Dr)}prepare(t,e){this._model=e,this._markLen=e.tick.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks)}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)}$_prepareLabels(t,e){const s=e._ticks;this._labelViews.prepare(s.length,((t,e)=>{t.text=s[e].label}),(t=>{t.anchor=Nr.START}))}}class wa extends ma{constructor(t){super(t,"rct-polar-xaxis"),this._gridLines=new gr(this._gridContainer,hi,"rct-polar-xaxis-grid-line"),this.add(this._lineView=new gn(t,"rct-polar-xaxis-line")),this._lineView.setStyle("fill","none")}_doPrepare(t,e){this._gridLines.prepare(e.length),this._lineView.visible=t.line.visible}_doLayout(t,e,s,i,r,n){const a=t.chart.startAngle();this._gridLines.forEach(((t,n)=>{const h=r[n].pos*Math.PI*2,o=e+Math.cos(a+h)*i,l=s+Math.sin(a+h)*i;t.setLine(e,s,o,l)}));const h=i+t.tick.length;this._labelViews.forEach(((t,i)=>{const n=r[i];t.anchor=Nr.MIDDLE,t.layout=Rr.MIDDLE,t.text=n.label;const o=t.getBBounds(),l=n.pos*Math.PI*2,c=e+Math.cos(a+l)*(h+o.width/2),u=s+Math.sin(a+l)*(h+o.height/2);t.translate(c,u)})),this._lineView.setCircle(e,s,i)}}class fa extends ma{constructor(t){super(t,"rct-polar-yaxis"),this._gridLines=new gr(this._gridContainer,gn,"rct-polar-yaxis-grid-line"),this.add(this._lineView=new hi(t,"rct-polar-yaxis-line"))}_doPrepare(t,e){this._gridLines.prepare(e.length,null,(t=>{t.setStyle("fill","none")})),this._lineView.visible=t.line.visible}_doLayout(t,e,s,i,r,n){this._gridLines.forEach(((t,i)=>{const n=r[i];t.setCircle(e,s,n.pos)})),this._labelViews.forEach(((t,i)=>{const n=r[i];t.anchor=Nr.END,t.layout=Rr.MIDDLE,t.text=n.label,t.translate(e-4,s-n.pos)})),this._lineView.setVLine(e,s,s-i)}}class xa extends ua{constructor(){super(...arguments),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,a=super._doMeasure(t,e,s,i,r);return this.$_prepareAxes(t,n.xAxis,n._getYAxes().items),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{t.resize(2*i,2*i),t.layout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((t=>{t.layout(null,e,s,i)}))}$_prepareAxes(t,e,s){this._axisContainer||(this.add(this._axisContainer=new ot(t,"rct-polar-axes")),this._axisContainer.add(this._xAxisView=new wa(t))),this._xAxisView.prepare(t,e);const i=this._yAxisViews;for(;i.length<s.length;){const e=new fa(t);this._axisContainer.add(e),i.push(e)}for(;i.length>s.length;)i.pop().remove();i.forEach(((e,i)=>e.prepare(t,s[i])))}}class ya extends $r{constructor(t,e){super(t,e?ya.SUBTITLE_CLASS:ya.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.add(this._textView=new Dr(t)),this._textView.anchor=Nr.START}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._textView.text=this.model.text,et(this._textView.getBBounds())}_doLayout(){this._textView.translate(this._margins.left+this._paddings.left,this._margins.top+this._paddings.top),this._textView.layoutText()}}ya.TITLE_CLASS="rct-title",ya.SUBTITLE_CLASS="rct-subtitle";class ba extends ot{constructor(t){super(t,"rct-tooltip"),this._textCallback=(t,e,s)=>this._model.getValue(this._series,t,e,s),this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new dt(t,"rct-tooltip-back")),this.add(this._textView=new Dr(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+ht.SHADOW_FILTER+")"),this._textView.anchor=Nr.START,this._richText=new Ct,this.close(!0,!1)}show(t,e,s,i,r){const n=this._model=t.tooltip,a=this._textView;this._series=t,this._richText.setFormat(n.text),this._richText.build(a,NaN,NaN,e,this._textCallback);const h=a.getBBounds(),o=Math.max(n.minWidth||0,h.width+16),l=Math.max(n.minHeight||0,h.height+12),c=new mr;c.rect(0,0,o,l),this._back.setPath(c.end(!0)),a.translate((o-h.width)/2,(l-h.height)/2);const u="visible"===this.getStyle("visibility")?300:0;n.series.chart.isInverted()?this.translateEx(s+n.offset,i-l/2,u):this.translateEx(s-o/2,i-l-n.offset,u),0===u&&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.hideDelay:ge.HIDE_DELAY))}$_hide(){!function(t,e,s,i,r,n){const a=null!=s?L(e,s):{},h=L(e,i),o=t.animate([a,h],{duration:r,fill:"none"});o&&n&&o.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}}class Va extends Mr{measure(t,e,s,i,r){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}}class va extends Va{_doInitChildren(t){this.add(this.titleView=new ya(t,!1)),this.add(this.subtitleView=new ya(t,!0))}_doMeasure(t,e,s,i,r){const n=this.titleView,a=this.subtitleView;let h,o=s,l=0;return(n.visible=e.title.isVisible())&&(h=n.measure(t,e.title,s,i,r),l+=h.height,i-=h.height,o=Math.max(h.width)),(a.visible=e.subtitle.isVisible())&&(h=a.measure(t,e.subtitle,s,i,r),l+=h.height,i-=h.height,o=Math.max(h.width)),{width:o,height:l}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model;let n,a,h=0;if(e.visible){switch(n=e.width>t.wPlot||i.alignBase===H.CHART?0:t.xPlot,a=e.width>t.wPlot||i.alignBase===H.CHART?t.wChart:t.wPlot,e.resizeByMeasured().layout(),i.align){case B.LEFT:break;case B.RIGHT:n+=a-e.width;break;default:n+=(a-e.width)/2}e.translate(n,h),h+=e.height}if(s.visible){switch(n=s.width>t.wPlot||r.alignBase===H.CHART?0:t.xPlot,a=s.width>t.wPlot||r.alignBase===H.CHART?t.wChart:t.wPlot,s.resizeByMeasured().layout(),r.position,r.align){case B.LEFT:break;case B.RIGHT:n+=a-s.width;break;default:n+=(a-s.width)/2}s.translate(n,h)}}}class Pa extends Va{_doInitChildren(t){this.add(this._legendView=new ga(t))}_doMeasure(t,e,s,i,r){const n=e.legend,a=this._legendView.measure(t,n,s,i,r),h=this._pos=n.getLocatiion();return h===It.LEFT||h===It.RIGHT?a.width+=this._legendView._gap:a.height+=this._legendView._gap,a}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case It.LEFT:s-=e;break;case It.RIGHT:s-=e,r+=e;break;case It.TOP:i-=e;break;default:n+=e,i-=e}t.resize(s,i).translate(r,n),t.layout()}}class Sa extends Va{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i){const r=this.views;for(;r.length<e.length;){const e=new dn(t);this.add(e),r.push(e)}for(;r.length>e.length;)r.pop().remove();r.forEach(((r,n)=>{r.model=e[n],r.prepareGuides(t,s,i)})),this.axes=e,(this.visible=r.length>0)&&(this.isHorz=r[0].model._isHorz,this._gap=r[0].model.chart.getAxesGap())}checkHeights(t,e,s){let i=0;return this.views.forEach((r=>{i+=r.checkHeight(t,e,s)})),i+(this.views.length-1)*this._gap}checkWidths(t,e,s){let i=0;return this.views.forEach((r=>{i+=r.checkWidth(t,e,s)})),i+(this.views.length-1)*this._gap}_doMeasure(t,e,s,i,r){const n=this.axes;let a=0,h=0;return this.views.forEach(((e,o)=>{const l=e.measure(t,n[o],s,i,r);e.setAttr("xy",n[o]._isX?"x":"y"),a+=l.width,h+=l.height})),this.isHorz?h+=(this.views.length-1)*this._gap:a+=(this.views.length-1)*this._gap,Cr.create(a,h)}_doLayout(){const t=this.width,e=this.height;let s=0;this.views.forEach((i=>{this.isHorz?i.resize(t,i.mh):i.resize(i.mw,e),i.layout(),this.isHorz?(i.translateY(this.dir===F.TOP?e-s-i.mh:s),s+=i.mh+this._gap):(i.translateX(this.dir===F.RIGHT?s:t-s-i.mw),s+=i.mw+this._gap),i.move(undefined,undefined)}))}}class ka extends Mr{}class Aa extends Fr{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Dr(t)),this._textView.anchor=Nr.START}clicked(t){this.model.url&&window.open(this.model.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.text,this.setCursor(e.url?"pointer":""),this._textView.getBBounds()}}class Ea extends ot{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionViews={},this.add(this._currBody=this._bodyView=new ua(t,this));for(const e in F){const s=new Sa(t,F[e]);this.add(s),this._axisSectionViews[F[e]]=s}this.add(this._titleSectionView=new va(t)),this.add(this._legendSectionView=new Pa(t)),this.add(this._creditView=new Aa(t)),this.add(this._historyView=new da(t)),this.add(this._tooltipView=new ba(t))}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}measure(t,e,s,i,r){if(e&&1==r&&e.prepareRender(),this.$_checkEmpty(t,e,s,i))return;const n=this._model=e,a=n.isPolar(),h=n.options.credits,o=n.legend;let l,c=s,u=i;if(this._inverted=e.isInverted(),this.$_prepareBody(t,a),this._creditView.setVisible(h.visible)&&(l=this._creditView.measure(t,h,c,u,r),h.floating||(u-=l.height+h.offsetY)),l=this._titleSectionView.measure(t,n,c,u,r),u-=l.height,this._legendSectionView.visible=o.isVisible())switch(l=this._legendSectionView.measure(t,n,c,u,r),o.getLocatiion()){case It.TOP:case It.BOTTOM:u-=l.height;break;case It.RIGHT:case It.LEFT:c-=l.width}a?this.$_measurePolar(t,n,c,u,1):this.$_measurePlot(t,n,c,u,1)}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;if(null===(t=this._emptyView)||void 0===t?void 0:t.visible)return void this._emptyView.resize(i,r);const n=this._model,a=n.isPolar(),h=n.legend,o=n.options.credits,l=this._creditView;let u=0,d=0,_=0,g=0;l.visible&&(l.resizeByMeasured(),o.floating||(o.verticalAlign===I.TOP?r-=u=l.height+o.offsetY:r-=d=l.height+o.offsetY));const p=this._titleSectionView;let m=0;const w=g+u;p.visible&&(p.resizeByMeasured(),r-=m=p.height),g=s-d;const f=this._legendSectionView;let x,y,b=0,V=0;if(f.visible)switch(f.resizeByMeasured().layout(),b=f.height,V=f.width,h.getLocatiion()){case It.TOP:x=m+u,r-=b;break;case It.BOTTOM:r-=b,x=g-b,g-=b;break;case It.RIGHT:i-=V,y=e-V;break;case It.LEFT:i-=V,_+=V,y=0}const v=this._axisSectionViews;let P;a||($.forEach((t=>{(P=v[t])&&P.visible&&(i-=P.mw)})),G.forEach((t=>{(P=v[t])&&P.visible&&(r-=P.mh)})),(P=v[F.LEFT])&&P.visible&&(P.resize(P.mw,r),P.layout(),_+=P.mw),(P=v[F.RIGHT])&&P.visible&&(P.resize(P.mw,r),P.layout()),(P=v[F.BOTTOM])&&P.visible&&(P.resize(i,P.mh),P.layout(),g-=P.mh),(P=v[F.TOP])&&P.visible&&(P.resize(i,P.mh),P.layout()));const S=this._org=hn.create(_,g);this._plotWidth=i,this._plotHeight=r,a||((P=v[F.LEFT])&&P.translate(S.x-P.mw,S.y-P.height),(P=v[F.RIGHT])&&P.translate(S.x+i,S.y-P.height),(P=v[F.BOTTOM])&&P.translate(S.x,S.y),(P=v[F.TOP])&&P.translate(S.x,S.y-r-P.height));const k=this._plotHeight,A=this._plotWidth;if(_=S.x,g=S.y-k,this._currBody.resize(A,k),this._currBody.layout().translate(_,g),l.visible){const t=o.offsetX||0,i=o.offsetY||0;let r,n;switch(l.layout(),o.verticalAlign){case I.TOP:break;case I.MIDDLE:n=(s-l.height)/2+i;break;default:n=s-d}switch(o.align){case B.LEFT:r=t;break;case B.CENTER:r=(e-l.width)/2+t;break;default:r=e-l.width-t}l.translate(r,n)}if(p.visible&&p.layout({xPlot:_,wPlot:A,wChart:e}).translate(0,w),f.visible){if(h.location===It.PLOT){let t=c(h.offsetX,0);switch(h.align){case B.RIGHT:_+=A-V-t;break;case B.CENTER:_+=(A-V)/2+t;break;default:_+=t}switch(t=c(h.offsetY,0),h.verticalAlign){case I.BOTTOM:g+=k-b-t;break;case I.MIDDLE:g+=(k-b)/2+t;break;default:g+=t}}else if(isNaN(x)){const t=c(h.offsetY,0);if(_=y,h.alignBase===H.CHART){switch(h.verticalAlign){case I.TOP:g=t;break;case I.BOTTOM:g=s-b-t;break;default:g=(s-b)/2+t}g+b>s&&(g=(s-b)/2)}else switch(h.verticalAlign){case I.TOP:g+=t;break;case I.BOTTOM:g=g+r-b-t;break;default:g=g+(r-b)/2+t}g+b>s&&(g=(s-b)/2),g<0&&(g=0)}else{const t=c(h.offsetX,0);if(g=x,h.alignBase===H.CHART)switch(h.align){case B.LEFT:_=t;break;case B.RIGHT:_=e-V-t;break;default:_=(e-V)/2+t}else switch(h.align){case B.LEFT:_+=t;break;case B.RIGHT:_=_+i-V-t;break;default:_+=(i-V)/2+t}_+V>e&&(_=(e-V)/2),_<0&&(_=0)}f.translate(_,g)}this._tooltipView.close(!0,!1)}showTooltip(t,e){const s=e.xPos+this._bodyView.tx,i=e.yPos+this._bodyView.ty;this._tooltipView.show(t,e,s,i,!0)}hideTooltip(){this._tooltipView.close(!1,!0)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}findSeriesView(t){return this._bodyView.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}clipSeries(t,e,s,i,r,n){t&&(this._model.inverted&&n?this._seriesClip.setBounds(0,-i,r,i):this._seriesClip.setBounds(0,0,i,r),t.setClip(this._seriesClip))}pointerMoved(t,e,s){const i=this._bodyView.controlToElement(t,e),r=this._bodyView.pointerMoved(i,s);for(const t in this._axisSectionViews)this._axisSectionViews[t].views.forEach((t=>{const e=t.model.crosshair,s=t.model._isHorz?this._bodyView.width:this._bodyView.height,n=t.model._isHorz?i.x:i.y,a=r&&e.visible&&e.flag.visible&&!e.isBar()&&e.getFlag(s,n);a?t.showCrosshair(n,a):t.hideCrosshiar()}))}_doAttached(t){this._seriesClip=this.control.clipBounds()}$_checkEmpty(t,e,s,i){if(!e||e.isEmpty())return this._emptyView||(this._emptyView=new ka(t)),this._emptyView.resize(s,i),!0;this._emptyView&&(this._emptyView.visible=!1)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new xa(t,this),this.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVisible(!1),this._polarView.setVisible(!0)):(null===(i=this._polarView)||void 0===i||i.setVisible(!1),this._bodyView.setVisible(!0),this._currBody=this._bodyView),this._currBody.prepareSeries(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e.needAxes(),n=this._axisSectionViews;for(const a in n){const h=n[a];r?h.prepare(t,e.getAxes(a),s,i):h.visible=!1}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionViews,a=s,h=i;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[F.LEFT].checkWidths(t,s,i),s-=n[F.RIGHT].checkWidths(t,s,i),i-=n[F.BOTTOM].checkHeights(t,s,i),i-=n[F.TOP].checkHeights(t,s,i),e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&h.measure(t,e,s,i,r)}s=a,i=h;for(const t in n){const e=n[t];e.visible&&(t===F.LEFT||t===F.RIGHT?s-=e.mw:t!==F.BOTTOM&&t!==F.TOP||(i-=e.mh))}e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&h.measure(t,e,s,i,r)}s=a,i=h;for(const t in n){const e=n[t];e.visible&&(t===F.LEFT||t===F.RIGHT?s-=e.mw:t!==F.BOTTOM&&t!==F.TOP||(i-=e.mh))}e.calcAxesPoints(s,i,this._inverted),this._bodyView.measure(t,e.body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e.body.calcRadius(s,i);this.$_prepareAxes(t,e),e.layoutAxes(2*Math.PI,n,!1,r),this._polarView.measure(t,e.body,s,i,r)}}class La extends ht{constructor(t,e){super(t,e),this.addElement(this._chartView=new Ea(t)),this.setPointerHandler(new an(this))}onModelChanged(t,e){this.invalidateLayout()}onVisibleChanged(t,e){e instanceof ke&&this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}get model(){return this._model}set model(t){t!==this._model&&(this._model&&(this._model.assets.unregister(this.doc(),this),this._model.removeListener(this)),this._model=t,this._model&&(this._model.addListener(this),this._model.assets.register(this.doc(),this)),this.invalidateLayout())}chartView(){return this._chartView}load(t,e=!1){this.loaded=!e,this.model=new _r(t)}refresh(){this.invalidateLayout()}useImage(t){}_doRender(t){const e=this._model,s=this._chartView;this.clearTemporaryDefs(),e&&(this.setData("theme",e.options.theme,!0),this.setData("palette",e.options.palette)),s.measure(this.doc(),e,t.width,t.height,1),s.resize(t.width,t.height),s.layout()}_doRenderBackground(t,e,s){this._model&&Object.assign(t.style,this._model.options.style)}}class Ca{constructor(t){this.$_p=t}get visible(){return this.$_p.visible}set visible(t){this.$_p.visible=t}getProp(t,e=!1){return this.$_p.getProp(t,e)}setProp(t,e){this.$_p.setProp(t,e)}setProps(t){this.$_p.setProps(t)}_changed(){this.$_p.chart._modelChanged(this.$_p)}}class Ma extends Ca{constructor(t){super(t)}get type(){return this.$_p._type()}get name(){return this.$_p.name}}class Ta extends Ca{}class Na extends Ma{}class Ra extends Ma{}class Oa extends Ma{}class Da extends Ma{}class Ba extends Ma{}class Ia extends Ma{}class Fa extends Ma{}class $a extends Ma{}class Ga extends Ma{}class Ha extends Ma{}class za extends Ma{}class ja extends Ma{}class Wa extends Ma{}class Ya extends Ma{}class Ua extends Ma{}class Xa extends Ma{}class qa extends Ma{}class Ka extends Ma{}class Za extends Ma{}class Qa extends Ma{}class Ja extends Ma{}class th extends Ca{}class eh extends th{updateValue(t){this.$_p.updateValue(t)}}class sh extends eh{}class ih extends eh{}class rh extends eh{}class nh extends th{get active(){return this.$_p.active}set active(t){this.$_p.active=t}}class ah extends Ca{}const hh={area:Ra,arearange:Oa,bar:Da,barrange:Ba,bellcurve:Ia,boxplot:Fa,bubble:$a,candlestick:Ha,dumbbell:za,equalizer:ja,errorbar:class extends Ma{},funnel:Wa,heatmap:Ya,histogram:Xa,line:Na,lollipop:qa,ohlc:class extends Ma{},pareto:Ka,pie:Za,scatter:Ga,treemap:Ua,vector:Qa,waterfall:Ja},oh={circle:sh,linear:ih,bullet:rh,clock:nh};function lh(t,e){if(e){let s=t.get(e);return s||(e instanceof ke?s=new(hh[e._type()])(e):e instanceof Ss&&(s=new(oh[e._type()])(e)),t.set(e,s)),s}}class ch{constructor(t){this._objects=new Map,this.$_p=t}load(t,e){this.$_p.load(t,e),this._objects.clear()}refresh(){this.$_p.refresh()}get series(){return lh(this._objects,this.$_p.model.firstSeries)}getSeries(t){return lh(this._objects,this.$_p.model.seriesByName(t))}get gauge(){return lh(this._objects,this.$_p.model.firstGauge)}getGauge(t){return lh(this._objects,this.$_p.model.gaugeByName(t))}}class uh{static getVersion(){return"0.9.7"}static setDebugging(t){ot.DEBUGGING=t}static setAnimatable(t){ht._animatable=t}static createChart(t,e,s){const i=new La(t,e);return i.model=new _r(s),new ch(i)}}const dh=uh.getVersion,_h=uh.setDebugging,gh=uh.setAnimatable,ph=uh.createChart;t.RcAreaRangeSeries=Oa,t.RcAreaSeries=Ra,t.RcAreaSeriesGroup=class extends Ta{},t.RcBarRangeSeries=Ba,t.RcBarSeries=Da,t.RcBarSeriesGroup=class extends Ta{},t.RcBellCurveSeries=Ia,t.RcBoxPlotSeries=Fa,t.RcBubbleSeries=$a,t.RcBulletGauge=rh,t.RcBulletGaugeGroup=class extends ah{},t.RcBumpSeriesGroup=class extends Ta{},t.RcCandlestickSeries=Ha,t.RcChartControl=ch,t.RcChartGauge=th,t.RcChartObject=Ca,t.RcChartSeries=Ma,t.RcCircleGauge=sh,t.RcCircleGaugeGroup=class extends ah{},t.RcClockGauge=nh,t.RcDumbbellSeries=za,t.RcEqualizerSeries=ja,t.RcFunnelSeries=Wa,t.RcGaugeGroup=ah,t.RcHeatmapSeries=Ya,t.RcHistogramSeries=Xa,t.RcLineSeries=Na,t.RcLineSeriesGroup=class extends Ta{},t.RcLinearGauge=ih,t.RcLinearGaugeGroup=class extends ah{},t.RcLollipopSeries=qa,t.RcParetoSeries=Ka,t.RcPieSeries=Za,t.RcPieSeriesGroup=class extends Ta{},t.RcScatterSeries=Ga,t.RcSeriesGroup=Ta,t.RcTreemapSeries=Ua,t.RcValueGauge=eh,t.RcVectorSeries=Qa,t.RcWaterfallSeries=Ja,t.createChart=ph,t.getVersion=dh,t.setAnimatable=gh,t.setDebugging=_h}));
|
|
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";let e=0;class s{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.$_destroyed=!0,this.$_destroying=!0,this._doDestory()),null}_doDestory(){}get destroying(){return this.$_destroying}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 i extends s{wrapper(){return this._wrapper}wrapperOrThis(){return this._wrapper||this}createWrapper(t){const e=this._wrapper=new t;return e.$_c=this,e}setWrapper(t){return this._wrapper=t,t.$_c=this,t}isWrapper(t){return t===this._wrapper}}class r extends s{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 n="http://www.w3.org/2000/svg",a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},h=Array.isArray,o=function(t){return"string"==typeof t},l=function(t){return"number"==typeof t},c=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},u=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},d=function(t,e){return void 0!==t?t:e},_=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},g=(t,e)=>{const s=Object.assign({},t);for(const i in e){const r=e[i];a(r)&&a(t[i])?s[i]=g(t[i],r):s[i]=r}return s};class p{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}p._debugging=!1;const m={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},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",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let b=m.ko;const x=void 0,f="%".charCodeAt(0),w=2*Math.PI,y=-Math.PI/2,V=2*Math.PI/360,v=360/Math.PI/2,P=Math.ceil;function S(t){return parseFloat(t.toPrecision(12))}function k(t){return null==t?null:String(t)}function A(t){return t+"px"}function L(t){return null==t||Number.isNaN(t)||""===t}function E(t,e){const s={};return s[t]=e,s}function C(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)===f?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;I(b.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 T(t,e){return C(t,!0)||C(e,!1)}function M(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const N={fill:"fill",stroke:"stroke",strokeWidth:"stroke-width",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},O=function(t){const e=N[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return N[t]=e,e}return e};class D extends Error{}const R=function(t,e){if(!t)throw new D(e)};var B;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(B||(B={}));const I=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))};var $,F,z;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}($||($={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(F||(F={})),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(z||(z={}));const G=[z.LEFT,z.RIGHT],H=[z.TOP,z.BOTTOM];var j;!function(t){t.CHART="chart",t.PLOT="plot"}(j||(j={}));const Y=function(t,e,s){let i,r;return h(t)&&(i=[],t.forEach((t=>{if(a(t)&&o(t.color)){const n={fromValue:c(t.fromValue,r?r.toValue:e),toValue:c(t.toValue,s),color:t.color};n.fromValue<n.toValue&&(i.push(n),r=n)}})),i=i.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),i.forEach((t=>{t.fromValue=Math.max(t.fromValue,e),t.toValue=Math.min(t.toValue,s)}))),i};let W=651212;class U{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,a=s.pageYOffset||n.scrollTop||r.scrollTop,h=s.pageXOffset||n.scrollLeft||r.scrollLeft,o=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=i.left+h-l,u=i.top+a-o;return{x:Math.round(c),y:Math.round(u)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)U.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const a={},h={};return a[e]=s,h[e]=i,t.animate([a,h],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+W++}static stopAnimation(t){if(t)try{t.finish()}catch(t){p.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}const X=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});let q=!1,Z=!1;"undefined"!=typeof window&&(q=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,Z=!!window.chrome&&!q,Object.prototype.toString.call(HTMLElement).indexOf("Constructor")>0||!Z&&!q&&navigator.userAgent.indexOf("Safari"),navigator.userAgent.toLocaleLowerCase().indexOf("samsungbrowser"),navigator.userAgent.toLocaleLowerCase().indexOf("miuibrowser"));const K=/"([^"]*(?="))"/,Q=/'([^']*(?='))'/,J='"'.charCodeAt(0),tt="'".charCodeAt(0);class et{static now(){return+new Date}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),a=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,o=e+Math.ceil((a+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===o?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=t.getDate()+i-1;return e+Math.floor(r/7)}static stopEvent(t,e=!1){t.preventDefault?(t.preventDefault(),t.stopPropagation()):t.returnValue=!1,e&&t.stopImmediatePropagation()}static getErrorStack(t){const e=t.stack;return e?e.split("\n").map((t=>t+"<br/>")):""}static getBaseClassName(t){return Object.getPrototypeOf(t.constructor).name}static isObject(t){return t&&"object"==typeof t&&!h(t)}static assign(t,e){this.isObject(e)&&Object.assign(t,e)}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&&!h(t))return Object.assign({},t)}static checkArray(t){return h(t)?t:void 0}static makeArray(t,e=!1){return null!=t?h(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return h(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(h(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 h(t)?t:null!=t?[t]:null}static copyArray(t){return h(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 isValidNumber(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 getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static checkEnumValue(t,e,s){const i=Object.keys(t);for(let s=i.length-1;s>=0;s--)if(t[i[s]]===e)return e;return s}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()-X}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=Math.max(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=Math.max(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 pickNum(...t){const e=t.length;for(let s=0;s<e;s++)if(!isNaN(t[s])&&null!==t[s])return t[s];return NaN}static included(t,...e){const s=e.length;for(let i=0;i<s;i++)if(e[i]==t)return!0;return!1}static compareTextValue(t,e,s,i){if(t===e)return!0;let r=String(t),n=null==e?void 0:String(e);return!r&&!n||!(!r||!n)&&(s||(r=r.toLowerCase(),n=n.toLowerCase()),i?n.indexOf(r)>=0:r==n)}static cast(t,e){return t instanceof e?t:null}static irandom(t,e){if(void 0!==e){const s=t>>0,i=e>>0;return Math.random()*(i-s)+s>>>0}{const e=t>>0;return Math.random()*e>>0}}static irandomExcept(t,e,s){if(0===t&&1===e&&isNaN(s))throw new Error("Invalid irandom2");for(;;){const i=this.irandom(e,s);if(i!==t)return i}}static brandom(){return Math.random()>.5}static srandom(t,e){let s="";const i=this.irandom(t,e);for(let t=0;t<i;t++)s+=String.fromCharCode(this.irandom(97,123));return s}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[Math.random()*t.length>>0]}static iarandom(t,e,s){const i=new Array;for(let s=t;s<e;s++)i.push(s);for(;i.length>s;)i.splice(et.irandom(i.length),1);return i}static alert(t){window.alert(t)}static toInt(t,e){const s=parseInt(t,e||10);return isNaN(s)?0:s}static toFloat(t){const e=parseFloat(t);return isNaN(e)?0:e}static toEven(t){return 1&t?t+1:t}static hex(t,e=2,s="0"){e=Math.max(e||2,1);const i=t.toString(16);return s=s||"0",new Array(e-i.length+1).join(s)+i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return 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 equalObjects(t,e){if(t===e)return!0;if(!t&&!e)return!0;if(!t||!e)return!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s]!==e[s])return!1;for(var s in e)if(e.hasOwnProperty(s)&&t[s]!==e[s])return!1;return!0}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 incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(s,et.month_days[et.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 getTextLength2(t){let e=0,s=0,i=0;for(;i=t.charCodeAt(s++);e+=i>>7?2:1);return e}static getClassName(t){if(t&&t.constructor)return t.constructor.name||function(t){let e=t.toString();return e=e.substring(9),e=e.substring(0,e.indexOf("(")),e}(t.constructor)}static isInteger(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===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 capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let s=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const i=t.charAt(e);i>="A"&&i<="Z"&&(s+=" "),s+=i}return s}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=h(t)?[]:{};for(let s of Object.keys(t))e[s]=et.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 hasSetter(t,e){for(;t;){const s=Reflect.getOwnPropertyDescriptor(t,e);if(s)return s.writable||!!s.set;t=Object.getPrototypeOf(t)}return!1}static dataUriToBinary(t){const e=";base64,",s=t.indexOf(e)+8,i=t.substring(s),r=window.atob(i),n=r.length,a=new Uint8Array(new ArrayBuffer(n));for(let t=0;t<n;t++)a[t]=r.charCodeAt(t);return a}static assignProps(t,e){let s=!1;if(e)for(let i in e)e[i]!==t[i]&&(t[i]=e[i],s=!0);return s}static assignStyleAndProps(t,e){let s=!1;if(e)for(let i in e)("style"===i||t.hasOwnProperty(i))&&(t[i]=e[i],s=!0);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 isUnique(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)if(t[s]===t[s-1])return!1;return!0}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),console.log(t,+new Date-s+"ms")}static clamp(t,e,s){return Math.max(e,Math.min(s,t))}static makeIntArray(t,e){const s=new Array(Math.max(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static setInterval(t,e){return setInterval(t,e)}static clearInterval(t){clearInterval(t)}static isStringArray(t){return h(t)&&t.every((t=>"string"==typeof t))}static isNumberArray(t){return h(t)&&t.every((t=>"number"==typeof t))}static makeLineSeparator(t){if(h(t)){if(t.length>0){let e=t[0];for(let s=1,i=t.length;s<i;s++)e+="|"+t[s];return new RegExp(e,"g")}}else if(t)return new RegExp(t,"g")}static stripQuotes(t){const e=t.charCodeAt(0);return e===J?t=t.replace(K,"$1"):e===tt&&(t=t.replace(Q,"$1")),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 watch(){return new st}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=Math.abs(t);if(i>=1e3){let r=e.length-1;for(;r;){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]}}}}}et.week_days=["일","월","화","수","목","금","토"],et.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],et.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]],et.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();class st{constructor(){this._started=+new Date}elapsed(t=!1){const e=+new Date-this._started;return t&&(this._started=+new Date),e}elapsedText(t=!1,e="ms."){return this.elapsed(t)+e}}function it(t){return{width:t.width,height:t.height}}class rt{static create(t,e,s,i){return et.isObject(t)?new rt(t.x,t.y,t.width,t.height):L(e)?new rt(t,t,t,t):L(s)?new rt(t,e,t,e):new rt(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return t=this,!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height));var t}clone(){return new rt(this.x,this.y,this.width,this.height)}getInner(){return new rt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}var nt;rt.Empty=new rt,rt.Temp=new rt,function(t){t.CIRCLE="circle",t.DIAMOND="diamond",t.RECTANGLE="rectangle",t.SQUARE="square",t.TRIANGLE="triangle",t.ITRIANGLE="itriangle",t.STAR="star"}(nt||(nt={}));const at=et.getEnumValues(nt),ht=.001;class ot{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e++)s.push("L",t[e++],t[e]);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,"L",t+s,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static square(t,e,s,i){const r=Math.min(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"L",t+r,e,"L",t+r,e+r,"L",t,e+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 arc(t,e,s,i,r,n,a,h=!1){const o=Math.cos(r),l=Math.sin(r),c=Math.cos(n-=ht),u=Math.sin(n),d=n-r-Math.PI<ht?0:1,_=a?1:0,g=[];return g.push("M",t+s*o,e+i*l,"A",s,i,0,d,_,t+s*c,e+i*u),h&&g.push("Z"),g}static sector(t,e,s,i,r,n,a,h){const o=2*Math.PI-Math.abs(a-n)<ht;let l=Math.abs(a-n)-Math.PI<ht?0:1;const c=h?1:0,u=Math.cos(n),d=Math.sin(n),_=Math.cos(a-=o?c?ht:-.001:0),g=Math.sin(a),p=s*r,m=i*r,b=[];return b.push("M",t+s*u,e+i*d,"A",s,i,0,l,c,t+s*_,e+i*g),o?b.push("M",t+p*_,e+m*g):b.push("L",t+p*_,e+m*g),isNaN(p)||b.push("A",p,m,0,l,1-c,t+p*u,e+m*d),b.push("Z"),b}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){const r=t+s/2,n=e+i/2,a=s/2,h=i/2,o=s/4,l=i/4,c=2*Math.PI/5,u=c/2,d=[];let _=-Math.PI/2;d.push("M",r+a*Math.cos(_),n+h*Math.sin(_));for(let t=0;t<5;t++)d.push("L",r+a*Math.cos(_),n+h*Math.sin(_)),d.push("L",r+o*Math.cos(_+u),n+l*Math.sin(_+u)),_+=c;return d.push("Z"),d}static setShape(t,e,s){let i;switch(e){case nt.SQUARE:case nt.RECTANGLE:case nt.DIAMOND:case nt.TRIANGLE:case nt.ITRIANGLE:case nt.STAR:i=ot[e](0,0,2*s,2*s);break;default:i=ot.circle(s,s,s)}t.setPath(i)}}class lt extends i{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.loaded=!1,this._windowResizeHandler=t=>{this._windowResized()},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._keyPressHandler=t=>{},this._wheelHandler=t=>{},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this.$_initControl(t||document,e,s||lt.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestory(){this._unresigterEventHandlers(this._dom),U.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}setData(t,e,s){L(e)?(delete this._svg.dataset[t],s&&delete this._dom.dataset[t]):(this._svg.dataset[t]=e,s&&(this._dom.dataset[t]=e))}clearDefs(){U.clearChildren(this._defs)}clearTemporaryDefs(){const t=this._defs,e=t.children;for(let s=0;s<e.length;s++)e[s].hasAttribute(ct.TEMP_KEY)&&t.removeChild(e[s])}appendDom(t){t&&this._htmlRoot.append(t)}addElement(t){t&&this._root.add(t)}removeElement(t){this._root.removeChild(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)}}getBounds(){return this._dom.getBoundingClientRect()}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 _t(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipRect(t){return this.clipBounds(t.x,t.y,t.width,t.height)}clipPath(){const t=new pt(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.dom.getBoundingClientRect();return{x:e+i.x-r.x,y:s+i.y-r.y}}_setTesting(){this._testing=!0,ct.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){t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),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)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}$_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||I(b.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden",padding:"20px","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const a=this._svg=i.createElementNS(n,"svg");a.classList.add("rct-root"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const h=i.createElement("desc");h.textContent="Created by RealChart v0.9.9",a.appendChild(h);const o=this._defs=i.createElementNS(n,"defs");this._initDefs(i,o),a.appendChild(o),r.appendChild(a),this._root=new dt(this),a.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(n,"filter");const i=t.createElementNS(n,"feDropShadow");s.setAttribute("id",lt.SHADOW_FILTER),i.setAttribute("dx","1"),i.setAttribute("dy","1"),i.setAttribute("flood-olor","#000"),i.setAttribute("flood-opacity","0.75"),i.setAttribute("stdDeviation","1.5"),s.appendChild(i),e.appendChild(s)}_render(){this.$_render()}$_requestRender(){window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):setTimeout((()=>{this.$_render()}),0)}updateNow(){this.$_render()}$_render(){if(+new Date<=this._toAnimation)this.$_requestRender();else{console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;Object.assign(this._htmlRoot.style,{left:A(e.left-t.left),top:A(e.top-t.top)}),this._doRender({x:0,y:0,width:s,height:i}),this._doRenderBackground(this._container.firstElementChild,s,i)}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s){}_windowResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}}lt.CLASS_NAME="rct-control",lt.SHADOW_FILTER="rr-chart-shadow-filter",lt._animatable=!0;class ct extends s{constructor(t,e,s=x){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(n,s||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDestory(){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 zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._translateX}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._translateY}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotaion(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}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent&&this._parent.removeChild(this),this}appendElement(t,e){const s=t.createElementNS(n,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(n,e);return this._dom.insertBefore(i,s),i}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return L(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}setAttrsEx(t){for(let e in t){const s=t[e];L(s)?this._dom.removeAttribute(e):this._dom.setAttribute(e,s)}return this}unsetAttr(t){return this._dom.removeAttribute(t),this}setBounds(t,e,s,i){return this.translate(t,e),this.resize(s,i),this}setRect(t){return this.translate(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return rt.create(this._translateX,this._translateY,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}getBBounds(){return this._dom.getBBox()}controlToElement(t,e){return this.control.containerToElement(this,t,e)}move(t,e){return this.x=t,this.y=e,this}movep(t){return this.x=t.x,this.y=t.y,this}isDomAnimating(){return this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}translate(t,e){return t===this._translateX&&e===this._translateY||(et.isValidNumber(t)&&(this._translateX=t),et.isValidNumber(e)&&(this._translateY=e),this._updateTransform()),this}translatep(t){return this.translate(t.x,t.y)}translateEx(t,e,s=0,i=!0){if(t=et.isNumber(t)?t:this._translateX,e=et.isNumber(e)?e:this._translateY,t!==this._translateX||e!==this._translateY){if(s>0){const r=this._dom.animate([{transform:`translate(${this._translateX}px,${this._translateY}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()}))}this._translateX=t,this._translateY=e,this._updateTransform()}return this}translateX(t){return t!==this._translateX&&et.isValidNumber(t)&&(this._translateX=t,this._updateTransform()),this}translateY(t){return t!==this._translateY&&et.isValidNumber(t)&&(this._translateY=t,this._updateTransform()),this}resize(t,e,s=!0){return t!==this._width&&s&&this.setAttr("width",this._width=t),e!==this._height&&s&&this.setAttr("height",this._height=e),this}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)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(O(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(O(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(O(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]}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t)this._styles[i]!==t[i]&&(s[i]=this._styles[i]=t[i],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._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this._dom.classList.add(t):a(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)}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}setData(t,e){this.dom.dataset[t]=d(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(ct.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}_testing(){return ct.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._translateX,s=this._translateY,i=[];(et.isValidNumber(e)||et.isValidNumber(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),et.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+et.pick(this._originX,t.getAttribute("x"),0)+" "+et.pick(this._originY,t.getAttribute("y")||0)+")");const r=et.getNumber(this._scaleX,1),n=et.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}ct.TESTING=!1,ct.DEBUGGING=!1,ct.TEMP_KEY="_temp_";class ut extends ct{constructor(t,e){super(t,e,"g")}}class dt extends ct{constructor(t){super(t.doc(),null),this._control=t}get control(){return this._control}}class _t extends ct{constructor(t,e,s,i,r,n=0,a=0){super(t,x,"clipPath");const h=this._id=et.uniqueKey()+"-";this.setAttr("id",h);const o=this._rect=new ct(t,null,"rect");o.setAttr("fill","none"),n>0&&o.setAttr("rx",String(n)),a>0&&this.dom.setAttribute("rx",String(a)),isNaN(e)||o.setBounds(e,s,i,r),this.add(o)}get id(){return this._id}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}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 gt extends ct{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}renderShape(t,e,s,i){let r;switch(t){case"squre":case"diamond":case"triangle":case"itriangle":r=ot[t](e-i,s-i,2*i,2*i);break;default:r=ot.circle(e,s,i)}this.setPath(r)}}class pt extends ct{constructor(t){super(t,x,"clipPath");const e=this._id=et.uniqueKey()+"-";this.setAttr("id",e),this._path=new gt(t),this.add(this._path)}get id(){return this._id}setPath(t){this._path.setPath(t)}}class mt{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._doCanceled()}finally{this.end(-1,-1)}}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){}}class bt{constructor(t){this.source=t}}class xt extends bt{_setStops(t,e){const s=t.createElementNS(n,"stop"),i=t.createElementNS(n,"stop"),r=this.source.color,a=L(this.source.opacity)?1:this.source.opacity,o=h(r)?r[0]:r,l=h(r)&&r.length>1?r[1]:"white",c=h(a)?a[0]:a,u=h(a)&&a.length>1?a[1]:a;e.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",l),s.setAttribute("stop-opacity",c),i.setAttribute("offset","1"),i.setAttribute("stop-color",o),i.setAttribute("stop-opacity",u),e.appendChild(s),e.appendChild(i)}}class ft extends xt{getEelement(t){const e=t.createElementNS(n,"linearGradient");let{x1:s,x2:i,y1:r,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,e),this.source.dir){case"up":r=1;break;case"right":i=1;break;case"left":s=1;break;default:a=1}return e.setAttribute("x1",s),e.setAttribute("y1",r),e.setAttribute("x2",i),e.setAttribute("y2",a),e}}ft.TYPE="lineargradient";class wt extends xt{getEelement(t){const e=this.source,s=t.createElementNS(n,"radialGradient");return L(e.cx)||s.setAttribute("cx",e.cx),L(e.cy)||s.setAttribute("cy",e.cy),L(e.rd)||s.setAttribute("rd",e.rd),this._setStops(t,s),s}}wt.TYPE="radialgradient";class yt{constructor(){this._items=[]}get count(){return this._items.length}get(t){return this._items[t]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(e)}}register(t,e){this._items.forEach((s=>{e.addDef(s.getEelement(t))}))}unregister(t,e){this._items.forEach((t=>{e.removeDef(t.source.id)}))}$_loadItem(t){if(a(t)&&t.type&&t.id)switch(t.type.toLowerCase()){case ft.TYPE:return new ft(t);case wt.TYPE:return new wt(t)}}}const Vt="0".charCodeAt(0),vt="#".charCodeAt(0),Pt=",".charCodeAt(0),St="s".charCodeAt(0),kt="a".charCodeAt(0);class At{static getFormatter(t){let e=At.Formatters[t];return e||(At.Formatters[t]=e=new At(t)),e}static get Default(){return At.getFormatter(At.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_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)===Vt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===vt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===Vt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Pt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===St){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===kt){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s.maximumFractionDigits||delete s.maximumFractionDigits,s}}}At.DEFAULT_FORMAT="",At.Formatters={};const Lt="$_TH";class Et{get type(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;if(s&&e){let i=this.text;for(let r=0;r<s.length;r+=3)i=i.replace(s[r],e(t,s[r+1],s[r+2]));return i}return this.text}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;){const s=t.indexOf("${",e);if(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),a=n.indexOf(";");a>0?this._literals.push(r,n.substring(0,a),n.substring(a+1)):this._literals.push(r,n,""),e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Ct extends Et{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf("<",r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.innerHTML=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))}}}const Tt={t:class extends Ct{get type(){return"t"}},b:class extends Ct{get type(){return"b"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends Ct{get type(){return"i"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}}};class Mt{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 Et).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){const s=t[i],r=t[i+1];if("<"==s){let s;if(r in Tt){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+r+">",a=t.indexOf(n,e+1);if(a>=0){const e=t.substring(i,a+n.length);s=(new Tt[r]).parse(e),i+=e.length}}}if(!s){e(t.substring(i));break}this._words.push(s)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}getText(t,e){let s="";for(let i of this._words)s+=i.getText(t,e);return s}}class Nt{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&(this._format=t,t&&this.$_parse(t))}lines(){return this._lines.slice()}build(t,e,s,i,r){const n=t.doc,a=c(this.lineHeight,1),h=this._lines,o=h.length,l=[];let u;t.clearDom(),i=i||t;for(let e=0;e<o;e++){const s=h[e];let o=0,c=0,u=null;for(let e of s.words){const s=e.prepareSpan(t.appendElement(n,"tspan"),i,r),a=s.getBBox();o+=a.width,s.$_TW=a.width,c=Math.max(c,s[Lt]=a.height),u||(u=s)}l.push(u),s[Lt]=c*a}u=h[0][Lt];for(let e=1;e<l.length;e++)if(l[e]){const s=t.insertElement(n,"tspan",l[e]);let i=Math.floor(u-t.getAscent(u))+t.getAscent(h[e][Lt]);s.setAttribute("x","0"),s.setAttribute("dy",String(i)),s.innerHTML="​",u=h[e][Lt]}t.layoutText(h[0][Lt])}$_parse(t){const e=this._lines=[];if(t){const s=t.split(/<br.*?>|\r\n|\n/);for(let t of s)e.push((new Mt).parse(t))}}}let Ot=0;class Dt extends s{constructor(t,e=!0){super(),this.INVALID={},this.chart=t,this._visible=e,Ot++}get visible(){return this._visible}set visible(t){var e;t!==this._visible&&(this._visible=t,null===(e=this.chart)||void 0===e||e._visibleChanged(this))}load(t){if(void 0!==t&&!this._doLoadSimple(t)){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t)),this._doLoad(t)}return this}save(){const t={visible:this.visible};return this._doSave(t),t}$_parseProp(t){if(t.indexOf(".")>=0){const e=t.split("."),i=e.length-1;let r=this;for(let t=0;t<i;t++)if(r=r[e[t]],!(r instanceof s))return this.INVALID;return{obj:r,prop:e[i]}}}getProp(t){if(o(t)){const e=this.$_parseProp(t);return e?e===this.INVALID?x:e.obj[e.prop]:this[t]}}setProp(t,e,i){if(o(t)){const r=this.$_parseProp(t);if(r)r.obj instanceof Dt?r.obj.setProp(r.prop,e,i):r.obj instanceof s&&e!==r.obj[r.prop]&&(r.obj[r.prop]=e,i&&this._changed());else if(t in this){const s=this[t];if(s instanceof Dt)return s.setProps(e,i);if(e!==s)return this[t]=e,i&&this._changed(),!0}}}setProps(t,e){let s=!1;if(a(t))for(const e in t)this.setProp(e,t[e],!1)&&(s=!0);else this._doLoadSimple(t)&&(s=!0);return s&&e&&this._changed(),s}prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoadSimple(t){if("boolean"==typeof t)return this.visible=t,!0}_doLoad(t){for(const e in t){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof Dt?this[e].load(s):h(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):a(s)?this[e]=Object.assign({},s):this[e]=s)}}_doLoadProp(t,e){return!1}_doSave(t){}_doPrepareRender(t){}}var Rt,Bt,It,$t,Ft,zt,Gt,Ht,jt,Yt,Wt;!function(t){t.NONE="none",t.OUTLINE="outline",t.BACKGROUND="background"}(Rt||(Rt={}));class Ut extends Dt{constructor(){super(...arguments),this.effect=Rt.NONE,this.autoContrast=!0}}class Xt extends Ut{constructor(t,e){super(t,e),this.numberSymbols="k,M,G,T,P,E",this.numberFormat="#,##0.#"}get numberSymbols(){return this._numberSymbols}set numberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?At.getFormatter(t):null)}get text(){return this._text}set text(t){this.setText(t)}setText(t){return t!==this._text&&(this._text=t,t?(this._richTextImpl||(this._richTextImpl=new Nt),this._richTextImpl.setFormat(t)):this._richTextImpl=null),!isNaN(this.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this.lineHeight),this}isVisible(){return this.visible&&!!this._text}buildSvg(t,e,s,i,r){this._richTextImpl.build(t,e,s,i,r)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}$_getNumberText(t,e,s){if(et.isValidNumber(t)){const i=this._numSymbols&&e&&et.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i=!1){let r=t||this.$_getNumberText(e,s,i)||e;return this.prefix&&(r=this.prefix+r),this.suffix&&(r+=this.suffix),r}}class qt extends Dt{}!function(t){t.AUTO="auto",t.LINE="line"}(Bt||(Bt={}));class Zt extends Dt{constructor(){super(...arguments),this.minWidth=50}}class Kt extends Dt{constructor(t){super(t.chart),this.axis=t,this.type=Bt.AUTO,this.showAlways=!0,this.followPointer=!0,this.numberFormat="#,##0.#",this.flag=new Zt(t.chart),this.visible=!1}isBar(){return!this.axis.isContinuous()&&this.type===Bt.AUTO}getFlag(t,e){return At.getFormatter(this.numberFormat).toStr(this.axis.getValueAt(t,e))}}class Qt extends Dt{constructor(t,e=!0){super(null==t?void 0:t.chart,e),this.axis=t}}class Jt extends Qt{constructor(t){super(t,!0),this.visible=t._isX}}!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(It||(It={}));class te extends Qt{constructor(){super(...arguments),this.align=It.MIDDLE,this.gap=5}isVisible(){return this.visible&&!L(this.text)}_doLoadSimple(t){if(o(t))return this.text=t,!0}}class ee extends Qt{constructor(t){super(t,null),this.circular=!0,this.startVisible=!1,this.endVisible=!0}isVisible(){return null==this.visible?!this.axis._isX:this.visible}getPoints(t){const e=this.axis;return e._ticks.map((s=>e.getPosition(t,s.value,!1)))}}class se extends Xt{constructor(t){super(t,!0),this.align=$.LEFT,this.verticalAlign=F.TOP}}!function(t){t.LINE="line",t.RANGE="range",t.AREA="area"}($t||($t={}));class ie extends Qt{constructor(t){super(t),this.front=!0,this.zindex=0,this.label=new se(t.chart)}}class re extends ie{}class ne extends ie{}class ae extends Qt{constructor(t){super(t),this.length=7,this.margin=3,this.visible=!1}}!function(t){t.NONE="none",t.ROTATE="rotate",t.STEP="step",t.ROWS="rows"}(Ft||(Ft={}));class he extends Xt{constructor(t){super(t&&t.chart,!0),this.axis=t,this.step=0,this.startStep=0,this.rows=0,this.autoArrange=Ft.ROTATE,this.wrap=!1,this.numberFormat=null}getRotation(){return this.rotation||0}}!function(t){t.NORMAL="normal",t.OPPOSITE="opposite",t.BASE="base"}(zt||(zt={}));class oe extends Qt{constructor(t){super(t,!1),this.thickness=12}}class le{constructor(t,e,s){this.axis=t,this._axixMin=t.axisMin(),this._axixMax=t.axisMax(),this.resize(e,s)}resize(t,e){if(t=Math.max(this._axixMin,Math.min(this._axixMax,t)),e=Math.max(t,Math.min(this._axixMax,e)),t!==this.start||e!==this.end)return this.start=t,this.end=e,!0}}class ce extends Dt{constructor(t,e,s){super(t),this.grid=this._createGrid(),this.guides=[],this.crosshair=new Kt(this),this.scrollBar=new oe(this),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this.position=zt.NORMAL,this.reversed=!1,this.marginNear=0,this.marginFar=0,this._isX=e,this.name=s,this.title=new te(this),this.line=new Jt(this),this.tick=this._createTickModel(),this.label=this._createLabelModel()}isEmpty(){return this._series.length<1}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}isBased(){return!1}disconnect(){this._series=[],this._values=[]}collectValues(){this._series.forEach((t=>{t.collectValues(this,this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}prepareRender(){this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isOpposite=this.position===zt.OPPOSITE,this._doPrepareRender();const t=this._series,e=this._values;if(this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalcluateRange(e),this._isX){let e=0,s=0;t.forEach((t=>{t.clusterable()&&(e+=c(t.groupWidth,1))})),t.forEach((t=>{if(t.clusterable()){const i=c(t.groupWidth,1)/e;t.setCluster(i,s),s+=i}}))}}buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t)}calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPosition(t,e.value)))}getLabelLength(t,e){return this.getUnitLength(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}parseValue(t){return parseFloat(t)}contains(t){return t>=this._range.min&&t<=this._range.max}resetZoom(){this._zoom&&(this._zoom=null,this._changed())}zoom(t,e){if(!isNaN(t)&&!isNaN(e)){if(!this._zoom)return this._zoom=new le(this,t,e),this._changed(),!0;if(this._zoom.resize(t,e))return this._changed(),!0}}isZoomed(){return!!this._zoom}_doLoadProp(t,e){if("guide"===t)return h(e)?this.$_loadGuides(e):a(e)&&this.$_loadGuides([e]),!0}_createGrid(){return new ee(this)}$_loadGuides(t){for(let e=0;e<t.length;e++){const s=t[e];let i;if("range"===s.type)i=new ne(this);else i=new re(this);i.load(s),this.guides.push(i)}}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalcluateRange(t){return{min:t.length>0?S(Math.min(...t)||0):NaN,max:t.length>0?S(Math.max(...t)||0):NaN}}}class ue{constructor(t,e){this._items=[],this._map=new Map,this.chart=t,this.isX=e}get count(){return this._items.length}get first(){return this._items[0]}get items(){return this._items.slice(0)}load(t){const e=this.chart,s=this._items;h(t)?t.forEach(((t,i)=>s.push(this.$_loadAxis(e,t,i)))):a(t)&&s.push(this.$_loadAxis(e,t,0))}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()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t.prepareRender()))}buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e.buildTicks(t)))}connect(t){const e=this._items,s=this.isX?t.xAxis:t.yAxis;let i;return l(s)&&s>=0&&e.length?i=e[s]:o(s)&&(i=e.find((t=>t.name===s))),i||(i=e[0]),i&&i._connect(t),i}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,r;let n=t._getAxisType(e.type);if(!n){let a;if(h(e.categories))a="category";else if(this.isX){for(const i of t._getSeries().items())if(i.canCategorized()){if(e.name&&i.xAxis===e.name){a="category";break}if(l(i.xAxis)&&i.xAxis===s){a="category";break}}!a&&(null===(i=t.first)||void 0===i?void 0:i.canCategorized())&&(a="category")}else a=null===(r=t._getSeries().first)||void 0===r?void 0:r.defaultYAxisType();a&&(n=t._getAxisType(a))}n||(n=t._getAxisType("linear"));const a=new n(t,this.isX,e.name);return a.load(e),a}}!function(t){t.NONE="none",t.X="x",t.Y="y",t.BOTH="both"}(Gt||(Gt={}));class de extends Dt{constructor(t){super(t),this._guides=[],this._frontGuides=[],this.startAngle=0,this.circular=!0,this.image=new qt(null),this.zoomType=Gt.NONE,this.radius="45%",this.centerX="50%",this.centerY="50%"}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(t,!0))}get centerX(){return this._centerX}set centerX(t){t!==this._centerX&&(this._centerX=t,this._cxDim=C(t,!0))}get centerY(){return this._centerY}set centerY(t){t!==this._centerY&&(this._centerY=t,this._cyDim=C(t,!0))}canZoom(){return this.zoomType===Gt.X||this.zoomType===Gt.Y||this.zoomType===Gt.BOTH}calcRadius(t,e){return M(this._radiusDim,Math.min(t,e))}setPolar(t,e){return this._cx=M(this._cxDim,t),this._cy=M(this._cyDim,e),this._rd=M(this._radiusDim,Math.min(t,e)),this}getStartAngle(){return y+V*this.startAngle}getPolar(t){return this.chart.isPolar()?{start:this.getStartAngle(),cx:this._cx,cy:this._cy,rd:this._rd,deg:t?2*Math.PI/t._runPoints.length:0}:x}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._guides=[],s=this._frontGuides=[];t._getXAxes().forEach((t=>{t.guides.forEach((t=>{t.front?s.push(t):e.push(t)}))}))}}class _e extends Dt{_doLoad(t){super._doLoad(t)}_doPrepareRender(t){}}class ge extends Dt{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}ge.MARKER_SIZE=10,function(t){t.BOTTOM="bottom",t.TOP="top",t.RIGHT="right",t.LEFT="left",t.PLOT="plot",t.SUBPLOT="subplot"}(Ht||(Ht={})),function(t){t.AUTO="auto",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(jt||(jt={})),function(t){t.START="start",t.CENTER="center",t.END="end"}(Yt||(Yt={}));class pe extends _e{constructor(t){super(t,void 0),this.location=Ht.BOTTOM,this.layout=jt.AUTO,this.alignBase=j.PLOT,this.gap=6,this.itemGap=8,this.markerGap=4,this.lineGap=4,this.offsetX=0,this.offsetY=0,this.itemsAlign=Yt.CENTER,this.visible=void 0}items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return this.visible||!1!==this.visible&&this._items.length>1}getLocatiion(){return this._location}getLayout(){if(this.layout!==jt.AUTO||this._location===Ht.PLOT)return this.layout;switch(this._location){case Ht.BOTTOM:case Ht.TOP:return jt.HORIZONTAL;default:return jt.VERTICAL}}getMaxWidth(t){return M(this._maxWidthDim,t,t)}getMaxHeight(t){return M(this._maxHeightDim,t,t)}_doLoad(t){super._doLoad(t),this._maxWidthDim=C(this.maxWidth,!0),this._maxHeightDim=C(this.maxHeight,!0)}_doPrepareRender(t){super._doPrepareRender(t),this._location=et.checkEnumValue(Ht,this.location,Ht.BOTTOM),this._items=this.$_collectItems()}$_collectItems(){return this.chart._getLegendSources().map((t=>new ge(this,t)))}}class me extends ct{static create(t,e,s,i,r,n,a=0){return new me(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=x,s=x){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},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 be extends gt{constructor(t,e=x){super(t,e)}setBox(t,e,s,i){return this.setPath(ot.box(t,e,s,i)),this}}!function(t){t.DEFAULT="default",t.SPLINE="spline",t.STEP="step"}(Wt||(Wt={}));let xe=0;class fe{static swap(t){const e=[];for(let s=0;s<t.length;s++)e.push({xPos:t[s].yPos,yPos:t[s].xPos});return e}constructor(t){this.pid=xe++,this.visible=!0,this.getValueOf=(t,e)=>this[e]||this.source[e],this.source=t}get yAbs(){return Math.abs(this.yValue)}get xAbs(){return Math.abs(this.xValue)}ariaHint(){return this.x+", "+this.yValue}labelCount(){return 1}assignTo(t){this._assignTo(t)}getProp(t){return null==(e=this.source)||isNaN(e)?this.source:this.source[t];var e}parse(t){const e=this.source;h(e)?this._readArray(t,e):a(e)?(this._readObject(t,e),(h(e.drillDown)||a(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e)}getLabel(t){return this.y}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}_assignTo(t){return Object.assign(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue})}_colorIndex(){return 2}_readArray(t,e){if(null==e)this.isNull=!0;else{const s=+t.colorField;isNaN(s)||(this.color=e[s]),e.length>1?(this.x=e[c(t.xField,0)],this.y=e[c(t.yField,1)]):this.y=e[c(t.yField,0)]}}_readObject(t,e){var s,i,r,n;null==e?this.isNull=!0:(this.x=(s=e[t.xField],i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=_(e[t.yField],e.y,e.value),this.color=d(e[t.colorField],e.color))}_readSingle(t){this.y=t}}class we{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}contains(t){return this._points.indexOf(t)>=0}load(t){h(t)?this._points=this._owner.createPoints(t):this._points=[]}getProps(t){return this._points.map((e=>e.getProp(t)))}getValues(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++);}getPoints(t,e){const s=t._zoom;return s?this._points.slice(Math.floor(s.start),Math.ceil(s.end)+1):this._points}}class ye extends Dt{constructor(t){super(t.chart),this.series=t,this.text="<b>${name}</b><br>${series}:<b> ${yValue}</b>",this.offset=8,this.hideDelay=ye.HIDE_DELAY,this.minWidth=100,this.minHeight=40}getValue(t,e,s,i){const r=t.getPointTooltip(e,s);if(l(r)){const t=i||this.numberFormat;return t?At.getFormatter(t).toStr(r):r}return r}}var Ve,ve,Pe,Se,ke,Ae,Le,Ee;ye.HIDE_DELAY=700,function(t){t.DEFAULT="default",t.POINT="point",t.EDGE="edge"}(Ve||(Ve={}));class Ce extends ae{constructor(){super(...arguments),this.position=Ve.POINT,this.step=1,this.showLast=!1}getPosition(){return this.position===Ve.POINT||this.position===Ve.EDGE?this.position:this.axis._isX?Ve.POINT:Ve.EDGE}}class Te extends he{getTick(t,e){return null!=e?this._getText(e,e,!1):""}}class Me extends ee{getPoints(){const t=this.axis._pts,e=this.axis._ticks.length,s=[];if(e>0)for(let i=0;i<=e;i++)s.push(t[i+1]);return s}}class Ne extends ce{constructor(){super(...arguments),this._map={},this._catPad=0,this.padding=0,this.categoryPadding=.1}getCategories(){return this._cats}getCategory(t){return this._cats[t]}categoryAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return e-2+(this._zoom?Math.floor(this._zoom.start):0);return-1}getWdith(t,e){return 0}categoryPad(){return this._catPad}type(){return"category"}isContinuous(){return!1}_createGrid(){return new Me(this)}_createTickModel(){return new Ce(this)}_createLabelModel(){return new Te(this)}collectValues(){this.$_collectCategories(this._series),this._series.length>0?super.collectValues():this._values=et.makeIntArray(0,this._categories.length)}_doPrepareRender(){this._cats=[],this._weights=[],this._minPad=u(this.minPadding,this.padding,0),this._maxPad=u(this.maxPadding,this.padding,0),this._catPad=c(this.categoryPadding,0)}_doBuildTicks(t,e,s){const i=this.label;let r=this._cats=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this.tick.step||1,h=[];for(t=this._min=Math.floor(t),e=this._max=Math.ceil(e);r.length<=e;)r.push(String(r.length)),n.push(1);r=this._cats=r.slice(t,e+1),n=n.slice(t,e+1);const o=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);if(o>0){const s=this._pts=[0];let l=this._minPad;for(let i=t;i<=e;i++)n[i-t],s.push(l/o),l+=n[i-t];s.push(l/o),s.push((l+this._maxPad)/o);for(let e=1;e<s.length-2;e+=a){const s=t+e-1;h.push({pos:NaN,value:s,label:i.getTick(e-1,r[e-1])})}}else this._pts=[];return h}calcPoints(t,e){super.calcPoints(t,e);const s=this._pts;if(e>0)for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;let i;i=this.tick.getPosition()===Ve.EDGE?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=i}getPosition(t,e,s=!0){e-=this._min,s&&(e+=.5);const i=Math.floor(e),r=this._pts[i+1]+(this._pts[i+2]-this._pts[i+1])*(e-i);return this.reversed?t-r:r}getValueAt(t,e){for(let t=1;t<this._pts.length-1;t++)if(e>=this._pts[t]&&e<this._pts[t+1])return this._min+t-1}getUnitLength(t,e){const s=Math.floor(e-this._min);return this._pts[s+2]-this._pts[s+1]}getValue(t){return l(t)?t:this._map[t]}$_collectCategories(t){const e=this.categories,s=this._categories=[];if(h(e)&&e.length>0)this._len=0,e.forEach((t=>{let e,i=null==t?1:c(t.weight,1);e=null==t?null:o(t)?t:t.name||t.label,this._len+=i,s.push({c:e,w:i})}));else if(h(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)s.find((t=>t.c===e))||s.push({c:e,w:1})}this._map={},s.forEach(((t,e)=>this._map[t.c]=e))}}!function(t){t.AUTO="auto",t.INSIDE="inside",t.OUTSIDE="outside",t.HEAD="head",t.FOOT="foot",t.INSIDE_FIRST="insideFirst",t.OUTSIDE_FIRST="outsideFirst"}(ve||(ve={}));class Oe extends Xt{constructor(t){super(t,!1),this.position=ve.AUTO,this.offset=4,this.distance=25}getText(t){if(et.isValidNumber(t)){return this._getText(null,t,Math.abs(t)>1e3,!0)}return t}_doLoad(t){super._doLoad(t)}}!function(t){t.LINEAR="linear",t.LOGARITHMIC="logarithmic",t.POLYNOMIAL="polynomial",t.POWER="power",t.EXPONENTIAL="exponential",t.MOVING_AVERAGE="movingAverage"}(Pe||(Pe={}));class De extends s{constructor(){super(...arguments),this.interval=5,this.type="simple"}}class Re extends Dt{constructor(t){super(t.chart),this.series=t,this.type=Pe.LINEAR,this.lineType=Wt.DEFAULT,this.movingAverage=new De,this.visible=!1}_doPrepareRender(t){(this["$_"+this.type]||this.$_linear).call(this,this.series._runPoints,this._points=[])}$_linear(t,e){const s=t.length;if(s>1){let i=0,r=0,n=0,a=0,h=0;t.forEach((t=>{i+=t.xValue,r+=t.yValue,n+=t.xValue*t.xValue,a+=t.yValue+t.yValue,h+=t.xValue*t.yValue}));const o=(s*h-i*r)/(s*n-i*i),l=(r-o*i)/s;e.push({x:t[0].xValue,y:o*t[0].xValue+l}),e.push({x:t[s-1].xValue,y:o*t[s-1].xValue+l})}}$_logarithmic(t,e){}$_polynomial(t,e){}$_power(t,e){}$_exponential(t,e){}$_movingAverage(t,e){const s=this.movingAverage,i=t.length,r=Math.max(1,Math.min(i,s.interval));let n=r-1;for(;n<=i;){n+=1;const s=t.slice(n-r,n).reduce(((t,e)=>t+e.yValue),0);n<=i&&e.push({x:t[n-1].xValue,y:s/r})}}}class Be extends Dt{static _loadSeries(t,e,s){let i=t._getSeriesType(e.type);i||(i=t._getSeriesType(s||t.type));const r=new i(t,e.name);return r.load(e),r}constructor(t,e){super(t),this.index=-1,this._simpleMode=!1,this.zOrder=0,this.clipped=!1,this.displayInLegend=!0,this.displayInNavigator=!1,this.name=e,this.pointLabel=new Oe(t),this.trendline=new Re(this),this.tooltip=new ye(this),this._points=new we(this),this._pointArgs=this._createPointArgs()}contains(t){return this._points.contains(t)}getPoints(){return this._points}getLabeledPoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}getVisiblePoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}displayName(){return this.label||this.name}legendMarker(t){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,ge.MARKER_SIZE)),this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return this.label||this.name}ignoreAxisBase(t){return!1}canMixWith(t){return!0}getBaseValue(t){return NaN}canMinPadding(t){return!0}canMaxPadding(t){return!0}hasMarker(){return!1}setShape(t){}createPoints(t){return t.map(((t,e)=>{const s=this._createPoint(t);return s.index=e,s.parse(this),s.isNull||(s.isNull=null==t||null==s.y),s}))}getXStart(){let t=this._xAxisObj.parseValue(this.xStart);const e=isNaN(t)?this._xAxisObj.parseValue(this.chart.xStart):t;return this._xAxisObj._zoom?e+Math.floor(this._xAxisObj._zoom.start):e}getXStep(){return d(this.xStep,this.chart.xStep)}getValue(t,e){const s=t.source;if(null==s)return NaN;s[this._getField(e)]}prepareRender(){this._calcedColor=void 0,this._xAxisObj=this.group?this.group._xAxisObj:this.chart._connectSeries(this,!0),this._yAxisObj=this.group?this.group._yAxisObj:this.chart._connectSeries(this,!1),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),super.prepareRender()}collectCategories(t){if(t instanceof Ne){let e=t.categoryField;return null!=e?this._points.getProps(e):this._points.getValues(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.getXStart()||0,i=this.getXStep()||1;o(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let a=t.getValue(r.x);isNaN(a)&&(a=s,s=t.incStep(s,i)),isNaN(a)?r.isNull=!0:(r.xValue=a,e&&e.push(a))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t.getValue(s.y);isNaN(i)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectVisibles(){const t=this._runPoints.filter((t=>t.visible)),e=t.length;if(e>0){let s=t[0].yValue,i=s;t[0].vindex=0;for(let r=1;r<e;r++){const e=t[r];e.vindex=r,e.yValue>i?i=e.yValue:e.yValue<s&&(s=e.yValue)}t.forEach(((t,e)=>{t.vindex=e,i=Math.max(t.yValue,i)})),this._pointArgs.yMin=this._minValue=s,this._pointArgs.yMax=this._maxValue=i}return t}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t)))}reference(t,e){}isVisible(t){return this._xAxisObj.contains(t.x)&&this._yAxisObj.contains(t.y)}getLegendSources(t){!1!==this.displayInLegend&&t.push(this)}getLabelPosition(t){return t}getLabelOff(t){return t}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))}_createPointArgs(){return{}}_preparePointArgs(t){t.series=this.name||this.index,t.count=this._points.count}_getPointCallbackArgs(t,e){e.assignTo(t)}getPointStyle(t){if(this.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointStyleCallback(this._pointArgs)}getPointTooltip(t,e){switch(e){case"series":return this.displayName();case"name":return this._xAxisObj instanceof Ne?this._xAxisObj.getCategory(t.index):t.x;case"x":return t.x||(this._xAxisObj instanceof Ne?this._xAxisObj.getCategory(t.index):"");case"y":return t.y;case"xValue":return t.xValue;case"yValue":return t.yValue;default:return e}}pointClicked(t){if(this.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this.onPointClick(this._pointArgs)}_createPoint(t){return new fe(t)}_createLegendMarker(t,e){return me.create(t,Be.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_getField(t){return t===this._xAxisObj?this.xField:this.yField}_colorByPoint(){return!1}_doLoad(t){super._doLoad(t);const e=this._loadData(t);h(e)&&e.length>0&&this._doLoadPoints(e)}_loadData(t){return t[this.dataProp||"data"]}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){let t,e;!1===this.pointColors?t=this.color:h(this.pointColors)?e=this.pointColors:this._colorByPoint()?e=this.chart.colors:t=this.color,this._runPoints.forEach(((s,i)=>{!s.color&&e&&(s.color=t||e[i%e.length])})),this._preparePointArgs(this._pointArgs)}prepareAfter(){this.trendline.visible&&this.trendline.prepareRender()}}Be.LEGEND_MARKER="rct-legend-item-marker";class Ie{constructor(t){this._map={},this._items=[],this._visibles=[],this._series=[],this._visibleSeries=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(){return!this._items.find((t=>!t.isEmpty()))}items(){return this._items.slice(0)}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}visibleSeries(){return this._visibleSeries.slice(0)}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}getSeries(t){return this._map[t]}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}load(t){const e=this.chart,s=this._items=[],i=this._series=[],r=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach(((t,e)=>{t.index=e,t instanceof We?i.push(...t.series):t instanceof Be&&i.push(t)})),this._widget=!0,i.forEach((t=>{!this._widget||t instanceof ze||(this._widget=!1),t.name&&(r[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}}))}updateData(t){}prepareRender(){const t=this._visibleSeries=[];let e=0;this._series.forEach((s=>{s.visible&&t.push(s),s.hasMarker()&&s.setShape(at[e++%at.length])}));const s=this._visibleSeries.filter((t=>t.clusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof He&&(t._single=1===s)})),this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let i=h(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getSeriesType(e.type||t.type),!i)throw new Error("Invalid series type: "+e.type+", "+t.type);const r=new i(t,e.name||`Series ${s+1}`);return r.load(e),r.index=s,r}}!function(t){t.DEFAULT="default",t.VISIBLE="visible",t.HIDDEN="hidden"}(Se||(Se={}));class $e extends Dt{constructor(t){super(t.chart),this.series=t,this.radius=3}}class Fe extends fe{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return d(this.x,this.y)}}class ze extends Be{constructor(){super(...arguments),this.boundsAnimation=!0,this.legendByPoint=!1}getCenter(t,e){return{x:M(this._centerXDim,t),y:M(this._centerYDim,e)}}getLabelPosition(){const t=this.pointLabel.position;return t===ve.AUTO?ve.INSIDE:t}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this.legendByPoint?!1!==this.displayInLegend&&this._runPoints.forEach((e=>{t.push(e)})):super.getLegendSources(t)}_doLoad(t){super._doLoad(t),this._centerXDim=C(_(this.centerX,this.center,ze.CENTER),!0),this._centerYDim=C(_(this.centerY,this.center,ze.CENTER),!0)}}ze.CENTER="50%";class Ge extends ze{constructor(){super(...arguments),this.radius=Ge.DEF_RADIUS,this.startAngle=0,this.totalAngle=360,this.clockwise=!0}getRadius(t,e){return M(this._radiusDim,Math.min(t,e))}_doLoad(t){super._doLoad(t),this._radiusDim=C(d(this.radius,Ge.DEF_RADIUS),!0)}}Ge.DEF_RADIUS="40%";class He extends Be{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0,this.pointWidth=1}get groupWidth(){return this.pointWidth}getPointWidth(t){const e=this.group;let s=t;return e?(s*=e._clusterWidth,s*=1-2*e.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,s}getPointPos(t){const e=this.group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.groupPadding,s-=s*e.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}getLabelPosition(t){return t===ve.AUTO?ve.OUTSIDE_FIRST:t}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this.pointPadding)?this._single?.25:this.group?.1:.2:this.pointPadding}}class je extends He{constructor(){super(...arguments),this.baseValue=0,this.nullAsBase=!1}_doPrepareRender(){super._doPrepareRender(),this._base=c(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this.baseValue}}class Ye extends He{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&e.push(s)}))}}!function(t){t.DEFAULT="default",t.OVERLAP="overlap",t.STACK="stack",t.FILL="fill"}(ke||(ke={}));class We extends Dt{constructor(){super(...arguments),this.layoutMax=100,this.index=-1,this._series=[],this._visibles=[],this.layout=ke.DEFAULT,this.displayInLegend=!0}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(){return this._series.length<1}canCategorized(){return!0}defaultYAxisType(){return"linear"}clusterable(){return!1}getBaseValue(t){return NaN}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.layout){case ke.STACK:this.$_collectStack(t,e);break;case ke.FILL:this.$_collectFill(t,e);break;case ke.DEFAULT:case ke.OVERLAP:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}pointValuesPrepared(t){this._series.forEach((e=>e.pointValuesPrepared(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}ignoreAxisBase(t){for(const e of this._visibles)if(e.ignoreAxisBase(t))return!0}getLegendSources(t){!1!==this.displayInLegend&&this._series.forEach((e=>e.getLegendSources(t)))}canMinPadding(t){return!0}canMaxPadding(t){return this.layout!==ke.FILL}getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e.getVisiblePoints()))),t}_doLoadProp(t,e){if("children"===t)return this.$_loadSeries(this.chart,e),!0}prepareRender(){this._visibles=this._series.filter((t=>t.visible)),super.prepareRender()}_doPrepareRender(t){const e=this._visibles.sort(((t,e)=>(t.zOrder||0)-(e.zOrder||0)));this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),e.length>0&&(e.forEach((t=>t.prepareRender())),this._doPrepareSeries(e))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,e){const s=this._seriesType();h(e)?e.forEach(((e,i)=>this.$_add(Be._loadSeries(t,e,s)))):a(e)&&this.$_add(Be._loadSeries(t,e,s))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t.group=this,t.index=this._series.length-1}$_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),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i),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.layoutMax||100,r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){let s=0;for(const e of t)s+=e.yValue||0;let r=0;for(const e of t)r=e.yGroup=(e.yValue||0)/s*i+r;e.push(i)}else for(const t of r.values()){let r=0;for(const e of t)r+=Math.abs(e.yValue)||0;let n=0,a=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?a=e.yGroup=(e.yValue||0)+a:n=e.yGroup=(e.yValue||0)+n;e.push(a,n)}}}class Ue extends We{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Xe extends We{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this.groupWidth=1,this.groupPadding=.1}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}!function(t){t.NORMAL="normal",t.MIXED="mixed",t.RANDOM="random"}(Ae||(Ae={}));class qe extends Dt{constructor(t){super(null),this.assets=new yt,t&&this.load(t)}activate(t){}deactivate(t){}_doLoadProp(t,e){if("assets"===t)return this.assets.load(e),!0}}class Ze{constructor(){this._items=[]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(e)}}$_loadItem(t){if(a(t)&&t.name)return new qe(t)}}class Ke extends Dt{constructor(){super(...arguments),this.text="Title",this.alignBase=j.PLOT,this.align=$.CENTER}isVisible(){return this.visible&&!L(this.text)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}!function(t){t.BOTTOM="bottom",t.RIGHT="right",t.LEFT="left",t.TOP="top"}(Le||(Le={}));class Qe extends Ke{constructor(){super(...arguments),this.position=Le.BOTTOM,this.verticalAlign=F.BOTTOM,this.text=""}}class Je extends ae{constructor(){super(...arguments),this.stepPixels=72,this.integral=!1}buildSteps(t,e,s,i,r=!1){let n;return this._step=NaN,n=r?this._getStepsByPixels(t,c(.85*this.stepPixels,60),e,s,i):Array.isArray(this.steps)?this.steps.slice(0):this._baseAxis instanceof ss?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s,i):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s,i):this.stepPixels>0?this._getStepsByPixels(t,this.stepPixels,e,s,i):s!==i?[s,i]:[s],n}getNextStep(t,e){return t+e*this._step}_findBaseAxis(){if(null!=this.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this.baseAxis);e!==t&&e instanceof ss&&(this._baseAxis=e,e.tick._baseAxis=null)}}_getStepsByCount(t,e,s,i){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),isNaN(e)&&this.integral;let r=(i-s)/(t-1);const n=Math.pow(10,Math.floor(Math.log10(r))),a=[];if(r=this._step=Math.ceil(r/n)*n,isNaN(e))s>Math.floor(s/n)*n?s=Math.floor(s/n)*n:s<Math.ceil(s/n)*n&&(s=Math.ceil(s/n)*n);else{for(R(s<e&&i>e,"base error"),t=Math.max(3,t);;){if(!(P((e-s)/r)+P((i-e)/r)+1>t))break;r+=n}s=e-P((e-s)/r)*r}a.push(s);for(let e=1;e<t;e++)a.push(S(a[e-1]+r));return a}_getStepsByInterval(t,e,s,i){const r=[];let n;if(isNaN(e))for(r.push(n=s);n<i;)r.push(n+=t);else{for(r.push(n=e);n>s;)r.unshift(n-=t);for(n=e;n<i;)r.push(n+=t)}return this._step=t,r}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i,r){i>=s?i=s:r<=s&&(r=s);const n=r-i,a=[];if(0===n)return isNaN(i)?[]:[i];let h=Math.floor(t/e)+1,o=n/(h-1);const l=Math.pow(10,Math.floor(Math.log10(o))),c=this._getStepMultiples(l);let u,d=0;if(o/=l,c)if(o>c[d]){for(;d<c.length-1;d++)if(o>c[d]&&o<c[d+1]){o=c[++d];break}}else o=c[d];if(o*=l,isNaN(s))i>Math.floor(i/o)*o?i=Math.floor(i/o)*o:i<Math.ceil(i/o)*o&&(i=Math.ceil(i/o)*o);else{for(R(i<=s&&r>=s,"base error"),h=Math.max(3,h);d<c.length;){if(!(P((s-i)/o)+P((r-s)/o)+1>h))break;o=d<c.length-1?c[d+1]*l:2*o,d++}i=s-P((s-i)/o)*o}for(this._step=o,a.push(S(u=i));u<r;)a.push(S(u+=o));return a}}class ts extends he{constructor(){super(...arguments),this.useSymbols=!0}getTick(t,e){return this._getText(null,e,this.useSymbols&&this.axis.tick._step>100)}}class es extends Qt{constructor(){super(...arguments),this.enabled=!0,this.size="30%",this.space=16}getSize(t){return M(this._sizeDim,t)}_doLoad(t){super._doLoad(t),this.space=c(this.space,0),this._sizeDim=C(this.size,!1)}}!function(t){t.DEFAULT="default",t.TICK="tick",t.VALUE="value"}(Ee||(Ee={}));class ss extends ce{constructor(){super(...arguments),this.nullable=!0,this.padding=.05,this.startFit=Ee.DEFAULT,this.endFit=Ee.DEFAULT,this.breaks=[]}getBaseValue(){return this.baseValue}hasBreak(){return null!=this._runBreaks}runBreaks(){return this._runBreaks&&this._runBreaks.slice(0,1)}getStartFit(){return this.startFit===Ee.DEFAULT?this._isX?Ee.VALUE:Ee.TICK:this.startFit}getEndFit(){return this.endFit===Ee.DEFAULT?this._isX?Ee.VALUE:Ee.TICK:this.endFit}isContinuous(){return!0}contains(t){return!isNaN(t)}isBased(){return!!this.tick._baseAxis}_createTickModel(){return new Je(this)}_createLabelModel(){return new ts(this)}_doLoadProp(t,e){return"break"===t?(this.$_loadBreaks(e),!0):super._doLoadProp(t,e)}_doPrepareRender(){this._hardMin=this.minValue,this._hardMax=this.maxValue,this._base=parseFloat(this.baseValue),this._unitLen=NaN,this.tick._findBaseAxis()}_doBuildTicks(t,e,s){if(isNaN(t)||isNaN(e))return[];const i=this.tick;let{min:r,max:n}=this._adjustMinMax(this._calcedMin=t,this._calcedMax=e),a=this._base;isNaN(a)&&r<0&&n>0&&(a=0);let h=i.buildSteps(s,a,r,n,!1);const o=[];if(isNaN(this.strictMin)&&this.getStartFit()!==Ee.VALUE){for(;h.length>2&&h[1]<=r;)h.shift();if(!isNaN(i._step))for(;h[0]>r;)h.unshift(i.getNextStep(h[0],-1));r=h[0]}else for(;h.length>1&&r>h[0];)h.shift();if(isNaN(this.strictMax)&&this.getEndFit()!==Ee.VALUE){for(;h.length>2&&h[h.length-2]>=n;)h.pop();if(!isNaN(i._step))for(;h[h.length-1]<n;)h.push(i.getNextStep(h[h.length-1],1));n=h[h.length-1]}else for(;n<h[h.length-1]&&h.length>1;)h.pop();this._setMinMax(r,n),this._runBreaks&&(h=this.$_getBrokenSteps(this._runBreaks,s,r,n));for(let t=0;t<h.length;t++){const e=this._createTick(s,t,h[t]);o.push(e)}return o}_getTickLabel(t,e){return this.label.getTick(t,e)||String(e)}_createTick(t,e,s){return{pos:NaN,value:s,label:this._getTickLabel(e,s)}}calcPoints(t,e){super.calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this.tick.buildSteps(t.len,void 0,t.from,t.to,!0)}$_getBrokenSteps(t,e,s,i){let r=0,n=s;const a=[n],h=this._sects=[];e-=t.reduce(((t,e)=>t+e.space),0),t.forEach((t=>{const s=t.getSize(e),i={from:n,to:t.from,pos:r,len:s};r+=s,h.push(i,t._sect={from:t.from,to:t.to,pos:r,len:t.space}),r+=t.space;this.$_buildBrokenSteps(i).forEach((t=>{t>i.from&&t<=i.to&&a.push(t)})),t.space>0&&a.push(t.to)}));const o=t[t.length-1];if(i>o.to){const t={from:o.to,to:i,pos:r,len:this._vlen-r};h.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&a.push(e)}))}return this._lastSect=h[h.length-1],a}getPosition(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.reversed?t-i-s.pos:i+s.pos}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return this.reversed?t-s:s}}getValueAt(t,e){return this._isHorz?this.reversed&&(e=t-e):this.reversed||(e=t-e),(this._max-this._min)*e/t+this._min}getUnitLength(t,e){return isNaN(this._unitLen)&&(this._unitLen=this.$_calcUnitLength(t)),this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_adjustMinMax(t,e){this._minBased=this._maxBased=!1,this._series.forEach((s=>{const i=s.getBaseValue(this);isNaN(i)||(isNaN(this._hardMin)&&i<=t?(t=i,this._minBased=!0):isNaN(this._hardMax)&&i>=e&&(e=i,this._maxBased=!0)),this._minBased||s.canMinPadding(this)||(this._minBased=!0),this._maxBased||s.canMaxPadding(this)||(this._maxBased=!0)}));let s=0,i=0;isNaN(this.strictMin)?this._hardMin<t?t=this._hardMin:this._minBased||(s=u(this.minPadding,this.padding,0)):t=this.strictMin,isNaN(this.strictMax)?(this._hardMax>e&&(e=this._hardMax),this._maxBased||(i=u(this.maxPadding,this.padding,0))):e=this.strictMax;let r=Math.max(0,e-t);return t-=r*(this._minPad=s),e+=r*(this._maxPad=i),{min:t,max:e}}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}$_calcUnitLength(t){const e=[];this._series.forEach((t=>{t.visible&&t.clusterable()&&e.push(...t.getVisiblePoints())}));const s=this._isX,i=e.map((t=>s?t.xValue:t.yValue)).sort();let r=i[1]-i[0];for(let t=2;t<i.length;t++)r=Math.min(i[t]-i[t-1]);return t*=r/(this._max-this._min),this._unitLen=c(t,1)}$_loadBreak(t){if(a(t)&&"from"in t&&"to"in t)return new es(this).load(t)}$_loadBreaks(t){if(h(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.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.to=e.to}const e=this.breaks.sort(((t,e)=>t.from-e.from)).filter((t=>t.to>t.from));if(this._runBreaks=null,e.length>0){const i=this._runBreaks=[];i.push(Object.assign(new es(this),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],a=e[r];s=n,a.from<s.to?t(n,a):i.push(Object.assign(new es(this),a))}}var s}}class is extends ss{type(){return"linear"}_adjustMinMax(t,e){const s=super._adjustMinMax(t,e),i=this._series;return 1===i.length&&i[0]instanceof We&&i[0].layout===ke.FILL&&(s.max=i[0].layoutMax),s}}class rs extends Je{_getStepMultiples(t){return t<=.1?[1/t]:[1,2,3,4,5,10]}}const ns=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],as=[".","/","-",":"],hs="Z".charCodeAt(0),os="z".charCodeAt(0),ls="A".charCodeAt(0),cs="a".charCodeAt(0),us="y".charCodeAt(0),ds="M".charCodeAt(0),_s="m".charCodeAt(0),gs="W".charCodeAt(0),ps="w".charCodeAt(0),ms="d".charCodeAt(0),bs="H".charCodeAt(0),xs="h".charCodeAt(0),fs="S".charCodeAt(0),ws="s".charCodeAt(0),ys=function(t){return t<10?"0"+t:String(t)},Vs=function(t){return t<10?"00"+t:t<100?"0":String(t)};class vs{static getFormatter(t){let e=vs.Formatters[t];return e||(vs.Formatters[t]=e=new vs(t)),e}static get Default(){return vs.getFormatter(b.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||b.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 a=s[r],h=a.length;switch(a.charCodeAt(0)){case us:i+=h>2?t.getFullYear():ys(t.getFullYear()%100);break;case ds:i+=h>1?ys(t.getMonth()+1):t.getMonth()+1;break;case ms:i+=h>1?ys(t.getDate()):t.getDate();break;case gs:i+=h>1?ys(et.weekOfYear(t,e)):et.weekOfMonth(t,e,!0);break;case ps:i+=h>1?et.long_week_days[t.getDay()]:et.week_days[t.getDay()];break;case bs:i+=h>1?ys(t.getHours()):t.getHours();break;case xs:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=h>1?ys(e):e}else i+=h>1?ys(t.getHours()):t.getHours();break;case _s:i+=h>1?ys(t.getMinutes()):t.getMinutes();break;case ws:i+=h>1?ys(t.getSeconds()):t.getSeconds();break;case cs:case ls:t.getHours()<12?i+=b.am:i+=b.pm;break;case fs:let s=t.getMilliseconds();i+=3==h?Vs(s):2==h?ys(s):s.toString().substr(0,h);break;default:i+=a}}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(as.indexOf(n)>=0)e.push(n),r++;else{let a=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(a,r),ns.indexOf(n)<0){let e=n.charCodeAt(0);(e>=ls&&e<=hs||e>=cs&&e<=os)&&I(b.invalidDateFormat,t)}e.push(n)}if(r<i&&et.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&et.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||b.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}vs.Formatters={};const Ps=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Ss=[[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]];class ks extends Je{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}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Ps[e]&&t<Ps[e+1]/2)return this.scale=e,Ss[e];this.scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],a=r-i;if(0===a)return n;const h=this.axis,o=new Date(h._calcedMin);let l=Math.floor(t/this.stepPixels)+1,c=Math.max(1,Math.floor(a/(l-1)));const u=this._getStepMultiples(c),d=Ps[this.scale];if(c/=d,u)if(c>u[0]){let t=0;for(;t<u.length-1;t++)if(c>u[t]&&c<u[t+1]){c=u[t+1];break}}else c=u[0];const _=h.date(i),g=h.date(r);let p,m=_;if(7===this.scale){const t=o.getFullYear();let e=m.getFullYear();this._step=c=Math.ceil(c),m=new Date(e,0),e<t&&e+c>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=c,m=new Date(e,0)}while(m<=g)}else if(6===this.scale){let t=m.getFullYear(),e=m.getMonth();this._step=c=Math.ceil(c),m=new Date(t,e),m<o&&new Date(t,e+c)>o&&(m=new Date(o.getFullYear(),o.getMonth()));do{n.push(+m),e+=c,m=new Date(t,e)}while(m<=g)}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=c=Math.ceil(c),m=new Date(t,e,s),m<o&&new Date(t,e,s+i*c)>o&&(m=new Date(o.getFullYear(),o.getMonth(),o.getDate()));do{n.push(+m),s+=c*i,m=new Date(t,e,s)}while(m<=g)}else{switch(this._step=c,c*=d,this.scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}p=m.getTime();const t=o.getTime();p<t&&p+c>t&&(p=t);do{n.push(p),p+=c}while(p<=r)}return n}}const As=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd"},{format:"MM-dd",beginningFormat:"YYYY-MM"},{format:"W주 w",beginningFormat:"YYYY-MM"},{format:"YYYY-MM",beginningFormat:"YYYY-MM"},{format:"YYYY"}];class Ls extends he{constructor(){super(...arguments),this.useBeginningFormat=!0,this.startOfWeek=0}_doLoad(t){super._doLoad(t);const e=o(this.timeFormat)?this.timeFormat:void 0,s=o(this.beginningFormat)?this.beginningFormat:void 0,i=this.timeFormats,r=this.useBeginningFormat;if(this._formats=As.map((t=>Object.assign(t))),h(i))for(let t=0;t<i.length;t++){const n=this._formats[t];if(e)n.format=e,n.beginningFormat=s||e;else{const e=i[t];o(e)?(n.format=e,r||(n.beginningFormat=e)):a(e)&&(o(e.format)&&(n.format=e.format),o(e.beginningFormat)?n.beginningFormat=e.beginningFormat:r||(n.beginningFormat=n.format))}}}getTick(t,e){const s=this.axis,i=this._formats,r=s.tick.scale,n=s.date(e);switch(r){case 7:return vs.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 6:return 0===t||0===n.getMonth()?vs.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):vs.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 5:case 4:return 0===t||1===n.getDate()?vs.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):vs.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 3:return 0===t||0===n.getHours()?vs.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):vs.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 2:return 0===t||0===n.getMinutes()?vs.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):vs.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 1:return 0===t||0===n.getSeconds()?vs.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):vs.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 0:return 0===t||0===n.getMilliseconds()?vs.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):vs.getFormatter(i[r].format).toStr(n,this.startOfWeek)}}}class Es extends ss{constructor(t,e,s){super(t,e,s),this.timeOffset=0,this.baseValue=NaN}type(){return"time"}_createTickModel(){return new ks(this)}_createLabelModel(){return new Ls(this)}_doLoad(t){super._doLoad(t),t&&t.label||this.label.load(null)}collectValues(){this._offset=60*c(this.timeOffset,0)*60*1e3,super.collectValues()}_adjustMinMax(t,e){return super._adjustMinMax(t,e)}parseValue(t){return l(t)?t+this._offset:t instanceof Date?t.getTime():o(t)?new Date(t).getTime():0}getValue(t){return+t}incStep(t,e){if(!o(e))return t+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"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}}}date(t){return new Date(t)}}class Cs extends _e{constructor(t){super(t),this.index=-1,this.size="100%"}get left(){return this._left}set left(t){t!==this._left&&(this._leftDim=C(this._left=t,!0))}get right(){return this._right}set right(t){t!==this._right&&(this._rightDim=C(this._right=t,!0))}get top(){return this._top}set top(t){t!==this._top&&(this._topDim=C(this._top=t,!0))}get bottom(){return this._bottom}set bottom(t){t!==this._bottom&&(this._bottomDim=C(this._bottom=t,!0))}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=C(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=C(this._height=t,!0))}get size(){return this._size}set size(t){t!==this._size&&(this._sizeDim=C(this._size=t,!0))}getSize(t,e){return{width:M(this._widthDim||this._sizeDim,t,t),height:M(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return M(this._leftDim,t)}getRight(t){return M(this._rightDim,t)}getTop(t){return M(this._topDim,t)}getBottom(t){return M(this._bottomDim,t)}}class Ts extends Cs{constructor(){super(...arguments),this.gindex=-1,this.duration=500}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t,e.name);return r.load(e),r}setGroup(t,e){this.group=t,this.gindex=e}}class Ms extends Cs{constructor(){super(...arguments),this._gauges=[],this._visibles=[],this.minValue=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.minValue,max:this.maxValue}}_doLoadProp(t,e){if("children"===t)return this.$_loadGauges(this.chart,e),!0}prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super.prepareRender(),this._prepareChildren(this._visibles)}_prepareChildren(t){t.forEach(((t,e)=>{this._setGroup(t,e),t.prepareRender()}))}$_loadGauges(t,e){const s=this._gaugesType();h(e)?e.forEach(((e,i)=>this.$_add(Ts._loadGauge(t,e,s)))):a(e)&&this.$_add(Ts._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)}}class Ns{constructor(t){this._map={},this._items=[],this._visibles=[],this._gauges=[],this.chart=t}get count(){return this._items.length}get firstGauge(){return this._gauges[0]}visibles(){return this._visibles}getGauge(t){const e=this._map[t];if(e instanceof Ts)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],i=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(i[t.name]=t),t instanceof Ms)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(i[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,s){let i=h(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getGaugeType(e.type||t.gaugeType),!i)throw new Error("Invalid gauge type: "+e.type);const r=new i(t,e.name||`Gauge ${s+1}`);return r.load(e),r.index=s,r}}class Os extends Ts{constructor(){super(...arguments),this.minValue=0,this.value=0,this.animatable=!0}updateValue(t,e){t!==this.value&&(this.value=t,this._changed())}getLabel(t,e){return this._runValue=e,t.text||(t.prefix||"")+"${value}"+(t.suffix||"")}getParam(t){switch(t){case"value":return this._runValue;case"min":return this.minValue;case"max":return this.maxValue}}calcedMinMax(){return{min:this.minValue,max:this.maxValue}}}class Ds extends Dt{constructor(t){super(t.chart),this.scale=t,this.reversed=!1,this.length=7}}class Rs extends Dt{constructor(t,e=!0){super(t.chart,e),this.gauge=t,this._gap=8,this.position=Bs.DEFAULT,this.stepPixels=48,this.line=new Dt(t.chart,!0),this.tick=new Ds(this),this.tickLabel=new Dt(t.chart)}get gap(){return this._gap}set gap(t){this._gap=c(t,0)}range(){return{min:this._min,max:this._max}}buildSteps(t,e,s=NaN){s=c(s,e);const{min:i,max:r}=this._adjustMinMax(Math.min(e,s),Math.max(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)}_adjustMinMax(t,e){const s=this.gauge;return isNaN(s.minValue)||(t=s.minValue),isNaN(s.maxValue)||(e=s.maxValue),this._min=Math.min(t,e),this._max=Math.max(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.minValue,i=e.maxValue;return isNaN(s)&&(s=Math.min(...t)),isNaN(i)&&(i=Math.max(...t)),this._min=Math.min(s,i),this._max=Math.max(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){let i;return i=Array.isArray(this.steps)?this.steps.slice(0):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s):this.stepPixels>0?this._getStepsByPixels(t,this.stepPixels,e,s):[e,s],this._min=i[0],this._max=i[i.length-1],i}_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,e>Math.floor(e/r)*r?e=Math.floor(e/r)*r:e<Math.ceil(e/r)*r&&(e=Math.ceil(e/r)*r),n.push(e);for(let e=1;e<t;e++)n.push(S(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 a=n/(Math.floor(t/e)+1-1);const h=Math.pow(10,Math.floor(Math.log10(a))),o=this._getStepMultiples(h);let l,c=0;if(a/=h,o)if(a>o[c]){for(;c<o.length-1;c++)if(a>o[c]&&a<o[c+1]){a=o[++c];break}}else a=o[c];for(a*=h,s>Math.floor(s/a)*a?s=Math.floor(s/a)*a:s<Math.ceil(s/a)*a&&(s=Math.ceil(s/a)*a),this._step=a,r.push(S(l=s));l<i;)r.push(S(l+=a));return r}}var Bs,Is,$s,Fs;!function(t){t.DEFAULT="default",t.OPPOSITE="opposite",t.INSIDE="inside"}(Bs||(Bs={}));class zs extends Dt{}class Gs extends Dt{constructor(t,e=!1){super(t.chart,e),this.gauge=t,this.position=Bs.DEFAULT,this.gap=5,this.itemGap=0,this.rangeLabel=new zs(t.chart,!1),this.tickLabel=new Dt(t.chart,!0)}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickDim=C(this._thickness=t,!0))}get ranges(){return this.$_internalRanges().slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}getThickness(t){return this._thickDim?M(this._thickDim,t,0):this.position===Bs.INSIDE?t:Gs.DEF_THICKNESS}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=Y(this._ranges,t.min,t.max)||[]}return this._runRanges}}Gs.DEF_THICKNESS=7;class Hs extends Xt{constructor(t){super(t,!0),this.animatable=!0}}class js extends Rs{}class Ys extends Hs{constructor(){super(...arguments),this.offsetX=0,this.offsetY=0}getOffset(t,e){return{x:M(this._offsetXDim,t,0),y:M(this._offsetYDim,e,0)}}load(t){return super.load(t),this._offsetXDim=C(this.offsetX,!0),this._offsetYDim=C(this.offsetY,!0),this}}class Ws{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Us.DEF_CENTER),this.setCenterY(Us.DEF_CENTER),this.setRadius(Us.DEF_RADIUS),this.setInnerRadius(Us.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=C(d(t,Us.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=C(d(t,Us.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(d(t,Us.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=C(d(t,Us.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=C(t,!0))}getCenter(t,e){return{x:M(this._centerXDim,t,t/2),y:M(this._centerYDim,e,e/2)}}getExtents(t){const e=M(this._radiusDim,t,t/2),s=Math.min(e,this._innerDim?M(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?M(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=c(t%360,0),i=Math.max(0,Math.min(360,c(e,360)));this._startRad=y+V*s,this._handRad=V*s,this._sweepRad=V*i}}class Us extends Os{constructor(t){super(t),this.props=new Ws,this.maxValue=100,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.label=new Ys(t)}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}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}setGroup(t,e){super.setGroup(t,e),t&&!this.childProps&&(this.childProps=new Ws)}_doPrepareRender(t){super._doPrepareRender(t);const e=this.group;e?this.childProps.prepareAngles(e.startAngle,e.sweepAngle):this.props.prepareAngles(this.startAngle,this.sweepAngle)}}Us.DEF_CENTER="50%",Us.DEF_RADIUS="40%",Us.DEF_INNER="80%";class Xs extends Ms{constructor(){super(...arguments),this.props=new Ws,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.itemGap=4,this.labelGap=10}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}getCenter(t,e){return this.props.getCenter(t,e)}getExtents(t){return this.props.getExtents(t)}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this.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}))}}}class qs extends Dt{constructor(t){super(t.chart,!0),this.gauge=t}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}isRanged(){const t=this.$_internalRanges();return t&&t.length>0}rangeCount(){const t=this.$_internalRanges();return t?t.length:0}getRange(t){const e=this.$_internalRanges();if(e)for(const s of e)if(t>=s.fromValue&&t<s.toValue)return s}$_internalRanges(){return this._runRanges||(this._runRanges=Y(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class Zs extends qs{constructor(t){super(t),this.segmentGap=0}get segmentThickness(){return this._segmentThickness}set segmentThickness(t){t!==this._segmentThickness&&(this._segmentThickness=t,this._thickDim=C(this.segmentThickness,!0))}getSegmentThickness(t){return M(this._thickDim,t,t)}}class Ks extends qs{constructor(t){super(t),this.stroked=!1,this.thickness="100%"}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=C(this.thickness,!0))}getThickness(t){return M(this._thickDim,t,t)}}class Qs extends Dt{constructor(t){super(t.chart,!1)}}class Js extends Dt{constructor(t){super(t.chart,!1),this.radius=3,this.length="100%",this.offset=0}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(t,!0))}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=C(t,!0))}get offset(){return this._offset}set offset(t){t!==this._offset&&(this._offset=t,this._offsetDim=C(t,!0))}getExtents(t){return{radius:M(this._radiusDim,t,0),length:M(this._lengthDim,t,0),offset:M(this._offsetDim,t,0)}}}class ti extends Dt{constructor(t){super(t.chart,!1),this.radius=5}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(t,!0))}getRadius(t){return M(this._radiusDim,t,0)}}class ei extends Rs{constructor(){super(...arguments),this.stepPixels=92}_getStepMultiples(t){return[1,3,6,12]}}class si extends Xs{constructor(t){super(t),this.innerRadius="50%"}_type(){return"circlegroup"}_gaugesType(){return"circle"}}class ii extends Dt{constructor(t){super(t.chart),this.thickness=7}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=C(this.thickness,!0))}getThickness(t){return M(this._thickDim,t,t)}}class ri extends Dt{constructor(t,e,s){super(t.chart),this.thickness=e,this.length=s}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=C(t,!0))}getLength(t){return M(this._lengthDim,t,t)}}class ni extends ri{constructor(){super(...arguments),this.animatable=!1,this.duration=200}}class ai extends Dt{constructor(t,e){super(t.chart),this.length=e}}class hi extends Dt{constructor(t){super(t.chart),this.step=1,this.offset=1}}class oi extends Dt{constructor(t,e){super(t.chart),this.raidus=e}}class li extends Xt{constructor(t){super(t.chart,!0),this.position="top",this.text="RealChart Clock<br>ver1.0"}}class ci extends fe{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class ui extends fe{}class di extends je{constructor(){super(...arguments),this.borderRaidus=0,this.colorByPoint=!1}_type(){return"bar"}canCategorized(){return!0}_colorByPoint(){return this.colorByPoint}_createPoint(t){return new ui(t)}_getGroupBase(){return this.group?this.group.baseValue:this.baseValue}}class _i extends Xe{constructor(){super(...arguments),this.baseValue=0}_type(){return"bargroup"}_seriesType(){return"bar"}_canContain(t){return t instanceof di}getBaseValue(t){return t._isX?NaN:c(this.baseValue,t.getBaseValue())}_doPrepareSeries(t){if(this.layout===ke.DEFAULT){const e=t.length>1?t.map((t=>t.pointWidth)).reduce(((t,e)=>t+e),0):t[0].pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.pointWidth/e,t._childPos=s,s+=t._childWidth}))}else this.layout,ke.STACK}}class gi extends gt{constructor(t,e=x,s=x){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){et.isNumber(t)?this.setPath(ot.line(t,e,s,i)):t&&this.setPath(ot.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(ot.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(ot.line(t,e,t,s))}setHLine(t,e,s){this.setPath(ot.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(ot.line(e,t,s,t))}}class pi extends ct{constructor(t,e){super(t,Be.LEGEND_MARKER),this._size=e,this.add(this._line=new gi(t)),this._line.setHLine(e/2,0,2*e),this.add(this._marker=new gt(t)),this._marker.translate(e/2,0),this.setShape(nt.CIRCLE,12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,ot.setShape(this._marker,t,(this._size=e)/2),this._marker.translate(e/2,0),this._line.setHLine(e/2,0,2*e))}}class mi extends fe{}class bi extends $e{constructor(){super(...arguments),this.radius=4,this.firstVisible=Se.DEFAULT,this.lastVisible=Se.DEFAULT,this.minVisible=Se.DEFAULT,this.maxVisible=Se.DEFAULT}}class xi extends Be{constructor(){super(...arguments),this.marker=new bi(this),this.nullAsBase=!1}getShape(t){return t&&t.shape||this.marker.shape||this._shape}getRadius(t){return c(t.radius,this.marker.radius)}_createPoint(t){return new mi(t)}hasMarker(){return!0}setShape(t){this._shape=t}}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Is||(Is={}));class fi extends xi{constructor(){super(...arguments),this.lineType=Wt.DEFAULT,this.stepDir=Is.FORWARD,this.connectNullPoints=!1,this.baseValue=0}_type(){return"line"}getLineType(){return this.lineType}_createLegendMarker(t,e){return new pi(t,e)}legendMarker(t){const e=super.legendMarker(t);return e.setShape(this.getShape(null),Math.min(ge.MARKER_SIZE,2*this.marker.radius)),e}}class wi extends mi{}class yi extends fi{_type(){return"area"}_createPoint(t){return new wi(t)}_doPrepareRender(){super._doPrepareRender(),this._base=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t._isX?NaN:this._base}}class Vi extends wi{parse(t){super.parse(t),this.y=this.high=d(this.high,this.low),this.lowValue=parseFloat(this.low),this.highValue=this.yValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.highValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.high=e[c(t.highField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.high=d(e[t.lowField],e.high)}_readSingle(t){super._readSingle(t),this.low=this.y}}class vi extends We{constructor(){super(...arguments),this.baseValue=0}_type(){return"linegroup"}_seriesType(){return"line"}_canContain(t){return t instanceof fi}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class Pi extends We{constructor(){super(...arguments),this.baseValue=0}_type(){return"areagroup"}_seriesType(){return"area"}_canContain(t){return t instanceof yi}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class Si extends wi{}class ki extends fe{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.minValue}_assignTo(t){return Object.assign(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue})}_readArray(t,e){const s=e.length>5?1:0;this.min=e[c(t.minField,0+s)],this.low=e[c(t.lowField,1+s)],this.mid=e[c(t.midField,2+s)],this.high=e[c(t.highField,3+s)],this.y=e[c(t.yField,4+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.min=d(e[t.minField],e.min),this.low=d(e[t.lowField],e.low),this.mid=d(e[t.midField],e.mid),this.high=d(e[t.highField],e.high),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue)||isNaN(this.highValue))}}class Ai extends fe{getLabel(t){return this.z}parse(t){super.parse(t),this.zValue=parseFloat(this.z)}_assignTo(t){return Object.assign(super._assignTo(t),{z:this.z,zValue:this.zValue})}_readArray(t,e){if(null===e)this.isNull=!0;else{const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.z=e[c(t.zProp,1+s)],s>0&&(this.x=e[c(t.xField,0)])}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=d(e[t.zProp],e.z))}_readSingle(t){super._readSingle(t),this.z=this.y}}!function(t){t.WIDTH="width",t.AREA="area"}($s||($s={}));class Li extends fe{parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high})}_readArray(t,e){const s=e.length>4?1:0;this.low=e[c(t.lowField,0+s)],this.open=e[c(t.openField,1+s)],this.close=e[c(t.closeField,2+s)],this.y=this.high=e[c(t.highField,3+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.row),this.open=d(e[t.openField],e.open),this.close=d(e[t.closeField],e.close),this.high=d(e[t.highField],e.high),isNaN(this.high)?isNaN(this.y)||(this.high=this.y):this.y=this.high}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.high=this.y}}class Ei extends Ye{_type(){return"candlestick"}canCategorized(){return!0}_createPoint(t){return new Li(t)}_getBottomValue(t){return t.lowValue}}class Ci extends $e{constructor(){super(...arguments),this.radius=4,this.shape=nt.CIRCLE}}class Ti extends fe{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.lowValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class Mi extends fe{}class Ni extends fe{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.isNull||(this.isNull=isNaN(this.lowValue))}}class Oi extends Fe{}class Di extends ze{constructor(t,e){super(t,e),this.width=Di.DEF_WIDTH,this.height=Di.DEF_HEIGHT,this.neckWidth=Di.DEF_NECK_WIDTH,this.neckHeight=Di.DEF_NECK_HEIGHT,this.reversed=!1,this.legendByPoint=!1}getSize(t,e){return{width:Math.max(.1*t,M(this._widthDim,t)),height:Math.max(.1*e,M(this._heightDim,e))}}getNeckSize(t,e){return{width:et.clamp(M(this._neckWidthDim,t),.1*t,t),height:et.clamp(M(this._neckHeightDim,e),.1*e,e)}}_type(){return"funnel"}_createPoint(t){return new Oi(t)}load(t){return super.load(t),this._widthDim=T(this.width,Di.DEF_WIDTH),this._heightDim=T(this.height,Di.DEF_HEIGHT),this._neckWidthDim=T(this.neckWidth,Di.DEF_NECK_WIDTH),this._neckHeightDim=T(this.neckHeight,Di.DEF_NECK_HEIGHT),this}}Di.DEF_WIDTH="85%",Di.DEF_HEIGHT="90%",Di.DEF_NECK_WIDTH="30%",Di.DEF_NECK_HEIGHT="30%";class Ri extends fe{parse(t){super.parse(t),this.heatValue=parseFloat(this.heat),this.isNull||(this.isNull=isNaN(this.heatValue))}_assignTo(t){return Object.assign(super._assignTo(t),{heat:this.heat,heatValue:this.heatValue})}_readArray(t,e){const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.heat=e[c(t.heatField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.heat=d(e[t.heatField],e.color)}_readSingle(t){super._readSingle(t)}getLabel(t){return this.heat}}class Bi extends fe{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return Object.assign(super._assignTo(t),{min:this.min,max:this.max})}}!function(t){t.SQURE_ROOT="squreRoot",t.STURGES="struges",t.RICE="rice"}(Fs||(Fs={}));const Ii={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 $i extends $e{constructor(){super(...arguments),this.radius=4,this.shape=nt.CIRCLE}}class Fi extends fe{}class zi extends Li{}class Gi extends fe{}class Hi extends Fe{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get endAngle(){return this.startAngle+this.angle}parse(t){super.parse(t),this.sliced=this.source.sliced}_assignTo(t){return Object.assign(super._assignTo(t),{sliced:this.sliced})}}class ji extends Xt{constructor(){super(null,!0)}}class Yi extends Ge{constructor(){super(...arguments),this.groupSize=1,this.labelDistance=25,this.sliceOffset="7%",this.autoSlice=!0,this.sliceDuration=300,this.borderRadius=0,this.innerText=new ji}hasInner(){return this._innerDim&&this._innerDim.size>0}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return this._sliceDim?M(this._sliceDim,t):0}_type(){return"pie"}_createPoint(t){return new Hi(t)}_doLoad(t){super._doLoad(t),this._innerDim=C(this.innerRadius,!0),this._sliceDim=C(this.sliceOffset,!0)}_doPrepareRender(){super._doPrepareRender();let t=c(this.startAngle%360,0),e=Math.max(0,Math.min(360,c(this.totalAngle,360)));this._startRad=y+V*t,this._totalRad=V*e,this._groupPos=NaN}}class Wi extends We{constructor(){super(...arguments),this.polarSize="80%",this.innerSize=0}getPolarSize(t,e){return M(this._polarDim,Math.min(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}_type(){return"piegroup"}_seriesType(){return"pie"}needAxes(){return!1}_canContain(t){return t instanceof Yi}_doLoad(t){super._doLoad(t),this._polarDim=C(this.polarSize,!0)||{size:80,fixed:!1},this._innerDim=C(this.innerSize,!0)}_doPrepareSeries(t){if(this.layout===ke.STACK||this.layout===ke.FILL){const e=t.map((t=>t.groupSize)).reduce(((t,e)=>t+c(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=c(t.groupSize,1)/e}))}}}class Ui extends fe{}class Xi extends fe{_assignTo(t){return Object.assign(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){super._readArray(t,e),this.id=k(e[parseInt(t.idField)]),this.group=k(e[parseInt(t.groupField)])}_readObject(t,e){super._readObject(t,e),this.id=k(e[t.idField]),this.group=k(e[t.groupField])}}class qi{constructor(t){this.point=t}getArea(){return{x:this.x,y:this.y,width:this.width,height:this.height}}setArea(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}getTotal(){return this.children.reduce(((t,e)=>t+e.value),0)}}var Zi,Ki,Qi,Ji;!function(t){t.SQUARIFY="squarify",t.STRIP="strip",t.SLICE="slice",t.SLICE_DICE="sliceDice"}(Zi||(Zi={}));class tr extends fe{_assignTo(t){return Object.assign(super._assignTo(t),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})}_readArray(t,e){const s=e.length>3?1:0;this.y=e[c(t.yField,0+s)],this.length=e[c(t.lengthField,1+s)],this.angle=e[c(t.angleField,2+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.length=d(e[t.lengthField],e.length),this.angle=d(e[t.angleField],e.angle),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.length=this.angle=this.y}parse(t){super.parse(t),this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))}}!function(t){t.CENTER="center",t.START="start",t.END="end"}(Ki||(Ki={})),function(t){t.NONE="none",t.CLOSE="close",t.OPEN="open"}(Qi||(Qi={}));class er extends fe{constructor(){super(...arguments),this.low=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._intermediate=this.source.intermediate,this._isSum&&(this.y=0),this.save=this.y}}class sr extends Hs{constructor(t){super(t),this.maxWidth="30%",this.maxHeight="30%",this.gap="5%"}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=C(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=C(t,!0))}get maxWidth(){return this._maxWidth}set maxWidth(t){t!==this._maxWidth&&(this._maxWidth=t,this._maxWidthDim=C(t,!0))}get maxHeight(){return this._maxHeight}set maxHeight(t){t!==this._maxHeight&&(this._maxHeight=t,this._maxHeightDim=C(t,!0))}get gap(){return this._gap}set gap(t){t!==this._gap&&(this._gap=t,this._gapDim=C(t,!0))}getWidth(t){return M(this._widthDim,t)}getHeight(t){return M(this._heightDim,t)}getMaxWidth(t){return M(this._maxWidthDim,t)}getMaxHeight(t){return M(this._maxHeightDim,t)}getGap(t){return M(this._gapDim,t,0)}}class ir extends Os{constructor(t){super(t),this.reversed=!1,this.scale=new js(this),this.label=new sr(this.chart)}isVertical(){return this.group?!this.group.vertical:this.vertical}scaleVisible(){return!this.group&&this.scale.visible}calcedMinMax(){return this.scale.range()}}!function(t){t.BAR="bar",t.needle="needle"}(Ji||(Ji={}));class rr extends Dt{constructor(t){super(t.chart,!0),this.gauge=t}}class nr extends ir{constructor(t){super(t),this.marker=new rr(this),this.band=new Gs(this)}_type(){return"linear"}}class ar extends Dt{constructor(){super(...arguments),this.opposite=!1,this.gap=10}}class hr extends Ms{constructor(t){super(t),this.vertical=!0,this.itemLabel=new ar(this.chart),this.scale=new js(this),this.itemGap=10,this.label=new sr(t),this.label.gap=10}calcedMinMax(){return this.scale.range()}}class or extends hr{constructor(){super(...arguments),this.band=new Gs(this,!1)}_type(){return"lineargroup"}_gaugesType(){return"linear"}}class lr extends Dt{constructor(t){super(t.chart),this.gauge=t,this.vertical=!1}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=C(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=C(t,!0))}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}$_internalRanges(){return this._runRanges||(this._runRanges=Y(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class cr extends Dt{constructor(t){super(t.chart)}}class ur extends Dt{constructor(t){super(t.chart)}}class dr extends hr{getRanges(t,e){return Y(this.ranges,t,e)}_type(){return"bulletgroup"}_gaugesType(){return"bullet"}}class _r extends Dt{}class gr extends Dt{constructor(t){super(t,!1),this._series=[],this.handle=new _r(this.chart)}prepareRender(){}}class pr extends Dt{constructor(){super(...arguments),this._cols=1,this._rows=1,this._panes=[]}get rows(){return this._rows}get cols(){return this._cols}count(){return this._rows*this._cols}getPane(t,e){return this._panes[t][e]}_doLoadProp(t,e){if(["panes","cols","rows"].indexOf(t)>=0)return!0}load(t){if(a(t)){const e=t.rows,s=t.cols,i=t.panes;super.load(t),this._panes=this.$_buildPanes(e,s),this.$_loadPanes(this._panes,i)}return this}_doPrepareRender(t){}$_parseSizes(t){if(h(t)&&t.length>1){const e=[];let s=0;for(let i=0;i<t.length;i++){const r=+t[i]||1;e.push(r),s+=r}for(let i=0;i<t.length;i++)e[i]=e[i]/s;return e}if(t>0){const e=[];for(let s=0;s<t;s++)e.push(1/t);return e}return[1]}$_buildPanes(t,e){const s=this.$_parseSizes(t),i=this.$_parseSizes(e),r=[];for(let t=0;t<s.length;t++){r.push([]);for(let e=0;e<i.length;e++)r[t].push(new br(this.chart,t,e,i[e],s[t]))}return this._cols=i.length,this._rows=s.length,r}$_loadPanes(t,e){e=h(e)?e:a(e)?[e]:null,h(e)&&e.forEach((e=>{const s=+e.row||0,i=+e.col||0;i>=0&&i<this._cols&&s>=0&&s<this._rows&&t[s][i].load(e)}))}}class mr extends Dt{constructor(t){super(t.chart),this.pane=t,this.align=$.CENTER}isVisible(){return this.visible&&!L(this.text)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}class br extends Dt{constructor(t,e,s,i,r){super(t),this.row=e,this.col=s,this.width=i,this.height=r,this.title=new mr(this)}}const xr={bar:_i,line:vi,area:Pi,pie:Wi,bargroup:_i,linegroup:vi,areagroup:Pi,piegroup:Wi,bump:class extends Ue{_type(){return"bump"}_seriesType(){return"line"}_canContain(t){return t instanceof fi}_doConstraintYValues(t){const e={};t.forEach((t=>{t._runPoints.forEach((t=>{const s=t.xValue;let i=e[s];i?i.push(t):e[s]=[t]}))}));for(const t in e){const s=e[t].sort(((t,e)=>t.yValue-e.yValue));for(let t=s.length-1;t>=0;t--)s[t].yValue=s[t].yGroup=t}return et.makeIntArray(0,t.length)}}},fr={area:yi,arearange:class extends xi{constructor(){super(...arguments),this.curved=!1}_type(){return"arearange"}_createPoint(t){return new Vi(t)}getLineType(){return this.curved?Wt.SPLINE:Wt.DEFAULT}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}},bar:di,barrange:class extends Ye{_type(){return"barrange"}pointLabelCount(){return 2}_createPoint(t){return new ci(t)}_getBottomValue(t){return t.lowValue}},bellcurve:class extends yi{constructor(){super(...arguments),this.sigmas=3,this.pointsInSigma=5,this.curved=!1}_type(){return"bellcurve"}getLineType(){return this.curved?Wt.SPLINE:Wt.DEFAULT}_createPoint(t){return new Si(t)}_loadData(t){const e=super._loadData(t);if(h(e))return this.$_loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.name===this.source||t.index===this.source))return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=t._runPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this.$_loadTable(e);this._doLoadPoints(s),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}$_loadTable(t){const e=t.length;if(e<1)return;const s=t.reduce(((t,e)=>t+e),0)/e,i=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-s,2)))/(e-1)),r=i/this.pointsInSigma,n=s-this.sigmas*i,a=s+this.sigmas*i;let h=s;const o=[];for(o.push(this.$_getDenstiy(s,i,h));h>n;)h-=r,o.unshift(this.$_getDenstiy(s,i,h));for(h=s;h<a;)h+=r,o.push(this.$_getDenstiy(s,i,h));return o}$_getDenstiy(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}}},boxplot:class extends Ye{_type(){return"boxplot"}pointLabelCount(){return 2}_createPoint(t){return new ki(t)}_getBottomValue(t){return t.minValue}},bubble:class extends Be{constructor(t,e){super(t,e),this.sizeMode=$s.AREA,this.minSize=8,this.maxSize="20%",this.colorByPoint=!1,this.radius=3}getPixelMinMax(t){return{min:M(this._minDim,t),max:M(this._maxDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return this.sizeMode==$s.AREA&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_type(){return"bubble"}ignoreAxisBase(t){return!0}_createPoint(t){return new Ai(t)}_colorByPoint(){return this.colorByPoint}load(t){return super.load(t),this._minDim=C(this.minSize,!0),this._maxDim=C(this.maxSize,!0),this}_doPrepareRender(){super._doPrepareRender(),this._zMin=Number.MAX_VALUE,this._zMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{t.isNull||isNaN(t.zValue)||(this._zMin=Math.min(this._zMin,t.zValue),this._zMax=Math.max(this._zMax,t.zValue))})),this._noSize=this._zMin===this._zMax}},candlestick:Ei,dumbbell:class extends He{constructor(){super(...arguments),this.marker=new Ci(this)}_type(){return"dumbbell"}canCategorized(){return!0}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+Math.max(0,this.marker.radius)}_createPoint(t){return new Ti(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=t.lowValue;!isNaN(s)&&e.push(s)}))}},equalizer:class extends je{constructor(){super(...arguments),this.segmentSize=10,this.segmentGap=4,this.segmented=!1,this.backSegments=!1}getSegmentSize(t){return M(this._segmentDim,t)}_type(){return"equalizer"}canCategorized(){return!0}_createPoint(t){return new Mi(t)}_doLoad(t){super._doLoad(t),this._segmentDim=C(this.segmentSize,!1)}},errorbar:class extends Ye{constructor(){super(...arguments),this.pointPadding=.3}_type(){return"errorbar"}clusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Ni(t)}_getBottomValue(t){return t.lowValue}},funnel:Di,heatmap:class extends Be{getColor(t){}_type(){return"heatmap"}canMixWith(t){return!1}canCategorized(){return!0}defaultYAxisType(){return"category"}_createPoint(t){return new Ri(t)}_doPrepareRender(){super._doPrepareRender(),this._heatMin=Number.MAX_VALUE,this._heatMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{isNaN(t.heatValue)||(this._heatMin=Math.min(this._heatMin,t.heatValue),this._heatMax=Math.max(this._heatMax,t.heatValue))}))}},histogram:class extends Be{constructor(){super(...arguments),this.binsNumber=Fs.SQURE_ROOT,this.baseValue=0}getBinCount(t){const e=c(this.binWidth,0);if(e>0)return t/e;return c(this.binsNumber,0)<1?Ii[this.binsNumber||Fs.SQURE_ROOT](t):void 0}_type(){return"histogram"}ignoreAxisBase(t){return t===this._xAxisObj}_createPoint(t){return new Bi(t)}_doLoadPoints(t){function e(t){let e;return e=h(t)?t[c(this.yField,0)]:a(t)?_(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=[];let i=[];for(let s=0;s<t.length;s++){const r=e(t[s]);isNaN(r)||i.push(r)}if(i.length>0){i=i.sort(((t,e)=>t-e)),this.minValue<i[0]&&i.unshift(this.minValue),this.maxValue>i[i.length-1]&&i.push(this.maxValue);const t=i.length,e=i[0],r=i[t-1],n=this.getBinCount(t),a=this._binInterval=(r-e)/n;let h=0,o=e,l=o+a;for(let e=0;e<n;e++){let c=0;if(e==n-1)c=t-h;else for(;h<t&&i[h]<l;)c++,h++;s.push({x:o,y:c,min:o,max:e===n-1?r:l}),o=l,l=o+a}}super._doLoadPoints(s)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._runPoints[this._runPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}},line:fi,lollipop:class extends je{constructor(){super(...arguments),this.marker=new $i(this)}_type(){return"lollipop"}canCategorized(){return!0}getLabelOff(t){return t+this.marker.radius}_createPoint(t){return new Fi(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}},ohlc:class extends Ei{_type(){return"ohlc"}_createPoint(t){return new zi(t)}},pareto:class extends xi{constructor(){super(...arguments),this.curved=!1}_type(){return"pareto"}getLineType(){return this.curved?Wt.SPLINE:Wt.DEFAULT}_createPoint(t){return new Gi(t)}_referOtherSeries(t){if(t.name===this.source||t.index===this.source)return t.referBy(this),!0}reference(t,e){e._isX||(this.$_loadPoints(t._runPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values))}$_loadPoints(t){const e=[],s=t.reduce(((t,e)=>t+c(e.yValue,0)),0);let i=0;t.forEach((t=>{t.isNull||e.push({x:t.xValue,y:i+=100*t.yValue/s})})),this._doLoadPoints(e),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj)}},pie:Yi,scatter:class extends Be{constructor(t,e){super(t,e),this.radius=5,this.jitterX=0,this.jitterY=0}_type(){return"scatter"}ignoreAxisBase(t){return!0}_createPoint(t){return new Ui(t)}},treemap:class extends Be{constructor(){super(...arguments),this.idField="id",this.groupField="group",this.algorithm=Zi.SQUARIFY,this.alternate=!0,this._map={}}buildMap(t,e){function s(t){if(t.children){let e=0;t.children.forEach(((t,i)=>{s(t),e+=t.value})),t.value=e,t.children=t.children.sort(((t,e)=>e.value-t.value)),t.children.forEach(((t,e)=>{t.index=e}))}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this.startDir||e>t,r=this._leafs=[];return this._roots.forEach(((t,e)=>{s(t)})),this._roots=this._roots.sort(((t,e)=>e.value-t.value)),this._roots.forEach(((t,e)=>{t.index=e})),(this[this.algorithm]||this.squarify).call(this,this._roots,t,e,i),this._leafs}_type(){return"treemap"}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new Xi(t)}getLabeledPoints(){return this._leafs.map((t=>t.point))}_doPrepareRender(){super._doPrepareRender(),this._roots=this.$_buildTree(this._runPoints)}$_buildTree(t){const e=[],s=[],i=this._map;t.forEach((t=>{if(t.id||!t.isNull){const r=new qi(t);t.id&&(i[t.id]=r),t.group?s.push(r):e.push(r)}}));for(let t=s.length-1;t>=0;t--){const r=s[t],n=i[r.point.group];(r.parent=n)?(n.children||(n.children=[]),n.children.push(r),r.children&&s.splice(t,1)):(e.push(r),s.splice(t,1))}return e}$_squarifyRow(t,e,s,i){const r=e.width*e.height,n=e.width,a=e.height;let h=e.x,o=e.y,l=Number.MAX_VALUE,c=0;const u=[];for(;t.length>0;){let d,_,g,p,m;if(d=t.shift(),c+=d.value,p=c*r/i,1===s?(_=p/a,g=a*d.value/c):(g=p/n,_=n*d.value/c),m=Math.max(_/g,g/_),t.length>0&&m>l)return t.unshift(d),c-=d.value,p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),1===s?(e.x+=_,e.width-=_):(e.y+=g,e.height-=g),i-c;if(0===t.length)return p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.push(d),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),0;l=m,u.push(d)}}$_squarify(t,e,s,i){const r=t.slice(0);let n=s?1:0,a=t.reduce(((t,e)=>t+e.value),0);do{a=this.$_squarifyRow(r,e,n,a),i&&(n=1-n)}while(a>0);t.forEach((t=>{t.children&&this.$_squarify(t.children,t.getArea(),!s,!0)}))}squarify(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!0)}strip(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!1)}$_sliceNext(t,e,s,i){if(t.x=e.x,t.y=e.y,1===s){const s=e.height*t.value/i;t.width=e.width,t.height=s,e.y+=s,e.height-=s}else{const s=e.width*t.value/i;t.height=e.height,t.width=s,e.x+=s,e.width-=s}t.children&&this.$_slice(t.children,t.getArea(),0===s,!0)}$_slice(t,e,s,i){let r=t.reduce(((t,e)=>t+e.value),0),n=s?1:0;t.forEach((t=>{this.$_sliceNext(t,e,n,r),r-=t.value,i&&(n=1-n)}))}slice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!1)}sliceDice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!0)}},vector:class extends Be{constructor(){super(...arguments),this.origin=Ki.CENTER,this.maxLength=20,this.startAngle=0,this.arrowHead=Qi.CLOSE}_type(){return"vector"}ignoreAxisBase(t){return!0}_createPoint(t){return new tr(t)}_doLoad(t){super._doLoad(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length>0){const e=this.maxLength,s=this.origin,i=t.map((t=>t.length)).reduce(((t,e)=>Math.max(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case Ki.START:case Ki.END:t._off=t._len/2;break;default:t._off=0}}))}}},waterfall:class extends Ye{constructor(t,e){super(t,e)}_type(){return"waterfall"}canCategorized(){return!0}_createPoint(t){return new er(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length<1)return;let e,s,i=t[0],r=i.y=i._isSum?0:i.y,n=r,a=r,h=r,o=0;for(let l=1,c=t.length;l<c;l++){if(i=t[l],i._isSum){const e=t[l-1],r=!0===i._intermediate||l<c-1&&!1!==i._intermediate,n=i.save=i.y=r?h:a;i.yGroup=i.yValue=i.y,r?h<0?(o=e.low,s=o-n):(s=e.y,o=s-n):(o=t[0].low,s=o+n),h=0}else e=i.y,e<0?n<0?(s=r+n,o=s+e):(s=r,o=s+e):(o=r,s=o+e),h+=e,a+=e;n=i.y,i.y=r=s,i.low=o}}_getBottomValue(t){return t.y=t.save,NaN}}},wr={category:Ne,linear:is,time:Es,date:Es,log:class extends ss{type(){return"log"}_createTickModel(){return new rs(this)}_doCalcluateRange(t){const e=super._doCalcluateRange(t);return e.min=Math.log10(e.min),e.max=Math.log10(e.max),e}_createTick(t,e,s){return super._createTick(t,e,Math.pow(10,s))}getPosition(t,e){return e=e>0?Math.log10(e):0,super.getPosition(t,e)}}},yr={circle:class extends Us{constructor(t){super(t),this.band=new Gs(this),this.scale=new ei(this,!1),this.rim=new Zs(this),this.valueRim=new Ks(this),this.marker=new Qs(this),this.hand=new Js(this),this.pin=new ti(this)}_type(){return"circle"}getExtents(t){const e=super.getExtents(t),s=this.scale,i=this.band;let r=e.radius;const n=r-e.inner;if(i.visible)switch(e.bandThick=i.getThickness(n),i.position){case Bs.INSIDE:e.band=r-(n-e.bandThick)/2;break;case Bs.OPPOSITE:e.band=e.inner-i.gap,e.inner=e.band-e.bandThick;break;default:e.band=r+=e.bandThick+i.gap}if(s.visible)switch(e.scaleTick=Math.max(1,s.tick.length||0),e.scaleLabel=16,s.position){case Bs.OPPOSITE:e.scale=e.inner-s.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;break;case Bs.INSIDE:default:e.scale=r+s.gap}return e}},linear:nr,bullet:class extends ir{constructor(t){super(t),this.band=new lr(this),this.targetBar=new cr(this),this.actualBar=new ur(this)}getRanges(t,e){return Y(this.ranges,t,e)}_type(){return"bullet"}_doLoad(t){super._doLoad(t)}},clock:class extends Ts{constructor(t){super(t),this._active=!0,this.centerX=Us.DEF_CENTER,this.centerY=Us.DEF_CENTER,this.radius=Us.DEF_RADIUS,this.rim=new ii(this),this.hourHand=new ri(this,7,"60%"),this.minuteHand=new ri(this,5,"85%"),this.secondHand=new ni(this,2,"95%"),this.tick=new ai(this,10),this.minorTick=new ai(this,5),this.tickLabel=new hi(this),this.pin=new oi(this,5),this.label=new li(this)}get active(){return this._active}set active(t){t!==this._active&&(this._active=t,this._changed())}getTime(){return this.time instanceof Date?this.time:o(this.time)?new Date(this.time):isNaN(this.time)?void 0:new Date(this.time)}getExtendts(t,e){const s=Math.min(t,e);return{cx:M(this._centerXDim,t,t/2),cy:M(this._centerYDim,e,e/3),rd:M(this._radiusDim,s,s/2)}}_type(){return"clock"}_doLoad(t){super._doLoad(t),this._centerXDim=C(d(this.centerX,Us.DEF_CENTER),!0),this._centerYDim=C(d(this.centerY,Us.DEF_CENTER),!0),this._radiusDim=C(d(this.radius,Us.DEF_RADIUS),!0)}}},Vr={circle:si,linear:or,bullet:dr,circlegroup:si,lineargroup:or,bulletgroup:dr};class vr extends Dt{constructor(){super(...arguments),this.text="RealChart v1.0",this.url="http://realgrid.com",this.floating=!1,this.align=$.RIGHT,this.verticalAlign=F.BOTTOM,this.offsetX=2,this.offsetY=1}}class Pr extends Dt{constructor(){super(...arguments),this.paletteMode=Ae.NORMAL,this.animatable=!0,this.xStart=0,this.xStep=1,this.axisGap=8,this.credits=new vr(null)}}class Sr extends r{constructor(t){super(),this.type="bar",this.gaugeType="circle",this.polar=!1,this._assets=new yt,this._themes=new Ze,this._options=new Pr(this),this._title=new Ke(this),this._subtitle=new Qe(this),this._legend=new pe(this),this._plane=new pr(this),this._series=new Ie(this),this._xAxes=new ue(this,!0),this._yAxes=new ue(this,!1),this._gauges=new Ns(this),this._body=new de(this),this._navigator=new gr(this),t&&this.load(t),this._polar=!0===this.polar}startAngle(){return this.body.getStartAngle()}get xStart(){return+this._options.xStart}get xStep(){return+this._options.xStep}get xStepUnit(){}animatable(){return!1!==this._options.animatable}get assets(){return this._assets}get options(){return this._options}get title(){return this._title}get subtitle(){return this._subtitle}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){return this._gauges.firstGauge}get legend(){return this._legend}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}get body(){return this._body}get navigator(){return this._navigator}needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}isGauge(){return this._gaugeOnly}isPolar(){return this._polar}isWidget(){return this._series.isWidget()}isInverted(){return!this._polar&&this._inverted}isEmpty(){return this._series.isEmpty()&&0===this._gauges.count}seriesByName(t){return this._series.getSeries(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){return this._gauges.getGauge(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){const e=this._xAxes.items,s=this._yAxes.items;let i;if(this.isInverted())switch(t){case z.LEFT:i=e.filter((t=>!t._isOpposite));break;case z.RIGHT:i=e.filter((t=>t._isOpposite));break;case z.BOTTOM:i=s.filter((t=>!t._isOpposite));break;case z.TOP:i=s.filter((t=>t._isOpposite))}else switch(t){case z.LEFT:i=s.filter((t=>!t._isOpposite));break;case z.RIGHT:i=s.filter((t=>t._isOpposite));break;case z.BOTTOM:i=e.filter((t=>!t._isOpposite));break;case z.TOP:i=e.filter((t=>t._isOpposite))}return i||[]}_getLegendSources(){return this._series.getLegendSources()}$_assignTemplates(t){if(null!=t.template){let e=this._templates[t.template];if(e)return g(e,t)}return t}load(t){console.time("load chart"),this.$_loadTemplates(t.templates),["type","gaugeType","polar","inverted"].forEach((e=>{e in t&&(this[e]=t[e])})),this.type=this.type||"bar",this.gaugeType=this.gaugeType||"circle",this._assets.load(t.assets),this._themes.load(t.themes),this._options.load(t.options),this._title.load(t.title),this._subtitle.load(t.subtitle),this._legend.load(t.legend),this._series.load(t.series),this._gauges.load(t.gauges||t.gauge),this._gaugeOnly=0==this._series.count&&this._gauges.count>0,this._gaugeOnly||(this._xAxes.load(t.xAxes||t.xAxis||{}),this._yAxes.load(t.yAxes||t.yAxis||{})),this._body.load(t.body||t.plot),console.log("chart-items:",Ot),console.timeEnd("load chart")}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}prepareRender(){this._inverted=this.inverted,this._xAxes.disconnect(),this._yAxes.disconnect(),this._series.prepareRender(),this._plane.count()>1&&this._plane.prepareRender(),this._xAxes.collectValues(),this._yAxes.collectValues(),this._xAxes.collectReferentsValues(),this._yAxes.collectReferentsValues(),this._xAxes.prepareRender(),this._yAxes.prepareRender(),this._series.prepareAfter(),this._legend.prepareRender(),this._gauges.prepareRender(),this._navigator.prepareRender()}layoutAxes(t,e,s,i){this._xAxes.buildTicks(s?e:t),this._yAxes.buildTicks(s?t:e),this.$_calcAxesPoints(t,e,s,0)}calcAxesPoints(t,e,s){this.$_calcAxesPoints(t,e,s,1)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{t.calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{t.calcPoints(r,i)}))}update(){}$_loadTemplates(t){if(a(t)){const e=this._templates={};for(const s in t){const i=t[s];a(i)&&(e[s]=Object.assign({},i))}this.assignTemplates=this.$_assignTemplates.bind(this)}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&xr[t.toLowerCase()]}_getSeriesType(t){return o(t)&&fr[t.toLowerCase()]}_getAxisType(t){return o(t)&&wr[t.toLowerCase()]}_getGaugeType(t){return o(t)&&yr[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&Vr[t.toLowerCase()]}getAxesGap(){return this._options.axisGap||0}_modelChanged(t){this._fireEvent("onModelChanged",t)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}class kr extends s{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}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()}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),this._owner.add(i),i}prepare(t,e,s){const i=this._owner.doc,r=this._pool,n=this._views;for(;n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(i);n.push(e),null==s||s(e,n.length-1,t)}return e&&this.forEach(e),this}reprepare(t,e,s,i,r,n){const a=this._owner.doc,h=this._pool,o=this._views,l=[];for(let t=this._removes.length-1;t>=0;t--)if(!this._removes[t].parent){const e=this._removes.splice(t,1)[0];h.push(e)}for(let i=0,n=e.length;i<n;i++){const h=e[i];let c=-1;if(t)for(let e=0,i=o.length;e<i;e++){const i=o[e][t];if(s&&i===h[s]||!s&&i===h){l.push(o[e]),c=e;break}}if(c>=0){const t=o.splice(c,1)[0];t.parent||this._owner.add(t)}else{const t=this.$_create(a,i,n);l.push(t),null==r||r(t,i,n)}}for(let t=0,e=o.length;t<e;t++){const s=o[t];s.removing||(this.removeDelay>0?this._removes.push(s.removeLater(this.removeDelay)):h.push(s.remove()),null==i||i(s,t,e))}return this._views=l,n&&this.forEach(n),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 of t)this.free(s,e)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}}const Ar=function(t){return isNaN(t)?0:t};class Lr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return t&&this._path.push("Z"),this._path.join(" ")}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return l(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return l(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return l(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),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 l(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(l(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Ar(t[e]),Ar(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Ar(t[e].x),Ar(t[e].y));return this}polygon(...t){return this.lines(...t),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}}const Er=Math.pow,Cr=Math.sqrt,Tr=Math.sin,Mr=Math.cos,Nr=Math.PI,Or=1.70158,Dr=1.525*Or,Rr=Or+1,Br=2*Nr/3,Ir=2*Nr/4.5,$r=function(t){const e=7.5625,s=2.75;return t<1/s?e*t*t:t<2/s?e*(t-=1.5/s)*t+.75:t<2.5/s?e*(t-=2.25/s)*t+.9375:e*(t-=2.625/s)*t+.984375},Fr={inQuad:t=>t*t,outQuad:t=>1-(1-t)*(1-t),inOutQuad:t=>t<.5?2*t*t:1-Er(-2*t+2,2)/2,inCubic:t=>t*t*t,outCubic:t=>1-Er(1-t,3),outCubic2:t=>1-Er(1-t,4),inOutCubic:t=>t<.5?4*t*t*t:1-Er(-2*t+2,3)/2,inQuart:t=>t*t*t*t,outQuart:t=>1-Er(1-t,4),inOutQuart:t=>t<.5?8*t*t*t*t:1-Er(-2*t+2,4)/2,inQuint:t=>t*t*t*t*t,outQuint:t=>1-Er(1-t,5),inOutQuint:t=>t<.5?16*t*t*t*t*t:1-Er(-2*t+2,5)/2,inSine:t=>1-Mr(t*Nr/2),outSine:t=>Tr(t*Nr/2),inOutSine:t=>-(Mr(Nr*t)-1)/2,inExpo:t=>0===t?0:Er(2,10*t-10),outExpo:t=>1===t?1:1-Er(2,-10*t),inOutExpo:t=>0===t?0:1===t?1:t<.5?Er(2,20*t-10)/2:(2-Er(2,-20*t+10))/2,inCirc:t=>1-Cr(1-Er(t,2)),outCirc:t=>Cr(1-Er(t-1,2)),inOutCirc:t=>t<.5?(1-Cr(1-Er(2*t,2)))/2:(Cr(1-Er(-2*t+2,2))+1)/2,inBack:t=>Rr*t*t*t-Or*t*t,outBack:t=>1+Rr*Er(t-1,3)+Or*Er(t-1,2),inOutBack:t=>t<.5?Er(2*t,2)*(7.189819*t-Dr)/2:(Er(2*t-2,2)*((Dr+1)*(2*t-2)+Dr)+2)/2,inElastic:t=>0===t?0:1===t?1:-Er(2,10*t-10)*Tr((10*t-10.75)*Br),outElastic:t=>0===t?0:1===t?1:Er(2,-10*t)*Tr((10*t-.75)*Br)+1,inOutElastic:t=>0===t?0:1===t?1:t<.5?-Er(2,20*t-10)*Tr((20*t-11.125)*Ir)/2:Er(2,-20*t+10)*Tr((20*t-11.125)*Ir)/2+1,inBounce:t=>1-$r(1-t),outBounce:$r,inOutBounce:t=>t<.5?(1-$r(1-2*t))/2:(1+$r(2*t-1))/2};class zr{constructor(){this.delay=0,this.duration=zr.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=Math.min(1,Math.max(0,S(t/this.duration)));this._easing&&(e=this._easing(e));try{!1===this._doUpdate(e)&&this._stop()}finally{t>=this.duration?this._stop():this._started&&window.requestAnimationFrame(this._handler)}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=c(t,zr.DURATION),this.delay=e||0,this._easing=Fr[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}}zr.DURATION=700,zr.SHORT_DURATION=300;class Gr{static empty(){return new Gr}static create(t=0,e=0){return new Gr(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new Gr(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}Gr.EMPTY=new Gr;class Hr extends ct{constructor(t,e=x){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Hr.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Hr.IGNORE_ATTRS={width:"",height:""};class jr{static isBright(t){return new jr(t).isBright()}static getContrast(t,e,s){return new jr(t).getContrast(e,s)}static interpolate(t,e,s){const i=(16711680&t)>>16,r=(65280&t)>>8,n=255&t;return(i+(((16711680&e)>>16)-i)*s<<16)+(r+(((65280&e)>>8)-r)*s<<8)+(n+((255&e)-n)*s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(et.startsWith(t,"rgb(")&&et.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):et.startsWith(t,"rgba(")&&et.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):et.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 jr(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var Yr,Wr,Ur;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Yr||(Yr={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Wr||(Wr={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ur||(Ur={}));class Xr extends ct{constructor(t,e=x){super(t,e,"text"),this._layout=Wr.TOP,this._overflow=Ur.WRAP,this._dirty=!0,this._text="",this.anchor=Yr.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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.75*t}layoutText(t){const e=this.getBBounds(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Wr.MIDDLE:i=Math.floor(s/2);break;case Wr.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.setAttr("y",i)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(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,a=s.length;do{r=Math.ceil((n+a)/2);i.getSubStringLength(0,r)>t?a=r-1:n=r}while(n<a);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(jr.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBounds(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}class qr extends Hr{constructor(t,e=x){super(t),this.add(this._text=new Xr(t,e)),this._text.anchor=Yr.START}get text(){return this._text.text}get anchor(){return this._text.anchor}set anchor(t){this._text.anchor=t}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setSvg(t){return this._text.svg=t,this}setModel(t,e,s){var i,r,n,a;const h=e.effect;return this._model=e,this._text.setStyleOrClass(e.style),h===Rt.BACKGROUND?(null===(i=this._outline)||void 0===i||i.remove(),this._back||(this._back=new me(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.backgroundStyle)):h===Rt.OUTLINE?(null===(r=this._back)||void 0===r||r.remove(),this._outline||(this._outline=new Xr(t),this._outline.anchor=Yr.START),this.insertFirst(this._outline),this._outline.setStyleOrClass(e.style)):(null===(n=this._back)||void 0===n||n.remove(),null===(a=this._outline)||void 0===a||a.remove()),this}setContrast(t){if(t&&this._model.autoContrast&&this._text.setContrast(t,this._model.darkStyle||"rct-label-dark",this._model.lightStyle||"rct-label-bright"),this._outline&&this._outline.parent){const t=jr.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:"2px"})}return this}layout(){if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom),e=this._text.getBBounds(),s=parseFloat(t.paddingLeft)||0,i=parseFloat(t.paddingTop)||0;this._back.setBounds(-s,-i,e.width+s+(parseFloat(t.paddingRight)||0),e.height+i+(parseFloat(t.paddingBottom)||0),3)}return this}}class Zr{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Zr(t,t,t,t):new Zr(t,t,e,e):new Zr(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 Zr(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=c(t.paddingLeft,0),this.right=c(t.paddingRight,0),this.top=c(t.paddingTop,0),this.bottom=c(t.paddingBottom,0),this}applyMargin(t){return this.left=c(t.marginLeft,0),this.right=c(t.marginRight,0),this.top=c(t.marginTop,0),this.bottom=c(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}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}Zr.Empty=Object.freeze(new Zr),Zr.Temp=new Zr;class Kr extends ct{constructor(t,e=x){super(t,e,"g"),ct.DEBUGGING&&(this.add(this._debugRect=new me(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t.style)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),e!==this.model&&(this.model=e,this._doModelChanged());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),ct.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new me(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()}_doModelChanged(){}}class Qr extends Kr{constructor(t,e,s){super(t,e),this._margins=new Zr,this._paddings=new Zr,this.add(this._background=new me(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this.setStyleOrClass(e.style),e!==this.model&&(this.model=e,this._doModelChanged()),this._setBackgroundStyle(this._background);const n=getComputedStyle(this.dom),a=this._paddings,h=this._margins;a.applyPadding(n),h.applyMargin(n);const o=this._doMeasure(t,e,s,i,r);return this.mw=o.width+=h.left+h.right+a.left+a.right,this.mh=o.height+=h.top+h.bottom+a.top+a.bottom,o}layout(t){super.layout(t);const e=this._margins;return this._background.setBounds(e.left+this._getBackOffset(),e.top,this.width-e.left-e.right,this.height-e.top-e.bottom),this}_getBackOffset(){return 0}}class Jr{static slide(t,e){new en(t,e)}static fadeIn(t){new tn(t,{prop:"opacity",start:"0",end:"1"})}static grow(t,e){new rn(t,e)}constructor(t,e){const s=this._createAnimation(t,e);s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class tn extends Jr{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:zr.DURATION,fill:"none"})}}class en extends Jr{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:zr.DURATION,fill:"none"}}$_clipRect(t){return t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height).setTemporary()}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:A(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:A(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class sn extends zr{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_doStop(){this._series=null}}class rn extends sn{_doUpdate(t){return!!this._series.parent&&(this._series.setViewRate(t),!0)}_doStop(){this._series.parent&&this._series.setViewRate(NaN),super._doStop()}}class nn extends qr{constructor(t){super(t,"rct-point-label")}}class an extends ut{constructor(t){super(t,"rct-point-labels"),this._labels=[new kr(this,nn),new kr(this,nn)],this._maps=[],this.setStyle("pointerEvents","none")}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r){const n=r.text,a=r.style;e.point=i,e.setModel(t,r,null),n?(r.buildSvg(e._text,NaN,NaN,r,i.getValueOf),e.setStyles(a),e._outline&&r.buildSvg(e._outline,NaN,NaN,r,i.getValueOf)):e.setText(r.getText(i.getLabel(s))).setStyles(a)}prepare(t,e){const s=e.model,i=s.pointLabel;if(i.visible){const r=s.pointLabelCount(),n=this._labels,a=s.getLabeledPoints(),h=this._maps,o=i.style;n[0].prepare(a.length),h[0]={},n[1].prepare(r>1?a.length:0),h[1]={},a.forEach(((s,r)=>{for(let a=0;a<s.labelCount();a++){const o=n[a].get(r);o.setVisible(e.isPointVisible(s))&&(this.prepareLabel(t,o,a,s,i),h[a][s.pid]=o)}})),this.setStyleOrClass(o)}else this.clear()}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class hn extends Hr{constructor(t){super(t),this.add(this._line=new gt(t))}setLine(t){this._line.setPath(t)}}class on extends Hr{constructor(t){super(t,"rct-point-label-lines"),this._lines=new kr(this,hn)}prepare(t){const e=this._lines,s=t.getPoints(),i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.count).forEach(((t,e)=>{const i=s.get(e);t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class ln extends ut{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform","")),this.inverted}}class cn extends Kr{constructor(t,e){super(t,"rct-series "+e),this._inverted=!1,this._animatable=!0,this._viewRate=NaN,this._animations=[],this.add(this._pointContainer=new ln(t,"rct-series-points")),this.add(this._labelContainer=new an(t))}invertable(){return!0}getClipContainer(){return this._pointContainer}setViewRate(t){isNaN(t)&&isNaN(this._viewRate)||t===this._viewRate||(this._viewRate=t,isNaN(t)?this.control.invalidateLayout():this._doViewRateChanged(t))}setPosRate(t){}isPointVisible(t){return t.visible&&!t.isNull}_doViewRateChanged(t){}_setChartOptions(t,e){this._inverted=t,this._animatable=e}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.visible&&this._labelContainer.setVisible(!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)}findPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e)}_doPointClicked(t){}_getColor(){return this.model._calcedColor}prepareSeries(t,e){this.setData("index",e.index%12),this.setBoolData("pointcolors",e._colorByPoint()),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e.style),e.color&&(this.internalSetStyle("fill",e.color),this.internalSetStyle("stroke",e.color)),e._calcedColor=getComputedStyle(this.dom).fill,this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_prepareStyleOrClass(t){}_doMeasure(t,e,s,i,r){return this.setClip(void 0),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new gt(t,"rct-series-trendline")),this._trendLineView.setVisible(!0)):this._trendLineView&&this._trendLineView.setVisible(!1),Gr.create(s,i)}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(),this._afterRender(),this._animatable&&this._runShowEffect(!this.control.loaded)}_collectVisPoints(t){return t.collectVisibles()}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointStyle(t,e,s,i){t.setAttr("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&(t.internalSetStyle("fill",s.color),t.internalSetStyle("stroke",s.color));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVisible(this.model.pointLabel.visible&&!this._animating()),this._labelContainer.visible&&this._labelContainer}_getViewRate(){return c(this._viewRate,1)}_animating(){return!isNaN(this._viewRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_afterRender(){}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(){const t=this.model,e=t._xAxisObj,s=t._yAxisObj,i=t.trendline._points.map((t=>({x:e.getPosition(e._vlen,t.x),y:s._vlen-s.getPosition(s._vlen,t.y)}))),r=new Lr;r.move(i[0].x,i[0].y),r.lines(...i),this._trendLineView.setPath(r.end(!1))}_layoutLabel(t){let{inverted:e,x:s,y:i,hPoint:r,labelView:n,labelOff:a}=t;const h=t.reversed?r<=0:r<0,o=n.getBBounds();let l=!0;switch(e?i-=o.height/2:s-=o.width/2,t.labelPos){case ve.INSIDE:e?s-=r/2+a:i+=(r-o.height)/2+a;break;case ve.HEAD:e?h?s+=o.width-a:s-=o.width+a:h?i-=o.height+a:i+=a;break;case ve.FOOT:e?s-=h?r+o.width+a:r-a:i+=h?r+a:r-o.height-a;break;case ve.OUTSIDE:default:e?h?s-=o.width+a:s+=a:h?i+=a:i-=o.height+a,l=!1}n.setContrast(l&&t.pointView.dom),n.layout().translate(s,i)}}cn.POINT_CLASS="rct-point",cn.DATA_FOUCS="focus",cn.LEGEND_MARKER="rct-legend-item-marker";class un extends gt{constructor(t){super(t,cn.POINT_CLASS),this.labelViews=[]}}let dn=class extends un{layout(t,e){this.setPath(ot.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class _n extends cn{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e){this._preparePointViews(t,e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPointViews(t,e)}_runShowEffect(t){t&&Jr.grow(this)}_doViewRateChanged(t){this._layoutPointViews(this.width,this.height)}}class gn extends _n{_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof Ne?2*h.categoryPad():0,u=i?t:e,d=i?e:t,_=i?0:e,g=o.axisMin(),p=o.getPosition(u,g),m=s.getBaseValue(o),b=c(o.getPosition(u,Math.max(g,m)),p),x=!isNaN(m),f=a&&Object.assign(this._labelInfo,{inverted:i,reversed:o.reversed,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const c=h.getUnitLength(d,n.xValue)*(1-l),g=s.getPointWidth(c),m=(o.getPosition(u,n.yValue)-b)*r;let w,y;w=h.getPosition(d,n.xValue)-c/2,y=_,n.xPos=w+=s.getPointPos(c)+g/2,n.yPos=y-=x&&b!==p?o.getPosition(u,n.yGroup*r):o.getPosition(u,n.yGroup)*r,this._layoutPointView(t,e,w,y+m,g,m),f&&(f.labelView=a.get(n,0))&&(i&&(y=d-h.getPosition(d,n.xValue)+c/2,w=_,n.yPos=y-=s.getPointPos(c)+g/2,n.xPos=w+=x?o.getPosition(u,n.yGroup)*r:o.getPosition(u,n.yGroup*r)),f.pointView=t,f.x=w,f.y=y,f.wPoint=g,f.hPoint=m,this._layoutLabel(f))}}))}}class pn extends _n{_layoutPointViews(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof Ne?2*h.categoryPad():0,c=i?t:e,u=i?e:t,d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const g=h.getUnitLength(u,n.xValue)*(1-l),p=s.getPointWidth(g),m=(o.getPosition(c,n.yValue)-o.getPosition(c,this._getLowValue(n)))*r;let b=h.getPosition(u,n.xValue)-g/2,x=d;n.xPos=b+=s.getPointPos(g)+p/2,n.yPos=x-=o.getPosition(c,n.yGroup)*r,this._layoutPointView(t,e,b,x,p,m),a&&(i&&(x=u-h.getPosition(u,n.xValue)+g/2,b=d,n.yPos=x-=s.getPointPos(g)+p/2,n.xPos=b+=o.getPosition(c,n.yGroup)*r),_.pointView=t,_.hPoint=m,_.x=b,_.y=x,(_.labelView=a.get(n,0))&&(_.hPoint=m,this._layoutLabel(_)),(_.labelView=a.get(n,1))&&(i?_.x-=m:_.y+=m,_.hPoint=-m,this._layoutLabel(_)))}}))}}class mn extends zr{constructor(t){super(),this.series=t,this.duration=300}_doUpdate(t){return!!this.series&&(this.series._zombieRate=this.series._zombie.visible?t:1-t,this.series._resizeZombie(),!0)}_doStop(){this.series&&(this.series._zombie=null,this.series._zombieAni=null,this.series.control.invalidateLayout(),this.series=null)}}class bn extends cn{togglePointVisible(t){var e;this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(200)}isPointVisible(t){return t===this._zombie||super.isPointVisible(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 mn(this),this._zombieAni.start())}_createPointLegendMarker(t,e,s){return me.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){s._legendMarker||s.setLegendMarker(this._createPointLegendMarker(t,s,ge.MARKER_SIZE)),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class xn extends mt{constructor(t){super(),this.chart=t}}class fn extends xn{constructor(t,e){super(t),this._body=e}_doStart(t,e,s,i,r){return this._xStart=e-this._body.tx,this._yStart=s-this._body.ty,this._body.addFeedback(this._feedback=new me(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){t-=this._body.tx,this._body.setZoom(Math.min(this._xStart,t),0,Math.max(this._xStart,t),this._body.height),this._feedback.remove()}_doDrag(t,e,s,i,r){return i-=this._body.tx,this._feedback.setBounds(Math.min(this._xStart,i),0,Math.abs(this._xStart-i),this._body.height),!0}}class wn{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);console.log("POINT DOWN",s.x,s.y),this._dragTracker&&this.$_stopDragTracker(e,s.x,s.y),this._prevX=s.x,this._prevY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),{x:s,y:i}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const r=this.isDragging(),n=t.target;s<0||s>=e.control.dom().offsetWidth||i<0||i>=e.control.dom().offsetHeight?r&&this.$_stopDragTracker(n,s,i,!0):r?this.$_doDrag(t,n,s,i):(!this._dragTracker&&Math.abs(this._prevX-s)>3||Math.abs(this._prevY-i)>3||this._dragTracker&&!r)&&this.$_startMove(t,n,s,i)}this._prevX=s,this._prevY=i,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(t.target)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleClick(t){const e=this._chart.chartView(),s=t.target,i=e.getButton(s);let r,n,a;if(i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof fe){const t=n.source,e=this._chart.model.seriesByPoint(t);if(e){e.setPointVisible(t,!t.visible);const s=this._chart.chartView().findSeriesView(e);s instanceof bn&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible;else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){}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.pageX-e.left,y:t.pageY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView().bodyView();if(i.model.canZoom()&&i.contains(t))return new fn(this._chart,i)}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(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))}$_startDrag(t,e,s,i,r){return this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.isDragging()&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}}class yn{static empty(){return new yn}static create(t=0,e=0){return new yn(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}get isEmpty(){return 0===this.x||0===this.y}clone(){return new yn(this.x,this.y)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y}setEmpty(){return this.x=this.y=0,this}set(t,e){return this.x=t,this.y=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t}toString(){return"{x: "+this.x+", y: "+this.y+"}"}}class Vn extends Qr{constructor(t){super(t,Vn.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Xr(t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this.rotation=0,this._textView.text=e.text,it(this._textView.getBBounds())}_doLayout(t){const e=this._paddings,s=this._margins;t||this.setRotaion(0,this.height/2,this.model.axis.position===zt.OPPOSITE?90:270),this._textView.translateY(s.top+e.top)}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}Vn.TITLE_CLASS="rct-axis-title";class vn extends Kr{constructor(t){super(t,kn.TICK_CLASS),this.add(this._lineView=new gi(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLineC(0,0,this.height):this._lineView.setHLineC(0,0,this.width)}}class Pn extends Xr{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}get rotatedWidth(){const t=this.rotation*V,e=this.getBBounds();return Math.abs(Math.sin(t)*e.height)+Math.abs(Math.cos(t)*e.width)}get rotatedHeight(){const t=this.rotation*V,e=this.getBBounds();return Math.abs(Math.cos(t)*e.height)+Math.abs(Math.sin(t)*e.width)}}class Sn extends ct{constructor(t){super(t,void 0),this.add(this._back=new gt(t,"rct-crosshair-flag")),this.add(this._text=new Xr(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text)return this._text.text=e,!0;if(e){const e=this._text.getBBounds(),s=new Lr,i=Math.max(t.flag.minWidth||0,e.width+8);s.rect(0,0,i,e.height+4),this._back.setPath(s.end()),this._text.translate(i/2,2)}}}class kn extends Kr{constructor(t){super(t,kn.AXIS_CLASS),this._markViews=[],this._labelViews=[],this.add(this._lineView=new gi(t,kn.LINE_CLASS)),this.add(this._titleView=new Vn(t)),this.add(this._markContainer=new ct(t,"rct-axis-ticks")),this.add(this._labelContainer=new ct(t,"rct-axis-labels"))}checkHeight(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(t,i)&&(r+=this.$_measureLabelsHorz(i,this._labelViews,e)),(this._titleView.visible=i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).height,r+=i.title.gap),r}checkWidth(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(t,i)&&(r+=this.$_measureLabelsVert(i,this._labelViews,e)),(this._titleView.visible=i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).height,r+=i.title.gap),r}prepareGuides(t,e,s){let i=this.model.guides.filter((t=>!t.front));e.addAll(t,i),i=this.model.guides.filter((t=>t.front)),s.addAll(t,i)}showCrosshair(t,e){let s=this._crosshairView;s||this.add(this._crosshairView=s=new Sn(this.doc)),s.setVisible(!0),s.setText(this.model.crosshair,e);const i=s.getBBounds();this.model._isHorz?s.translate(t-i.width/2,this.model.tick.length):s.translate(this.width-this.model.tick.length-i.width,t-i.height/2)}hideCrosshiar(){this._crosshairView&&this._crosshairView.visible&&this._crosshairView.setVisible(!1)}scroll(t){}_doMeasure(t,e,s,i,r){const n=e._isHorz,a=this._titleView,h=this._labelViews;let o=0;return(this._lineView.visible=e.line.visible)&&this._lineView.setStyleOrClass(e.line.style),this._markLen=e.tick.length||0,this._markLen>0&&(o+=e.tick.margin||0),o+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(t,e)?o+=this._labelSize=n?this.$_measureLabelsHorz(e,h,s):this.$_measureLabelsVert(e,h,i):this._labelSize=0,a.visible&&(o+=a.mh,o+=e.title.gap||0),Gr.create(n?s:o,n?o:i)}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._ticks,r=t._markPoints,n=this._titleView,a=this._labelViews,h=this._markLen,o=this.width,l=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?l:0,0,o):this._lineView.setVLine(s?0:o,0,l)),this._markContainer.visible&&(e?this._markViews.forEach(((t,e)=>{t.resize(1,h),t.layout().translate(r[e],s?l-h:0)})):this._markViews.forEach(((t,e)=>{t.resize(h,1),t.layout().translate(s?0:o-h,l-r[e])})));const c=h+(t.tick.margin||0);if(this._labelContainer.visible&&(e?this.$_layoutLabelsHorz(a,i,s,o,l,c):this.$_layoutLabelsVert(a,i,s,o,l,c)),n.visible){const i=this._labelSize,r=t.title.gap||0;if(n.resizeByMeasured().layout(e),e){const t=s?0:c+i+r;n.translate(o/2,t)}else{const t=s?c+i+r+n.height/2:o-c-i-r-n.height/2;n.translate(t,(l-n.height)/2)}}}$_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 vn(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}$_prepareLabels(t,e){const s=this._labelContainer;if(s.visible=e.label.visible){const i=e._ticks,r=i.length,n=this._labelViews;for(;n.length<r;){const e=new Pn(t,"rct-axis-label");e.anchor=Yr.START,s.add(e),n.push(e)}for(;n.length>r;)n.pop().remove();return n.forEach(((t,e)=>{t.setVisible(!0),t.value=i[e].value,t.text=i[e].label})),n.length}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz(t,e,s,i,r,n){const a=e.length,h=Math.max(1,i)*Math.max(1,r),o=n||0,l=Math.abs(o)*Math.PI/180;let c=!1;e.forEach((t=>t.rotation=o));for(let i=0;i<a-1;i+=h){let r=0;for(let n=i;n<i+h&&n<a-1;n++)r+=t.getLabelLength(s,e[i].value);if(0===o&&e[i].getBBounds().width>=r){c=!0;break}if(0!==o&&(e[i].getBBounds().width+e[i].getBBounds().height)*Math.cos(l)>=r){c=!0;break}}return c}$_applyStep(t,e,s){const i=t.label,r=Math.max(0,i.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.setVisible(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s){const i=t.label;let r,n=+i.step>>0,a=+i.rows>>0,h=+i.rotation%360,o=this.$_checkOverlappedHorz(t,e,s,n,a,h);if(e.forEach((t=>t.row=0)),this._labelRowPts=[0],o){switch(n=a=h=0,i.autoArrange){case Ft.ROTATE:h=-45;break;case Ft.ROWS:a=this.$_getRows(e);break;case Ft.STEP:n=this.$_getStep(e)}if(n>1){const i=e.slice(0);for(;i.length>1&&(e=this.$_applyStep(t,i,n),this.$_checkOverlappedHorz(t,i,s,n,1,0));)n++}else if(a>1){for(;e.length>a&&(e.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz(t,e,s,1,a,0));)a++;this._labelRowPts=[]}else h=-45,e.forEach(((t,e)=>{t.rotation=h,t.index=e})),this.$_checkOverlappedHorz(t,e,s,n,a,h)&&(n=Math.max(2,n++),e=this.$_applyStep(t,e,n),this.$_checkOverlappedHorz(t,e,s,n,a,0)&&e.forEach(((t,e)=>{t.rotation=h})))}else e=this.$_applyStep(t,e,n||1);if(a>1){const t=!isNaN(h)&&0!=h,s=this._labelRowPts;a>1&&e.forEach(((t,e)=>t.row=e%a));for(let t=0;t<a;t++)s.push(0);e.forEach((e=>{s[e.row]=Math.max(s[e.row],t?e.rotatedHeight:e.getBBounds().height)})),s.unshift(0);for(let t=2;t<s.length;t++)s[t]+=s[t-1];return s[s.length-1]}if(isNaN(h)||0==h){r=e[0].getBBounds().height;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].getBBounds().height)}else{r=e[0].rotatedHeight;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].rotatedHeight)}return r}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=Math.max(1,i);for(let i=0;i<r-1;i+=n){let a=0;for(let h=i;h<i+n&&h<r-1;h++)a+=t.getLabelLength(s,e[i].value);if(e[i].getBBounds().height>=a)return!0}}$_measureLabelsVert(t,e,s){const i=t.label;let r=Math.max(1,+i.step>>0);if(this.$_checkOverlappedVert(t,e,s,r)){const i=e.slice(0);for(;i.length>1&&r<i.length/2&&(e=this.$_applyStep(t,i,++r),this.$_checkOverlappedHorz(t,i,s,r,1,0)););}else e=this.$_applyStep(t,e,r);let n=e[0].getBBounds().width;for(let t=1;t<e.length;t++)n=Math.max(n,e[t].getBBounds().width);return n}$_layoutLabelsHorz(t,e,s,i,r,n){const a=this._labelRowPts;t.forEach((t=>{if(t.visible){const i=t.rotation,h=i*V,o=t.getBBounds(),l=Math.floor(t.getAscent(o.height));let c=e[t.index].pos,u=s?r-n-o.height-a[t.row]:n+a[t.row];i<-15&&i>=-90?(t.anchor=Yr.END,c+=-Math.sin(h)*l/2-1,u+=Math.cos(h)*l-l):i>15&&i<=90?(t.anchor=Yr.START,c-=Math.sin(h)*l/2-1,u+=Math.cos(h)*l-l):t.anchor=Yr.MIDDLE,t.translate(c,u)}}))}$_layoutLabelsVert(t,e,s,i,r,n){const a=s?n:i-n;t.forEach(((t,i)=>{if(t.visible){const n=t.getBBounds(),h=s?a:a-n.width;t.translate(h,r-e[i].pos-n.height/2)}}))}}kn.AXIS_CLASS="rct-axis",kn.LINE_CLASS="rct-axis-line",kn.TICK_CLASS="rct-axis-tick";class An extends ct{constructor(t,e){super(t,e,"image"),this._dirty=!0,this.setAttr("preserveAspectRatio","none")}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,s){return!!t&&(this.setAttr("href",t),this.resize(e,s),!0)}getBBounds(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}_doSizeChanged(){this._dirty=!0}}class Ln extends ct{constructor(t,e,s,i,r){super(t,e,"circle"),"number"==typeof s&&this.setCircle(s,i,r)}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class En extends gt{static create(t,e,s,i,r,n,a,h,o=!0){return new En(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:a,angle:h,clockwise:o})}static createInner(t,e="",s,i,r,n,a,h,o,l=!0){return new En(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:h,angle:o,clockwise:l})}constructor(t,e=x,s=x){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 ot.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 ot.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)}}class Cn extends Kr{constructor(t,e){super(t,e),this._inverted=!1,this._animatable=!0,this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new me(t,Cn.PANE_CLASS)),this.add(this._contentContainer=new ut(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Cn.GAUGE_CLASS}_setChartOptions(t,e){this._inverted=t,this._animatable=e}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}}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._paneElement.setStyleOrClass(t.paneStyle)}_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=Object.assign(U.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.translate(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Bn)return t;t=t.parent}}}Cn.GAUGE_CLASS="rct-gauge",Cn.PANE_CLASS="rct-gauge-pane";class Tn extends zr{constructor(t,e,s){super(),this.view=t,this.from=e,this.to=s}_doUpdate(t){return this.view._runValue=this.from+(this.to-this.from)*t,this.view._renderValue(),!0}}class Mn extends Cn{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?At.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null),super._doLayout(),this._checkValueAnimation()}_checkValueAnimation(){const t=this.model;this._animatable&&t.animatable&&t.value!==this._prevValue&&(this._ani=new Tn(this,this._prevValue,t.value).start((()=>this._runValue=NaN)),this._prevValue=t.value)}}class Nn extends Kr{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 kr(this._tickContainer,gi),this.add(this._labelContainer=new ut(t,"rct-gauge-scale-tick-labels")),this._labels=new kr(this._labelContainer,Xr)}}class On extends Nn{_createLine(t,e){return new gi(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,h=e._steps,o=h.length;let l=a?e.gap:s,c=a?i:e.gap;if(this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.setStyleOrClass(e.tick.style),this._ticks.prepare(o)),a?l+=e.tick.length:c+=e.tick.length,this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(o),o>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?s:o-1-s]),t=Math.max(e.getBBounds().width)})),l+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?o-1-s:s]),t=Math.max(e.getBBounds().height)})),c+=t}return{width:l,height:c}}_doLayout(){const t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)}$_layoutHorz(t,e,s){const i=this._line,r=t.tick,n=t._steps,a=e/(n.length-1),h=t.position===Bs.OPPOSITE,o=h?-r.length:r.length;let l=h?s-t.gap:t.gap,c=0;i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setHLineC(l,c,c+e)),this._tickContainer.setVisible(r.visible)&&this._ticks.forEach((t=>{t.setVLine(c,l,l+o),c+=a})),this._labelContainer.visible&&(l=h?0:l+o,c=0,this._labels.forEach(((t,e)=>{t.anchor=e<n.length-1?Yr.MIDDLE:Yr.END,t.translate(c,l),c+=a})))}$_layoutVert(t,e,s){const i=this._line,r=t.tick,n=t._steps,a=this.height/(n.length-1),h=t.position===Bs.OPPOSITE,o=h?r.length:-r.length;let l=0,c=h?t.gap:e-t.gap;if(i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setVLineC(c,l,l+s)),this._tickContainer.setVisible(r.visible)&&this._ticks.forEach(((t,e)=>{t.setHLine(l,c,c+o),l+=a})),this._labelContainer.visible){const s=h?Yr.START:Yr.END;c=h?c+o:e-t.gap+o,l=0,this._labels.forEach(((t,e)=>{t.anchor=s,t.layout=e<n.length-1?Wr.MIDDLE:Wr.BOTTOM,t.translate(c,l),l+=a}))}}}class Dn extends Mn{measureLabelSize(t,e,s){const i=t.label,r=this.labelView();return i.setText(t.getLabel(i,t.value)),r.text=i.text,i.buildSvg(r,e,s,t,this.valueOf),it(r.getBBounds())}_renderGauge(t,e){const s=this.model,i=c(this._runValue,s.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),t,e),this._renderValue()}_renderValue(){const t=this.model,e=t.label,s=t.scale,i=this.labelView(),r=c(this._runValue,t.value),n=Object.assign({},this._rBand);if(this._renderScale(n),n.height>0&&(this.background().setRect(n),this._renderBand(t,n,r),this._rLabel.height=n.height,this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&s.position===Bs.OPPOSITE)){const t=i.getBBounds();i.ty+t.height>this.height&&i.translateY(Math.max(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const h=this._rBand=rt.create(0,0,n,a);if(this._vertical=!t.group&&d(r,a>n),e.visible){const r=e._runPos=d(e.position,this._vertical?"top":"left"),o=e._runVert="top"===r||"bottom"===r,l=t.group?t.group.itemLabel.gap:e._runGap=e.getGap(o?a:n);let u=o?n:e.getWidth(n),_=o?e.getHeight(a):a;const g=o?n:e.getMaxWidth(n),p=o?e.getMaxHeight(a):a,m=this._rLabel=rt.create(0,0,n,a);e.setText(t.getLabel(e,e.animatable?i:t.value)),s.text=e.text,e.buildSvg(s,c(u,g),c(_,p),t,this.valueOf);const b=s.getBBounds();switch(o?(m.height=c(_,b.height),h.height=Math.max(0,h.height-(m.height+l))):(m.width=c(u,b.width),this._wLabel=t.group?t.group._labelWidth:m.width,h.width=Math.max(0,h.width-(this._wLabel+l))),r){case"top":h.y=m.height+l;break;case"bottom":m.y=h.height+l;break;case"right":m.x=h.width+l;break;default:h.x=this._wLabel+l}}else this._rLabel=null}_renderLabel(t,e,s,i){if(s.visible){const t=this._rLabel,i=s.getBBounds();let r=t.x,n=t.y;switch(e._runPos){case"top":case"bottom":r+=t.width/2;break;case"right":r=this.width-t.width,s.anchor=Yr.START,n+=Math.max(0,(t.height-i.height)/2);break;default:s.anchor=Yr.END,r+=this._wLabel,n+=Math.max(0,(t.height-i.height)/2)}s.translate(r,n)}}_renderScale(t){const e=this.model,s=e.label,i=e.scale,r=this.scaleView(),n=this._vertical?t.height:t.width;let a,h;if(i._vertical=this._vertical,i._reversed=e.reversed,isNaN(this._runValue)&&i.buildSteps(n,e.value),r.setVisible(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,h=t.y,t.width=Math.max(0,t.width-e.width),i.position===Bs.OPPOSITE?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=Math.max(0,t.height-e.height),i.position===Bs.OPPOSITE?s._runVert?(h=t.y,t.y+=e.height):(this._rLabel.y=t.y+=e.height,h=t.y-e.height):h=t.y+t.height),r.resizeByMeasured().layout().translate(a,h)}}}class Rn extends Mn{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?At.getFormatter(s||t.label.numberFormat).toStr(i):i}}}class Bn extends Cn{_defaultCalss(){return Bn.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new ut(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_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))}))}}Bn.GAUGE_GROUP_CLASS="rct-gauge-group";class In extends Nn{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new Ln(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length;return this._line.setVisible(e.line.visible)&&this._line.internalSetStyleOrClass(e.line.style),this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick.style),this._ticks.prepare(n)),this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.internalSetStyleOrClass(e.tickLabel.style),this._labels.prepare(n,(t=>{t.layout=Wr.MIDDLE}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e.gauge,i=e.position===Bs.OPPOSITE?-1:1,r=s.props,n=this._center.x,a=this._center.y,h=this._exts.scale,o=h+this.model.tick.length*i,l=r._sweepRad,c=s.maxValue-s.minValue;let u,d,_,g;if(this._line.visible&&this._line.setCircle(n,a,h),this._tickContainer.visible&&this._ticks.forEach(((t,e,s)=>{const i=e/s*l+r._startRad;u=n+Math.cos(i)*h,d=a+Math.sin(i)*h,_=n+Math.cos(i)*o,g=a+Math.sin(i)*o,t.setLine(u,d,_,g)})),this._labelContainer.visible){this._labels.get(0).text=String(s.maxValue);const t=o+.5*this._labels.get(0).getBBounds().height*i;this._labels.forEach(((e,s,i)=>{const h=s/i*l+r._startRad;_=n+Math.cos(h)*t,g=a+Math.sin(h)*t,e.text=String(s*c/i),e.translate(_,g)}))}}}let $n=class extends Kr{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new kr(this,En),this.add(this._labelContainer=new ut(t,"rct-circle-gauge-band-tick-labels")),this._labels=new kr(this._labelContainer,Xr)}setExtends(t,e){this._center=t,this._exts=e}_doLayout(t){const e=this.model,s=e.gauge,i=s.props,r=this._center.x,n=this._center.y,a=this._exts.band,h=s.clockwise,o=1-this._exts.bandThick/a,l=e.ranges,c=i._sweepRad,u=s.maxValue-s.minValue;let d=i._startRad;this._sectorViews.prepare(l.length).forEach(((t,e)=>{const s=(l[e].toValue-l[e].fromValue)*c/u;t.setSector({cx:r,cy:n,rx:a,ry:a,innerRadius:o,start:d,angle:s,clockwise:h}),t.setStyle("fill",l[e].color),d+=s}))}};class Fn extends gt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Lr).circle(0,0,s).end())),this.internalSetStyleOrClass(t.style),this}}class zn extends gt{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new Lr;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t.style),this}}class Gn extends Rn{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new En(t,"rct-circle-gauge-back")),e.add(this._valueView=new En(t,"rct-circle-gauge-value")),e.add(this._innerView=new En(t,"rct-circle-gauge-inner")),e.add(this._textView=new Xr(t,"rct-circle-gauge-label")),e.add(this._handContainer=new ut(t,void 0)),e.add(this._scaleView=new In(t)),e.add(this._bandView=new $n(t))}_prepareGauge(t,e){this._rimView.setVisible(e.rim.visible),this._scaleView.setVisible(e.scale.visible),this._bandView.setVisible(e.band.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new zn(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new Fn(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.labelVisible())&&this._textView.setStyleOrClass(e.label.style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(Math.min(t,e));this.$_renderBackground(s,i,r),this._renderValue()}_renderValue(){const t=this.model,e=t.getProps(),s=c(this._runValue,t.value),i=c((s-t.minValue)/(t.maxValue-t.minValue),0),r=this._center,n=this._exts,a=t.valueRim.getThickness(n.radiusThick),h=this._textView;if(this._valueView.visible){const h=t.valueRim,o=h.getRange(s),l=n.value+(h.stroked?0:a/2);this._valueView.setStyleOrClass(h.style),o&&this._valueView.setStyle(h.stroked?"stroke":"fill",o.color),t.valueRim.stroked&&(this._valueView.setStyle("fill","none"),this._valueView.setStyle("strokeWidth",A(a))),this._valueView.setBoolData("stroked",h.stroked),this._valueView.setSectorEx({cx:r.x,cy:r.y,rx:l,ry:l,innerRadius:(l-a)/l,start:e._startRad,angle:e._sweepRad*i,clockwise:t.clockwise},t.valueRim.stroked)}if(this._handView){const s=(e._handRad+e._sweepRad*i)*v;this._handView.render(t.hand,n.radius).translatep(r).rotate(t.clockwise?s:-s)}if(h.visible)if(t.label.setText(t.getLabel(t.label,t.label.animatable?s:t.value)),h.text=t.label.text,t.label.buildSvg(h,NaN,NaN,t,this.valueOf),h.setBoolData("grouped",!!t.group),t.group)this.$_layoutGroupedLabel(t,h,n);else{const e=h.getBBounds(),s=t.label.getOffset(this.width,this.height);h.translate(r.x+s.x,r.y-e.height/2+s.y)}}$_renderBackground(t,e,s){const i=t.getProps(),r=i._startRad;this._center=e,this._exts=s,this._rimView.setVisible(t.rim.visible)&&this._rimView.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:r,angle:i._sweepRad,clockwise:t.clockwise}),this._scaleView.visible&&(t.scale.buildSteps(s.scale*i._sweepRad,NaN),this._scaleView.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.measure(this.doc,t.band,this.width,this.height,0),this._bandView.setExtends(e,s),this._bandView.layout()),this._innerView.setStyleOrClass(t.innerStyle);let n=s.inner;const a=getComputedStyle(this._innerView.dom),h=parseFloat(a.strokeWidth);h>1&&(n-=h/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,n).translate(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBounds(),r=this._rimView.getBBounds(),n=+t.group.labelGap||0;e.anchor=Yr.END,e.translate(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class Hn extends zr{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class jn extends gt{constructor(t){super(t,cn.POINT_CLASS)}}class Yn extends ct{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.dom.style.transform=`translate(${e}px, ${e}px) rotate(-90deg) scale(1, -1)`:this.dom.style.transform=""),this.inverted}}class Wn extends cn{constructor(t,e){super(t,e),this._needBelow=!1,this.insertFirst(this._lineContainer=new Yn(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new gt(t,"rct-line-series-line")),this._markers=new kr(this._pointContainer,jn)}getClipContainer(){return null}_getPointPool(){return this._markers}_prepareSeries(t,e){e instanceof fi&&this._prepareBelow(e),this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.model,this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this._layoutLines(this._visPoints)}_runShowEffect(t){this._polar?t&&Jr.grow(this):t&&Jr.slide(this,{from:function(t){const e=t.model._xAxisObj.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines(this._visPoints.slice())}_markersPerPoint(){return 1}_prepareBelow(t){const e=this.control;let s=this._lowLine;if(this._needBelow=t.belowStyle&&t._minValue<t.baseValue,this._needBelow)return s||(this._lineContainer.insertChild(s=this._lowLine=new gt(this.doc),this._line),this._upperClip=e.clipBounds(),this._lowerClip=e.clipBounds()),this._line.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.setClip(),this._line.setClip()}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,e-s,e,t):n.setBounds(0,e-t,e,t-s):r?n.setBounds(0,0+s,t,e-s):n.setBounds(0,0,t,s)),(n=this._lowerClip)&&(this._inverted?r?n.setBounds(0,e-t,e,t-s):n.setBounds(0,e-s,e,t):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof fi&&this._needBelow,i=s?t.baseValue:NaN,r=t.marker,n=[r.style,null];if(this._pointContainer.visible=r.visible&&!t._simpleMode){const r=this._markersPerPoint(),a=e.length;this._markers.prepare(a*r,((r,h)=>{const o=e[h%a];o.isNull||(r.point=o,n[1]=s&&o.yValue<i?t.belowStyle:null,this._setPointStyle(r,t,o,n))}))}else this._markers.prepare(0)}_layoutMarker(t,e,s){const i=this.model,r=t.point,n=t._radius=i.getRadius(r);ot.setShape(t,i.getShape(r),n),t.translate(e-=n,s-=n)}_layoutMarkers(t,e,s){const i=this.model,r=this._inverted,n=this._polar=i.chart.body.getPolar(i),a=this._getViewRate(),h=i.marker.visible,o=i.pointLabel.offset,l=this._labelViews(),c=i._xAxisObj,u=i._yAxisObj,d=r?e:s,_=r?s:e,g=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];let i,p;if(n){const t=n.start+e*n.deg,r=u.getPosition(n.rd,s.yGroup)*a;i=s.xPos=n.cx+r*Math.cos(t),p=s.yPos=n.cy+r*Math.sin(t)}else i=s.xPos=c.getPosition(_,s.xValue),p=s.yPos=g-u.getPosition(d,s.yGroup),r&&(i=u.getPosition(d,s.yGroup),p=g-c.getPosition(_,s.xValue));const m=this._markers.get(e),b=l&&l.get(s,0);if(m&&m.setVisible(!s.isNull)){if(this._layoutMarker(m,i,p),b){const t=b.getBBounds();b.visible=!0,b.translate(i-t.width/2,p-t.height-o-(h?m._radius:0))}}else b&&(b.visible=!1)}}_layoutLines(t){const e=this.model,s=e instanceof fi&&this._needBelow,i=new Lr;let r,n=0;for(;n<t.length;){const e=t[n++];if(!e.isNull){i.move(e.xPos,e.yPos);break}}if(this._linePts=t,n<t.length-1&&(this._buildLines(t,n,i),this._line.setPath(r=i.end(this._polar)),this._line.clearStyleAndClass(),this._line.setStyle("stroke",e.color),this._line.addStyleOrClass(e.style),U.setImportantStyle(this._line.dom.style,"fill","none"),s)){const t=e._yAxisObj,s=e.baseValue;this._inverted?this.$_resetClips(this.width,this.height,t.getPosition(this.width,s),!0):this.$_resetClips(this.width,this.height,this.height-t.getPosition(this.height,s),!1),this._lowLine.setPath(r),this._lowLine.clearStyleAndClass(),this._lowLine.setStyle("stroke",e.color),this._lowLine.addStyleOrClass(e.style),this._lowLine.addStyleOrClass(e.belowStyle),U.setImportantStyle(this._lowLine.dom.style,"fill","none")}}_buildLines(t,e,s){const i=this.model,r=i.getLineType();r===Wt.SPLINE?this._drawCurve(t,e-1,s):i instanceof fi&&r===Wt.STEP?this._drawStep(t,e,s,i.stepDir):this._drawLine(t,e,s)}_drawLine(t,e,s){const i=t.length;let r=e;for(;r<i;)if(t[r].isNull){do{r++}while(r<i&&t[r].isNull);r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else s.line(t[r].xPos,t[r].yPos),r++}_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.$_drawCurve(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else r++;r-1>n&&this.$_drawCurve(t,n,r-1,s)}}$_drawCurve(t,e,s,i){let r=e;if(1===Math.abs(s-e))return void i.line(t[r+1].xPos,t[r+1].yPos);const n=.23,a={x:0,y:0},h={x:0,y:0},o={x:0,y:0},l={x:t[r+1].xPos-t[r].xPos,y:t[r+1].yPos-t[r].yPos},c={x:0,y:0},u={x:0,y:0},d={x:0,y:0};let _={x:0,y:0},g=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=g,l.y/=g;let p=t[r+1].xPos-t[r].xPos,m=t[r].xPos,b=t[r].yPos;for(++r;r!=s;r++){o.x=-l.x,o.y=-l.y,l.x=t[r+1].xPos-t[r].xPos,l.y=t[r+1].yPos-t[r].yPos,g=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=g,l.y/=g,l.x<o.x?(_.x=o.x-l.x,_.y=o.y-l.y):(_.x=l.x-o.x,_.y=l.y-o.y);const s=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=s,_.y/=s,o.y*l.y>=0&&(_={x:1,y:0}),a.x=-_.x*p*n,a.y=-_.y*p*n,r===e+1?i.quad(t[r].xPos+a.x,t[r].yPos+a.y,t[r].xPos,t[r].yPos):(c.x=m+h.x,c.y=b+h.y,u.x=t[r].xPos+a.x,u.y=t[r].yPos+a.y,d.x=(c.x+u.x)/2,d.y=(c.y+u.y)/2,i.quad(c.x,c.y,d.x,d.y),i.quad(u.x,u.y,t[r].xPos,t[r].yPos)),p=t[r+1].xPos-t[r].xPos,h.x=_.x*p*n,h.y=_.y*p*n,m=t[r].xPos,b=t[r].yPos}i.quad(m+h.x,b+h.y,t[r].xPos,t[r].yPos)}_drawStep(t,e,s,i){const r=t.length;let n=e;for(;n<r;)if(t[n].isNull){do{n++}while(n<r&&t[n].isNull);n<r&&(s.move(t[n].xPos,t[n].yPos),n++)}else i===Is.BACKWARD?(s.line(t[n-1].xPos,t[n].yPos),s.line(t[n].xPos,t[n].yPos)):(s.line(t[n].xPos,t[n-1].yPos),s.line(t[n].xPos,t[n].yPos)),n++}}class Un extends Wn{constructor(t){super(t,Un.CLASS)}}Un.CLASS="rct-line-series";class Xn extends Wn{constructor(t,e){super(t,e||"rct-area-series"),this._lineContainer.insertFirst(this._area=new gt(t,"rct-area-series-area"))}_layoutLines(t){super._layoutLines(t),this._polar?this._layoutPolar(this._area,t):this._layoutArea(this._area,t)}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._lineContainer.insertChild(e=this._lowArea=new gt(this.doc,"rct-area-series-area"),this._area),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model._yAxisObj,r=s;for(let e=0,n=t.length;e<n;e++){const n=t[e];n.yLow=r-i.getPosition(s,n.yGroup-n.yValue)}}_layoutArea(t,e){const s=this.model,i=this._needBelow?this._lowArea:void 0,r=s.group,n=s.chart.isInverted(),a=s._yAxisObj,h=n?this.width:this.height,o=a.axisMin(),l=s.getBaseValue(a),u=this.height-a.getPosition(h,c(Math.max(o,l),o)),d=new Lr;let _,g=0;for(;g<e.length&&e[g].isNull;)g++;if(!r||r.layout!==ke.STACK&&r.layout!==ke.FILL){d.move(e[g].xPos,u),d.line(e[g].xPos,e[g].yPos),this._buildLines(e,g+1,d);const t=d._path;for(g=6;g<t.length;)"M"===t[g]?(t.splice(g,0,"L",t[g-2],u),g+=3,t.splice(g,0,"M",t[g+1],u),t[g+3]="L",g+=6):"Q"===t[g]?g+=4:g+=3;d.line(t[t.length-2],u)}else{const t=g;for(d.move(e[g].xPos,e[g].yLow),d.line(e[g].xPos,e[g].yPos),g++;g<e.length;)d.line(e[g].xPos,e[g].yPos),g++;for(g=e.length-1,d.line(e[g].xPos,e[g].yLow);g>=t;)d.line(e[g].xPos,e[g].yLow),g--}t.setPath(_=d.end()),t.internalClearStyleAndClass(),s.color&&t.setStyle("fill",s.color),s.style&&t.internalSetStyleOrClass(s.style),i&&(i.setPath(_),i.internalClearStyleAndClass(),s.color&&i.setStyle("fill",s.color),s.belowStyle&&i.internalSetStyleOrClass(s.belowStyle))}_layoutPolar(t,e){const s=this.model,i=s.group,r=s._yAxisObj,n=r instanceof is?s.getBaseValue(r):NaN,a=this.height;r.getPosition(a,et.isNotEmpty(n)?n:r.axisMax());const h=new Lr;if(!i||i.layout!==ke.STACK&&i.layout!==ke.FILL){h.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);t.setPath(h.end())}else{h.move(e[0].xPos,e[0].yLow),h.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);h.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)h.line(e[t].xPos,e[t].yLow);t.setPath(h.end())}t.clearStyleAndClass(),t.setStyle("fill",s.color),t.addStyleOrClass(s.style)}}class qn extends En{constructor(t){super(t,cn.POINT_CLASS)}}class Zn extends Hr{constructor(t){super(t,cn.POINT_CLASS+" rct-boxplot-point")}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.minValue,r=e/2;const n=0+s-s*(t.lowValue-t.minValue)/i,a=0+s-s*(t.highValue-t.minValue)/i,h=s*(t.highValue-t.lowValue)/i;t.color&&this._box.setStyle("fill",t.color),this._stemUp.setVLine(r,0,a),this._stemDown.setVLine(r,n,s),this._min.setHLine(0,e/4,3*e/4),this._max.setHLine(0+s,e/4,3*e/4),this._box.setBox(0,a,e,h),this._mid.setHLine(0+s-s*(t.midValue-t.minValue)/i,0,e)}_doInitChildren(t){this.add(this._stemUp=new gi(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new gi(t,"rct-boxplot-point-stem")),this.add(this._box=new me(t,"rct-boxplot-point-box")),this.add(this._mid=new gi(t,"rct-boxplot-point-mid")),this.add(this._min=new gi(t,"rct-boxplot-point-min")),this.add(this._max=new gi(t,"rct-boxplot-point-max"))}}let Kn=class extends gt{constructor(t){super(t,cn.POINT_CLASS)}};let Qn=class extends Hr{constructor(t){super(t,cn.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue;const r=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,n=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i,a=Math.min(n,r),h=Math.max(1,Math.abs(r-n)),o=t.close<t.open;this._body.setStyle("fill",o?"":t.color),this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,s),this._body.setBox(-e/2,a,e,h),this._body.setClass(o?"rct-candlestick-point-fall":"")}_doInitChildren(t){this.add(this._wickUpper=new gi(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new gi(t,"rct-candlestick-point-wick")),this.add(this._body=new me(t))}};class Jn extends Hr{constructor(t){super(t,cn.POINT_CLASS),this.add(this._line=new gi(t)),this.add(this._hmarker=new gt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new gt(t,"rct-dumbbell-point-marker"))}layout(){const t=this.point,e=this.width,s=this.height,i=e/2;t.color&&(this._line.setStyle("stroke",t.color),this._hmarker.setStyle("fill",t.color),this._lmarker.setStyle("fill",t.color)),this._line.setVLineC(i,0,s),this._hmarker.renderShape(t.shape,i,0,t.radius),this._lmarker.renderShape(t.shape,i,s,t.radius)}}let ta=class extends Hr{constructor(t){super(t,cn.POINT_CLASS),this._backs=new kr(this,gt),this._segments=new kr(this,gt),this._decimal=0}prepareSegments(t,e,s,i,r){this._decimal=i,this._backs.prepare(t?e:0).forEach(((t,e)=>{t.setClass(r)})),this._segments.prepare(Math.round(s)).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._backs.forEach(((e,r)=>{e.setPath(ot.rectangle(0,s-t[2*r],i,n(-1,t[2*r]-t[2*r+1])))})),this._segments.forEach(((a,h,o)=>{h===o-1&&this._decimal>0?a.setPath(ot.rectangle(e,s-t[2*h],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(ot.rectangle(e,s-t[2*h],i,n(-1,t[2*h]-t[2*h+1])))}))}};let ea=class extends Hr{constructor(t){super(t,cn.POINT_CLASS),this.add(this._stem=new gi(t)),this.add(this._whiskerUp=new gi(t)),this.add(this._whiskerDown=new gi(t))}layout(){const t=this.width,e=this.height,s=t/2;this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t)}};class sa extends gt{constructor(t){super(t,cn.POINT_CLASS)}}class ia extends me{constructor(t){super(t,cn.POINT_CLASS)}}let ra=class extends un{layout(t,e){this.setPath(ot.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};let na=class extends Hr{constructor(t){super(t,cn.POINT_CLASS),this.add(this._line=new gi(t)),this.add(this._marker=new gt(t,"rct-lollipop-point-marker"))}layout(){this._line.setVLineC(0,0,this.height),this._marker.renderShape(this.point.shape,0,0,this.point.radius)}};class aa extends Hr{constructor(t){super(t,cn.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue,r=-e/2;const n=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,a=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i;this._back.setBox(r,0,e,s),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,this.width),this._bar.setVLine(0,0,0+s),this._bar.setClass(t.close<t.open?"rct-ohlc-point-bar-fall":"rct-ohlc-point-bar")}_doInitChildren(t){this.add(this._tickOpen=new gi(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new gi(t,"rct-ohlc-point-tick")),this.add(this._bar=new gi(t)),this.add(this._back=new me(t,"rct-ohlc-point-back")),U.setImportantStyle(this._back.dom.style,"fill","transparent")}}class ha extends En{constructor(t){super(t,cn.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class oa extends gt{constructor(t){super(t,cn.POINT_CLASS)}}class la extends gt{constructor(t){super(t,cn.POINT_CLASS)}get point(){return this.node.point}render(){this.setPath(ot.rect(this.node))}}class ca extends gt{constructor(t){super(t,cn.POINT_CLASS)}layout(t,e,s){const i=this.point._len,r=this.point._off,n=.5;let a;switch(t){case Qi.NONE:a=[0,-.5*i,0,n*i];break;case Qi.OPEN:const t=.15,e=.45,s=.2;a=[0,-e*i,-t*i,-s*i,0,-.5*i,t*i,-s*i,0,-e*i,0,n*i];break;default:const r=.1,h=.3;a=[0,-h*i,-r*i,-h*i,0,-.5*i,r*i,-h*i,0,-h*i,0,n*i]}const h=["M",a[0],a[1]+r];for(let t=2;t<a.length;t+=2)h.push("L",a[t],a[t+1]+r);this.rotation=e,this.setPath(h)}}class ua extends un{layout(t,e){this.setPath(ot.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}}class da extends Kr{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._barViews=new kr(this,me),this.add(this._labelContainer=new ut(t,"rct-linear-gauge-band-tick-labels")),this._labels=new kr(this._labelContainer,Xr)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof nr?n.isVertical():!n.vertical,h=e.position,o=this._thick=e.getThickness(a?s:i)+(h===Bs.INSIDE?0:this._gap=c(e.gap,0));let l=a?o:s,u=a?i:o;const d=this._ranges=e.ranges;if(this._labelContainer.setVisible(e.tickLabel.visible&&d.length>0)){const t=[d[0].fromValue].concat(d.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(d.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().width)})),l+=e}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().height)})),u+=e}}return{width:l,height:u}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVisible(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&e.position!==Bs.INSIDE)&&this.$_layoutLabels(s,r,this._ranges)}$_layoutBars(t,e,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&e>0){const t=this._vertical,i=this.model.position===Bs.OPPOSITE,r=this.width,n=this.height,a=t?n:r,h=this._thick;let o=0;return this._barViews.prepare(s.length).forEach(((r,l)=>{const c=s[l],u=a*(c.toValue-c.fromValue)/e;if(t)r.setBounds(0,n-o-u,h,u);else{const t=i?n-h:0;r.setBounds(o,t,u,this._thick)}r.setStyle("fill",c.color),o+=u})),!0}}$_layoutLabels(t,e,s){const i=this._vertical,r=this.model.position===Bs.OPPOSITE,n=this.width,a=this.height,h=i?a:n,o=r?0:this._thick;let l=this._labels.get(0);i?l.translate(o,0):l.translate(0,o);for(let t=1;t<=s.length;t++){const r=h*s[t-1].toValue/e,n=this._labels.get(t);i?n.translate(o,r):n.translate(r,o)}}}class _a extends Dn{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new me(t,"rct-linear-gauge-background")),e.add(this._bandView=new da(t)),e.add(this._scaleView=new On(t)),e.add(this._valueView=new me(t,"rct-linear-gauge-value")),e.add(this._labelView=new Xr(t))}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderScale(t){const e=this.model.band,s=this._bandView;if(super._renderScale(t),s.setVisible(e.visible)){const i=+e.gap||0,r=s.measure(this.doc,e,t.width,t.height,1);s.resizeByMeasured().layout(),this._vertical?e.position===Bs.INSIDE?s.translate(t.x,t.y):e.position===Bs.OPPOSITE?(s.translate(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.translate(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):e.position===Bs.INSIDE?s.translate(t.x,t.y):e.position===Bs.OPPOSITE?(s.translate(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.translate(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=t.reversed,r=t.group?t.group.scale:t.scale,n=r._max-r._min;if(this._valueView.setVisible(n>0&&!isNaN(t.value)))if(this._vertical){const t=e.height*(s-r._min)/n;i?e.y:(e.y,e.height),this._valueView.setBounds(e.x,e.y+e.height-t,e.width,t)}else{const t=e.width*(s-r._min)/n,a=i?e.x+e.width-t:e.x;this._valueView.setBounds(a,e.y,t,e.height)}}}class ga extends Bn{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new On(t)),e.insertFirst(this._textView=new Xr(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVisible(e.label.visible)&&this._textView.setStyleOrClass(e.label.style),this._scaleView.setVisible(e.scale.visible)&&this._scaleView.setStyleOrClass(e.scale.style),super._prepareGauge(t,e)}_doRenderGauges(t,e,s,i){const r=this.model,n=this._textView,a=rt.create(0,0,s,i);if(n.visible){n.text=r.label.text,r.label.buildSvg(n,NaN,NaN,r,null);const t=this._textView.getBBounds().height+r.label.getGap(i);a.y+=t,a.height-=t,n.translate(this.width/2,0)}r._labelWidth=r._labelHeight=0,this._gaugeViews.forEach(((t,e)=>{const n=t.measureLabelSize(r.get(e),s,i);r._labelWidth=Math.max(r._labelWidth,n.width),r._labelHeight=Math.max(r._labelHeight,n.height)}));const h=(o=a)&&Object.assign({},o);var o;const l=r.itemLabel.gap;r.vertical?(h.width-=r._labelWidth+l,r.itemLabel.opposite||(h.x+=r._labelWidth+l)):(h.height-=r._labelHeight+l,r.itemLabel.opposite||(h.x+=r._labelHeight+l)),this._renderScale(r,a,h),r.vertical?this.$_layoutVert(this.doc,r,e,a):this.$_layoutHorz(this.doc,r,e,a)}_renderScale(t,e,s){const i=this._scaleView,r=t.scale,n=t.vertical?e.width:e.height,a=[];let h,o;if(this._gaugeViews.forEach(((e,s)=>{a.push(c(e._runValue,t.get(s).value))})),r.buildGroupSteps(n,a),i.setVisible(r.visible)){if(t.vertical){const t=i.measure(this.doc,r,s.width,s.height,1);s.height-=t.height,e.height-=t.height,h=s.x,r.position===Bs.OPPOSITE?(o=s.y,s.y+=t.height,e.y+=t.height):o=s.y+s.height}i.resizeByMeasured().layout().translate(h,o)}}$_layoutHorz(t,e,s,i){i.height,i.width,s.count,i.y}$_layoutVert(t,e,s,i){const r=i.width,n=(i.height-e.itemGap*(s.count-1))/s.count,a=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(t,e.get(i),r,n,0),s.resize(r,n),s.layout(),s.translate(a,h),h+=n+e.itemGap}))}}class pa extends Dn{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new me(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new ut(t,void 0)),this._barViews=new kr(this._barContainer,me),e.add(this._valueView=new me(t,"rct-bullet-gauge-value")),e.add(this._targetView=new me(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new On(t)),e.add(this._labelView=new Xr(t))}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderBand(t,e,s){const i=t.group,r=t.reversed,n=this._vertical,a=i?i.scale:t.scale,h=a._max-a._min;if(this._barContainer.setVisible(h>0)){const s=t.getRanges(a._min,a._max)||(null==i?void 0:i.getRanges(a._min,a._max));if(s)if(this._barContainer.setRect(e),this._barViews.prepare(s.length),n){let t=r?0:e.height;this._barViews.forEach(((i,n)=>{const a=s[n],o=e.height*(a.toValue-a.fromValue)/h;i.setBounds(0,r?t:t-o,e.width,o),i.setStyle("fill",a.color),t+=r?o:-o}))}else{let t=r?e.width:0;this._barViews.forEach(((i,n)=>{const a=s[n],o=e.width*(a.toValue-a.fromValue)/h;i.setBounds(r?t-o:t,0,o,e.height),i.setStyle("fill",a.color),t+=r?-o:o}))}}if(this._valueView.setVisible(h>0&&!isNaN(t.value)))if(n){const i=e.height*(s-t.scale._min)/h,n=r?e.y:e.y+e.height-i;this._valueView.setBounds(e.x+e.width/3,n,e.width/3,i)}else{const i=e.width*(s-t.scale._min)/h,n=r?e.x+e.width-i:e.x;this._valueView.setBounds(n,e.y+e.height/3,i,e.height/3)}if(this._targetView.setVisible(h>0&&!isNaN(t.targetValue)))if(n&&e.width>10){let s=e.height*(t.targetValue-t.scale._min)/h;s=r?e.y+s:e.y+e.height-s,this._targetView.setBounds(e.x+5,s-1,e.width-10,3)}else if(!n&&e.height>10){let s=e.width*(t.targetValue-t.scale._min)/h;s=r?e.x+e.width-s:e.x+s,this._targetView.setBounds(s-1,e.y+5,3,e.height-10)}}}class ma extends ct{constructor(t,e,s){super(t,ma.STYLE),this.add(this._back=new me(t,ma.BACK_STYLE)),this.add(this._textView=new Xr(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 Zr).applyPadding(e),i=this._textView.getBBounds();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.translate(i.width/2+s.left,s.top)}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}ma.STYLE="rct-button",ma.BACK_STYLE="rct-button-background";const ba={area:Xn,arearange:class extends Wn{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Yn(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new gt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new gt(t,"rct-areanrange-series-line")),U.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}_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=this._inverted,n=i._yAxisObj,a=r?e:s,h=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=h-n.getPosition(a,s.lowValue)}if(i.marker.visible){const e=this._markers;for(let s=0,i=t.length;s<i;s++){const h=t[s],o=e.get(s+i);let l,c;h.isNull?o.visible=!1:(o.visible=!0,r?(l=n.getPosition(a,h.lowValue),c=e.get(s).ty):(l=h.xPos,c=h.yLow),this._layoutMarker(o,l,c))}}}_layoutLines(t){super._layoutLines(t);const e=t.map((t=>({xPos:t.xPos,yPos:t.yLow,isNull:t.isNull}))).slice().reverse(),s=new Lr;let i=0;for(;i<e.length&&e[i].isNull;)i++;s.move(e[i].xPos,e[i].yPos),this._buildLines(e,i+1,s),this._lowerLine.setPath(s.end(!1)),this._lowerLine.setStyle("stroke",this.model.color),this.$_layoutArea(this._area,this._linePts,e)}$_layoutArea(t,e,s){const i=new Lr;let r=0;for(;r<e.length&&e[r].isNull;)r++;const n=e.length;let a,h,o,l=r++;for(;r<n;)if(e[r].isNull){for(a=r,a>l&&(h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i));r<n&&e[r].isNull;)r++;l=r}else r++;r>l&&(a=r,h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i)),t.setPath(i.end())}},bar:class extends gn{constructor(t){super(t,"rct-bar-series"),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePointViews(t,e,s){e.chart.isPolar()?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints)}_layoutPointViews(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}$_parepareBars(t,e,s){this._bars||(this._bars=new kr(this._pointContainer,dn)),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 kr(this._pointContainer,qn)),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._getViewRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart.body,n=t._xAxisObj,a=t._yAxisObj,h=r.getPolar(t),o=i&&Object.assign(this._labelInfo,{labelPos:t.getLabelPosition(s.position),labelOff:t.getLabelOff(s.offset)});this._sectors.forEach(((s,r)=>{const l=s.point,c=a.getPosition(h.rd,l.yGroup)*e,u=n.getUnitLength(2*Math.PI,l.xValue),d=t.getPointWidth(u);if(s.setSector({cx:h.cx,cy:h.cy,rx:c,ry:c,start:h.start+r*h.deg,angle:d,clockwise:!0}),i&&(o.labelView=i.get(l,0))){const t=s.start+s.angle,e=s.cx+s.rx/2*Math.cos(t),i=s.cy+s.ry/2*Math.sin(t),r=o.labelView.getBBounds();o.labelView._text.anchor=Yr.MIDDLE,o.labelView.translate(e-r.width/2,i-r.height/2)}}))}},barrange:class extends pn{constructor(t){super(t,"rct-barrange-series"),this._bars=new kr(this._pointContainer,dn)}_getPointPool(){return this._bars}_preparePointViews(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}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i+n)}},bellcurve:class extends Xn{constructor(t){super(t,"rct-bellcurve-series")}},boxplot:class extends pn{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new kr(this._pointContainer,Zn)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePointViews(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},bubble:class extends cn{constructor(t){super(t,"rct-bubble-series"),this._markers=new kr(this._pointContainer,Kn)}_getPointPool(){return this._markers}invertable(){return!1}_prepareSeries(t,e){this.$_prepareMarkser(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Jr.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkser(t,e){const s=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,i=e.length;t.getPixelMinMax(s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];r.shape=t.shape,this._setPointStyle(s,t,r)}))}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=this._getViewRate();s.pointLabel.offset;const n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=i?t:e,l=i?e:t,c=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:u,max:d}=s.getPixelMinMax(c),_=e;let g,p;this._markers.forEach(((t,e)=>{const c=t.point;if(t.setVisible(!c.isNull&&!isNaN(c.zValue))){const e=(c.radius=s.getRadius(c.zValue,u,d))*r;let m,b,x;b=c.xPos=a.getPosition(l,c.xValue),x=c.yPos=_-h.getPosition(o,c.yValue),i&&(b=h.getPosition(o,c.yGroup),x=_-a.getPosition(l,c.xValue)),m=ot.circle(0,0,e),t.setPath(m),t.translate(b,x),n&&(g=n.get(c,0))&&(g.setContrast(t.dom),g.layout(),p=g.getBBounds(),g.setVisible(p.width<=c.radius)&&g.translate(b-p.width/2,x-p.height/2))}}))}},candlestick:class extends pn{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new kr(this._pointContainer,Qn)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}},dumbbell:class extends pn{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new kr(this._pointContainer,Jn)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},equalizer:class extends gn{constructor(t){super(t,"rct-equalizer-series"),this._bars=new kr(this._pointContainer,ta)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(e,s)}_layoutPointViews(t,e){const s=(this._inverted?t:e)*this._getViewRate();this.$_buildSegments(this.model,s),super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){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.backSegments,i=t._yAxisObj.axisMax(),r=t.segmented,n=t.segmentGap||0,a=this._pts=[];let h,o,l=0;for(o=t.maxCount>0?t.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),h=(e-n*(o-1))/o;a.length<2*o;)a.push(l,l+h),l+=h+n;a[a.length-1]=e;const c=a.length/2;this._bars.forEach((n=>{const o=n.point;if(n.setVisible(!o.isNull)){const l=o.yValue/i;let u=-1,d=0;for(let t=0;t<c-1;t++)if(l>=a[2*t]/e&&l<a[2*(t+1)]/e){u=t+1,d=!r&&l<a[2*t+1]/e?l*e-a[2*t]:h;break}u<0&&(u=c,d=h),n.prepareSegments(s,c,u,d,t.backStyle)}}))}},errorbar:class extends pn{constructor(t){super(t,"rct-errorbar-series"),this._bars=new kr(this._pointContainer,ea)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},funnel:class extends bn{constructor(t){super(t,"rct-funnel-series"),this._segments=new kr(this._pointContainer,sa),this.add(this._lineContainer=new on(t))}_getPointPool(){return this._segments}_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&&Jr.slide(this,{from:this.model.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVisible(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=t.length;let s=0,i=0;if(t.forEach((t=>{s+=t.yValue*(t===this._zombie?this._zombieRate:1)})),e>1||e>0&&!this._zombie){let r=0;for(;r<e-1;r++){const e=t[r],n=S(e.yValue*(e===this._zombie?this._zombieRate:1)/s)||0;e.yRate=100*n,e.yPos=i,e.height=n,i+=n}t[r].yPos=i,t[r].height=1-i}else if(1==e){const e=t[0],s=S(this._zombieRate);i=1-s,e.yRate=100*s,e.yPos=i,e.height=s,e.yPos=i,e.height=1-i}}$_layoutSegments(t,e){function s(t){return c?p+(w-p)*(b-t)/(b-y):p+(w-p)*(t-m)/(y-m)}const i=this.model,r=this._labelViews(),n=i.getLabelPosition()===ve.INSIDE,a=i.pointLabel,h=a.offset,o=r&&a.distance||0,l=this._lineContainer,c=i.reversed,u=i.getSize(t,e),d=i.getNeckSize(u.width,u.height),_=new Lr,g=i.getCenter(t,e),p=g.x-u.width/2,m=g.y-u.height/2,b=m+u.height,x=p+u.width/2,f=u.height-d.height,w=p+(u.width-d.width)/2,y=c?b-f:m+f;let V;this._lineContainer.setVisible(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVisible(!i.isNull)){const a=i.yPos*u.height,g=(i.yPos+i.height)*u.height,p=c?b-a:m+a,v=c?b-g:m+g;let P,S,k,A;if(a>=f?(P=w,S=P+d.width,_.move(P,p).lines(S,p,S,v,P,v),t.ny=t.nx1=NaN):g<f?(P=s(p),S=P+2*(x-P),k=s(v),A=k+2*(x-k),_.move(P,p).lines(S,p,A,v,k,v),t.ny=NaN,t.nx1=k-P,t.nx2=A-P):(P=s(p),S=P+2*(x-P),k=w,A=k+d.width,_.move(P,p).lines(S,p,A,y,A,v,k,v,k,y),t.ny=y-p,t.nx1=k-P,t.nx2=A-P),t.setPath(_.close(!0)),i.xPos=x,i.yPos=p+(v-p)/2,r&&(V=r.get(i,0))){const e=l.get(i);if(e.setVisible(!n)){const s=t.getBBounds();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):Math.abs(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/Math.abs(t.ny)),this.$_layoutLabel(V,s,e,h,o,r,n)}else this.$_layoutLabelInner(V,i.xPos,i.yPos);V.setContrast(n&&t.dom)}else null===(e=l.get(i))||void 0===e||e.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=t.getBBounds();n+=e.width/2,s.setLine((new Lr).move(0,0).line(r,0).end()),s.translate(n,a),n+=r+i,t.translate(n,a-h.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBounds();t.translate(e-i.width/2,s-i.height/2)}},heatmap:class extends cn{constructor(t){super(t,"rct-heatmap-series"),this._cells=new kr(this._pointContainer,ia)}_getPointPool(){return this._cells}_prepareSeries(t,e){this.$_parepareCells(e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)}_runShowEffect(t){t&&Jr.slide(this)}$_parepareCells(t,e){this._cells.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutCells(t,e){const s=this.model,i=s.chart.isInverted();s.pointLabel.offset;const r=this._labelViews(),n=s._xAxisObj,a=s._yAxisObj,h=i?t:e,o=i?e:t,l=new jr(this._getColor());this._cells.forEach((t=>{const c=t.point;if(t.setVisible(!c.isNull)){const u=n.getUnitLength(o,c.xValue),d=u,_=a.getUnitLength(h,c.yValue),g=_,p=i?0:e;let m,b,x;if(m=(c.xPos=n.getPosition(o,c.xValue))-u/2,b=(c.yPos=p-a.getPosition(h,c.yValue))-_/2,t.setBounds(m,b,d,g),t.setStyle("fill",l.brighten(1-c.heatValue/s._heatMax).toString()),r&&(x=r.get(c,0))){const t=x.getBBounds();i?(b=o-n.getPosition(o,c.xValue),m=p,b-=t.height/2,m+=a.getPosition(h,c.yValue)-t.width/2):(m+=(d-t.width)/2,b+=(g-t.height)/2),x.translate(m,b)}}}))}},histogram:class extends _n{constructor(t){super(t,"rct-histogram-series"),this._bars=new kr(this._pointContainer,ra)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=i?t:e,c=i?e:t,u=o.getPosition(l,s.getBaseValue(o)),d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const s=t.point,n=h.getPosition(c,s.min),g=h.getPosition(c,s.max),p=o.getPosition(l,s.yValue),m=g-n+(g>n?-1:1),b=p-u;let x=n+(g-n)/2,f=d;s.xPos=x,s.yPos=f-=p,this._layoutPointView(t,e,x,f+b,m,b*r),_&&(_.labelView=a.get(s,0))&&(i&&(f=c-x,x=d,s.yPos=f,s.xPos=x+=o.getPosition(l,s.yGroup)),_.pointView=t,_.x=x,_.y=f,_.wPoint=m,_.hPoint=b,this._layoutLabel(_))}))}$_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._getViewRate();this._bars.forEach(((a,h)=>{const o=a.point,l=s.getPosition(t,o.min),c=s.getPosition(t,o.max),u=l+(c-l)/2,d=i.getPosition(e,a.point.yValue)*n,_=Math.max(1,c-l-1);o.xPos=u,o.yPos=r-d,a.wPoint=_,a.hPoint=d,a.layout(u,r)}))}},line:Un,lollipop:class extends gn{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i-n,0,n),t.layout()}$_parepareBars(t,e,s){this._bars||(this._bars=new kr(this._pointContainer,na)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}},ohlc:class extends pn{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new kr(this._pointContainer,aa)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this.$_prepareSticks(e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutSticks(t,e){const s=this.model;this._inverted;const i=this._getViewRate(),r=s.pointLabel.offset,n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=this.height;this._sticks.forEach(((l,c)=>{const u=l.point;if(l.setVisible(!u.isNull)){const c=a.getUnitLength(t,u.xValue),d=s.getPointWidth(c),_=(u.xPos=a.getPosition(t,u.xValue))-d/2,g=u.yPos=o-h.getPosition(e,u.yValue)*i,p=d,m=Math.abs(o-h.getPosition(e,u.lowValue)-g)*i;let b;if(l.setBounds(_,g,p,m),l.layout(),n&&(b=n.get(u,0))){const t=b.getBBounds();b.translate(_+(p-t.width)/2,g-t.height-r)}}}))}},pareto:class extends Wn{constructor(t){super(t,"rct-pareto-series")}},pie:class extends bn{constructor(t){super(t,"rct-pie-series"),this._sectors=new kr(this._pointContainer,ha,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new Ln(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new qr(t,"rct-pie-series-inner")),this._textView.anchor=Yr.MIDDLE,this.add(this._lineContainer=new on(t))}_getPointPool(){return this._sectors}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVisible(e.hasInner()&&e.innerText.isVisible())&&(this._textView.setModel(t,e.innerText,null),e.innerText.buildSvg(this._textView._text,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rd=this.model.getRadius(t,e),this._rdInner=this.model.getInnerRadius(this._rd)}$_calcGroup(t,e){const s=this.model,i=s.group,r=Math.floor(i?i.getPolarSize(t,e)/2:s.getRadius(t,e)),n=i?i.getInnerRadius(r)*r:s.getInnerRadius(r),a=r-n;this._rd=n+(s._groupPos+s._groupSize)*a,this._rdInner=(n+s._groupPos*a)/this._rd}_runShowEffect(t){t&&Jr.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.translate(0,0),this.$_slice(e,!0,!1))}))}_doPointClicked(t){if(t instanceof ha){const e=this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0),!this.model.autoSlice&&this.control.invalidateLayout()}}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_resizeZombie(){this._renderSeries(this.width,this.height)}$_prepareSectors(t,e,s){this._sectors.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=t.length,s=this.model.clockwise?1:-1,i=t.filter((t=>(t.visible||t===this._zombie)&&!t.isNull)).map((t=>t===this._zombie?t.yValue*this._zombieRate:t.yValue)).reduce(((t,e)=>t+e),0),r=this.model._totalRad*this._getViewRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=S(t===this._zombie?t.yValue*this._zombieRate:t.yValue)/i||0,t.startAngle=n,n+=t.angle=s*t.yRate*r)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r}}$_layoutSectors(t,e,s){const i=this.model,r=i.clockwise,n=this._getViewRate(),a=i.getCenter(e,s),h=this._cx=a.x,o=this._cy=a.y,l=this._rd,c=this._rdInner,u=i.pointLabel,d=this._labelViews(),_=i.getLabelPosition()===ve.INSIDE,g=u.offset,p=u.distance||0,m=this._lineContainer,b=this._slicedOff=i.getSliceOffset(l)*n;let x;if(this._textView.visible){const t=this._textView.getBBounds();this._textView.translate(h,o-t.height/2)}(this._circle.visible=this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{var e,s;const a=t.point;if(a.isNull)t.setVisible(!1),d&&(x=d.get(a,0))&&x.setVisible(!1),null===(s=m.get(a))||void 0===s||s.setVisible(!1);else{const s=a.startAngle;let u=0,f=0;if(a.sliced&&n>=1&&!t.isDomAnimating()){const t=s+a.angle/2;u+=Math.cos(t)*b,f+=Math.sin(t)*b}t.translate(u,f).setVisible(!0);const w=a.startAngle+a.angle/2;if(a.xPos=h+Math.cos(w)*(b+.7*l),a.yPos=o+Math.sin(w)*(b+.7*l),t.setPieSector(d,null,{cx:h,cy:o,rx:l,ry:l,innerRadius:c,start:s,angle:Math.abs(a.angle),clockwise:i.clockwise}),d&&(x=d.get(a,0))){const e=m.get(a);e.setVisible(!_)?this.$_layoutLabel(a,x,e,g,p,a.sliced?b:0,r):(e.visible=!1,this.$_layoutLabelInner(a,x,g,0,a.sliced?b:0)),x.setContrast(_&&t.dom).setVisible(!0)}else null===(e=m.get(a))||void 0===e||e.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=e.getBBounds(),o=t.startAngle+t.angle/2;let l=this._cx,c=this._cy,u=this._rd+.8*r,d=Math.cos(o)*n,_=Math.sin(o)*n,g=l+Math.cos(o)*this._rd,p=c+Math.sin(o)*this._rd,m=l+Math.cos(o)*u,b=c+Math.sin(o)*u;const x=m<l;let f;f=x?m-.2*r:m+.2*r,s&&s.setVisible(u>0)&&(s.setLine((new Lr).move(0,0).quad(m-g,b-p,f-g,b-p).end()),s.move(g,p),!e.isDomAnimating()&&s.translate(g+d,p+_)),x?(f-=h.width+i,b-=h.height/2):(f+=i,b-=h.height/2),e.move(f,b),!e.isDomAnimating()&&e.layout().translate(f+d,b+_)}$_layoutLabelInner(t,e,s,i,r){const n=e.getBBounds(),a=this._rdInner*this._rd,h=a>0?a+(this._rd-a)/2:.7*this._rd,o=t.startAngle+t.angle/2;let l=this._cx+Math.cos(o)*h,c=this._cy+Math.sin(o)*h;e.move(l-n.width/2,c-n.height/2),l=this._cx+Math.cos(o)*(r+h),c=this._cy+Math.sin(o)*(r+h),e.layout().translate(l-n.width/2,c-n.height/2)}$_slice(t,e,s){const i=this.model,r=i.autoSlice?i.sliceDuration:0,n=t.point,a=n.startAngle+n.angle/2,h=this._labelViews(),o=i.pointLabel,l=this._lineContainer,c=i.getLabelPosition()===ve.INSIDE;(n.sliced=e)?t.translateEx(Math.cos(a)*this._slicedOff,Math.sin(a)*this._slicedOff,r):t.translateEx(0,0,r);const u=h.get(n,0);if(u){const t=!c&&l.get(n);if(s&&(c?this.$_layoutLabelInner(n,u,o.offset,o.distance,this._slicedOff):this.$_layoutLabel(n,u,t,o.offset,o.distance,this._slicedOff,i.clockwise)),e){let e=u.tx,s=u.ty;u.translate(u.x,u.y),u.translateEx(e,s,r),t&&(e=t.tx,s=t.ty,t.translate(t.x,t.y),t.translateEx(e,s,r))}else u.translate(u.tx,u.ty),u.translateEx(u.x,u.y,r),t&&(t.translate(t.tx,t.ty),t.translateEx(t.x,t.y,r))}}},scatter:class extends cn{constructor(t){super(t,"rct-scatter-series"),this._markers=new kr(this._pointContainer,oa)}_getPointPool(){return this._markers}invertable(){return!1}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Jr.slide(this)}$_prepareMarkers(t,e){const s=t.color,i=e.length;this._pointContainer.setStyle("fill",s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(t,e){const s=this.model,i=this._inverted;s.pointLabel.offset;const r=this._labelViews(),n=s._xAxisObj,a=s._yAxisObj,h=i?t:e,o=i?e:t,l=e;let c,u;this._markers.forEach(((t,e)=>{const d=t.point;if(t.setVisible(!d.isNull)){const e=s.shape,_=s.radius;let g,p,m;switch(p=d.xPos=n.getPosition(o,d.xValue),m=d.yPos=l-a.getPosition(h,d.yValue),i&&(p=a.getPosition(h,d.yGroup),m=l-n.getPosition(o,d.xValue)),e){case"square":case"diamond":case"triangle":case"itriangle":g=ot[e](0-_,0-_,2*_,2*_);break;default:g=ot.circle(0,0,_)}t.setPath(g),t.translate(p,m),r&&(c=r.get(d,0))&&(u=c.getBBounds(),c.translate(p-u.width/2,m-u.height/2))}}))}},treemap:class extends cn{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new kr(this._pointContainer,la)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){const s=this.model;s.pointLabel;const i=this._labelViews(),r=s.buildMap(t,e),n=new jr(s._calcedColor);let a;i.prepare(this.doc,this),this._nodeViews.prepare(r.length,((t,e,s)=>{const h=r[e],o=h.parent;let l=n;if(o&&(!o._color&&o.point.color?l=o._color=new jr(o.point.color):o._color&&(l=o._color)),t.node=h,t.setStyle("fill",l.brighten(h.index/s).toString()),t.render(),h.point.xPos=h.x+h.width/2,h.point.yPos=h.y+h.height/2,i&&(a=i.get(h.point,0))){const t=a.getBBounds();a.setVisible(h.width>=t.height&&h.height>=t.height)&&a.translate(h.x+h.width/2-t.width/2,h.y+h.height/2-t.height/2)}}))}_runShowEffect(t){t&&new en(this)}},vector:class extends cn{constructor(t){super(t,"rct-vector-series"),this._arrows=new kr(this._pointContainer,ca)}_getPointPool(){return this._arrows}_prepareSeries(t,e){this.$_prepareArrows(e,this._visPoints)}_renderSeries(t,e){const s=this.model,i=s.startAngle,r=s.arrowHead,n=s._xAxisObj,a=s._yAxisObj;this._arrows.forEach((t=>{const e=t.point;if(t.setVisible(!e.isNull)){const s=e.xPos=n.getPosition(this.width,e.xValue),h=e.yPos=this.height-a.getPosition(this.height,e.yValue);t.translate(s,h),t.layout(r,e.angleValue+i,!1)}}))}_runShowEffect(t){t&&Jr.fadeIn(this)}$_prepareArrows(t,e){this._arrows.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}},waterfall:class extends pn{constructor(t){super(t,"rct-waterfall-series"),this._bars=new kr(this._pointContainer,ua),this.add(this._lineContainer=new ut(t,"rct-waterfall-series-lines")),this._lines=new kr(this._lineContainer,gi)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){const a=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i),e>0){const t=this._lines.get(e-1),h=a._isSum?i-n:a.y>=0?i:i-n;t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPointViews(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPointViews(t,e)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r),t.setStyleOrClass(r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"")})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}},xa={circle:Gn,linear:_a,bullet:pa,clock:class extends Cn{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new Ln(t,"rct-clock-gauge-face")),e.add(this._rimView=new En(t,"rct-clock-gauge-rim")),e.add(this._labelView=new Xr(t,"rct-clock-gauge-label")),this._labelView.layout=Wr.MIDDLE,e.add(this._tickContainer=new ut(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new ut(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new gt(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new gt(t,"rct-clock-gauge-minute")),e.add(this._secondView=new gt(t,"rct-clock-gauge-second")),e.add(this._pinView=new Ln(t,"rct-clock-gauge-pin")),this._tickViews=new kr(this._tickContainer,gi,"rct-clock-gauge-tick"),this._minorTickViews=new kr(this._tickContainer,gi,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new kr(this._tickLabelContainer,Xr,"rct-clock-gauge-tick-label")}_prepareGauge(t,e){this._tickViews.prepare(e.tick.visible?12:0),this._minorTickViews.prepare(e.minorTick.visible?48:0);const s=Math.round(12/Math.max(1,Math.floor(e.tickLabel.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Wr.MIDDLE}))}_renderGauge(t,e){const s=this.model,i=this._exts=s.getExtendts(t,e);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const t=this._prevSec;this.$_renderHands(this.model,this._exts),Math.abs(t-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.animatable&&this.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,{cx:i,cy:r,rd:n}=e,a=this._rimThick=this._rimView.visible?this.model.rim.getThickness(n):0;this._faceView.setCircle(i,r,n),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim.style),this._rimView.setSector({cx:i,cy:r,rx:n,ry:n,innerRadius:1-a/n,start:0,angle:2*Math.PI,clockwise:!0}));const h=n-a;let o=h-this.model.tick.length,l=y,c=w/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c})),!this._minorTickViews.isEmpty){let t=0;o=h-this.model.minorTick.length,l=y,c=w/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=c,t++),e.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=w/12*t;l=y,this._tickLabelViews.get(0).text="12",o=h-(this.model.tick.length+this.model.tickLabel.offset||0),o-=.5*this._tickLabelViews.get(0).getBBounds().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.translate(i+Math.cos(l)*o,r+Math.sin(l)*o),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVisible(t.label.visible)&&(s.internalSetStyleOrClass(t.label.style),t.label.buildSvg(s,NaN,NaN,null,null),"bottom"===t.label.position?s.translate(i,r+o/2):s.translate(i,r-o/2))}$_getNow(){const t=this.model.timezone;let e=this.model.getTime()||new Date;if(!isNaN(t)){const s=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(s)}return e}$_renderHands(t,e){const s=this.$_getNow(),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),{cx:a,cy:h,rd:o}=e,l=new Lr;let c,u,d,_;c=t.hourHand,u=this._hourView,u.setVisible(c.visible)&&(_=w*(i/12+r/60/12+n/60/60/12),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*v)),c=t.minuteHand,u=this._minuteView,u.setVisible(c.visible)&&(_=w*(r/60+n/60/60),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*v)),c=t.secondHand,u=this._secondView,u.setVisible(c.visible)&&(_=this._secRate<1?w*(this._aniSec+this._secRate)/60:w*n/60,d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*v),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new Hn(this);e.duration=this.model.secondHand.duration||200,e.start()}}},circlegroup:class extends Bn{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new kr(t,Gn)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.getCenter(s,i),h=n.getExtents(Math.min(s,i));n.setChildExtents(h),s=i=2*h.radius,e.forEach(((t,e)=>{t.measure(r,n.getVisible(e),s,i,0),t.resize(s,i),t.layout()})),t.translate(a.x-h.radius,a.y-h.radius)}},lineargroup:class extends ga{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new da(t),this._scaleView)}_createPool(t){return new kr(t,_a)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVisible(r.visible)){const h=+r.gap||0;if(t.vertical){const t=i.measure(this.doc,r,s.width,s.height,1).height+h;s.height-=t,e.height-=t,n=s.x,r.position===Bs.OPPOSITE?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+h}i.resizeByMeasured().layout().translate(n,a)}}},bulletgroup:class extends ga{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new kr(t,pa)}}};class fa extends Kr{constructor(t){super(t,"rct-axis-grid"),this._lines=new kr(this,gi)}_doMeasure(t,e,s,i,r){return this._pts=e.getPoints(e.axis._isHorz?s:i),this._lines.prepare(this._pts.length,(t=>{t.setClass("rct-axis-grid-line")})),Gr.create(s,i)}_doLayout(){const t=this.model,e=t.axis,s=this.width,i=this.height,r=this._pts,n=this._lines,a=n.count-1;n.forEach(((t,n)=>{t.setBoolData("first",0===n),t.setBoolData("last",r[n]===(e._isHorz?s:i))})),e._isHorz?n.forEach(((e,s)=>{e.setVisible((0!==s||t.startVisible)&&(s!==a||t.endVisible))&&e.setVLineC(r[s],0,i)})):n.forEach(((e,n)=>{e.setVisible((0!==n||t.startVisible)&&(n!==a||t.endVisible))&&e.setHLineC(i-r[n],0,s)}))}}class wa extends ct{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new gt(t)),this._mask.setStyle("stroke","none"),this.add(this._upLine=new gt(t)),this._upLine.setStyle("fill","none"),this.add(this._downLine=new gt(t)),this._downLine.setStyle("fill","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 Lr;if(s){let t=0,s=0,n=i/2,a=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(a,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s);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(a,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,a=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,a);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,a);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,a);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,a);this._mask.setPath(r.end())}}}class ya extends ct{constructor(t){super(t,"rct-axis-guide"),this.add(this._label=new Xr(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t){this.model=t,this._label.text=t.label.text,this._label.setStyles(t.label.style)}}class Va extends ya{constructor(t){super(t),this.insertFirst(this._line=new gi(t,"rct-axis-guide-line"))}prepare(t){super.prepare(t),this._line.setStyles(t.style)}layout(t,e){const s=this.model,i=s.label,r=this._label;let n,a,h,o;if(this.vertical()){const r=s.axis.getPosition(t,s.value,!0);switch(this._line.setVLineC(r,0,e),i.align){case $.CENTER:n=r,h=Yr.MIDDLE;break;case $.RIGHT:n=r,h=Yr.START;break;default:n=r,h=Yr.END}switch(i.verticalAlign){case F.BOTTOM:a=e,o=Wr.BOTTOM;break;case F.MIDDLE:a=e/2,o=Wr.MIDDLE;break;default:a=0,o=Wr.TOP}}else{const l=e-s.axis.getPosition(e,s.value,!0);switch(this._line.setHLineC(l,0,t),i.align){case $.CENTER:n=t/2,h=Yr.MIDDLE;break;case $.RIGHT:n=t,h=Yr.END;break;default:n=0,h=Yr.START}switch(i.verticalAlign){case F.BOTTOM:a=l+1,o=Wr.TOP;break;case F.MIDDLE:a=l,o=Wr.MIDDLE;break;default:a=l-r.getBBounds().height,o=Wr.TOP}}r.anchor=h,r.layout=o,r.translate(n,a)}}class va extends ya{constructor(t){super(t),this.insertFirst(this._box=new be(t,"rct-axis-guide-range"))}prepare(t){super.prepare(t)}layout(t,e){const s=this.model,i=this._label;if(this.vertical()){const r=s.axis.getPosition(t,s.start,!0),n=s.axis.getPosition(t,s.end,!0);let a,h,o,l;switch(s.label.align){case $.CENTER:a+=(n-r)/2,o=Yr.MIDDLE;break;case $.RIGHT:a=n,o=Yr.END;break;default:a=r,o=Yr.START}switch(s.label.verticalAlign){case F.BOTTOM:h=e,l=Wr.BOTTOM;break;case F.MIDDLE:h=e/2,l=Wr.MIDDLE;break;default:h=0,l=Wr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(r,0,n,e)}else{const r=e-this.model.axis.getPosition(e,Math.min(s.start,s.end),!0),n=e-this.model.axis.getPosition(e,Math.max(s.start,s.end),!0);let a,h,o,l;switch(s.label.align){case $.CENTER:a=t/2,o=Yr.MIDDLE;break;case $.RIGHT:a=t,o=Yr.END;break;default:a=0,o=Yr.START}switch(s.label.verticalAlign){case F.BOTTOM:h=r,l=Wr.BOTTOM;break;case F.MIDDLE:h=n+(r-n)/2,l=Wr.MIDDLE;break;default:h=n,l=Wr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(0,n,t,r)}}}class Pa extends ut{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(let e=t.length-1;e>=0;e--){const e=t.pop();e.remove(),e instanceof va?this._rangePool.push(e):this._linePool.push(e)}R(0===t.length,"GuideContainer.prepare")}addAll(t,e){e.forEach((e=>{if(e instanceof ne){let s=this._rangePool.pop()||new va(t);this.add(s),s.prepare(e),this._views.push(s)}else if(e instanceof re){let s=this._linePool.pop()||new Va(t);this.add(s),s.prepare(e),this._views.push(s)}}))}add(t){return this._views.push(t),super.add(t)}}class Sa extends gt{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,a=n._isHorz,h=new Lr;if(this._bar){const o=n._isHorz?i:r;let l=-1;if(t?l=t.point.xValue:this._model.showAlways&&(l=n.reversed?n.categoryAt(a?i-e:s):n.categoryAt(a?e:r-s)),l>=0){const t=n.getPosition(o,l),e=n.getUnitLength(o,l);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,i,e)}}else(t||this._model.showAlways)&&(a?h.vline(e,0,r):h.hline(s,0,i));this.setPath(h.end())}}class ka extends ma{constructor(t){super(t,"Reset Zoom","rc-reset-zoom"),this.visible=!1}}class Aa extends Kr{constructor(t,e){super(t,Aa.BODY_CLASS),this._gridViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._focused=null,this._owner=e,this.add(this._hitTester=new me(t)),this._hitTester.setStyle("fill","transparent"),this.add(this._background=new me(t,"rct-body-background")),this.add(this._image=new An(t,"rct-body-image")),this.add(this._gridContainer=new ut(t,"rct-grids")),this.add(this._guideContainer=new Pa(t,"rct-guides")),this.add(this._seriesContainer=new ut(t,"rct-series-container")),this.add(this._axisBreakContainer=new ut(t,"rct-axis-breaks")),this.add(this._frontGuideContainer=new Pa(t,"rct-front-guides")),this.add(this._feedbackContainer=new ut(t,"rct-feedbacks")),this.add(this._zoomButton=new ka(t)),this._crosshairLines=new kr(this._feedbackContainer,Sa)}prepareSeries(t,e){this._animatable=lt._animatable&&e.animatable(),this.$_prepareSeries(t,e,e._getSeries().visibleSeries()),this.$_prepareGauges(t,e,e._getGauges().visibles())}prepareGuideContainers(){this._guideContainer.prepare(),this._frontGuideContainer.prepare()}pointerMoved(t,e){const s=this.width,i=this.height,r=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let n,a;if(e instanceof SVGElement&&(e.classList.contains(cn.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(cn.POINT_CLASS)))for(let t=this._seriesViews.length-1;t>=0;t--)if(a=this._seriesViews[t].pointByDom(e),a){n=this._seriesViews[t];break}return this._zoomRequested||this._crosshairLines.forEach((e=>{e.setVisible(r)&&e.layout(a,t.x,t.y,s,i)})),a?this.$_setFocused(n.model,a):this.$_setFocused(null,null),r}$_setFocused(t,e){if(e!=this._focused)return this._focused&&this._focused.unsetData(cn.DATA_FOUCS),this._focused=e,this._focused?(this._focused.setData(cn.DATA_FOUCS),this._owner.showTooltip(t,e.point)):this._owner.hideTooltip(),!0}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesViews.find((e=>e.model===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().xAxis,n=r.getValueAt(this.width,t),a=r.getValueAt(this.width,s);r.zoom(n,a)&&(this._zoomRequested=!0)}_doMeasure(t,e,s,i,r){const n=e.chart;if(this._polar=n.isPolar(),this._zoomRequested=!1,this._background.setStyleOrClass(e.style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._seriesViews.forEach(((e,n)=>{e.measure(t,this._series[n],s,i,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,s,i,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,n)=>{e.measure(t,this._gauges[n],s,i,r)})),this._zoomButton.setVisible(e.isZoomed())&&this._zoomButton.layout(),Gr.create(s,i)}_doLayout(){const t=this.width,e=this.height,s=this._image;if(this._hitTester.resize(t,e),this._background.resize(t,e),s.setVisible(s.setImage(this.model.image.url,t,e))&&s.setStyleOrClass(this.model.image.style),this._seriesViews.forEach((s=>{this._owner.clipSeries(s.getClipContainer(),0,0,t,e,s.invertable()),s.resize(t,e),s.layout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.reversed?s.translate(t-i._sect.pos,0):s.translate(i._sect.pos,0):r.reversed?s.translate(0,i._sect.pos):s.translate(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)})),[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.layout(t,e)))}))}this.$_preppareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().translatep(s.getPosition(t,e))})),this._zoomButton.visible&&this._zoomButton.translate(t-this._zoomButton.getBBounds().width-10,10)}$_createSeriesView(t,e){return new(ba[e._type()])(t)}$_createGaugeView(t,e){return new(xa[e._type()])(t)}$_prepareGrids(t,e){const s=e.needAxes(),i=this._gridContainer,r=this._gridViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.isVisible()||(r.get(t).remove(),r.delete(t));[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{if(s&&e.grid.isVisible()&&!r.has(e)){const s=new fa(t);r.set(e,s),i.add(s)}}))))}$_prepareSeries(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._seriesMap,a=this._seriesViews;for(const t of n.keys())s.indexOf(t)<0&&n.delete(t);this._series=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((e=>{const s=n.get(e)||this.$_createSeriesView(t,e);s._setChartOptions(r,this._animatable),i.add(s),n.set(e,s),a.push(s),s.prepareSeries(t,e)}))}$_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,a=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&n.delete(t);this._gauges=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((e=>{const s=n.get(e)||this.$_createGaugeView(t,e);s._setChartOptions(r,this._animatable),i.add(s),n.set(e,s),a.push(s),s.prepareGauge(t,e)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof is&&r.push(...t.runBreaks()||[])}))));i.length<r.length;){const e=new wa(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_preppareCrosshairs(t){const e=this._crosshairLines,s=[];[t._getXAxes(),t._getYAxes()].forEach((t=>t.forEach((t=>{t.crosshair.visible&&s.push(t.crosshair)})))),e.prepare(s.length,((t,e)=>{t.setModel(s[e])}))}}Aa.BODY_CLASS="rct-body";class La extends ut{constructor(t){super(t,La.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVisible(!1)}setHistory(t,e){if(this.setVisible(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Xr(t,"rct-history-item");e.anchor=Yr.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Xr(t);e.anchor=Yr.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let a=0;a<r;a++)e[a].text=t[a].name,e[a].translateX(n),a<r-1&&(n+=e[a].width+i,s[a].translateX(n),n+=s[a].width+i)}}La.TITLE_CLASS="rct-history";class Ea extends Kr{constructor(t){super(t,"rct-legend-item"),this.add(this._label=new Xr(t,"rct-legend-item-label")),this._label.anchor=Yr.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){U.setData(this._label.dom,"hidden",e.source.visible?"":1),U.setData(this._marker.dom,"hidden",e.source.visible?"":1),this._label.text=e.text();const n=this._marker.getBBounds(),a=it(this._label.getBBounds());return this._gap=c(e.legend.markerGap,0),Gr.create(n.width+this._gap+a.width,Math.max(n.height,a.height))}_doLayout(){const t=this._marker.getBBounds();this._marker.translate(0,(this.height-t.height)/2),this._label.translate(t.width+this._gap,(this.height-this._label.getBBounds().height)/2)}}class Ca extends Qr{constructor(t){super(t,Ca.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new kr(this,Ea)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyles)}_doMeasure(t,e,s,i,r){const n=e.items(),a=this._vertical=e.getLayout()===jt.VERTICAL;return this._ipr=c(e.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap=e.location!==Ht.PLOT?c(e.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,a,this._ipr,s,i)}_doLayout(){const t=this.model,e=this._rowViews,s=this._sizes,i=t.itemsAlign,r=t.lineGap||0,n=t.itemGap||0,a=this._margins,h=this._paddings,o=this._vertical,l=a.left+h.left,c=a.top+h.top;let u,d=l,_=c;this._itemViews.forEach((t=>{t._marker.setStyle("fill",t.model.source.legendColor()),t._marker.setStyle("stroke",t.model.source.legendColor()),t.resizeByMeasured().layout()})),e.forEach(((t,e)=>{o?(_=c,i!==Yt.CENTER&&i!==Yt.END||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.top+a.bottom+h.top+h.bottom,i===Yt.CENTER?_+=(this.height-u)/2:_+=this.height-u),t.forEach((t=>{t.translate(d,_),_+=t.height+n})),d+=s[e]+r):(d=l,i!==Yt.CENTER&&i!==Yt.END||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.left+a.right+h.left+h.right,i===Yt.CENTER?d+=(this.width-u)/2:d+=this.width-u),t.forEach((t=>{t.translate(d,_),d+=t.width+n})),_+=s[e]+r)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const a=e.items(),h=this._itemViews,o=e.itemGap||0,l=e.lineGap||0,c=h.count,u=this._rowViews=[],d=this._sizes=[];let _,g,p,m;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t)),e.measure(t,a[s],r,n,1)}));let b=0,x=0;if(s){for(;b<c;)m=h.get(b),x%i==0?(u.push(p=[m]),g=m.mh,x++,b++):(g+=o+m.mh,g<=n?(p.push(m),x++,b++):x=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{s+=t.mh,e=Math.max(e,t.mw)})),s+=o*(t.length-1),g=Math.max(g,s),_+=e,d.push(e)})),_+=l*(u.length-1)}else{for(;b<c;)m=h.get(b),x%i==0?(u.push(p=[m]),_=m.mw,x++,b++):(_+=o+m.mw,_<=r?(p.push(m),x++,b++):x=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=Math.max(s,t.mh)})),e+=o*(t.length-1),_=Math.max(_,e),g+=s,d.push(s)})),g+=l*(u.length-1)}return Gr.create(_,g)}}Ca.LEGEND_CLASS="rct-legend";class Ta extends Kr{constructor(t){super(t,Ta.CLASS_NAME),this.setVisible(!1)}}Ta.CLASS_NAME="rct-series-navigator";class Ma extends ct{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Ln(t))}layout(){}}class Na extends ct{constructor(t,e){super(t,e),this.add(this._markContainer=new ut(t,"rct-polar-axis-markers")),this._markViews=new kr(this._markContainer,Ma),this.add(this._gridContainer=new ct(t,"rct-polar-axis-grids")),this.add(this._labelContainer=new ut(t,"rct-polar-axis-labels")),this._labelViews=new kr(this._labelContainer,Xr)}prepare(t,e){this._model=e,this._markLen=e.tick.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks)}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)}$_prepareLabels(t,e){const s=e._ticks;this._labelViews.prepare(s.length,((t,e)=>{t.text=s[e].label}),(t=>{t.anchor=Yr.START}))}}class Oa extends Na{constructor(t){super(t,"rct-polar-xaxis"),this._gridLines=new kr(this._gridContainer,gi,"rct-polar-xaxis-grid-line"),this.add(this._lineView=new Ln(t,"rct-polar-xaxis-line")),this._lineView.setStyle("fill","none")}_doPrepare(t,e){this._gridLines.prepare(e.length),this._lineView.visible=t.line.visible}_doLayout(t,e,s,i,r,n){const a=t.chart.startAngle();this._gridLines.forEach(((t,n)=>{const h=r[n].pos*Math.PI*2,o=e+Math.cos(a+h)*i,l=s+Math.sin(a+h)*i;t.setLine(e,s,o,l)}));const h=i+t.tick.length;this._labelViews.forEach(((t,i)=>{const n=r[i];t.anchor=Yr.MIDDLE,t.layout=Wr.MIDDLE,t.text=n.label;const o=t.getBBounds(),l=n.pos*Math.PI*2,c=e+Math.cos(a+l)*(h+o.width/2),u=s+Math.sin(a+l)*(h+o.height/2);t.translate(c,u)})),this._lineView.setCircle(e,s,i)}}class Da extends Na{constructor(t){super(t,"rct-polar-yaxis"),this._gridLines=new kr(this._gridContainer,Ln,"rct-polar-yaxis-grid-line"),this.add(this._lineView=new gi(t,"rct-polar-yaxis-line"))}_doPrepare(t,e){this._gridLines.prepare(e.length,null,(t=>{t.setStyle("fill","none")})),this._lineView.visible=t.line.visible}_doLayout(t,e,s,i,r,n){this._gridLines.forEach(((t,i)=>{const n=r[i];t.setCircle(e,s,n.pos)})),this._labelViews.forEach(((t,i)=>{const n=r[i];t.anchor=Yr.END,t.layout=Wr.MIDDLE,t.text=n.label,t.translate(e-4,s-n.pos)})),this._lineView.setVLine(e,s,s-i)}}class Ra extends Aa{constructor(){super(...arguments),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,a=super._doMeasure(t,e,s,i,r);return this.$_prepareAxes(t,n.xAxis,n._getYAxes().items),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{t.resize(2*i,2*i),t.layout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((t=>{t.layout(null,e,s,i)}))}$_prepareAxes(t,e,s){this._axisContainer||(this.add(this._axisContainer=new ct(t,"rct-polar-axes")),this._axisContainer.add(this._xAxisView=new Oa(t))),this._xAxisView.prepare(t,e);const i=this._yAxisViews;for(;i.length<s.length;){const e=new Da(t);this._axisContainer.add(e),i.push(e)}for(;i.length>s.length;)i.pop().remove();i.forEach(((e,i)=>e.prepare(t,s[i])))}}class Ba extends Qr{constructor(t,e){super(t,e?Ba.SUBTITLE_CLASS:Ba.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.add(this._textView=new Xr(t)),this._textView.anchor=Yr.START}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._textView.text=this.model.text,it(this._textView.getBBounds())}_doLayout(){this._textView.translate(this._margins.left+this._paddings.left,this._margins.top+this._paddings.top),this._textView.layoutText()}}Ba.TITLE_CLASS="rct-title",Ba.SUBTITLE_CLASS="rct-subtitle";class Ia extends ct{constructor(t){super(t,"rct-tooltip"),this._textCallback=(t,e,s)=>this._model.getValue(this._series,t,e,s),this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new gt(t,"rct-tooltip-back")),this.add(this._textView=new Xr(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+lt.SHADOW_FILTER+")"),this._textView.anchor=Yr.START,this._richText=new Nt,this.close(!0,!1)}show(t,e,s,i,r){const n=this._model=t.tooltip,a=this._textView;this._series=t,this._richText.setFormat(n.text),this._richText.build(a,NaN,NaN,e,this._textCallback);const h=a.getBBounds(),o=Math.max(n.minWidth||0,h.width+16),l=Math.max(n.minHeight||0,h.height+12),c=new Lr;c.rect(0,0,o,l),this._back.setPath(c.end(!0)),a.translate((o-h.width)/2,(l-h.height)/2);const u="visible"===this.getStyle("visibility")?300:0;n.series.chart.isInverted()?this.translateEx(s+n.offset,i-l/2,u,!1):this.translateEx(s-o/2,i-l-n.offset,u,!1),0===u&&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.hideDelay:ye.HIDE_DELAY))}$_hide(){!function(t,e,s,i,r,n){const a=null!=s?E(e,s):{},h=E(e,i),o=t.animate([a,h],{duration:r,fill:"none"});o&&n&&o.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}}class $a extends Hr{measure(t,e,s,i,r){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}}class Fa extends $a{_doInitChildren(t){this.add(this.titleView=new Ba(t,!1)),this.add(this.subtitleView=new Ba(t,!0))}_doMeasure(t,e,s,i,r){const n=this.titleView,a=this.subtitleView;let h,o=s,l=0;return(n.visible=e.title.isVisible())&&(h=n.measure(t,e.title,s,i,r),l+=h.height,i-=h.height,o=Math.max(h.width)),(a.visible=e.subtitle.isVisible())&&(h=a.measure(t,e.subtitle,s,i,r),l+=h.height,i-=h.height,o=Math.max(h.width)),{width:o,height:l}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model;let n,a,h=0;if(e.visible){switch(n=e.width>t.wPlot||i.alignBase===j.CHART?0:t.xPlot,a=e.width>t.wPlot||i.alignBase===j.CHART?t.wChart:t.wPlot,e.resizeByMeasured().layout(),i.align){case $.LEFT:break;case $.RIGHT:n+=a-e.width;break;default:n+=(a-e.width)/2}e.translate(n,h),h+=e.height}if(s.visible){switch(n=s.width>t.wPlot||r.alignBase===j.CHART?0:t.xPlot,a=s.width>t.wPlot||r.alignBase===j.CHART?t.wChart:t.wPlot,s.resizeByMeasured().layout(),r.position,r.align){case $.LEFT:break;case $.RIGHT:n+=a-s.width;break;default:n+=(a-s.width)/2}s.translate(n,h)}}}class za extends $a{_doInitChildren(t){this.add(this._legendView=new Ca(t))}_doMeasure(t,e,s,i,r){const n=e.legend,a=this._legendView.measure(t,n,s,i,r),h=this._pos=n.getLocatiion();return h===Ht.LEFT||h===Ht.RIGHT?a.width+=this._legendView._gap:a.height+=this._legendView._gap,a}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case Ht.LEFT:s-=e;break;case Ht.RIGHT:s-=e,r+=e;break;case Ht.TOP:i-=e;break;default:n+=e,i-=e}t.resize(s,i).translate(r,n),t.layout()}}class Ga extends $a{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i){const r=this.views;for(;r.length<e.length;){const e=new kn(t);this.add(e),r.push(e)}for(;r.length>e.length;)r.pop().remove();r.forEach(((r,n)=>{r.model=e[n],r.prepareGuides(t,s,i)})),this.axes=e,(this.visible=r.length>0)&&(this.isHorz=r[0].model._isHorz,this._gap=r[0].model.chart.getAxesGap())}checkHeights(t,e,s){let i=0;return this.views.forEach((r=>{i+=r.checkHeight(t,e,s)})),i+(this.views.length-1)*this._gap}checkWidths(t,e,s){let i=0;return this.views.forEach((r=>{i+=r.checkWidth(t,e,s)})),i+(this.views.length-1)*this._gap}_doMeasure(t,e,s,i,r){const n=this.axes;let a=0,h=0;return this.views.forEach(((e,o)=>{const l=e.measure(t,n[o],s,i,r);e.setAttr("xy",n[o]._isX?"x":"y"),a+=l.width,h+=l.height})),this.isHorz?h+=(this.views.length-1)*this._gap:a+=(this.views.length-1)*this._gap,Gr.create(a,h)}_doLayout(){const t=this.width,e=this.height;let s=0;this.views.forEach((i=>{this.isHorz?i.resize(t,i.mh):i.resize(i.mw,e),i.layout(),this.isHorz?(i.translateY(this.dir===z.TOP?e-s-i.mh:s),s+=i.mh+this._gap):(i.translateX(this.dir===z.RIGHT?s:t-s-i.mw),s+=i.mw+this._gap),i.move(undefined,undefined)}))}}class Ha extends Hr{}class ja extends Kr{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Xr(t)),this._textView.anchor=Yr.START}clicked(t){this.model.url&&window.open(this.model.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.text,this.setCursor(e.url?"pointer":""),this._textView.getBBounds()}}class Ya extends ct{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionViews={},this.add(this._currBody=this._bodyView=new Aa(t,this));for(const e in z){const s=new Ga(t,z[e]);this.add(s),this._axisSectionViews[z[e]]=s}this.add(this._titleSectionView=new Fa(t)),this.add(this._legendSectionView=new za(t)),this.add(this._navigatorView=new Ta(t)),this.add(this._creditView=new ja(t)),this.add(this._historyView=new La(t)),this.add(this._tooltipView=new Ia(t))}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}measure(t,e,s,i,r){if(e&&1==r&&e.prepareRender(),this.$_checkEmpty(t,e,s,i))return;const n=this._model=e,a=n.isPolar(),h=n.options.credits,o=n.legend;let l,c=s,u=i;if(this._inverted=e.isInverted(),this.$_prepareBody(t,a),this._creditView.setVisible(h.visible)&&(l=this._creditView.measure(t,h,c,u,r),h.floating||(u-=l.height+h.offsetY)),l=this._titleSectionView.measure(t,n,c,u,r),u-=l.height,this._legendSectionView.visible=o.isVisible())switch(l=this._legendSectionView.measure(t,n,c,u,r),o.getLocatiion()){case Ht.TOP:case Ht.BOTTOM:u-=l.height;break;case Ht.RIGHT:case Ht.LEFT:c-=l.width}a?this.$_measurePolar(t,n,c,u,1):this.$_measurePlot(t,n,c,u,1)}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;if(null===(t=this._emptyView)||void 0===t?void 0:t.visible)return void this._emptyView.resize(i,r);const n=this._model,a=n.isPolar(),h=n.legend,o=n.options.credits,l=this._creditView;let u=0,d=0,_=0,g=0;l.visible&&(l.resizeByMeasured(),o.floating||(o.verticalAlign===F.TOP?r-=u=l.height+o.offsetY:r-=d=l.height+o.offsetY));const p=this._titleSectionView;let m=0;const b=g+u;p.visible&&(p.resizeByMeasured(),r-=m=p.height),g=s-d;const x=this._legendSectionView;let f,w,y=0,V=0;if(x.visible)switch(x.resizeByMeasured().layout(),y=x.height,V=x.width,h.getLocatiion()){case Ht.TOP:f=m+u,r-=y;break;case Ht.BOTTOM:r-=y,f=g-y,g-=y;break;case Ht.RIGHT:i-=V,w=e-V;break;case Ht.LEFT:i-=V,_+=V,w=0}const v=this._axisSectionViews;let P;a||(G.forEach((t=>{(P=v[t])&&P.visible&&(i-=P.mw)})),H.forEach((t=>{(P=v[t])&&P.visible&&(r-=P.mh)})),(P=v[z.LEFT])&&P.visible&&(P.resize(P.mw,r),P.layout(),_+=P.mw),(P=v[z.RIGHT])&&P.visible&&(P.resize(P.mw,r),P.layout()),(P=v[z.BOTTOM])&&P.visible&&(P.resize(i,P.mh),P.layout(),g-=P.mh),(P=v[z.TOP])&&P.visible&&(P.resize(i,P.mh),P.layout()));const S=this._org=yn.create(_,g);this._plotWidth=i,this._plotHeight=r,a||((P=v[z.LEFT])&&P.translate(S.x-P.mw,S.y-P.height),(P=v[z.RIGHT])&&P.translate(S.x+i,S.y-P.height),(P=v[z.BOTTOM])&&P.translate(S.x,S.y),(P=v[z.TOP])&&P.translate(S.x,S.y-r-P.height));const k=this._plotHeight,A=this._plotWidth;if(_=S.x,g=S.y-k,this._currBody.resize(A,k),this._currBody.layout().translate(_,g),l.visible){const t=o.offsetX||0,i=o.offsetY||0;let r,n;switch(l.layout(),o.verticalAlign){case F.TOP:break;case F.MIDDLE:n=(s-l.height)/2+i;break;default:n=s-d}switch(o.align){case $.LEFT:r=t;break;case $.CENTER:r=(e-l.width)/2+t;break;default:r=e-l.width-t}l.translate(r,n)}if(p.visible&&p.layout({xPlot:_,wPlot:A,wChart:e}).translate(0,b),x.visible){if(h.location===Ht.PLOT){let t=c(h.offsetX,0);switch(h.align){case $.RIGHT:_+=A-V-t;break;case $.CENTER:_+=(A-V)/2+t;break;default:_+=t}switch(t=c(h.offsetY,0),h.verticalAlign){case F.BOTTOM:g+=k-y-t;break;case F.MIDDLE:g+=(k-y)/2+t;break;default:g+=t}}else if(isNaN(f)){const t=c(h.offsetY,0);if(_=w,h.alignBase===j.CHART){switch(h.verticalAlign){case F.TOP:g=t;break;case F.BOTTOM:g=s-y-t;break;default:g=(s-y)/2+t}g+y>s&&(g=(s-y)/2)}else switch(h.verticalAlign){case F.TOP:g+=t;break;case F.BOTTOM:g=g+r-y-t;break;default:g=g+(r-y)/2+t}g+y>s&&(g=(s-y)/2),g<0&&(g=0)}else{const t=c(h.offsetX,0);if(g=f,h.alignBase===j.CHART)switch(h.align){case $.LEFT:_=t;break;case $.RIGHT:_=e-V-t;break;default:_=(e-V)/2+t}else switch(h.align){case $.LEFT:_+=t;break;case $.RIGHT:_=_+i-V-t;break;default:_+=(i-V)/2+t}_+V>e&&(_=(e-V)/2),_<0&&(_=0)}x.translate(_,g)}this._tooltipView.close(!0,!1)}showTooltip(t,e){const s=e.xPos+this._bodyView.tx,i=e.yPos+this._bodyView.ty;this._tooltipView.show(t,e,s,i,!0)}hideTooltip(){this._tooltipView.close(!1,!0)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}findSeriesView(t){return this._bodyView.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}clipSeries(t,e,s,i,r,n){t&&(this._model.inverted&&n?this._seriesClip.setBounds(0,-i,r,i):this._seriesClip.setBounds(0,0,i,r),t.setClip(this._seriesClip))}pointerMoved(t,e,s){const i=this._bodyView.controlToElement(t,e),r=this._bodyView.pointerMoved(i,s);for(const t in this._axisSectionViews)this._axisSectionViews[t].views.forEach((t=>{const e=t.model.crosshair,s=t.model._isHorz?this._bodyView.width:this._bodyView.height,n=t.model._isHorz?i.x:i.y,a=r&&e.visible&&e.flag.visible&&!e.isBar()&&e.getFlag(s,n);a?t.showCrosshair(n,a):t.hideCrosshiar()}))}getAxis(t){for(const e in this._axisSectionViews){const s=this._axisSectionViews[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._bodyView.getButton(t)}buttonClicked(t){this._bodyView.buttonClicked(t)}_doAttached(t){this._seriesClip=this.control.clipBounds()}$_checkEmpty(t,e,s,i){if(!e||e.isEmpty())return this._emptyView||(this._emptyView=new Ha(t)),this._emptyView.resize(s,i),!0;this._emptyView&&(this._emptyView.visible=!1)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Ra(t,this),this.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVisible(!1),this._polarView.setVisible(!0)):(null===(i=this._polarView)||void 0===i||i.setVisible(!1),this._bodyView.setVisible(!0),this._currBody=this._bodyView),this._currBody.prepareSeries(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e.needAxes(),n=this._axisSectionViews;for(const a in n){const h=n[a];r?h.prepare(t,e.getAxes(a),s,i):h.visible=!1}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionViews,a=s,h=i;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[z.LEFT].checkWidths(t,s,i),s-=n[z.RIGHT].checkWidths(t,s,i),i-=n[z.BOTTOM].checkHeights(t,s,i),i-=n[z.TOP].checkHeights(t,s,i),e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&h.measure(t,e,s,i,r)}s=a,i=h;for(const t in n){const e=n[t];e.visible&&(t===z.LEFT||t===z.RIGHT?s-=e.mw:t!==z.BOTTOM&&t!==z.TOP||(i-=e.mh))}e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&h.measure(t,e,s,i,r)}s=a,i=h;for(const t in n){const e=n[t];e.visible&&(t===z.LEFT||t===z.RIGHT?s-=e.mw:t!==z.BOTTOM&&t!==z.TOP||(i-=e.mh))}e.calcAxesPoints(s,i,this._inverted),this._bodyView.measure(t,e.body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e.body.calcRadius(s,i);this.$_prepareAxes(t,e),e.layoutAxes(2*Math.PI,n,!1,r),this._polarView.measure(t,e.body,s,i,r)}}class Wa extends lt{constructor(t,e){super(t,e),this.addElement(this._chartView=new Ya(t)),this.setPointerHandler(new wn(this))}onModelChanged(t,e){this.invalidateLayout()}onVisibleChanged(t,e){e instanceof Be&&this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}get model(){return this._model}set model(t){t!==this._model&&(this._model&&(this._model.assets.unregister(this.doc(),this),this._model.removeListener(this)),this._model=t,this._model&&(this._model.addListener(this),this._model.assets.register(this.doc(),this)),this.invalidateLayout())}chartView(){return this._chartView}load(t,e=!1){this.loaded=!e,this.model=new Sr(t)}refresh(t){t?this._render():this.invalidateLayout()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}useImage(t){}_doRender(t){const e=this._model,s=this._chartView;this.clearTemporaryDefs(),e&&(this.setData("theme",e.options.theme,!0),this.setData("palette",e.options.palette)),s.measure(this.doc(),e,t.width,t.height,1),s.resize(t.width,t.height),s.layout()}_doRenderBackground(t,e,s){this._model&&Object.assign(t.style,this._model.options.style)}}class Ua{constructor(t){this._doInit(this.$_p=t)}_createObjects(...t){for(const e of t)this["_"+e]=new Ua(this.$_p[e])}_doInit(t){}get(t){const e=this.$_p.getProp(t);if(e instanceof Dt){const e=this[t];return e instanceof Ua?e:void 0}return e}set(t,e,s=!0){return this.$_p.setProp(t,e,s),this}setAll(t,e=!0){return this.$_p.setProps(t,e),this}toggle(t,e=!0){return this.$_p.setProp(t,!this.$_p.getProp(t),e),this}_changed(){this.$_p.chart._modelChanged(this.$_p)}}class Xa extends Ua{_doInit(t){this._createObjects("title","line","grid","tick","label","crosshair")}get title(){return this._title}get line(){return this._line}get grid(){return this._grid}get tick(){return this._tick}get label(){return this._label}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get isEmpty(){return this.$_p.isEmpty()}resetZoom(){this.$_p.resetZoom()}zoom(t,e){this.$_p.zoom(t,e)}}class qa extends Xa{}class Za extends Xa{}class Ka extends Za{}class Qa extends Za{}class Ja extends Ua{_doInit(t){this._createObjects("pointLabel","trendline","tooltip")}get pointLabel(){return this._pointLabel}get trendLine(){return this._trendLine}get tooltip(){return this._tooltip}}class th extends Ua{}class eh extends Ja{}class sh extends eh{}class ih extends Ja{}class rh extends Ja{}class nh extends Ja{}class ah extends Ja{}class hh extends Ja{}class oh extends Ja{}class lh extends Ja{}class ch extends Ja{}class uh extends Ja{}class dh extends Ja{}class _h extends Ja{}class gh extends Ja{}class ph extends Ja{}class mh extends Ja{}class bh extends Ja{}class xh extends Ja{}class fh extends Ja{}class wh extends Ja{}class yh extends Ja{}class Vh extends Ja{}class vh extends Ua{}class Ph extends vh{}class Sh extends Ph{updateValue(t,e=!0){this.$_p.updateValue(t,e)}}class kh extends Ua{_doInit(t){this._createObjects("line","tick","tickLabel")}get line(){return this._line}get tick(){return this._tick}get tickLabel(){return this._tickLabel}}class Ah extends Sh{_doInit(t){this._createObjects("label")}get label(){return this._label}}class Lh extends Ua{_doInit(t){this._createObjects("rangeLabel","thickLabel")}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}}class Eh extends Ah{_doInit(t){this._createObjects("scale","rim","valueRim","marker","hand","pin"),this._band=new Lh(t.band)}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get marker(){return this._marker}get hand(){return this._hand}get pin(){return this._pin}}class Ch extends Sh{_doInit(t){this._createObjects("label"),this._scale=new kh(t.scale)}get label(){return this._label}get scale(){return this._scale}}class Th extends Ch{}class Mh extends Ch{}class Nh extends Ph{}class Oh extends vh{}class Dh extends Ua{}class Rh extends Ua{}class Bh extends Ua{}class Ih extends Ua{}const $h={category:qa,linear:sh,time:Ka,log:Qa},Fh={area:ih,arearange:rh,bar:nh,barrange:ah,bellcurve:hh,boxplot:oh,bubble:lh,candlestick:uh,dumbbell:dh,equalizer:_h,errorbar:class extends Ja{},funnel:gh,heatmap:ph,histogram:bh,line:sh,lollipop:xh,ohlc:class extends Ja{},pareto:fh,pie:wh,scatter:ch,treemap:mh,vector:yh,waterfall:Vh},zh={circle:Eh,linear:Th,bullet:Mh,clock:Nh};function Gh(t,e){if(e){let s=t.get(e);return s||(e instanceof Be?s=new(Fh[e._type()])(e):e instanceof Ts?s=new(zh[e._type()])(e):e instanceof ce?s=new($h[e.type()])(e):e instanceof Ke?s=new Dh(e):e instanceof Qe?s=new Rh(e):e instanceof pe?s=new Bh(e):e instanceof de&&(s=new Ih(e)),t.set(e,s)),s}}class Hh{constructor(t){this._objects=new Map,this.$_p=t}load(t,e){this.$_p.load(t,e),this._objects.clear()}render(t=!1){this.$_p.refresh(t)}get xAxis(){return Gh(this._objects,this.$_p.model.xAxis)}getXAxis(t){return Gh(this._objects,this.$_p.model.getXAxis(t))}get yAxis(){return Gh(this._objects,this.$_p.model.yAxis)}getYAxis(t){return Gh(this._objects,this.$_p.model.getYAxis(t))}get series(){return Gh(this._objects,this.$_p.model.firstSeries)}getSeries(t){return Gh(this._objects,this.$_p.model.seriesByName(t))}get gauge(){return Gh(this._objects,this.$_p.model.firstGauge)}getGauge(t){return Gh(this._objects,this.$_p.model.gaugeByName(t))}get title(){return Gh(this._objects,this.$_p.model.title)}get subtitle(){return Gh(this._objects,this.$_p.model.subtitle)}get legend(){return Gh(this._objects,this.$_p.model.legend)}get body(){return Gh(this._objects,this.$_p.model.legend)}get type(){return this.$_p.model.type}get gaugeType(){return this.$_p.model.gaugeType}get inverted(){return this.$_p.model.inverted}set inverted(t){t!==this.$_p.model.inverted&&(this.$_p.model.inverted=t,this.$_p.invalidateLayout())}get polar(){return this.$_p.model.polar}scroll(t,e){this.$_p.scroll(t.$_p,e)}}class jh{static getVersion(){return"0.9.9"}static setDebugging(t){ct.DEBUGGING=t}static setAnimatable(t){lt._animatable=t}static createChart(t,e,s){const i=new Wa(t,e);return i.model=new Sr(s),new Hh(i)}}const Yh=jh.getVersion,Wh=jh.setDebugging,Uh=jh.setAnimatable,Xh=jh.createChart;t.RcAreaRangeSeries=rh,t.RcAreaSeries=ih,t.RcAreaSeriesGroup=class extends th{},t.RcBarRangeSeries=ah,t.RcBarSeries=nh,t.RcBarSeriesGroup=class extends th{},t.RcBellCurveSeries=hh,t.RcBody=Ih,t.RcBoxPlotSeries=oh,t.RcBubbleSeries=lh,t.RcBulletGauge=Mh,t.RcBulletGaugeGroup=class extends Oh{},t.RcBumpSeriesGroup=class extends th{},t.RcCandlestickSeries=uh,t.RcCategoryAxis=qa,t.RcChartAxis=Xa,t.RcChartControl=Hh,t.RcChartGauge=Ph,t.RcChartGaugeBase=vh,t.RcChartObject=Ua,t.RcChartSeries=Ja,t.RcCircleGauge=Eh,t.RcCircleGaugeGroup=class extends Oh{},t.RcCircularGauge=Ah,t.RcClockGauge=Nh,t.RcContinuousAxis=Za,t.RcDumbbellSeries=dh,t.RcEqualizerSeries=_h,t.RcFunnelSeries=gh,t.RcGaugeGroup=Oh,t.RcGaugeRangeBand=Lh,t.RcGaugeScale=kh,t.RcHeatmapSeries=ph,t.RcHistogramSeries=bh,t.RcLegend=Bh,t.RcLineSeries=sh,t.RcLineSeriesGroup=class extends th{},t.RcLinearAxis=class extends Za{},t.RcLinearGauge=Th,t.RcLinearGaugeGroup=class extends Oh{},t.RcLinerGaugeBase=Ch,t.RcLogAxis=Qa,t.RcLollipopSeries=xh,t.RcParetoSeries=fh,t.RcPieSeries=wh,t.RcPieSeriesGroup=class extends th{},t.RcPointLabel=class extends Xa{},t.RcScatterSeries=ch,t.RcSeriesGroup=th,t.RcSubtitle=Rh,t.RcTimeAxis=Ka,t.RcTitle=Dh,t.RcTreemapSeries=mh,t.RcValueGauge=Sh,t.RcVectorSeries=yh,t.RcWaterfallSeries=Vh,t.createChart=Xh,t.getVersion=Yh,t.setAnimatable=Uh,t.setDebugging=Wh}));
|