UNPKG

realchart

Version:

Wooritech charting library

7 lines (6 loc) 406 kB
/** * RealChart v1.3.17 * Copyright (C) 2023-2025 WooriTech Inc. * All Rights Reserved. */ const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"string"==typeof t&&t.length>0},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,_=Math.floor,c=Math.ceil,u=Math.cos,d=Math.sin,p=function(t){return Math.pow(10,t)},g=Math.log10,m=Math.min,f=Math.max,y=Math.abs,b=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},x=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},w=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},S=t=>t&&l({},t),V=(t,e,s)=>t+(e-t)*s,P=function(t){return"function"==typeof t?t:null},A=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class C{static log(...t){this.LOGGING&&console.log(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&C.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(m(s,C.month_days[C.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return l({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(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(i(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 i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-A}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=C.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),C.log(t,+new Date-s+"ms")}static clamp(t,e,s){return f(e,m(s,t))}static makeIntArray(t,e){const s=new Array(f(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=y(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}C.LOGGING=!1,C.week_days=["일","월","화","수","목","금","토"],C.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],C.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],C.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const k={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let L="ko",N=k[L]||k[L="ko"];const E=(t,e)=>{t&&s(e)&&(N=k[t.substring(0,2)]=Object.assign(k.ko,k.en,e))};let M=0;class T{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(M++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class O extends T{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const B=void 0,R=Math.PI,D=2*R,F=-R/2,$=2*R/360,z=360/R/2,I="%".charCodeAt(0);function H(t){return t>D?t%D:t}function G(t){return parseFloat(t.toPrecision(12))}function j(t){return Math.floor(1e6*t)/1e6}function Y(t){return null==t?null:String(t)}function X(t){return t+"px"}function W(t){return null==t||Number.isNaN(t)||""===t}function U(t){return t<10?"0"+t:String(t)}function Z(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function q(t,e){const s={};return s[t]=e,s}function K(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)===I?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;nt(N.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function Q(t,e){return K(t,!0)||K(e,!1)}function J(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const tt="fill",et={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},st=function(t){const e=et[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return et[t]=e,e}return e};class it extends Error{}const rt=function(t,e){if(!t)throw new it(e)},nt=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},ot=function(t,e,r,o=!0,a=!0,h=!1,_){let c,u;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:b(t.fromValue,u?u.toValue:e),toValue:b(t.toValue,r),color:t.color,style:t.style?l({},t.style):B};s.fromValue<s.toValue&&(c.push(s),u=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),a&&c.forEach((t=>{t.fromValue=f(t.fromValue,e),t.toValue=m(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const o=i(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),r>o[o.length-1]&&o.push(r);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:s[m(t,s.length-1)],style:n?n[m(t,n.length-1)]:B})}else{let i=b(t.fromValue,e);const o=b(t.toValue,r),a=(o-i)/s.length;let h=0;for(;i<o;)c.push({fromValue:i,toValue:i+=a,color:s[m(h,s.length-1)],style:n?n[m(h,n.length-1)]:B}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:_}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:_})}return c},at="shuffle",ht="random",lt="vertical-lr",_t="vertical-rl",ct=function(t){return t&&"object"==typeof t};class ut extends O{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else ct(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&nt(N.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class dt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let r;i(s)?r=new ut({},s):ct(s)&&i(s.values)&&(r=new ut(s.options,s.values)),this._map[e]=r}}}const pt="0".charCodeAt(0),gt="#".charCodeAt(0),mt=",".charCodeAt(0),ft="s".charCodeAt(0),yt="a".charCodeAt(0);class bt{static getFormatter(t){let e=bt.Formatters[t];return e||(bt.Formatters[t]=e=new bt(t)),e}static get Default(){return bt.getFormatter(bt.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)===pt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===gt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===pt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===mt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===yt){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}bt.DEFAULT_FORMAT="",bt.Formatters={};const xt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],wt=[".","/","-",":"],vt="Z".charCodeAt(0),St="z".charCodeAt(0),Vt="A".charCodeAt(0),Pt="a".charCodeAt(0),At="y".charCodeAt(0),Ct="M".charCodeAt(0),kt="m".charCodeAt(0),Lt="W".charCodeAt(0),Nt="w".charCodeAt(0),Et="d".charCodeAt(0),Mt="H".charCodeAt(0),Tt="h".charCodeAt(0),Ot="S".charCodeAt(0),Bt="s".charCodeAt(0);class Rt{static getFormatter(t){let e=Rt.Formatters[t];return e||(Rt.Formatters[t]=e=new Rt(t)),e}static get Default(){return Rt.getFormatter(N.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||N.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var o=s[r],a=o.length;switch(o.charCodeAt(0)){case At:i+=a>2?t.getFullYear():U(t.getFullYear()%100);break;case Ct:i+=a>1?U(t.getMonth()+1):t.getMonth()+1;break;case Et:i+=a>1?U(t.getDate()):t.getDate();break;case Lt:i+=a>1?U(C.weekOfYear(t,e)+1):C.weekOfMonth(t,e,!0)+1;break;case Nt:i+=a>1?C.long_week_days[t.getDay()]:C.week_days[t.getDay()];break;case Mt:i+=a>1?U(t.getHours()):t.getHours();break;case Tt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?U(e):e}else i+=a>1?U(t.getHours()):t.getHours();break;case kt:i+=a>1?U(t.getMinutes()):t.getMinutes();break;case Bt:i+=a>1?U(t.getSeconds()):t.getSeconds();break;case Pt:case Vt:t.getHours()<12?i+=N.am:i+=N.pm;break;case Ot:let s=t.getMilliseconds();i+=3==a?Z(s):2==a?U(s):s.toString().substring(0,a);break;default:i+=o}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(wt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),xt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Vt&&e<=vt||e>=Pt&&e<=St)&&nt(N.invalidDateFormat,t)}e.push(n)}if(r<i&&C.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&C.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||N.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Rt.Formatters={};class Dt{static isBright(t){return new Dt(t).isBright()}static getContrast(t,e,s){return new Dt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(C.startsWith(t,"rgb(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):C.startsWith(t,"rgba(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):C.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Dt(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}class Ft{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}var $t;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}($t||($t={}));const zt={name:"RealChart",version:"1.3.17",license:"enterprise",code:null};class It{static decode(t){const e=It.CHARS,s=It.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}It.PAD="=",It.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ht{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=Ht.xor,i=Ht.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=Ht.xor,i=Ht.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=Ht.kb,i=Ht._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*Ht.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=Ht._decryptBlock;let i=Ht._init(e),r=[],n=It.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Ht.POW24|n[a+1]*Ht.POW16|n[a+2]*Ht.POW8|n[a+3],h.right=n[a+4]*Ht.POW24|n[a+5]*Ht.POW16|n[a+6]*Ht.POW8|n[a+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}Ht.POW2=Math.pow(2,2),Ht.POW3=Math.pow(2,3),Ht.POW4=Math.pow(2,4),Ht.POW8=Math.pow(2,8),Ht.POW16=Math.pow(2,16),Ht.POW24=Math.pow(2,24),Ht.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class Gt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=Ht.decrypt(t,"dkdl"+this._getLDKey(Ht.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}class jt extends T{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._domResize=!1,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=zt.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=Gt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==zt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(zt.license!=$t.Developer&&!Gt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values($t).includes(n))throw new Error(s);if(zt.license=i.lic,n==$t.Evaluation||n==$t.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||jt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Ft.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){W(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){Ft.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(Yt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(Yt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}getBounds(){return this._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 Zt(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new Kt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,Yt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(e,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof HTMLDivElement||nt(N.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");l(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const o=this._svg=r.createElementNS(t,"svg");o.classList.add("rct-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created by RealChart v"+zt.version,o.appendChild(a);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Wt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute"})}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",jt.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=e.createElementNS(t,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=e.createElementNS(t,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(+new Date<=this._toAnimation)this.$_requestRender();else{C.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;l(this._htmlRoot.style,{left:X(e.left-t.left),top:X(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),l(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=Ft.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),C.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}jt.CLASS_NAME="rct-control",jt.SHADOW_FILTER="rr-chart-shadow-filter",jt._animatable=!0;class Yt extends T{constructor(e,s,i=B){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return n(e)&&e.indexOf("NaN"),this._dom.setAttribute(t,e),this}setAttrEx(t,e){return W(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t=C.isValidNum(t)?t:this._tx,e=C.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=C.isValidNum(t)?t:this._tx,e=C.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transEx2(t,e,s=0,i=!0){const r=C.isValidNum(t)?t:this._tx,n=C.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&a.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&C.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&C.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==B&&(this._dom.setAttribute("style",this._saveStyle),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalC