diff --git a/NOTES.md b/NOTES.md index 19d0ce36..6fcbd034 100644 --- a/NOTES.md +++ b/NOTES.md @@ -4,7 +4,7 @@ https://github.com/christophrumpel/laravel-import-million-rows https://github.com/spatie/simple-excel https://csv.thephpleague.com/ -mongodb +MONGODB model schema https://www.mongodb.com/docs/drivers/php/laravel-mongodb/v4.x/eloquent-models/schema-builder/ @@ -12,4 +12,8 @@ upsert https://medium.com/@kaamil.mirza.2002/how-i-learned-to-upsert-millions-of-documents-into-mongodb-with-minimal-overhead-8b7f9404a70c https://www.mongodb.com/docs/manual/reference/method/Bulk.find.upsert/ -https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/fundamentals/write-operations/ \ No newline at end of file +https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/fundamentals/write-operations/ + +CHART +https://icehouse-ventures.github.io/laravel-chartjs/ +https://www.chartjs.org/docs/latest/configuration/interactions.html \ No newline at end of file diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index ebc38da3..c956e516 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -10,6 +10,7 @@ use App\Filament\Tables\Columns\ColumnOdds; use App\Filament\Tables\Columns\ColumnStarttime; use App\Filament\Tables\Columns\EventColumn; use App\Filament\Tables\Columns\MatchIds; +use App\Filament\Tables\Columns\StatisticEventColumn; use App\Filament\Tables\Columns\TooltipOdds; use App\Models\ClientGroupList; use App\Models\CompetitionGroup; @@ -37,6 +38,7 @@ use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Filters\Filter; use Filament\Tables\Filters\Indicator; use Filament\Tables\Table; +use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; @@ -85,6 +87,9 @@ class EventsTable ->description(fn ($record) => ucwords($record->group?->name)), EventColumn::make('event'), + StatisticEventColumn::make('statistic-event') + ->label('') + ->alignCenter(), TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn () => in_array('odds_2ways', self::$bettype_settings)), ColumnOdds::make('odds_2ways')->bettype('odds_2ways') @@ -578,6 +583,16 @@ class EventsTable ->recordUrl(null) // disable row click for page ->recordAction(null) // disable row click for modal ->recordActions([ + // Action::make('event-statistic') + // ->iconButton() + // ->modalIcon('phosphor-chart-line') + // ->color('gray') + // ->modalHeading(fn ($record) => $record->country->name.' - '.$record->group->name) + // ->icon('phosphor-chart-line') + // ->modalContent(fn ($record): View => view( + // 'statistic-event-chart', + // ['record' => $record], + // )), Action::make('star') ->iconButton() ->color(function ($record) { diff --git a/app/Filament/Tables/Columns/StatisticEventColumn.php b/app/Filament/Tables/Columns/StatisticEventColumn.php new file mode 100644 index 00000000..83cd36df --- /dev/null +++ b/app/Filament/Tables/Columns/StatisticEventColumn.php @@ -0,0 +1,10 @@ +'; + $str .= '
'.$this->record->country->name.' '.$this->record->group->name.'
'; + if ($this->record->home->betsapi_image_id) { + $str .= ' '; + } + $str .= '
'.$this->record->home->name.'
'; + $str .= '
vs
'; + $str .= '
'.$this->record->away->name.'
'; + if ($this->record->away->betsapi_image_id) { + $str .= ' '; + } + $str .= ''; + + return new HtmlString($str); + } + + protected function getFilters(): ?array + { + return [ + 'gls' => 'Goals', + 'crn' => 'Corner', + 'fls' => 'Committed Fouls', + 'ofs' => 'Offsides', + 'crd' => 'Cards', + 'snt' => 'Shots on target', + 'tsh' => 'TotalShots', + ]; + } + + protected function getData(): array + { + $activeFilter = $this->filter; + + $res = StatistikoEvent::where('league_id', $this->record['competition_group_id']) + ->where('home_id', $this->record['home_id']) + ->where('away_id', $this->record['away_id']) + ->get(); + + switch ($activeFilter) { + case 'crn': + $h = 'crn_h'; + $a = 'crn_a'; + break; + case 'fls': + $h = 'fls_h'; + $a = 'fls_a'; + break; + case 'ofs': + $h = 'ofs_h'; + $a = 'ofs_a'; + break; + case 'crd': + $h = 'crd_h'; + $a = 'crd_a'; + break; + case 'snt': + $h = 'snt_h'; + $a = 'snt_a'; + break; + case 'tsh': + $h = 'tsh_h'; + $a = 'tsh_a'; + break; + + default: + $h = 'gls_h'; + $a = 'gls_a'; + break; + } + + $starttimes = []; + $data_home = []; + $data_away = []; + foreach ($res as $event) { + $data_home[] = $event[$h]; + $data_away[] = $event[$a]; + $starttimes[] = $event['starttime']->format('d.m.Y'); + } + + return [ + 'datasets' => [ + [ + 'label' => $this->record->home->name, + 'data' => $data_home, + 'backgroundColor' => '#155dfc', + 'borderColor' => '#2b7fff', + ], + [ + 'label' => $this->record->away->name, + 'data' => $data_away, + 'backgroundColor' => '#00a63e', + 'borderColor' => '#00c950', + ], + ], + 'labels' => $starttimes, + 'scales' => $this->getOptions(), + ]; + } + + protected function getOptions(): array + { + return [ + 'scales' => [ + 'y' => [ + 'ticks' => [ + 'precision' => 0, // Forces integers + 'beginAtZero' => true, + ], + ], + ], + ]; + } + + protected function getType(): string + { + return 'line'; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 49a7d582..3b89f815 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -69,7 +69,7 @@ class AppServiceProvider extends ServiceProvider 'gray' => Color::Zinc, 'info' => Color::Blue, 'success' => Color::Green, - 'warning' => Color::Orange, + 'warning' => Color::Amber, ]); } } diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index 118f4f3e..157688dc 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -18,7 +18,6 @@ use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\AuthenticateSession; use Filament\Http\Middleware\DisableBladeIconComponents; use Filament\Http\Middleware\DispatchServingFilamentEvent; -// use Filament\Pages\Dashboard; use Filament\Panel; use Filament\PanelProvider; use Filament\Support\Enums\Width; diff --git a/public/js/app/components/apexcharts.js b/public/js/app/components/apexcharts.js new file mode 100644 index 00000000..80b0c0a7 --- /dev/null +++ b/public/js/app/components/apexcharts.js @@ -0,0 +1,967 @@ +var Ci=(u,t)=>()=>(t||u((t={exports:{}}).exports,t),t.exports);var vi=Ci((Ht,Mt)=>{var fa=200,si="__lodash_hash_undefined__",ga=800,pa=16,ii=9007199254740991,ai="[object Arguments]",ua="[object Array]",xa="[object AsyncFunction]",ba="[object Boolean]",ma="[object Date]",ya="[object Error]",oi="[object Function]",wa="[object GeneratorFunction]",va="[object Map]",Aa="[object Number]",Ca="[object Null]",ri="[object Object]",Sa="[object Proxy]",ka="[object RegExp]",La="[object Set]",Da="[object String]",Ta="[object Undefined]",Ma="[object WeakMap]",Pa="[object ArrayBuffer]",Ea="[object DataView]",Fa="[object Float32Array]",Xa="[object Float64Array]",Ra="[object Int8Array]",_a="[object Int16Array]",Ia="[object Int32Array]",Ya="[object Uint8Array]",Na="[object Uint8ClampedArray]",za="[object Uint16Array]",Oa="[object Uint32Array]",Ba=/[\\^$.*+?()[\]{}|]/g,Ha=/^\[object .+?Constructor\]$/,Wa=/^(?:0|[1-9]\d*)$/,U={};U[Fa]=U[Xa]=U[Ra]=U[_a]=U[Ia]=U[Ya]=U[Na]=U[za]=U[Oa]=!0;U[ai]=U[ua]=U[Pa]=U[ba]=U[Ea]=U[ma]=U[ya]=U[oi]=U[va]=U[Aa]=U[ri]=U[ka]=U[La]=U[Da]=U[Ma]=!1;var ni=typeof global=="object"&&global&&global.Object===Object&&global,Ga=typeof self=="object"&&self&&self.Object===Object&&self,$t=ni||Ga||Function("return this")(),li=typeof Ht=="object"&&Ht&&!Ht.nodeType&&Ht,Wt=li&&typeof Mt=="object"&&Mt&&!Mt.nodeType&&Mt,ci=Wt&&Wt.exports===li,bs=ci&&ni.process,Us=(function(){try{var u=Wt&&Wt.require&&Wt.require("util").types;return u||bs&&bs.binding&&bs.binding("util")}catch{}})(),qs=Us&&Us.isTypedArray;function $a(u,t,e){switch(e.length){case 0:return u.call(t);case 1:return u.call(t,e[0]);case 2:return u.call(t,e[0],e[1]);case 3:return u.call(t,e[0],e[1],e[2])}return u.apply(t,e)}function Va(u,t){for(var e=-1,s=Array(u);++e-1}function uo(u,t){var e=this.__data__,s=ge(e,u);return s<0?(++this.size,e.push([u,t])):e[s][1]=t,this}dt.prototype.clear=ho;dt.prototype.delete=fo;dt.prototype.get=go;dt.prototype.has=po;dt.prototype.set=uo;function Pt(u){var t=-1,e=u==null?0:u.length;for(this.clear();++t1?e[i-1]:void 0,o=i>2?e[2]:void 0;for(a=u.length>3&&typeof a=="function"?(i--,a):void 0,o&&Go(e[0],e[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++s-1&&u%1==0&&u0){if(++t>=ga)return arguments[0]}else t=0;return u.apply(void 0,arguments)}}function Jo(u){if(u!=null){try{return fe.call(u)}catch{}try{return u+""}catch{}}return""}function xe(u,t){return u===t||u!==u&&t!==t}var vs=ei((function(){return arguments})())?ei:function(u){return Vt(u)&&ht.call(u,"callee")&&!to.call(u,"callee")},As=Array.isArray;function ks(u){return u!=null&&bi(u.length)&&!Ls(u)}function Qo(u){return Vt(u)&&ks(u)}var xi=so||ar;function Ls(u){if(!kt(u))return!1;var t=pe(u);return t==oi||t==wa||t==xa||t==Sa}function bi(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ii}function kt(u){var t=typeof u;return u!=null&&(t=="object"||t=="function")}function Vt(u){return u!=null&&typeof u=="object"}function tr(u){if(!Vt(u)||pe(u)!=ri)return!1;var t=di(u);if(t===null)return!0;var e=ht.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&fe.call(e)==Ja}var mi=qs?Ua(qs):Po;function er(u){return zo(u,yi(u))}function yi(u){return ks(u)?Lo(u,!0):Eo(u)}var sr=Oo(function(u,t,e){gi(u,t,e)});function ir(u){return function(){return u}}function wi(u){return u}function ar(){return!1}Mt.exports=sr});var Si=Object.defineProperty,ki=Object.defineProperties,Li=Object.getOwnPropertyDescriptors,Ds=Object.getOwnPropertySymbols,Di=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,ye=(u,t,e)=>t in u?Si(u,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[t]=e,I=(u,t)=>{for(var e in t||(t={}))Di.call(t,e)&&ye(u,e,t[e]);if(Ds)for(var e of Ds(t))Ti.call(t,e)&&ye(u,e,t[e]);return u},W=(u,t)=>ki(u,Li(t)),$=(u,t,e)=>ye(u,typeof t!="symbol"?t+"":t,e);var Y=class{static isSSR(){return typeof window>"u"||typeof document>"u"}static isBrowser(){return!this.isSSR()}static hasAPI(t){return this.isSSR()?!1:typeof window[t]<"u"}static getApex(){return typeof window<"u"&&window.Apex?window.Apex:typeof global<"u"&&global.Apex?global.Apex:{}}},qt=class u{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new we,this.parentNode=null,this._ssrWidth=void 0,this._ssrHeight=void 0,this._ssrMode=void 0}setAttribute(t,e){this.attributes.set(t,e)}getAttribute(t){return this.attributes.get(t)}removeAttribute(t){this.attributes.delete(t)}hasAttribute(t){return this.attributes.has(t)}appendChild(t){if(t&&t!==this){if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){let e=this.children.indexOf(t);e!==-1&&this.children.splice(e,1)}t.parentNode=this,this.children.push(t)}return t}removeChild(t){let e=this.children.indexOf(t);return e!==-1&&(this.children.splice(e,1),t.parentNode=null),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){let i=this.children.indexOf(t);i!==-1&&this.children.splice(i,1)}let s=this.children.indexOf(e);return s!==-1&&(t.parentNode=this,this.children.splice(s,0,t)),t}cloneNode(t=!1){let e=new u(this.nodeName,this.namespaceURI);return e.textContent=this.textContent,this.attributes.forEach((s,i)=>{e.attributes.set(i,s)}),Object.assign(e.style,this.style),t&&this.children.forEach(s=>{s.cloneNode&&e.appendChild(s.cloneNode(!0))}),e}getBoundingClientRect(){return{width:this._ssrWidth||0,height:this._ssrHeight||0,top:0,left:0,right:this._ssrWidth||0,bottom:this._ssrHeight||0,x:0,y:0}}getRootNode(){let t=this;for(;t.parentNode;)t=t.parentNode;return t}querySelector(){return null}querySelectorAll(){return[]}getElementsByClassName(){return[]}addEventListener(){}removeEventListener(){}get childNodes(){return this.children}toString(){let t="";if(this.attributes.forEach((s,i)=>{t+=` ${i}="${s}"`}),this.children.length===0&&!this.textContent)return`<${this.nodeName}${t}/>`;let e=this.children.map(s=>s.toString()).join("");return`<${this.nodeName}${t}>${this.textContent}${e}`}get innerHTML(){return this.children.map(t=>t.toString()).join("")}set innerHTML(t){this.children=[],this.textContent=t}get outerHTML(){return this.toString()}get isConnected(){return!0}},we=class{constructor(){this.classes=new Set}add(...t){t.forEach(e=>this.classes.add(e))}remove(...t){t.forEach(e=>this.classes.delete(e))}contains(t){return this.classes.has(t)}toggle(t,e){return e===!0?(this.classes.add(t),!0):e===!1?(this.classes.delete(t),!1):this.classes.has(t)?(this.classes.delete(t),!1):(this.classes.add(t),!0)}toString(){return Array.from(this.classes).join(" ")}},ve=class{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new qt(e,t)}createTextNode(t){let e={nodeName:"#text",nodeType:3,textContent:t,toString(){return e.textContent}};return e}querySelector(){return null}querySelectorAll(){return[]}getComputedStyle(){return{}}getBoundingClientRect(t){return t&&t.getBoundingClientRect?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}createXMLSerializer(){return{serializeToString(t){return t.toString?t.toString():""}}}createDOMParser(){return{parseFromString(t,e){let s=new qt("root");return s.innerHTML=t,{documentElement:s}}}}},Q=null,xt=null,bt=null,z=class{static init(){Y.isSSR()&&!Q&&(Q=new ve)}static createElement(t){return Y.isSSR()?(Q||this.init(),Q.createElementNS(null,t)):document.createElement(t)}static createElementNS(t,e){return Y.isSSR()?(Q||this.init(),Q.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return Y.isSSR()?(Q||this.init(),Q.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return Y.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return Y.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return Y.isSSR()?{}:window.getComputedStyle(t)}static getBoundingClientRect(t){return Y.isSSR()?(Q||this.init(),Q.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return Y.isSSR()?(Q||this.init(),xt||(xt=Q.createXMLSerializer()),xt):(xt||(xt=new XMLSerializer),xt)}static getDOMParser(){return Y.isSSR()?(Q||this.init(),bt||(bt=Q.createDOMParser()),bt):(bt||(bt=new DOMParser),bt)}static addWindowEventListener(t,e,s){Y.isBrowser()&&window.addEventListener(t,e,s)}static removeWindowEventListener(t,e,s){Y.isBrowser()&&window.removeEventListener(t,e,s)}static requestAnimationFrame(t){return Y.isBrowser()?window.requestAnimationFrame(t):(t(0),null)}static cancelAnimationFrame(t){Y.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return t?Y.isSSR()?t._ssrMode===!0||t.nodeName!==void 0:t.getRootNode?t.getRootNode({composed:!0})===document||t.isConnected:!1:!1}static getWindow(){return Y.isBrowser()?window:null}static getDocument(){return Y.isBrowser()?document:null}static _getShim(){return Q}static _resetShim(){Q=null,xt=null,bt=null}},D=class Lt{static isObject(t){return t&&typeof t=="object"&&!Array.isArray(t)}static is(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"}static isSafari(){return Y.isBrowser()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static extend(t,e){let s=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach(i=>{this.isObject(e[i])?i in t?s[i]=this.extend(t[i],e[i]):Object.assign(s,{[i]:e[i]}):Object.assign(s,{[i]:e[i]})}),s}static extendArray(t,e){let s=[];return t.map(i=>{s.push(Lt.extend(e,i))}),t=s,t}static monthMod(t){return t%12}static clone(t,e=new WeakMap,s=!1){if(t===null||typeof t!="object")return t;if(e.has(t))return e.get(t);let i;if(Array.isArray(t))if(s)i=t.slice();else{i=[],e.set(t,i);for(let a=0;a(Array.isArray(s)&&(s=s.reduce((i,a)=>i.length>a.length?i:a)),e.length>s.length?e:s),0)}static hexToRgba(t="#999999",e=.6){t.substring(0,1)!=="#"&&(t="#999999");let s=t.replace("#",""),i=s.match(new RegExp("(.{"+s.length/3+"})","g"))||[];for(let a=0;a>16,r=s>>8&255,n=s&255;return"#"+(16777216+(Math.round((i-o)*a)+o)*65536+(Math.round((i-r)*a)+r)*256+(Math.round((i-n)*a)+n)).toString(16).slice(1)}shadeColor(t,e){return Lt.isColorHex(e)?this.shadeHexColor(t,e):this.shadeRGBColor(t,e)}static isColorHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}static isCSSVariable(t){if(typeof t!="string")return!1;let e=t.trim();return e.startsWith("var(")&&e.endsWith(")")}static getThemeColor(t){if(!Lt.isCSSVariable(t)||Y.isSSR())return t;let e=document.createElement("div");e.style.cssText="position:fixed; left: -9999px; visibility:hidden;",e.style.color=t,document.body.appendChild(e);let s;try{s=window.getComputedStyle(e).color}finally{e.parentNode&&e.parentNode.removeChild(e)}return s}static applyOpacityToColor(t,e){let s=Number(e);if(!Number.isFinite(s))return t;if(s<=0)return"transparent";if(s>=1)return t;let i=Math.round(s*100);return`color-mix(in srgb, ${t} ${i}%, transparent)`}static getPolygonPos(t,e){let s=[],i=Math.PI*2/e;for(let a=0;a{}[\]\\/]/gi,e),s}static negToZero(t){return t<0?0:t}static moveIndexInArray(t,e,s){if(s>=t.length){let i=s-t.length+1;for(;i--;)t.push(void 0)}return t.splice(s,0,t.splice(e,1)[0]),t}static extractNumber(t){return parseFloat(t.replace(/[^\d.]*/g,""))}static findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}static setELstyles(t,e){for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){let s=(String(t).split(".")[1]||"").length,i=(String(e).split(".")[1]||"").length,a=Math.pow(10,Math.max(s,i));return(Math.round(t*a)+Math.round(e*a))/a}static isNumber(t){return!isNaN(t)&&parseFloat(String(Number(t)))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!==0}static isMsEdge(){if(Y.isSSR())return!1;let t=window.navigator.userAgent,e=t.indexOf("Edge/");return e>0?parseInt(t.substring(e+5,t.indexOf(".",e)),10):!1}static getGCD(t,e,s=7){let i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));for(i>1?(t=Math.round(Math.abs(t)*i),e=Math.round(Math.abs(e)*i)):i=1;e;){let a=e;e=t%e,t=a}return t/i}static getPrimeFactors(t){let e=[],s=2;for(;t>=2;)t%s==0?(e.push(s),t=t/s):s++;return e}static mod(t,e,s=7){let i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));return t=Math.round(Math.abs(t)*i),e=Math.round(Math.abs(e)*i),t%e/i}},j=class{constructor(t){this.w=t,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}isValidDate(t){return typeof t=="number"?!1:!isNaN(this.parseDate(t))}getTimeStamp(t){return Date.parse(t)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime():t}getDate(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}parseDate(t){let e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);let s=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return s=this.getTimeStamp(s),s}parseDateWithTimezone(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}formatDate(t,e){let s=this.w.globals.locale,i=this.w.config.xaxis.labels.datetimeUTC,a=["\0",...s.months],o=["",...s.shortMonths],r=["",...s.days],n=["",...s.shortDays];function c(C,L=2){let k=C+"";for(;k.length12?g-12:g===0?12:g;e=e.replace(/(^|[^\\])hh+/g,"$1"+c(p)),e=e.replace(/(^|[^\\])h/g,"$1"+p);let f=i?t.getUTCMinutes():t.getMinutes();e=e.replace(/(^|[^\\])mm+/g,"$1"+c(f)),e=e.replace(/(^|[^\\])m/g,"$1"+f);let x=i?t.getUTCSeconds():t.getSeconds();e=e.replace(/(^|[^\\])ss+/g,"$1"+c(x)),e=e.replace(/(^|[^\\])s/g,"$1"+x);let m=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+c(m,3)),m=Math.round(m/10),e=e.replace(/(^|[^\\])ff/g,"$1"+c(m)),m=Math.round(m/10),e=e.replace(/(^|[^\\])f/g,"$1"+m);let b=g<12?"AM":"PM";e=e.replace(/(^|[^\\])TT+/g,"$1"+b),e=e.replace(/(^|[^\\])T/g,"$1"+b.charAt(0));let v=b.toLowerCase();e=e.replace(/(^|[^\\])tt+/g,"$1"+v),e=e.replace(/(^|[^\\])t/g,"$1"+v.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);let C=Math.floor(y/60),L=y%60;w+=c(C)+":"+c(L)}e=e.replace(/(^|[^\\])K/g,"$1"+w);let A=(i?t.getUTCDay():t.getDay())+1;return e=e.replace(new RegExp(r[0],"g"),r[A]),e=e.replace(new RegExp(n[0],"g"),n[A]),e=e.replace(new RegExp(a[0],"g"),a[h]),e=e.replace(new RegExp(o[0],"g"),o[h]),e=e.replace(/\\(.)/g,"$1"),e}getTimeUnitsfromTimestamp(t,e){let s=this.w;s.config.xaxis.min!==void 0&&(t=s.config.xaxis.min),s.config.xaxis.max!==void 0&&(e=s.config.xaxis.max);let i=this.getDate(t),a=this.getDate(e),o=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),r=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(r[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(r[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(r[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(r[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(r[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(r[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(r[0],10)}}isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}calculcateLastDaysOfMonth(t,e,s){return this.determineDaysOfMonths(t,e)-s}determineDaysOfYear(t){let e=365;return this.isLeapYear(t)&&(e=366),e}determineRemainingDaysOfYear(t,e,s){let i=this.daysCntOfYear[e]+s;return e>1&&this.isLeapYear(t)&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=D.monthMod(t),!0){case this.months30.indexOf(t)>-1:t===2&&(this.isLeapYear(e)?s=29:s=28);break;case this.months31.indexOf(t)>-1:s=31;break;default:s=31;break}return s}},yt=class{constructor(t){this.w=t,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){let a=this.w;if(a.config.xaxis.type==="datetime"&&a.config.xaxis.labels.formatter===void 0&&a.config.tooltip.x.formatter===void 0){let o=new j(this.w);return o.formatDate(o.getDate(e),a.config.tooltip.x.format)}return t(e,s,i)}defaultGeneralFormatter(t){return Array.isArray(t)?t.map(e=>e):t}defaultYFormatter(t,e){let s=this.w;if(D.isNumber(t))if(s.globals.yValueDecimal!==0)t=t.toFixed(e.decimalsInFloat!==void 0?e.decimalsInFloat:s.globals.yValueDecimal);else{let i=t.toFixed(0);t=Number(i)===t?i:t.toFixed(1)}return t}setLabelFormatters(){let t=this.w,e=t.formatters;return e.xaxisTooltipFormatter=s=>this.defaultGeneralFormatter(s),e.ttKeyFormatter=s=>this.defaultGeneralFormatter(s),e.ttZFormatter=s=>s,e.legendFormatter=s=>this.defaultGeneralFormatter(s),t.config.xaxis.labels.formatter!==void 0?e.xLabelFormatter=t.config.xaxis.labels.formatter:e.xLabelFormatter=s=>{if(D.isNumber(s)){if(!t.config.xaxis.convertedCatToNumeric&&t.config.xaxis.type==="numeric"){if(D.isNumber(t.config.xaxis.decimalsInFloat))return s.toFixed(t.config.xaxis.decimalsInFloat);{let i=t.globals.maxX-t.globals.minX;return i>0&&i<100?s.toFixed(1):s.toFixed(0)}}return t.globals.isBarHorizontal&&t.globals.maxY-t.globals.minYArr<4?s.toFixed(1):s.toFixed(0)}return s},typeof t.config.tooltip.x.formatter=="function"?e.ttKeyFormatter=t.config.tooltip.x.formatter:e.ttKeyFormatter=e.xLabelFormatter,typeof t.config.xaxis.tooltip.formatter=="function"&&(e.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||t.config.tooltip.y.formatter!==void 0)&&(e.ttVal=t.config.tooltip.y),t.config.tooltip.z.formatter!==void 0&&(e.ttZFormatter=t.config.tooltip.z.formatter),t.config.legend.formatter!==void 0&&(e.legendFormatter=t.config.legend.formatter),e.yLabelFormatters=[],t.config.yaxis.forEach((s,i)=>{s.labels.formatter!==void 0?e.yLabelFormatters[i]=s.labels.formatter:e.yLabelFormatters[i]=a=>t.globals.xyCharts?Array.isArray(a)?a.map(o=>this.defaultYFormatter(o,s)):this.defaultYFormatter(a,s):a}),t.globals}heatmapLabelFormatters(){let t=this.w;if(t.config.chart.type==="heatmap"){t.globals.yAxisScale[0].result=t.seriesData.seriesNames.slice();let e=t.seriesData.seriesNames.reduce((s,i)=>s.length>i.length?s:i,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}},be=({isTimeline:u,seriesIndex:t,dataPointIndex:e,y1:s,y2:i,w:a})=>{var o;let r=a.rangeData.seriesRangeStart[t][e],n=a.rangeData.seriesRangeEnd[t][e],c=a.labelData.labels[e],l=a.config.series[t].name?a.config.series[t].name:"",h=a.formatters.ttKeyFormatter,d=a.config.tooltip.y.title.formatter,g={w:a,seriesIndex:t,dataPointIndex:e,start:r,end:n};typeof d=="function"&&(l=d(l,g)),(o=a.config.series[t].data[e])!=null&&o.x&&(c=a.config.series[t].data[e].x),u||a.config.xaxis.type==="datetime"&&(c=new yt(a).xLabelFormat(a.formatters.ttKeyFormatter,c,c,{i:void 0,dateFormatter:new j(a).formatDate,w:a})),typeof h=="function"&&(c=h(c,g)),Number.isFinite(s)&&Number.isFinite(i)&&(r=s,n=i);let p="",f="",x=a.globals.colors[t];if(a.config.tooltip.x.formatter===void 0)if(a.config.xaxis.type==="datetime"){let m=new j(a);p=m.formatDate(m.getDate(r),a.config.tooltip.x.format),f=m.formatDate(m.getDate(n),a.config.tooltip.x.format)}else p=r,f=n;else p=a.config.tooltip.x.formatter(r),f=a.config.tooltip.x.formatter(n);return{start:r,end:n,startVal:p,endVal:f,ylabel:c,color:x,seriesName:l}},me=u=>{let{color:t,seriesName:e,ylabel:s,start:i,end:a,seriesIndex:o,dataPointIndex:r}=u,n=u.w.globals.tooltip.tooltipLabels.getFormatters(o);i=n.yLbFormatter(i),a=n.yLbFormatter(a);let c=n.yLbFormatter(u.w.seriesData.series[o][r]),l="",h=` + ${i} + - + ${a} + `;return u.w.globals.comboCharts?u.w.config.series[o].type==="rangeArea"||u.w.config.series[o].type==="rangeBar"?l=h:l=`${c}`:l=h,'
'+(e||"")+'
'+s+": "+l+"
"},wt=class{constructor(t){this.opts=t}hideYAxis(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}line(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}sparkline(t){this.hideYAxis();let e={grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}};return D.extend(t,e)}slope(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter(t,e){let s=e.w.config.series[e.seriesIndex].name;return t!==null?s+": "+t:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}bar(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}funnel(){return this.hideYAxis(),W(I({},this.bar()),{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}candlestick(){return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Open","High","","Low","Close"],"candlestick")},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}boxPlot(){return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}rangeBar(){let t=s=>{let{color:i,seriesName:a,ylabel:o,startVal:r,endVal:n}=be(W(I({},s),{isTimeline:!0}));return me(W(I({},s),{color:i,seriesName:a,ylabel:o,start:r,end:n}))},e=s=>{let{color:i,seriesName:a,ylabel:o,start:r,end:n}=be(s);return me(W(I({},s),{color:i,seriesName:a,ylabel:o,start:r,end:n}))};return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter(s,{seriesIndex:i,dataPointIndex:a,w:o}){let r=()=>{let n=o.rangeData.seriesRangeStart[i][a];return o.rangeData.seriesRangeEnd[i][a]-n};return o.globals.comboCharts?o.config.series[i].type==="rangeBar"||o.config.series[i].type==="rangeArea"?r():s:r()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom(s){return s.w.config.plotOptions&&s.w.config.plotOptions.bar&&s.w.config.plotOptions.bar.horizontal?t(s):e(s)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}dumbbell(t){var e,s;return(e=t.plotOptions.bar)!=null&&e.barHeight||(t.plotOptions.bar.barHeight=2),(s=t.plotOptions.bar)!=null&&s.columnWidth||(t.plotOptions.bar.columnWidth=2),t}area(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}rangeArea(){let t=e=>{let{color:s,seriesName:i,ylabel:a,start:o,end:r}=be(e);return me(W(I({},e),{color:s,seriesName:i,ylabel:a,start:o,end:r}))};return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom(e){return t(e)}}}}brush(t){let e={chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}};return D.extend(t,e)}stacked100(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;let e=t.dataLabels.formatter;return t.yaxis.forEach((i,a)=>{t.yaxis[a].min=0,t.yaxis[a].max=100}),t.chart.type==="bar"&&(t.dataLabels.formatter=e||function(i){return typeof i=="number"?i&&i.toFixed(0)+"%":i}),t}stackedBars(){let t=this.bar();return W(I({},t),{plotOptions:W(I({},t.plotOptions),{bar:W(I({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(a){return D.isNumber(a)?Math.floor(a):a};let s=t.xaxis.labels.formatter,i=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return e&&e.length&&(i=e.map(a=>Array.isArray(a)?a:String(a))),i&&i.length&&(t.xaxis.labels.formatter=function(a){return D.isNumber(a)?s(i[Math.floor(a)-1]):s(a)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}bubble(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}scatter(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}heatmap(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}treemap(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}pie(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}donut(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}polarArea(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter(t){return t.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}radar(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:t=>t,style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}radialBar(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}_getBoxTooltip(t,e,s,i,a){let o=t.candleData.seriesCandleO[e][s],r=t.candleData.seriesCandleH[e][s],n=t.candleData.seriesCandleM[e][s],c=t.candleData.seriesCandleL[e][s],l=t.candleData.seriesCandleC[e][s],h=t.config.series[e];return h.type&&h.type!==a?`
+ ${h.name?h.name:"series-"+(e+1)}: ${t.seriesData.series[e][s]} +
`:`
${i[0]}: `+o+`
${i[1]}: `+r+"
"+(n?`
${i[2]}: `+n+"
":"")+`
${i[3]}: `+c+`
${i[4]}: `+l+"
"}},Mi="en",Pi={months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}},Os={name:Mi,options:Pi},lt=class{constructor(){this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}init(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[Os],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0,keyDown:void 0,keyUp:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0,navigation:{enabled:!0,wrapAround:!1}}},dataReducer:{enabled:!1,algorithm:"lttb",targetPoints:250,threshold:500}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter(t){return t}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter(t){return t+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter(t){return t.globals.seriesTotals.reduce((e,s)=>e+s,0)/t.seriesData.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter(t){return t},onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter(t){return t}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter(t){return t}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter(t){return t.globals.seriesTotals.reduce((e,s)=>e+s,0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter(t){return t!==null?t:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter(t){return t?t+": ":""}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65},accessibility:{colorBlindMode:""}}}}},vt=class{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,o,r,n,c,l,h;let d=this.opts,g=new lt,p=new wt(d);this.chartType=d.chart.type,d=this.extendYAxis(d),d=this.extendAnnotations(d);let f=g.init(),x={};if(d&&typeof d=="object"){let b={};["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(d.chart.type)!==-1?b=p[d.chart.type]():b=p.line(),(s=(e=d.plotOptions)==null?void 0:e.bar)!=null&&s.isFunnel&&(b=p.funnel()),d.chart.stacked&&d.chart.type==="bar"&&(b=p.stackedBars()),(i=d.chart.brush)!=null&&i.enabled&&(b=p.brush(b)),(o=(a=d.plotOptions)==null?void 0:a.line)!=null&&o.isSlopeChart&&(b=p.slope()),d.chart.stacked&&d.chart.stackType==="100%"&&(d=p.stacked100(d)),(n=(r=d.plotOptions)==null?void 0:r.bar)!=null&&n.isDumbbell&&(d=p.dumbbell(d)),this.checkForDarkTheme(Y.getApex()),this.checkForDarkTheme(d),d.xaxis=d.xaxis||Y.getApex().xaxis||{},t||(d.xaxis.convertedCatToNumeric=!1),d=this.checkForCatToNumericXAxis(this.chartType,b,d),((c=d.chart.sparkline)!=null&&c.enabled||(h=(l=Y.getApex().chart)==null?void 0:l.sparkline)!=null&&h.enabled)&&(b=p.sparkline(b)),x=D.extend(f,b)}let m=D.extend(x,Y.getApex());return f=D.extend(m,d),f=this.handleUserInputErrors(f),f}checkForCatToNumericXAxis(t,e,s){var i,a;let o=new wt(s),r=(t==="bar"||t==="boxPlot")&&((a=(i=s.plotOptions)==null?void 0:i.bar)==null?void 0:a.horizontal),n=t==="pie"||t==="polarArea"||t==="donut"||t==="radar"||t==="radialBar"||t==="heatmap",c=s.xaxis.type!=="datetime"&&s.xaxis.type!=="numeric",l=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return!r&&!n&&c&&l!=="between"&&(s=o.convertCatToNumeric(s)),s}extendYAxis(t,e){let s=new lt;(typeof t.yaxis>"u"||!t.yaxis||Array.isArray(t.yaxis)&&t.yaxis.length===0)&&(t.yaxis={});let i=Y.getApex();t.yaxis.constructor!==Array&&i.yaxis&&i.yaxis.constructor!==Array&&(t.yaxis=D.extend(t.yaxis,i.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[D.extend(s.yAxis,t.yaxis)]:t.yaxis=D.extendArray(t.yaxis,s.yAxis);let a=!1;t.yaxis.forEach(r=>{r.logarithmic&&(a=!0)});let o=t.series;return e&&!o&&(o=e.config.series),a&&o.length!==t.yaxis.length&&o.length&&(t.yaxis=o.map((r,n)=>{if(r.name||(o[n].name=`series-${n+1}`),t.yaxis[n])return t.yaxis[n].seriesName=o[n].name,t.yaxis[n];{let c=D.extend(s.yAxis,t.yaxis[0]);return c.show=!1,c}})),a&&o.length>1&&o.length!==t.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),t}extendAnnotations(t){return typeof t.annotations>"u"&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),t=this.extendPointAnnotations(t),t}extendYAxisAnnotations(t){let e=new lt;return t.annotations.yaxis=D.extendArray(typeof t.annotations.yaxis<"u"?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){let e=new lt;return t.annotations.xaxis=D.extendArray(typeof t.annotations.xaxis<"u"?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){let e=new lt;return t.annotations.points=D.extendArray(typeof t.annotations.points<"u"?t.annotations.points:[],e.pointAnnotation),t}checkForDarkTheme(t){t.theme&&t.theme.mode==="dark"&&(t.tooltip||(t.tooltip={}),t.tooltip.theme!=="light"&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}handleUserInputErrors(t){let e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if(e.chart.type==="bar"&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return(e.chart.type==="bar"||e.chart.type==="rangeBar")&&e.tooltip.shared&&e.xaxis.crosshairs.width==="barWidth"&&e.series.length>1&&(e.xaxis.crosshairs.width="tickWidth"),(e.chart.type==="candlestick"||e.chart.type==="boxPlot")&&e.yaxis[0].reversed&&(console.warn(`Reversed y-axis in ${e.chart.type} chart is not supported.`),e.yaxis[0].reversed=!1),e}},Bs=1.618,Hs=[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],Ae=[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24],Zt=class{initGlobalVars(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRange=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.dataWasParsed=!1,t.originalSeries=null,t.maxValsInArrayIndex=0,t.yValueDecimal=0,t.allSeriesHasEqualX=!0,t.labels=[],t.hasXaxisGroups=!1,t.groups=[],t.barGroups=[],t.lineGroups=[],t.areaGroups=[],t.hasSeriesGroups=!1,t.seriesGroups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.isXNumeric=!1,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0,t.disableZoomIn=!1,t.disableZoomOut=!1,t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.rotateXLabels=!1,t.overlappingXLabels=!1,t.radialSize=0,t.barHeight=0,t.barWidth=0,t.animationEnded=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.lastDrawnDataLabelsIndexes=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},t.seriesNS||this._attachNamespaces(t)}_attachNamespaces(t){let e=(r,n,c=n)=>{Object.defineProperty(r,c,{get(){return t[n]},set(l){t[n]=l},enumerable:!0,configurable:!0})},s={};e(s,"series","data");for(let r of["seriesNames","seriesX","seriesZ","seriesXvalues","seriesYvalues","seriesGoals","seriesLog","seriesColors","seriesPercent","seriesTotals","stackedSeriesTotals","seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC","seriesRangeStart","seriesRangeEnd","seriesRange","seriesYAxisMap","seriesYAxisReverseMap","seriesGroups","barGroups","lineGroups","areaGroups","originalSeries","collapsedSeries","collapsedSeriesIndices","ancillaryCollapsedSeries","ancillaryCollapsedSeriesIndices","allSeriesCollapsed","risingSeries","previousPaths","ignoreYAxisIndexes","labels","categoryLabels","timescaleLabels","groups"])e(s,r);Object.defineProperty(t,"seriesNS",{value:s,writable:!1,enumerable:!1,configurable:!0});let i={};for(let r of["minX","maxX","initialMinX","initialMaxX","minY","maxY","minYArr","maxYArr","minZ","maxZ","minDate","maxDate","minXDiff","xRange","yRange","zRange","xAxisScale","yAxisScale","xAxisTicksPositions","xTickAmount","multiAxisTickAmount","dataPoints","maxValsInArrayIndex","isXNumeric","isMultipleYAxis","isMultiLineX","isDataXYZ","dataFormatXNumeric","allSeriesHasEqualX","hasNullValues","dataWasParsed","hasXaxisGroups","hasSeriesGroups","skipFirstTimelinelabel","skipLastTimelinelabel","yValueDecimal","invalidLogScale","noLabelsProvided"])e(i,r);Object.defineProperty(t,"axes",{value:i,writable:!1,enumerable:!1,configurable:!0});let a={};for(let r of["svgWidth","svgHeight","gridWidth","gridHeight","translateX","translateY","translateXAxisX","translateXAxisY","translateYAxisX","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yAxisLabelsWidth","yAxisWidths","yLabelsCoords","yTitleCoords","padHorizontal","barPadForNumericAxis","rotateXLabels","scaleX","scaleY","radialSize","defaultLabels","overlappingXLabels"])e(a,r);Object.defineProperty(t,"layout",{value:a,writable:!1,enumerable:!1,configurable:!0});let o={};for(let r of["domCache","dimensionCache","cachedSelectors","textRectsCache","pointsArray","dataLabelsRects","lastDrawnDataLabelsIndexes","delayedElements","resizeTimer","selectionResizeTimer","resizeObserver"])e(o,r);Object.defineProperty(t,"cache",{value:o,writable:!1,enumerable:!1,configurable:!0})}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},LINE_HEIGHT_RATIO:Bs,axisCharts:!0,isSlopeChart:t.plotOptions.line.isSlopeChart,comboCharts:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],ignoreYAxisIndexes:[],isDirty:!1,isExecCalled:!1,dataChanged:!1,resized:!1,invalidLogScale:!1,hasNullValues:!1,columnSeries:null,yaxis:null,total:0,shouldAnimate:!0,previousPaths:[],svgWidth:0,svgHeight:0,defaultLabels:!1,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateYAxisX:[],yAxisWidths:[],tooltip:null,resizeObserver:null,locale:{},memory:{methodsToExec:[]},niceScaleAllowedMagMsd:Hs,niceScaleDefaultTicks:Ae,seriesYAxisMap:[],seriesYAxisReverseMap:[],noData:!1}}init(t){let e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=D.extend({},t),e.initialSeries=D.clone(t.series),e.lastXAxis=D.clone(e.initialConfig.xaxis),e.lastYAxis=D.clone(e.initialConfig.yaxis),e}},Ce=class{constructor(t){this.opts=t}init(){let t=new vt(this.opts).init({responsiveOverride:!1}),e=new Zt().init(t),s={config:t,globals:e,dom:{},interact:{zoomEnabled:t.chart.toolbar.autoSelected==="zoom"&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:t.chart.toolbar.autoSelected==="pan"&&t.chart.toolbar.tools.pan,selectionEnabled:t.chart.toolbar.autoSelected==="selection"&&t.chart.toolbar.tools.selection,zoomed:!1,selection:void 0,visibleXRange:void 0,selectedDataPoints:[],mousedown:!1,clientX:null,clientY:null,lastClientPosition:{},lastWheelExecution:0,capturedSeriesIndex:-1,capturedDataPointIndex:-1,disableZoomIn:!1,disableZoomOut:!1,isTouchDevice:Y.isBrowser()?"ontouchstart"in window||navigator.maxTouchPoints>0:!1},formatters:{xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,legendFormatter:void 0},candleData:{seriesCandleO:[],seriesCandleH:[],seriesCandleM:[],seriesCandleL:[],seriesCandleC:[]},rangeData:{seriesRangeStart:[],seriesRangeEnd:[],seriesRange:[]},labelData:{labels:[],categoryLabels:[],timescaleLabels:[],hasXaxisGroups:!1,groups:[],seriesGroups:[]},axisFlags:{isXNumeric:!1,dataFormatXNumeric:!1,isDataXYZ:!1,isRangeData:!1,isRangeBar:!1,isMultiLineX:!1,noLabelsProvided:!1,dataWasParsed:!1},seriesData:{series:[],seriesNames:[],seriesX:[],seriesZ:[],seriesColors:[],seriesGoals:[],stackedSeriesTotals:[],stackedSeriesTotalsByGroups:[]},layout:{gridHeight:0,gridWidth:0,translateX:0,translateY:0,translateXAxisX:0,translateXAxisY:0,rotateXLabels:!1,xAxisHeight:0,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yLabelsCoords:[],yTitleCoords:[]}};Object.defineProperty(e,"dom",{get(){return s.dom},set(i){s.dom=i},enumerable:!1,configurable:!0});for(let i of["xLabelFormatter","yLabelFormatters","xaxisTooltipFormatter","ttKeyFormatter","ttVal","ttZFormatter","legendFormatter"])Object.defineProperty(e,i,{get(){return s.formatters[i]},set(a){s.formatters[i]=a},enumerable:!1,configurable:!0});for(let i of["zoomEnabled","panEnabled","selectionEnabled","zoomed","selection","visibleXRange","selectedDataPoints","mousedown","clientX","clientY","lastClientPosition","lastWheelExecution","capturedSeriesIndex","capturedDataPointIndex","disableZoomIn","disableZoomOut","isTouchDevice"])Object.defineProperty(e,i,{get(){return s.interact[i]},set(a){s.interact[i]=a},enumerable:!1,configurable:!0});for(let i of["gridHeight","gridWidth","translateX","translateY","translateXAxisX","translateXAxisY","rotateXLabels","xAxisHeight","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yLabelsCoords","yTitleCoords"])Object.defineProperty(e,i,{get(){return s.layout[i]},set(a){s.layout[i]=a},enumerable:!1,configurable:!0});for(let i of["series","seriesNames","seriesX","seriesZ","seriesColors","seriesGoals","stackedSeriesTotals","stackedSeriesTotalsByGroups"])Object.defineProperty(e,i,{get(){return s.seriesData[i]},set(a){s.seriesData[i]=a},enumerable:!1,configurable:!0});for(let i of["isXNumeric","dataFormatXNumeric","isDataXYZ","isRangeData","isRangeBar","isMultiLineX","noLabelsProvided","dataWasParsed"])Object.defineProperty(e,i,{get(){return s.axisFlags[i]},set(a){s.axisFlags[i]=a},enumerable:!1,configurable:!0});for(let i of["labels","categoryLabels","timescaleLabels","hasXaxisGroups","groups","seriesGroups"])Object.defineProperty(e,i,{get(){return s.labelData[i]},set(a){s.labelData[i]=a},enumerable:!1,configurable:!0});for(let i of["seriesRangeStart","seriesRangeEnd","seriesRange"])Object.defineProperty(e,i,{get(){return s.rangeData[i]},set(a){s.rangeData[i]=a},enumerable:!1,configurable:!0});for(let i of["seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC"])Object.defineProperty(e,i,{get(){return s.candleData[i]},set(a){s.candleData[i]=a},enumerable:!1,configurable:!0});return s}},Z=class{constructor(t){this.w=t}static checkComboSeries(t,e){let s=!1,i=0,a=0;return e===void 0&&(e="line"),t.length&&typeof t[0].type<"u"&&t.forEach(o=>{(o.type==="bar"||o.type==="column"||o.type==="candlestick"||o.type==="boxPlot")&&i++,typeof o.type<"u"&&o.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){let e=this.w,s=[];if(e.seriesData.series.length===0)return s;for(let i=0;ie+s,0):this.w.seriesData.series[t].reduce((e,s)=>e+s,0)}getStackedSeriesTotalsByGroups(){let t=this.w,e=[];return t.labelData.seriesGroups.forEach(s=>{let i=[];t.config.series.forEach((o,r)=>{s.indexOf(t.seriesData.seriesNames[r])>-1&&i.push(r)});let a=t.seriesData.series.map((o,r)=>i.indexOf(r)===-1?r:-1).filter(o=>o!==-1);e.push(this.getStackedSeriesTotals(a))}),e}setSeriesYAxisMappings(){let t=this.w.globals,e=this.w.config,s=[],i=[],a=[],o=this.w.seriesData.series.length>e.yaxis.length||e.yaxis.some(c=>Array.isArray(c.seriesName));e.series.forEach((c,l)=>{a.push(l),i.push(null)}),e.yaxis.forEach((c,l)=>{s[l]=[]});let r=[];e.yaxis.forEach((c,l)=>{let h=!1;if(c.seriesName){let d=[];Array.isArray(c.seriesName)?d=c.seriesName:d.push(c.seriesName),d.forEach(g=>{e.series.forEach((p,f)=>{if(p.name===g){let x=f;l===f||o?!o||a.indexOf(f)>-1?s[l].push([l,f]):console.warn("Series '"+p.name+"' referenced more than once in what looks like the new style. That is, when using either seriesName: [], or when there are more series than yaxes."):(s[f].push([f,l]),x=l),h=!0,x=a.indexOf(x),x!==-1&&a.splice(x,1)}})})}h||r.push(l)}),s=s.map(c=>{let l=[];return c.forEach(h=>{i[h[1]]=h[0],l.push(h[1])}),l});let n=e.yaxis.length-1;for(let c=0;c{s[n].push(c),i[c]=n}),t.seriesYAxisMap=s.map(c=>c),t.seriesYAxisReverseMap=i.map(c=>c),t.seriesYAxisMap.forEach((c,l)=>{c.forEach(h=>{if(e.series[h]&&e.series[h].group===void 0){let d=e.series[h];d.group="apexcharts-axis-".concat(l.toString())}})})}isSeriesNull(t=null){let e=[];return t===null?e=this.w.config.series.filter(s=>s!==null):e=this.w.config.series[t].data.filter(s=>s!==null),e.length===0}seriesHaveSameValues(t){return this.w.seriesData.series[t].every((e,s,i)=>e===i[0])}getCategoryLabels(t){let e=this.w,s=t.slice();return e.config.xaxis.convertedCatToNumeric&&(s=t.map(i=>e.config.xaxis.labels.formatter(i-e.globals.minX+1))),s}getLargestSeries(){let t=this.w;t.globals.maxValsInArrayIndex=t.seriesData.series.map(e=>e.length).indexOf(Math.max.apply(Math,t.seriesData.series.map(e=>e.length)))}getLargestMarkerSize(){let t=this.w,e=0;return t.globals.markers.size.forEach(s=>{e=Math.max(e,s)}),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach(s=>{e=Math.max(e,s.size)}),e>0&&(t.config.markers.hover.size>0?e=t.config.markers.hover.size:e+=t.config.markers.hover.sizeOffset),t.globals.markers.largestSize=e,e}getSeriesTotals(){let t=this.w;t.globals.seriesTotals=t.seriesData.series.map(e=>{let s=0;if(Array.isArray(e))for(let i=0;i{let r=0;for(let n=0;nt&&s.seriesData.seriesX[o][n]{let s=[];if(Array.isArray(e))for(let i=0;io+r,0),a=100*e/i;s.push(a)}return s})}getCalculatedRatios(){let t=this.w,e=t.globals,s=[],i=0,a=0,o=0,r=0,n=[],c=.1,l=0;if(e.yRange=[],e.isMultipleYAxis)for(let h=0;h0){let h=(d,g)=>{let p=t.config.yaxis[t.globals.seriesYAxisReverseMap[g]],f=d<0?-1:1;return d=Math.abs(d),p.logarithmic&&(d=this.getBaseLog(p.logBase,d)),-f*d/s[g]};if(e.isMultipleYAxis){n=[];for(let d=0;d{let a=e.globals.seriesYAxisReverseMap[i];return e.config.yaxis[a]&&e.config.yaxis[a].logarithmic?s.map(o=>o===null?null:this.getLogVal(e.config.yaxis[a].logBase,o,i)):s}),e.globals.invalidLogScale?t:e.globals.seriesLog}getLogValAtSeriesIndex(t,e){if(t===null)return null;let s=this.w,i=s.globals.seriesYAxisReverseMap[e];return s.config.yaxis[i]&&s.config.yaxis[i].logarithmic?this.getLogVal(s.config.yaxis[i].logBase,t,e):t}getBaseLog(t,e){return Math.log(e)/Math.log(t)}getLogVal(t,e,s){if(e<=0)return 0;let i=this.w,a=i.globals.minYArr[s]===0?-1:this.getBaseLog(t,i.globals.minYArr[s]),r=(i.globals.maxYArr[s]===0?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;return e<1?e/r:(this.getBaseLog(t,e)-a)/r}getLogYRatios(t){let e=this.w,s=this.w.globals,i=s;return i.yLogRatio=t.slice(),i.logYRange=s.yRange.map((a,o)=>{let r=e.globals.seriesYAxisReverseMap[o];if(e.config.yaxis[r]&&this.w.config.yaxis[r].logarithmic){let n=-Number.MAX_VALUE,c=Number.MIN_VALUE,l=1;return s.seriesLog.forEach((h,d)=>{h.forEach(g=>{e.config.yaxis[d]&&e.config.yaxis[d].logarithmic&&(n=Math.max(g,n),c=Math.min(g,c))})}),l=Math.pow(s.yRange[o],Math.abs(c-n)/s.yRange[o]),i.yLogRatio[o]=l/this.w.layout.gridHeight,l}}),i.invalidLogScale?t.slice():i.yLogRatio}static extendArrayProps(t,e,s){var i,a;return e?.yaxis&&(e=t.extendYAxis(e,s)),e?.annotations&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),(i=e?.annotations)!=null&&i.xaxis&&(e=t.extendXAxisAnnotations(e)),(a=e?.annotations)!=null&&a.points&&(e=t.extendPointAnnotations(e))),e}drawSeriesByGroup(t,e,s,i){let a=this.w,o=[];return t.series.length>0&&e.forEach(r=>{let n=[],c=[];t.i.forEach((l,h)=>{a.config.series[l].group===r&&(n.push(t.series[h]),c.push(l))}),n.length>0&&o.push(i.draw(n,s,c))}),o}},ft=class{constructor(t,e){this.w=t,this.ctx=e}animateLine(t,e,s,i){t.attr(e).animate(i).attr(s)}animateMarker(t,e,s,i){t.attr({opacity:0}).animate(e).attr({opacity:1}).after(()=>{i()})}animateRect(t,e,s,i,a){t.attr(e).animate(i).attr(s).after(()=>a())}animatePathsGradually(t){let{el:e,realIndex:s,j:i,fill:a,pathFrom:o,pathTo:r,speed:n,delay:c}=t,l=this,h=this.w,d=0;h.config.chart.animations.animateGradually.enabled&&(d=h.config.chart.animations.animateGradually.delay),h.config.chart.animations.dynamicAnimation.enabled&&h.globals.dataChanged&&h.config.chart.type!=="bar"&&(d=0),l.morphSVG(e,s,i,h.config.chart.type==="line"&&!h.globals.comboCharts?"stroke":a,o,r,n,c*d)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{let e=t.el;e.classList.remove("apexcharts-element-hidden"),e.classList.add("apexcharts-hidden-element-shown")})}animationCompleted(t){let e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),typeof e.config.chart.events.animationEnd=="function"&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}morphSVG(t,e,s,i,a,o,r,n){let c=this.w;a||(a=t.attr("pathFrom")),o||(o=t.attr("pathTo"));let l=()=>(c.config.chart.type==="radar"&&(r=1),`M 0 ${c.layout.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=l()),(!o.trim()||o.indexOf("undefined")>-1||o.indexOf("NaN")>-1)&&(o=l()),c.globals.shouldAnimate||(r=1),t.plot(a).animate(1,n).plot(a).animate(r,n).plot(o).after(()=>{D.isNumber(s)?s===c.seriesData.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&this.animationCompleted(t):i!=="none"&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&e===c.seriesData.series.length-1||c.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}},J=class{constructor(t){this.w=t}getDefaultFilter(t,e){let s=this.w;t.unfilter&&t.unfilter(!0),s.config.chart.dropShadow.enabled&&this.dropShadow(t,s.config.chart.dropShadow,e)}applyFilter(t,e,s){var i,a,o;let r=this.w;if(t.unfilter&&t.unfilter(!0),s==="none"){this.getDefaultFilter(t,e);return}let n=r.config.chart.dropShadow,c=s==="lighten"?2:.3;t.filterWith&&(t.filterWith(l=>{l.colorMatrix({type:"matrix",values:` + ${c} 0 0 0 0 + 0 ${c} 0 0 0 + 0 0 ${c} 0 0 + 0 0 0 1 0 + `,in:"SourceGraphic",result:"brightness"}),n.enabled&&this.addShadow(l,e,n,"brightness")}),n.noUserSpaceOnUse||(a=(i=t.filterer())==null?void 0:i.node)==null||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize((o=t.filterer())==null?void 0:o.node))}addShadow(t,e,s,i){var a;let o=this.w,{blur:r,top:n,left:c,color:l,opacity:h}=s;if(l=Array.isArray(l)?l[e]:l,((a=o.config.chart.dropShadow.enabledOnSeries)==null?void 0:a.length)>0&&o.config.chart.dropShadow.enabledOnSeries.indexOf(e)===-1)return t;t.offset({in:i,dx:c,dy:n,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:r,result:"blur"}),t.flood({"flood-color":l,"flood-opacity":h,result:"flood"}),t.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),t.merge(["shadow",i])}dropShadow(t,e,s=0){var i,a,o,r,n;let c=this.w;return t.unfilter&&t.unfilter(!0),D.isMsEdge()&&c.config.chart.type==="radialBar"||((i=c.config.chart.dropShadow.enabledOnSeries)==null?void 0:i.length)>0&&((a=c.config.chart.dropShadow.enabledOnSeries)==null?void 0:a.indexOf(s))===-1||t.filterWith&&(t.filterWith(l=>{this.addShadow(l,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||(r=(o=t.filterer())==null?void 0:o.node)==null||r.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize((n=t.filterer())==null?void 0:n.node)),t}setSelectionFilter(t,e,s){let i=this.w;if(typeof i.interact.selectedDataPoints[e]<"u"&&i.interact.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);let a=i.config.states.active.filter;a!=="none"&&this.applyFilter(t,e,a.type)}}_scaleFilterSize(t){if(!t)return;(s=>{for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.setAttribute(i,s[i])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}},F=class u{constructor(t,e=null){this.w=t,this.ctx=e}roundPathCorners(t,e){t.indexOf("NaN")>-1&&(t="");function s(k,S,T){var P=S.x-k.x,M=S.y-k.y,E=Math.sqrt(P*P+M*M);return i(k,S,Math.min(1,T/E))}function i(k,S,T){return{x:k.x+(S.x-k.x)*T,y:k.y+(S.y-k.y)*T}}function a(k,S){k.length>2&&(k[k.length-2]=S.x,k[k.length-1]=S.y)}function o(k){return{x:parseFloat(k[k.length-2]),y:parseFloat(k[k.length-1])}}var r=t.split(/[,\s]/).reduce(function(k,S){var T=S.match(/^([a-zA-Z])(.+)/);return T?(k.push(T[1]),k.push(T[2])):k.push(S),k},[]),n=r.reduce(function(k,S){return parseFloat(S)==S&&k.length?k[k.length-1].push(S):k.push([S]),k},[]),c=[];if(n.length>1){var l=o(n[0]),h=null;n[n.length-1][0]=="Z"&&n[0].length>2&&(h=["L",l.x,l.y],n[n.length-1]=h),c.push(n[0]);for(var d=1;d2&&p[0]=="L"&&f.length>2&&f[0]=="L"){var x=o(g),m=o(p),b=o(f),v,y;v=s(m,x,e),y=s(m,b,e),a(p,v),p.origPoint=m,c.push(p);var w=i(v,m,.5),A=i(m,y,.5),C=["C",w.x,w.y,A.x,A.y,y.x,y.y];C.origPoint=m,c.push(C)}else c.push(p)}if(h){var L=o(c[c.length-1]);c.push(["Z"]),a(c[0],L)}}else c=n;return c.reduce(function(k,S){return k+S.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",o=0,r=null,n="butt"){return this.w.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":o,"stroke-width":r,"stroke-linecap":n})}drawRect(t=0,e=0,s=0,i=0,a=0,o="#fefefe",r=1,n=null,c=null,l=0){let d=this.w.dom.Paper.rect();return d.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,rx:a,ry:a,opacity:r,"stroke-width":n!==null?n:0,stroke:c!==null?c:"none","stroke-dasharray":l}),d.node.setAttribute("fill",o),d}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){let s=this.w;t<0&&(t=0);let i=s.dom.Paper.circle(t*2);return e!==null&&i.attr(e),i}drawPath({d:t="",stroke:e="#a8a8a8",strokeWidth:s=1,fill:i,fillOpacity:a=1,strokeOpacity:o=1,classes:r,strokeLinecap:n=null,strokeDashArray:c=0}){let l=this.w;return n===null&&(n=l.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${l.layout.gridHeight}`),l.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":o,"stroke-linecap":n,"stroke-width":s,"stroke-dasharray":c,class:r})}group(t=null){let s=this.w.dom.Paper.group();return t!==null&&s.attr(t),s}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){return s==="H"?[" H",t].join(" "):s==="V"?[" V",e].join(" "):[" L",t,e].join(" ")}curve(t,e,s,i,a,o){return["C",t,e,s,i,a,o].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,o,r,n=!1){let c="A";return n&&(c="a"),[c,t,e,s,i,a,o,r].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,stroke:a,strokeWidth:o,strokeLinecap:r,fill:n,animationDelay:c,initialSpeed:l,dataChangeSpeed:h,className:d,chartType:g,shouldClipToGrid:p=!0,bindEventsOnPaths:f=!0,drawShadow:x=!0}){let m=this.w,b=new J(this.w),v=new ft(this.w,void 0),y=this.w.config.chart.animations.enabled,w=y&&this.w.config.chart.animations.dynamicAnimation.enabled;if(s&&s.startsWith("M 0 0")&&i){let P=i.match(/^M\s+[\d.-]+\s+[\d.-]+/);P&&(s=s.replace(/^M\s+0\s+0/,P[0]))}let A,C=!!(y&&!m.globals.resized||w&&m.globals.dataChanged&&m.globals.shouldAnimate);C?A=s:(A=i,m.globals.animationEnded=!0);let L=m.config.stroke.dashArray,k=0;Array.isArray(L)?k=L[e]:k=m.config.stroke.dashArray;let S=this.drawPath({d:A,stroke:a,strokeWidth:o,fill:n,fillOpacity:1,classes:d,strokeLinecap:r,strokeDashArray:k});S.attr("index",e),p&&(g==="bar"&&!m.globals.isBarHorizontal||m.globals.comboCharts?S.attr({"clip-path":`url(#gridRectBarMask${m.globals.cuid})`}):S.attr({"clip-path":`url(#gridRectMask${m.globals.cuid})`})),m.config.chart.dropShadow.enabled&&x&&b.dropShadow(S,m.config.chart.dropShadow,e),f&&(S.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,S)),S.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,S)),S.node.addEventListener("mousedown",this.pathMouseDown.bind(this,S))),S.attr({pathTo:i,pathFrom:s});let T={el:S,j:t,realIndex:e,pathFrom:s,pathTo:i,fill:n,strokeWidth:o,delay:c};return y&&!m.globals.resized&&!m.globals.dataChanged?v.animatePathsGradually(W(I({},T),{speed:l})):(m.globals.resized||!m.globals.dataChanged)&&v.showDelayedElements(),m.globals.dataChanged&&w&&C&&v.animatePathsGradually(W(I({},T),{speed:h})),S}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.dom.Paper.pattern(e,s,n=>{t==="horizontalLines"?n.line(0,0,s,0).stroke({color:i,width:a+1}):t==="verticalLines"?n.line(0,0,0,e).stroke({color:i,width:a+1}):t==="slantedLines"?n.line(0,0,e,s).stroke({color:i,width:a}):t==="squares"?n.rect(e,s).fill("none").stroke({color:i,width:a}):t==="circles"&&n.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,o=null,r=null,n=[],c=0){let l=this.w,h;e.length<9&&e.indexOf("#")===0&&(e=D.hexToRgba(e,i)),s.length<9&&s.indexOf("#")===0&&(s=D.hexToRgba(s,a));let d=0,g=1,p=1,f=null;r!==null&&(d=typeof r[0]<"u"?r[0]/100:0,g=typeof r[1]<"u"?r[1]/100:1,p=typeof r[2]<"u"?r[2]/100:1,f=typeof r[3]<"u"?r[3]/100:null);let x=l.config.chart.type==="donut"||l.config.chart.type==="pie"||l.config.chart.type==="polarArea"||l.config.chart.type==="bubble";if(!n||n.length===0?h=l.dom.Paper.gradient(x?"radial":"linear",m=>{m.stop(d,e,i),m.stop(g,s,a),m.stop(p,s,a),f!==null&&m.stop(f,e,i)}):h=l.dom.Paper.gradient(x?"radial":"linear",m=>{(Array.isArray(n[c])?n[c]:n).forEach(v=>{m.stop(v.offset/100,v.color,v.opacity)})}),!x)t==="vertical"?h.from(0,0).to(0,1):t==="diagonal"?h.from(0,0).to(1,1):t==="horizontal"?h.from(0,1).to(1,1):t==="diagonal2"&&h.from(1,0).to(0,1);else{let m=l.layout.gridWidth/2,b=l.layout.gridHeight/2;l.config.chart.type!=="bubble"?h.attr({gradientUnits:"userSpaceOnUse",cx:m,cy:b,r:o}):h.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}return h}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){let a=this.getTextRects(t,s,i,""),o=a.width/t.length,r=Math.floor(e/o);return e"u"&&(s="");let f=s;i||(i="start"),(!n||!n.length)&&(n=p.config.chart.foreColor),o=o||p.config.chart.fontFamily,a=a||"11px",r=r||"regular";let x={maxWidth:l,fontSize:a,fontFamily:o},m;return Array.isArray(s)?m=p.dom.Paper.text(b=>{for(let v=0;vb.tspan(f))),m.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":g,"font-size":a,"font-family":o,"font-weight":r,fill:n,class:"apexcharts-text "+h}),m.node.style.fontFamily=o,m.node.style.opacity=c,m}getMarkerPath(t,e,s,i){let a="";switch(s){case"cross":i=i/1.4,a=`M ${t-i} ${e-i} L ${t+i} ${e+i} M ${t-i} ${e+i} L ${t+i} ${e-i}`;break;case"plus":i=i/1.12,a=`M ${t-i} ${e} L ${t+i} ${e} M ${t} ${e-i} L ${t} ${e+i}`;break;case"star":case"sparkle":{let o=5;i=i*1.15,s==="sparkle"&&(i=i/1.1,o=4);let r=Math.PI/o;for(let n=0;n<=2*o;n++){let c=n*r,l=n%2===0?i:i/2,h=t+l*Math.sin(c),d=e-l*Math.cos(c);a+=(n===0?"M":"L")+h+","+d}a+="Z";break}case"triangle":a=`M ${t} ${e-i} + L ${t+i} ${e+i} + L ${t-i} ${e+i} + Z`;break;case"square":case"rect":i=i/1.125,a=`M ${t-i} ${e-i} + L ${t+i} ${e-i} + L ${t+i} ${e+i} + L ${t-i} ${e+i} + Z`;break;case"diamond":i=i*1.05,a=`M ${t} ${e-i} + L ${t+i} ${e} + L ${t} ${e+i} + L ${t-i} ${e} + Z`;break;case"line":i=i/1.1,a=`M ${t-i} ${e} + L ${t+i} ${e}`;break;case"circle":default:i=i*2,a=`M ${t}, ${e} + m -${i/2}, 0 + a ${i/2},${i/2} 0 1,0 ${i},0 + a ${i/2},${i/2} 0 1,0 -${i},0`;break}return a}drawMarkerShape(t,e,s,i,a){let o=this.drawPath({d:this.getMarkerPath(t,e,s,i),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return o.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),o}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return D.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,s?.shape,i,I(I({},s),s.shape==="line"||s.shape==="plus"||s.shape==="cross"?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){var s,i;let a=this.w,o=new J(this.w),r=parseInt((s=t.node.getAttribute("index"))!=null?s:"",10),n=parseInt((i=t.node.getAttribute("j"))!=null?i:"",10);if(!(isNaN(r)||isNaN(n))&&(typeof a.config.chart.events.dataPointMouseEnter=="function"&&a.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}),u._fireEvent(a,"dataPointMouseEnter",[e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}]),!(a.config.states.active.filter.type!=="none"&&t.node.getAttribute("selected")==="true")&&a.config.states.hover.filter.type!=="none"&&!a.interact.isTouchDevice)){let c=a.config.states.hover.filter;o.applyFilter(t,r,c.type)}}pathMouseLeave(t,e){var s,i;let a=this.w,o=new J(this.w),r=parseInt((s=t.node.getAttribute("index"))!=null?s:"",10),n=parseInt((i=t.node.getAttribute("j"))!=null?i:"",10);isNaN(r)||isNaN(n)||(typeof a.config.chart.events.dataPointMouseLeave=="function"&&a.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}),u._fireEvent(a,"dataPointMouseLeave",[e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}]),!(a.config.states.active.filter.type!=="none"&&t.node.getAttribute("selected")==="true")&&a.config.states.hover.filter.type!=="none"&&o.getDefaultFilter(t,r))}pathMouseDown(t,e){var s,i;let a=this.w,o=new J(this.w),r=parseInt((s=t.node.getAttribute("index"))!=null?s:"",10),n=parseInt((i=t.node.getAttribute("j"))!=null?i:"",10);if(isNaN(r)||isNaN(n))return;let c="false";if(t.node.getAttribute("selected")==="true"){t.node.setAttribute("selected","false");let l=a.interact.selectedDataPoints[r].indexOf(n);l>-1&&a.interact.selectedDataPoints[r].splice(l,1)}else{if(!a.config.states.active.allowMultipleDataPointsSelection&&a.interact.selectedDataPoints.length>0){a.interact.selectedDataPoints=[];let l=a.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),h=a.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),d=g=>{Array.prototype.forEach.call(g,p=>{p.node.setAttribute("selected","false"),o.getDefaultFilter(p,r)})};d(l),d(h)}t.node.setAttribute("selected","true"),c="true",typeof a.interact.selectedDataPoints[r]>"u"&&(a.interact.selectedDataPoints[r]=[]),a.interact.selectedDataPoints[r].push(n)}if(c==="true"){let l=a.config.states.active.filter;if(l!=="none")o.applyFilter(t,r,l.type);else if(a.config.states.hover.filter!=="none"&&!a.interact.isTouchDevice){let h=a.config.states.hover.filter;o.applyFilter(t,r,h.type)}}else if(a.config.states.active.filter.type!=="none")if(a.config.states.hover.filter.type!=="none"&&!a.interact.isTouchDevice){let l=a.config.states.hover.filter;o.applyFilter(t,r,l.type)}else o.getDefaultFilter(t,r);typeof a.config.chart.events.dataPointSelection=="function"&&a.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:r,dataPointIndex:n,w:a}),e&&u._fireEvent(a,"dataPointSelection",[e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:r,dataPointIndex:n,w:a}])}rotateAroundCenter(t){let e={};t&&typeof t.getBBox=="function"&&(e=t.getBBox());let s=e.x+e.width/2,i=e.y+e.height/2;return{x:s,y:i}}setupEventDelegation(t,e){let s=null;t.node.addEventListener("mouseover",i=>{let a=u._findDelegateTarget(i.target,t.node,e);!a||a===s||(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=a,a.instance&&this.pathMouseEnter(a.instance,i))}),t.node.addEventListener("mouseout",i=>{if(!s)return;(i.relatedTarget?u._findDelegateTarget(i.relatedTarget,t.node,e):null)!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=null)}),t.node.addEventListener("mousedown",i=>{let a=u._findDelegateTarget(i.target,t.node,e);a&&a.instance&&this.pathMouseDown(a.instance,i)})}static _fireEvent(t,e,s){let i=t.globals.events;if(!i||!Object.prototype.hasOwnProperty.call(i,e))return;let a=i[e];for(let o=0;o0&&t.getComputedTextLength()>=s/1.1)){for(let i=e.length-3;i>0;i-=3)if(t.getSubStringLength(0,i)<=s/1.1){t.textContent=e.substring(0,i)+"...";return}t.textContent="."}}},V="http://www.w3.org/2000/svg",at=class u{constructor(t,e){typeof t=="object"?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}transform(t){return t.apply(this)}clone(){return new u(this.x,this.y)}},_t=class u{constructor(t,e,s,i,a,o){this.a=t??1,this.b=e??0,this.c=s??0,this.d=i??1,this.e=a??0,this.f=o??0}rotate(t){let e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new u(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new u(t,0,0,e??t,0,0))}multiply(t){return new u(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}apply(t){return new at(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}},Se=class{constructor(t,e,s,i){this.x=t,this.y=e,this.w=s,this.h=i,this.width=s,this.height=i,this.x2=t+s,this.y2=e+i}},st=class{constructor(t){this.w=t,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){let e=this.w,s=e.config,i=parseInt(String(e.layout.gridWidth),10),a=parseInt(String(e.layout.gridHeight),10),o=i>a?i:a,r=t.image,n=0,c=0;typeof t.width>"u"&&typeof t.height>"u"?s.fill.image.width!==void 0&&s.fill.image.height!==void 0?(n=s.fill.image.width+1,c=s.fill.image.height):(n=o+1,c=o):(n=t.width,c=t.height);let l=z.createElementNS(V,"pattern");F.setAttrs(l,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:n+"px",height:c+"px"});let h=z.createElementNS(V,"image");l.appendChild(h);let d=Y.isBrowser()?window.SVG:global.SVG;h.setAttributeNS(d.xlink,"href",r),F.setAttrs(h,{x:0,y:0,preserveAspectRatio:"none",width:n+"px",height:c+"px"}),h.style.opacity=t.opacity,e.dom.elDefs.node.appendChild(l)}getSeriesIndex(t){let e=this.w,s=e.config.chart.type;return(s==="bar"||s==="rangeBar")&&e.config.plotOptions.bar.distributed||s==="heatmap"||s==="treemap"?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.seriesData.series.length,this.seriesIndex}computeColorStops(t,e){let s=this.w,i=null,a=null;for(let c of t)c>=e.threshold?(i===null||c>i)&&(i=c):(a===null||c-1?f=D.getOpacityFromRGBA(g):b=D.hexToRgba(D.rgb2hex(g),f);let v=D.isCSSVariable(g)?D.getThemeColor(g):g;if(p==="pattern"&&(c=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:c,fillColor:v,defaultColor:b})),x){let y=r.fill.gradient.colorStops?[...r.fill.gradient.colorStops]:[],w=r.fill.gradient.type;h&&(y[this.seriesIndex]=this.computeColorStops(o.seriesData.series[this.seriesIndex],r.plotOptions.line.colors),w="vertical"),l=this.handleGradientFill({type:w,fillConfig:t.fillConfig,fillColor:v,fillOpacity:f,colorStops:y,i:this.seriesIndex})}if(p==="image"){let y=r.fill.image.src,w=t.patternID?t.patternID:"",A=`pattern${o.globals.cuid}${t.seriesNumber+1}${w}`;this.patternIDs.indexOf(A)===-1&&(this.clippedImgArea({opacity:f,image:Array.isArray(y)?t.seriesNumber-1&&(g=D.getOpacityFromRGBA(h));let p=r.gradient.opacityTo===void 0?s:Array.isArray(r.gradient.opacityTo)?r.gradient.opacityTo[o]:r.gradient.opacityTo;if(r.gradient.gradientToColors===void 0||r.gradient.gradientToColors.length===0)r.gradient.shade==="dark"?d=l.shadeColor(parseFloat(r.gradient.shadeIntensity)*-1,e.indexOf("rgb")>-1?D.rgb2hex(e):e):d=l.shadeColor(parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?D.rgb2hex(e):e);else if(r.gradient.gradientToColors[n.seriesNumber]){let f=r.gradient.gradientToColors[n.seriesNumber];d=f,f.indexOf("rgba")>-1&&(p=D.getOpacityFromRGBA(f))}else d=e;if(r.gradient.gradientFrom&&(h=r.gradient.gradientFrom),r.gradient.gradientTo&&(d=r.gradient.gradientTo),r.gradient.inverseColors){let f=h;h=d,d=f}return h.indexOf("rgb")>-1&&(h=D.rgb2hex(h)),d.indexOf("rgb")>-1&&(d=D.rgb2hex(d)),c.drawGradient(t,h,d,g,p,n.size,r.gradient.stops,a,o)}},gt=class{constructor(t,e){this.w=t,this.ctx=e,this._filters=new J(this.w),this._graphics=new F(this.w,this.ctx)}setGlobalMarkerSize(){let t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.length"u"&&t.globals.markers.size.push(t.globals.markers.size[0])}else t.globals.markers.size=t.config.series.map(()=>t.config.markers.size)}plotChartMarkers({pointsPos:t,seriesIndex:e,j:s,pSize:i,alwaysDrawMarker:a=!1,isVirtualPoint:o=!1}){let r=this.w,n=e,c=t,l=null,h=new F(this.w),d=r.config.markers.discrete&&r.config.markers.discrete.length;if(Array.isArray(c.x))for(let g=0;g0:r.config.markers.size>0)||a||d){x||(m+=` w${D.randomId()}`);let v=this.getMarkerConfig({cssClass:m,seriesIndex:e,dataPointIndex:f}),y=r.config.series[n];y.data[f]&&(y.data[f].fillColor&&(v.pointFillColor=y.data[f].fillColor),y.data[f].strokeColor&&(v.pointStrokeColor=y.data[f].strokeColor)),typeof i<"u"&&(v.pSize=i),(c.x[g]<-r.globals.markers.largestSize||c.x[g]>r.layout.gridWidth+r.globals.markers.largestSize||c.y[g]<-r.globals.markers.largestSize||c.y[g]>r.layout.gridHeight+r.globals.markers.largestSize)&&(v.pSize=0),x||((r.globals.markers.size[e]>0||a||d)&&!l&&(l=h.group({class:a||d?"":"apexcharts-series-markers"}),l.attr("clip-path",`url(#gridRectMarkerMask${r.globals.cuid})`),this.setupMarkerDelegation(l)),p=h.drawMarker(c.x[g],c.y[g],v),p.attr("rel",f),p.attr("j",f),p.attr("index",e),p.node.setAttribute("default-marker-size",v.pSize),this._filters.setSelectionFilter(p,e,f),l&&l.add(p))}else typeof r.globals.pointsArray[e]>"u"&&(r.globals.pointsArray[e]=[]),r.globals.pointsArray[e].push([c.x[g],c.y[g]])}return l}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:o=null}){let r=this.w,n=this.getMarkerStyle(e),c=a===null?r.globals.markers.size[e]:a,l=r.config.markers;return s!==null&&l.discrete.length&&l.discrete.map(h=>{h.seriesIndex===e&&h.dataPointIndex===s&&(n.pointStrokeColor=h.strokeColor,n.pointFillColor=h.fillColor,c=h.size,n.pointShape=h.shape)}),{pSize:i===null?c:i,pRadius:i!==null?i:l.radius,pointStrokeWidth:o!==null?o:Array.isArray(l.strokeWidth)?l.strokeWidth[e]:l.strokeWidth,pointStrokeColor:n.pointStrokeColor,pointFillColor:n.pointFillColor,shape:n.pointShape||(Array.isArray(l.shape)?l.shape[e]:l.shape),class:t,pointStrokeOpacity:Array.isArray(l.strokeOpacity)?l.strokeOpacity[e]:l.strokeOpacity,pointStrokeDashArray:Array.isArray(l.strokeDashArray)?l.strokeDashArray[e]:l.strokeDashArray,pointFillOpacity:Array.isArray(l.fillOpacity)?l.fillOpacity[e]:l.fillOpacity,seriesIndex:e}}setupMarkerDelegation(t){let e=this.w,s=".apexcharts-marker";this._graphics.setupEventDelegation(t,s),t.node.addEventListener("click",i=>{e.config.markers.onClick&&F._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}),t.node.addEventListener("dblclick",i=>{e.config.markers.onDblClick&&F._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}),t.node.addEventListener("touchstart",i=>{let a=F._findDelegateTarget(i.target,t.node,s);a&&a.instance&&this._graphics.pathMouseDown(a.instance,i)},{passive:!0})}addEvents(t){let e=this.w;t.node.addEventListener("mouseenter",this._graphics.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",this._graphics.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",this._graphics.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",this._graphics.pathMouseDown.bind(this.ctx,t),{passive:!0})}getMarkerStyle(t){let e=this.w,s=e.globals.markers.colors,i=e.config.markers.strokeColor||e.config.markers.strokeColors,a=Array.isArray(i)?i[t]:i,o=Array.isArray(s)?s[t]:s;return{pointStrokeColor:a,pointFillColor:o}}},jt=class{constructor(t,e){this.ctx=e,this.w=t,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new ft(this.w),this.filters=new J(this.w),this.fill=new st(this.w),this.markers=new gt(this.w,this.ctx),this.graphics=new F(this.w)}draw(t,e,s){let i=this.w,a=this.graphics,o=s.realIndex,r=s.pointsPos,n=s.zRatio,c=s.elParent,l=a.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`});if(l.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(l),Array.isArray(r.x))for(let h=0;hm.maxBubbleRadius&&(p=m.maxBubbleRadius)}let f=r.x[h],x=r.y[h];if(p=p||0,(x===null||typeof i.seriesData.series[o][d]>"u")&&(g=!1),g){let m=this.drawPoint(f,x,p,o,d,e);l.add(m)}c.add(l)}}drawPoint(t,e,s,i,a,o){let r=this.w,n=i,c=this.anim,l=this.filters,h=this.fill,d=this.markers,g=this.graphics,p=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:n,dataPointIndex:a,radius:r.config.chart.type==="bubble"||r.globals.comboCharts&&r.config.series[i]&&r.config.series[i].type==="bubble"?s:null}),f=h.fillPath({seriesNumber:i,dataPointIndex:a,color:p.pointFillColor,patternUnits:"objectBoundingBox",value:r.seriesData.series[i][o]}),x=g.drawMarker(t,e,p),m=r.config.series[n];if(m.data[a]&&m.data[a].fillColor&&(f=m.data[a].fillColor),x.attr({fill:f}),r.config.chart.dropShadow.enabled){let b=r.config.chart.dropShadow;l.dropShadow(x,b,i)}if(this.initialAnim&&!r.globals.dataChanged&&!r.globals.resized){let b=r.config.chart.animations.speed;c.animateMarker(x,b,r.globals.easing,()=>{window.setTimeout(()=>{c.animationCompleted(x)},100)})}else r.globals.animationEnded=!0;return x.attr({rel:a,j:a,index:i,"default-marker-size":p.pSize}),l.setSelectionFilter(x,i,a),x.node.classList.add("apexcharts-marker"),x}centerTextInBubble(t){let e=this.w;return t=t+parseInt(e.config.dataLabels.style.fontSize,10)/4,{y:t}}},ct=class{constructor(t,e=null){this.w=t,this.ctx=e}dataLabelsCorrection(t,e,s,i,a,o,r){let n=this.w,c=new F(this.w),l=!1,h=c.getTextRects(s,r),d=h.width,g=h.height;e<0&&(e=0),e>n.layout.gridHeight+g&&(e=n.layout.gridHeight+g/2),typeof n.globals.dataLabelsRects[i]>"u"&&(n.globals.dataLabelsRects[i]=[]),n.globals.dataLabelsRects[i].push({x:t,y:e,width:d,height:g});let p=n.globals.dataLabelsRects[i].length-2,f=typeof n.globals.lastDrawnDataLabelsIndexes[i]<"u"?n.globals.lastDrawnDataLabelsIndexes[i][n.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(typeof n.globals.dataLabelsRects[i][p]<"u"){let x=n.globals.dataLabelsRects[i][f];(t>x.x+x.width||e>x.y+x.height||e+gr.config.dataLabels.formatter(y,{seriesIndex:s,dataPointIndex:d,w:r});r.config.chart.type==="bubble"?(x=r.seriesData.seriesZ[s][d],m=b(x),h=e.y[f],h=new jt(this.w,this.ctx).centerTextInBubble(h).y):typeof x<"u"&&(m=b(x));let v=r.config.dataLabels.textAnchor;r.globals.isSlopeChart&&(d===0?v="end":d===r.config.series[s].data.length-1?v="start":v="middle"),this.plotDataLabelsText({x:l,y:h,text:m,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:r.config.dataLabels,textAnchor:v})}return g}plotDataLabelsText(t){let e=this.w,s=new F(this.w),{x:i,y:a,i:o,j:r,text:n,textAnchor:c,fontSize:l,parent:h,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:p,offsetCorrection:f,className:x}=t,m=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(o)<0)return m;let b={x:i,y:a,drawnextLabel:!0,textRects:null};f&&(b=this.dataLabelsCorrection(i,a,n,o,r,p,parseInt(d.style.fontSize,10).toString())),e.interact.zoomed||(i=b.x,a=b.y),b.textRects&&(i<-20-b.textRects.width||i>e.layout.gridWidth+b.textRects.width+30)&&(n="");let v=e.globals.dataLabels.style.colors[o];((e.config.chart.type==="bar"||e.config.chart.type==="rangeBar")&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(v=e.globals.dataLabels.style.colors[r]),typeof v=="function"&&(v=v({series:e.seriesData.series,seriesIndex:o,dataPointIndex:r,w:e})),g&&(v=g);let y=d.offsetX,w=d.offsetY;if((e.config.chart.type==="bar"||e.config.chart.type==="rangeBar")&&(y=0,w=0),e.globals.isSlopeChart&&(r!==0&&(y=d.offsetX*-2+5),r!==0&&r!==e.config.series[o].data.length-1&&(y=0)),b.drawnextLabel){if(c==="middle"&&i===e.layout.gridWidth&&(c="end"),m=s.drawText({x:i+y,y:a+w,foreColor:v,textAnchor:c||d.textAnchor,text:n,fontSize:l||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),m.attr({class:x||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){let A=d.dropShadow;new J(this.w).dropShadow(m,A)}h.add(m),typeof e.globals.lastDrawnDataLabelsIndexes[o]>"u"&&(e.globals.lastDrawnDataLabelsIndexes[o]=[]),e.globals.lastDrawnDataLabelsIndexes[o].push(r)}return m}addBackgroundToDataLabel(t,e){let s=this.w,i=s.config.dataLabels.background,a=i.padding,o=i.padding/2,r=e.width,n=e.height,l=new F(this.w).drawRect(e.x-a,e.y-o/2,r+a*2,n+o,i.borderRadius,s.config.chart.background==="transparent"||!s.config.chart.background?"#fff":s.config.chart.background,i.opacity,i.borderWidth,i.borderColor);return i.dropShadow.enabled&&new J(this.w).dropShadow(l,i.dropShadow),l}dataLabelsBackground(){var t;let e=this.w;if(e.config.chart.type==="bubble")return;let s=e.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let i=0;i"u"?"":t[i],l=c,h=n.formatters.xLabelFormatter,d=n.config.xaxis.labels.formatter,g=!1,p=new yt(this.w),f=c;r&&(l=p.xLabelFormat(h,c,f,{i,dateFormatter:new j(this.w).formatDate,w:n}),d!==void 0&&(l=d(c,t[i],{i,dateFormatter:new j(this.w).formatDate,w:n})));let x=y=>{let w=null;return e.forEach(A=>{A.unit==="month"?w="year":A.unit==="day"?w="month":A.unit==="hour"?w="day":A.unit==="minute"&&(w="hour")}),w===y};e.length>0?(g=x(e[i].unit),s=e[i].position,l=e[i].value):n.config.xaxis.type==="datetime"&&d===void 0&&(l=""),typeof l>"u"&&(l=""),l=Array.isArray(l)?l:l.toString();let m=new F(this.w),b={};n.layout.rotateXLabels&&r?b=m.getTextRects(l,parseInt(o,10).toString(),null,`rotate(${n.config.xaxis.labels.rotate} 0 0)`,!1):b=m.getTextRects(l,parseInt(o,10).toString());let v=!n.config.xaxis.labels.showDuplicates&&this.timeScale;return!Array.isArray(l)&&(String(l)==="NaN"||a.indexOf(l)>=0&&v)&&(l=""),{x:s,text:l,textRect:b,isBold:g}}checkLabelBasedOnTickamount(t,e,s){let i=this.w,a=i.config.xaxis.tickAmount;if(a==="dataPoints"&&(a=Math.round(i.layout.gridWidth/120)),a>s)return e;let o=Math.round(s/(a+1));return t%o===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){let o=this.w;if(t===0&&o.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&o.globals.skipLastTimelinelabel&&(e.text=""),o.config.xaxis.labels.hideOverlappingLabels&&i.length>0){let r=a[a.length-1];if(o.config.xaxis.labels.trim&&o.config.xaxis.type!=="datetime")return e;e.xe.collapsedSeriesIndices.indexOf(s)===-1)}translateYAxisIndex(t){let e=this.w,s=e.globals,i=e.config.yaxis;return e.seriesData.series.length>i.length||i.some(o=>Array.isArray(o.seriesName))?t:s.seriesYAxisReverseMap[t]}isYAxisHidden(t){let e=this.w,s=e.config.yaxis[t];if(!s.show||this.yAxisAllSeriesCollapsed(t))return!0;if(!s.showForNullSeries){let i=e.globals.seriesYAxisMap[t],a=new Z(this.w);return i.every(o=>a.isSeriesNull(o))}return!1}getYAxisForeColor(t,e){var s;let i=this.w;return Array.isArray(t)&&i.globals.yAxisScale[e]&&((s=this.theme)==null||s.pushExtraColors(t,i.globals.yAxisScale[e].result.length,!1)),t}drawYAxisTicks(t,e,s,i,a,o,r){let n=this.w,c=new F(this.w),l=n.layout.translateY+n.config.yaxis[a].labels.offsetY;if(n.globals.isBarHorizontal?l=0:n.config.chart.type==="heatmap"&&(l+=o/2),i.show&&e>0){n.config.yaxis[a].opposite===!0&&(t=t+i.width);for(let h=e;h>=0;h--){let d=c.drawLine(t+s.offsetX-i.width+i.offsetX,l+i.offsetY,t+s.offsetX+i.offsetX,l+i.offsetY,i.color);r.add(d),l+=o}}}},At=class{constructor(t,e,s){this.w=t,this.ctx=e,this.elgrid=s,this.axesUtils=new rt(t,{theme:e.theme,timeScale:e.timeScale}),this.xaxisLabels=t.labelData.labels.slice(),t.labelData.timescaleLabels.length>0&&!t.globals.isBarHorizontal&&(this.xaxisLabels=t.labelData.timescaleLabels.slice()),t.config.xaxis.overwriteCategories&&(this.xaxisLabels=t.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],t.config.xaxis.position==="top"?this.offY=0:this.offY=t.layout.gridHeight,this.offY=this.offY+t.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal=t.config.chart.type==="bar"&&t.config.plotOptions.bar.horizontal,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.xaxisBorderWidth=t.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=t.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=t.layout.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=t.config.xaxis.axisBorder.height,this.yaxis=t.config.yaxis[0]}drawXaxis(){let t=this.w,e=new F(this.w),s=e.group({class:"apexcharts-xaxis",transform:`translate(${t.config.xaxis.offsetX}, ${t.config.xaxis.offsetY})`}),i=e.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${t.layout.translateXAxisX}, ${t.layout.translateXAxisY})`});s.add(i);let a=[];for(let o=0;or),t.labelData.hasXaxisGroups){let o=t.labelData.groups;a=[];for(let n=0;no[n].cols*c,r)}if(t.config.xaxis.title.text!==void 0){let o=e.group({class:"apexcharts-xaxis-title"}),r=e.drawText({x:t.layout.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+(t.config.xaxis.position==="bottom"?t.layout.xAxisLabelsHeight:-t.layout.xAxisLabelsHeight-10)+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+t.config.xaxis.title.style.cssClass});o.add(r),s.add(o)}if(t.config.xaxis.axisBorder.show){let o=t.globals.barPadForNumericAxis,r=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-o,this.offY,this.xaxisBorderWidth+o,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(r):s.add(r)}return s}drawXAxisLabelAndGroup(t,e,s,i,a,o,r={}){let n=[],c=[],l=this.w,h=r.xaxisFontSize||this.xaxisFontSize,d=r.xaxisFontFamily||this.xaxisFontFamily,g=r.xaxisForeColors||this.xaxisForeColors,p=r.fontWeight||l.config.xaxis.labels.style.fontWeight,f=r.cssClass||l.config.xaxis.labels.style.cssClass,x,m=l.globals.padHorizontal,b=i.length,v=l.config.xaxis.type==="category"?l.globals.dataPoints:b;if(v===0&&b>v&&(v=b),a){let y=Math.max(Number(l.config.xaxis.tickAmount)||1,v>1?v-1:v);x=l.layout.gridWidth/Math.min(y,b-1),m=m+o(0,x)/2+l.config.xaxis.labels.offsetX}else x=l.layout.gridWidth/v,m=m+o(0,x)+l.config.xaxis.labels.offsetX;for(let y=0;y<=b-1;y++){let w=m-o(y,x)/2+l.config.xaxis.labels.offsetX;y===0&&b===1&&x/2===m&&v===1&&(w=l.layout.gridWidth/2);let A=this.axesUtils.getLabel(i,l.labelData.timescaleLabels,w,y,n,h,t),C=28;l.layout.rotateXLabels&&t&&(C=22),l.config.xaxis.title.text&&l.config.xaxis.position==="top"&&(C+=parseFloat(l.config.xaxis.title.style.fontSize)+2),t||(C=C+parseFloat(h)+(l.layout.xAxisLabelsHeight-l.layout.xAxisGroupLabelsHeight)+(l.layout.rotateXLabels?10:0)),typeof l.config.xaxis.tickAmount<"u"&&l.config.xaxis.tickAmount!=="dataPoints"&&l.config.xaxis.type!=="datetime"?A=this.axesUtils.checkLabelBasedOnTickamount(y,A,b):A=this.axesUtils.checkForOverflowingLabels(y,A,b,n,c);let k=()=>t&&l.config.xaxis.convertedCatToNumeric?g[l.globals.minX+y-1]:g[y];if(l.config.xaxis.labels.show){let S=e.drawText({x:A.x,y:this.offY+l.config.xaxis.labels.offsetY+C-(l.config.xaxis.position==="top"?l.layout.xAxisHeight+l.config.xaxis.axisTicks.height-2:0),text:A.text,textAnchor:"middle",fontWeight:A.isBold?600:p,fontSize:h,fontFamily:d,foreColor:Array.isArray(g)?k():g,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+f});if(s.add(S),S.on("click",T=>{if(typeof l.config.chart.events.xAxisLabelClick=="function"){let P=Object.assign({},l,{labelIndex:y});l.config.chart.events.xAxisLabelClick(T,this.ctx,P)}}),t){let T=z.createElementNS(V,"title");T.textContent=Array.isArray(A.text)?A.text.join(" "):A.text,S.node.appendChild(T),A.text!==""&&(n.push(A.text),c.push(A))}}y"u"?"":r[p];f=l(f,{seriesIndex:t,dataPointIndex:p,w:e});let x=this.axesUtils.getYAxisForeColor(h.style.colors,t),m=()=>Array.isArray(x)?x[p]:x,b=0;Array.isArray(f)&&(b=f.length/2*parseInt(h.style.fontSize,10));let v=h.offsetX-15,y="end";this.yaxis.opposite&&(y="start"),e.config.yaxis[0].labels.align==="left"?(v=h.offsetX,y="start"):e.config.yaxis[0].labels.align==="center"?(v=h.offsetX,y="middle"):e.config.yaxis[0].labels.align==="right"&&(y="end");let w=s.drawText({x:v,y:c+n+h.offsetY-b,text:f,textAnchor:y,foreColor:m(),fontSize:h.style.fontSize,fontFamily:h.style.fontFamily,fontWeight:h.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+h.style.cssClass,maxWidth:h.maxWidth});o.add(w),w.on("click",C=>{if(typeof e.config.chart.events.xAxisLabelClick=="function"){let L=Object.assign({},e,{labelIndex:p});e.config.chart.events.xAxisLabelClick(C,this.ctx,L)}});let A=z.createElementNS(V,"title");if(A.textContent=Array.isArray(f)?f.join(" "):f,w.node.appendChild(A),e.config.yaxis[t].labels.rotate!==0){let C=s.rotateAroundCenter(w.node);w.node.setAttribute("transform",`rotate(${e.config.yaxis[t].labels.rotate} 0 ${C.y})`)}c=c+n}if(e.config.yaxis[0].title.text!==void 0){let p=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+i+", 0)"}),f=s.drawText({x:e.config.yaxis[0].title.offsetX,y:e.layout.gridHeight/2+e.config.yaxis[0].title.offsetY,text:e.config.yaxis[0].title.text,textAnchor:"middle",foreColor:e.config.yaxis[0].title.style.color,fontSize:e.config.yaxis[0].title.style.fontSize,fontWeight:e.config.yaxis[0].title.style.fontWeight,fontFamily:e.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[0].title.style.cssClass});p.add(f),a.add(p)}let d=0;this.isCategoryBarHorizontal&&e.config.yaxis[0].opposite&&(d=e.layout.gridWidth);let g=e.config.xaxis.axisBorder;if(g.show){let p=s.drawLine(e.globals.padHorizontal+g.offsetX+d,1+g.offsetY,e.globals.padHorizontal+g.offsetX+d,e.layout.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(p):a.add(p)}return e.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,r.length,e.config.yaxis[0].axisBorder,e.config.yaxis[0].axisTicks,0,n,a),a}drawXaxisTicks(t,e,s){let i=this.w,a=t;if(t<0||t-2>i.layout.gridWidth)return;let o=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+o+i.config.xaxis.axisTicks.height,i.config.xaxis.position==="top"&&(e=o-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){let n=new F(this.w).drawLine(t+i.config.xaxis.axisTicks.offsetX,o+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(n),n.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){let t=this.w,e=[],s=this.xaxisLabels.length,i=t.globals.padHorizontal;if(t.labelData.timescaleLabels.length>0)for(let a=0;a{a.placeTextWithEllipsis(g,g.textContent,i.layout.xAxisLabelsHeight-(i.config.legend.position==="bottom"?20:10))})}else{let l=i.layout.gridWidth/(i.labelData.labels.length+1);for(let h=0;h{a.placeTextWithEllipsis(g,g.textContent,l)})}}if(n.length>0){let l=n[n.length-1].getBBox(),h=n[0].getBBox();l.x<-20&&((t=n[n.length-1].parentNode)==null||t.removeChild(n[n.length-1])),h.x+h.width>i.layout.gridWidth&&!i.globals.isBarHorizontal&&((e=n[0].parentNode)==null||e.removeChild(n[0]));for(let d=0;d0&&(this.xaxisLabels=t.labelData.timescaleLabels.slice())}drawGridArea(t=null){let e=this.w,s=new F(this.w);t||(t=s.group({class:"apexcharts-grid"}));let i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.layout.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.layout.gridHeight,e.layout.gridWidth,e.layout.gridHeight,"transparent");return t.add(a),t.add(i),t}drawGrid(){if(this.w.globals.axisCharts){let e=this.renderGrid();return this.drawGridArea(e.el),e}return null}createGridMask(){let t=this.w,e=t.globals,s=new F(this.w),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=h=>{let d=z.createElementNS(V,"clipPath");return d.setAttribute("id",h),d};t.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),t.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),t.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),t.dom.elForecastMask=a(`forecastMask${e.cuid}`),t.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let o=["bar","rangeBar","candlestick","boxPlot"].includes(t.config.chart.type)||t.globals.comboBarCount>0,r=0,n=0;o&&t.axisFlags.isXNumeric&&!t.globals.isBarHorizontal&&(r=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),n=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),t.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,t.layout.gridWidth+i+4,t.layout.gridHeight+i+4,0,"#fff"),t.dom.elGridRectBar=s.drawRect(-i/2-r-2,-i/2-2,t.layout.gridWidth+i+n+r+4,t.layout.gridHeight+i+4,0,"#fff");let c=t.globals.markers.largestSize;t.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-r-2,-c),-c,t.layout.gridWidth+Math.max(i+n+r+4,c*2),t.layout.gridHeight+c*2,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);let l=t.dom.elDefs.node;l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r}){let n=this.w;if(!(t===0&&n.globals.skipFirstTimelinelabel||t===o-1&&n.globals.skipLastTimelinelabel&&!n.config.xaxis.labels.formatter||n.config.chart.type==="radar")){n.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r});let l=0;if(n.labelData.hasXaxisGroups&&n.config.xaxis.tickPlacement==="between"){let d=n.labelData.groups;if(d){let g=0;for(let p=0;g{for(let d=0;d{for(let d=0;d0&&i.config.xaxis.type!=="datetime"&&(c=a.yAxisScale[r].result.length-1)),this._drawXYLines({xCount:c,tickAmount:n})):(c=n,n=a.xTickAmount,this._drawInvertedXYLines({xCount:c,tickAmount:n})),this.drawGridBands(c,n),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:i.layout.gridWidth/c}}drawGridBands(t,e){var s,i,a,o,r;let n=this.w,c=(l,h,d,g,p,f)=>{for(let x=0,m=0;x=n.config.grid[l].colors.length&&(m=0),this._drawGridBandRect({c:m,x1:d,y1:g,x2:p,y2:f,type:l}),g+=n.layout.gridHeight/e};if(((s=n.config.grid.row.colors)==null?void 0:s.length)>0&&c("row",e,0,0,n.layout.gridWidth,n.layout.gridHeight/e),((i=n.config.grid.column.colors)==null?void 0:i.length)>0){let l=!n.globals.isBarHorizontal&&n.config.xaxis.tickPlacement==="on"&&(n.config.xaxis.type==="category"||n.config.xaxis.convertedCatToNumeric)?t-1:t;n.axisFlags.isXNumeric&&(l=((o=(a=n.globals.xAxisScale)==null?void 0:a.result.length)!=null?o:1)-1);let h=n.globals.padHorizontal,d=0,g=n.globals.padHorizontal+n.layout.gridWidth/l,p=n.layout.gridHeight;for(let f=0,x=0;f=n.config.grid.column.colors.length&&(x=0),n.config.xaxis.type==="datetime"&&(h=this.xaxisLabels[f].position,g=(((r=this.xaxisLabels[f+1])==null?void 0:r.position)||n.layout.gridWidth)-this.xaxisLabels[f].position),this._drawGridBandRect({c:x,x1:h,y1:d,x2:g,y2:p,type:"column"}),h+=n.layout.gridWidth/l}}},Jt=class{constructor(t){this.w=t,this.coreUtils=new Z(this.w)}niceScale(t,e,s=0){let a=this.w,o=a.globals,r,n,c,l;o.isBarHorizontal?(r=a.config.xaxis,n=Math.max((o.svgWidth-100)/25,2)):(r=a.config.yaxis[s],n=Math.max((o.svgHeight-100)/15,2)),D.isNumber(n)||(n=10),c=r.min!==void 0&&r.min!==null,l=r.max!==void 0&&r.min!==null;let h=r.stepSize!==void 0&&r.stepSize!==null,d=r.tickAmount!==void 0&&r.tickAmount!==null,g=d?r.tickAmount:Ae[Math.min(Math.round(n/2),Ae.length-1)];if(o.isMultipleYAxis&&!d&&o.multiAxisTickAmount>0&&(g=o.multiAxisTickAmount,d=!0),g==="dataPoints"?g=o.dataPoints-1:g=Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&e===0||!D.isNumber(t)&&!D.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=D.isNumber(r.min)?r.min:0,e=D.isNumber(r.max)?r.max:t+g,o.allSeriesCollapsed=!1),t>e){console.warn("axis.min cannot be greater than axis.max: swapping min and max");let P=e;e=t,t=P}else t===e&&(t=t===0?0:t-1,e=e===0?2:e+1);let p=[];g<1&&(g=1);let f=g,x=Math.abs(e-t),m=.15;!c&&t>0&&t/x0&&tn&&(t=e-b*g,t+=b*Math.floor((P-t)/b))}else if(c)if(d)e=t+b*f;else{let P=e;e=b*Math.ceil(e/b),Math.abs(e-t)/D.getGCD(x,b)>n&&(e=t+b*g,e+=b*Math.ceil((P-e)/b))}x=Math.abs(e-t),b=D.getGCD(x,b),f=Math.round(x/b)}if(!d&&!(c||l)&&(f=Math.ceil((x-1e-11)/(b+1e-11)),f>16&&D.getPrimeFactors(f).length<2&&f++),!d&&r.forceNiceScale&&o.yValueDecimal===0&&f>x&&(f=x,b=Math.round(x/f)),f>n&&(!(d||h)||r.forceNiceScale)){let P=D.getPrimeFactors(f),M=P.length-1,E=f;t:for(var C=0;CT);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){let o=Math.abs(e-t),r=[];if(t===e)return r=[t],{result:r,niceMin:r[0],niceMax:r[r.length-1]};s=this._adjustTicksForSmallRange(s,i,o),s==="dataPoints"&&(s=this.w.globals.dataPoints-1);let n=s;a||(a=o/n);let c=2;if(a!==0&&isFinite(a)){let d=Math.floor(Math.log10(Math.abs(a))),g=Math.max(c,-d+c),p=Math.pow(10,g);a=Math.round((a+Number.EPSILON)*p)/p}let l=s===Number.MAX_VALUE?5:n;s===Number.MAX_VALUE&&(a=1);let h=t;for(;l>=0;)r.push(h),h=D.preciseAddition(h,a),l-=1;return{result:r,niceMin:r[0],niceMax:r[r.length-1]}}logarithmicScaleNice(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));let i=[],a=Math.ceil(Math.log(e)/Math.log(s)+1),o=Math.floor(Math.log(t)/Math.log(s));for(let r=o;r"u"&&(i.yAxisScale[t]=[]);let r=Math.abs(s-e);o.logarithmic&&r<=5&&(i.invalidLogScale=!0),o.logarithmic&&r>5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=o.forceNiceScale?this.logarithmicScaleNice(e,s,o.logBase):this.logarithmicScale(e,s,o.logBase)):s===-Number.MAX_VALUE||!D.isNumber(s)||e===Number.MAX_VALUE||!D.isNumber(e)?i.yAxisScale[t]=this.niceScale(Number.MIN_VALUE,0,t):(i.allSeriesCollapsed=!1,i.yAxisScale[t]=this.niceScale(e,s,t))}setXScale(t,e){let s=this.w,i=s.globals;if(e===-Number.MAX_VALUE||!D.isNumber(e))i.xAxisScale=this.linearScale(0,10,10);else{let a=i.xTickAmount;i.xAxisScale=this.linearScale(t,e,a,0,s.config.xaxis.max===void 0?s.config.xaxis.stepSize:void 0)}return i.xAxisScale}scaleMultipleYAxes(){let t=this.w.config,e=this.w.globals;this.coreUtils.setSeriesYAxisMappings();let s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr;e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((o,r)=>{let n=[];if(o.forEach(c=>{var l;let h=(l=t.series[c])==null?void 0:l.group;n.indexOf(h)<0&&n.push(h)}),o.length>0){let c=Number.MAX_VALUE,l=-Number.MAX_VALUE,h=c,d=l,g,p;if(t.chart.stacked){let f=new Array(e.dataPoints).fill(0),x=[],m=[],b=[];n.forEach(()=>{x.push(f.map(()=>Number.MIN_VALUE)),m.push(f.map(()=>Number.MIN_VALUE)),b.push(f.map(()=>Number.MIN_VALUE))});for(let v=0;v{if(t.series[y].group===A)for(let L=0;L=0?m[C][L]+=k:b[C][L]+=k,x[C][L]+=k,h=Math.min(h,k),d=Math.max(d,k)}})),(g==="bar"||g==="column")&&e.barGroups.push(p)}g||(g=t.chart.type),g==="bar"||g==="column"?n.forEach((v,y)=>{c=Math.min(c,Math.min.apply(null,b[y])),l=Math.max(l,Math.max.apply(null,m[y]))}):(n.forEach((v,y)=>{h=Math.min(h,Math.min.apply(null,x[y])),d=Math.max(d,Math.max.apply(null,x[y]))}),c=h,l=d),c===Number.MIN_VALUE&&l===Number.MIN_VALUE&&(l=-Number.MAX_VALUE)}else for(let f=0;fm.indexOf(f)===x),this.setYScaleForIndex(r,c,l),o.forEach(f=>{i[f]=e.yAxisScale[r].niceMin,a[f]=e.yAxisScale[r].niceMax})}else this.setYScaleForIndex(r,0,-Number.MAX_VALUE)})}},Yt=class{constructor(t){this.w=t,this.scales=new Jt(this.w)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,o,r,n,c;let l=this.w.config,h=this.w.globals,d=-Number.MAX_VALUE,g=Number.MIN_VALUE;i===null&&(i=t+1);let p=this.w.seriesData.series,f=p,x=p;l.chart.type==="candlestick"?(f=this.w.candleData.seriesCandleL,x=this.w.candleData.seriesCandleH):l.chart.type==="boxPlot"?(f=this.w.candleData.seriesCandleO,x=this.w.candleData.seriesCandleC):this.w.axisFlags.isRangeData&&(f=this.w.rangeData.seriesRangeStart,x=this.w.rangeData.seriesRangeEnd);let m=!1;if(this.w.seriesData.seriesX.length>=i){let b=(a=h.brushSource)==null?void 0:a.w.config.chart.brush;(l.chart.zoom.enabled&&l.chart.zoom.autoScaleYaxis||b?.enabled&&b?.autoScaleYaxis)&&(m=!0)}for(let b=t;btypeof A<"u").length),this.w.labelData.labels.length&&l.xaxis.type!=="datetime"&&this.w.seriesData.series.reduce((A,C)=>A+C.length,0)!==0&&(h.dataPoints=Math.max(h.dataPoints,this.w.labelData.labels.length));let y=0,w=p[b].length-1;if(m){if(l.xaxis.min)for(;yy&&this.w.seriesData.seriesX[b][w]>l.xaxis.max;w--);}for(let A=y;A<=w&&A{d=Math.max(d,L.value),e=Math.min(e,L.value)}),s=d,C=D.noExponents(C),D.isFloat(C)&&(h.yValueDecimal=Math.max(h.yValueDecimal,C.toString().split(".")[1].length)),g>((n=f[b])==null?void 0:n[A])&&((c=f[b])==null?void 0:c[A])<0&&(g=f[b][A])}else h.hasNullValues=!0}(v==="bar"||v==="column")&&(g<0&&d<0&&(d=0,s=Math.max(s,0)),g===Number.MIN_VALUE&&(g=0,e=Math.min(e,0)))}return l.chart.type==="rangeBar"&&this.w.rangeData.seriesRangeStart.length&&h.isBarHorizontal&&(g=e),l.chart.type==="bar"&&(g<0&&d<0&&(d=0),g===Number.MIN_VALUE&&(g=0)),{minY:g,maxY:d,lowestY:e,highestY:s}}setYRange(){let t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;let s=Number.MAX_VALUE,i;if(t.isMultipleYAxis){s=Number.MAX_VALUE;for(let a=0;a{a.max!==void 0&&(typeof a.max=="number"?t.maxYArr[o]=a.max:typeof a.max=="function"&&(t.maxYArr[o]=a.max(t.isMultipleYAxis?t.maxYArr[o]:t.maxY)),t.maxY=t.maxYArr[o]),a.min!==void 0&&(typeof a.min=="number"?t.minYArr[o]=a.min:typeof a.min=="function"&&(t.minYArr[o]=a.min(t.isMultipleYAxis?t.minYArr[o]===Number.MIN_VALUE?0:t.minYArr[o]:t.minY)),t.minY=t.minYArr[o])}),t.isBarHorizontal&&["min","max"].forEach(o=>{e.xaxis[o]!==void 0&&typeof e.xaxis[o]=="number"&&(o==="min"?t.minY=e.xaxis[o]:t.maxY=e.xaxis[o])}),t.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),t.minY=s):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.minY,t.maxYArr[0]=t.maxY),t.barGroups=[],t.lineGroups=[],t.areaGroups=[],e.series.forEach(a=>{let o=a;switch(o.type||e.chart.type){case"bar":case"column":t.barGroups.push(o.group);break;case"line":t.lineGroups.push(o.group);break;case"area":t.areaGroups.push(o.group);break}}),t.barGroups=t.barGroups.filter((a,o,r)=>r.indexOf(a)===o),t.lineGroups=t.lineGroups.filter((a,o,r)=>r.indexOf(a)===o),t.areaGroups=t.areaGroups.filter((a,o,r)=>r.indexOf(a)===o),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}setXRange(){let t=this.w.globals,e=this.w.config,s=e.xaxis.type==="numeric"||e.xaxis.type==="datetime"||e.xaxis.type==="category"&&!this.w.axisFlags.noLabelsProvided||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.isXNumeric,i=()=>{for(let a=0;at.dataPoints&&t.dataPoints!==0&&(a=t.dataPoints-1);else if(e.xaxis.tickAmount==="dataPoints"){if(this.w.seriesData.series.length>1&&(a=this.w.seriesData.series[t.maxValsInArrayIndex].length-1),this.w.axisFlags.isXNumeric){let o=Math.round(t.maxX-t.minX);o<30&&(a=o)}}else a=e.xaxis.tickAmount;if(t.xTickAmount=a,e.xaxis.max!==void 0&&typeof e.xaxis.max=="number"&&(t.maxX=e.xaxis.max),e.xaxis.min!==void 0&&typeof e.xaxis.min=="number"&&(t.minX=e.xaxis.min),e.xaxis.range!==void 0&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!this.w.axisFlags.dataFormatXNumeric){let o=[];for(let r=t.minX-1;r0&&(t.xAxisScale=this.scales.linearScale(1,this.w.labelData.labels.length,a-1,0,e.xaxis.stepSize),this.w.seriesData.seriesX=this.w.labelData.labels.slice());s&&(this.w.labelData.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&this.w.labelData.labels.length&&(t.xTickAmount=this.w.labelData.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){let t=this.w.globals;if(this.w.axisFlags.isDataXYZ){for(let e=0;e{if(e.length){e.length===1&&e.push(this.w.seriesData.seriesX[t.maxValsInArrayIndex][this.w.seriesData.seriesX[t.maxValsInArrayIndex].length-1]);let s=e.slice();s.sort((i,a)=>i-a),s.forEach((i,a)=>{if(a>0){let o=i-s[a-1];o>0&&(t.minXDiff=Math.min(o,t.minXDiff))}}),(t.dataPoints===1||t.minXDiff===Number.MAX_VALUE)&&(t.minXDiff=.5)}})}_setStackedMinMax(){let t=this.w.globals;if(!this.w.seriesData.series.length)return;let e=this.w.labelData.seriesGroups;e.length||(e=[this.w.seriesData.seriesNames.map(a=>a)]);let s={},i={};e.forEach(a=>{s[a]=[],i[a]=[],this.w.config.series.map((r,n)=>a.indexOf(this.w.seriesData.seriesNames[n])>-1?n:null).filter(r=>r!==null).forEach(r=>{var n,c,l,h;for(let d=0;d"u"&&(s[a][d]=0,i[a][d]=0),(this.w.config.chart.stacked&&!t.comboCharts||this.w.config.chart.stacked&&t.comboCharts&&(!this.w.config.chart.stackOnlyBar||((c=(n=this.w.config.series)==null?void 0:n[r])==null?void 0:c.type)==="bar"||((h=(l=this.w.config.series)==null?void 0:l[r])==null?void 0:h.type)==="column"))&&this.w.seriesData.series[r][d]!==null&&D.isNumber(this.w.seriesData.series[r][d])&&(this.w.seriesData.series[r][d]>0?s[a][d]+=parseFloat(String(this.w.seriesData.series[r][d]))+1e-4:i[a][d]+=parseFloat(String(this.w.seriesData.series[r][d])))})}),Object.entries(s).forEach(([a])=>{s[a].forEach((o,r)=>{t.maxY=Math.max(t.maxY,s[a][r]),t.minY=Math.min(t.minY,i[a][r])})})}};function ke(){return{palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3F51B5","#03A9F4","#4CAF50","#F9CE1D","#FF9800"],palette3:["#33B2DF","#546E7A","#D4526E","#13D8AA","#A5978B"],palette4:["#4ECDC4","#C7F464","#81D4FA","#FD6A6A","#546E7A"],palette5:["#2B908F","#F9A3A4","#90EE7E","#FA4443","#69D2E7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]}}var Nt=class{constructor(t,{theme:e=null,timeScale:s=null}={},i){this.w=t,this.elgrid=i,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.axisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal=t.config.chart.type==="bar"&&t.config.plotOptions.bar.horizontal,this.xAxisoffX=t.config.xaxis.position==="bottom"?t.layout.gridHeight:0,this.drawnLabels=[],this.axesUtils=new rt(t,{theme:e,timeScale:s})}drawYaxis(t){let e=this.w,s=new F(this.w),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:o,fontWeight:r}=i,n=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return n;let c=s.group({class:"apexcharts-yaxis-texts-g"});n.add(c);let l=e.globals.yAxisScale[t].result.length-1,h=e.layout.gridHeight/l,d=e.formatters.yLabelFormatters[t],g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let p=e.layout.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?p=0:e.config.chart.type==="heatmap"&&(p-=h/2),p+=parseInt(a,10)/3;let f=null;for(let x=l;x>=0;x--){let m=d(g[x],x,e),b=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&e.config.yaxis.length!==0&&(b*=-1);let v=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),y=this.axesUtils.getYAxisForeColor(i.colors,t),w=Array.isArray(y)?y[x]:y,A=Array.from(e.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(L=>L.textContent),C=s.drawText({x:b,y:p,text:A.includes(m)&&!e.config.yaxis[t].labels.showDuplicates?"":m,textAnchor:v,fontSize:a,fontFamily:o,fontWeight:r,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:w,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});c.add(C),this.addTooltip(C,m),f===null&&(f=C),e.config.yaxis[t].labels.rotate!==0&&this.rotateLabel(s,C,f,e.config.yaxis[t].labels.rotate),p+=h}}return this.addYAxisTitle(s,n,t),this.addAxisBorder(s,n,t,l,h),n}getTextAnchor(t,e){return t==="left"?"start":t==="center"?"middle":t==="right"?"end":e?"start":"end"}addTooltip(t,e){let s=z.createElementNS(V,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){let a=t.rotateAroundCenter(s.node),o=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${o.y})`)}addYAxisTitle(t,e,s){let i=this.w;if(i.config.yaxis[s].title.text!==void 0){let a=t.group({class:"apexcharts-yaxis-title"}),o=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,r=t.drawText({x:o,y:i.layout.gridHeight/2+i.layout.translateY+i.config.yaxis[s].title.offsetY,text:i.config.yaxis[s].title.text,textAnchor:"end",foreColor:i.config.yaxis[s].title.style.color,fontSize:i.config.yaxis[s].title.style.fontSize,fontWeight:i.config.yaxis[s].title.style.fontWeight,fontFamily:i.config.yaxis[s].title.style.fontFamily,cssClass:`apexcharts-yaxis-title-text ${i.config.yaxis[s].title.style.cssClass}`});a.add(r),e.add(a)}}addAxisBorder(t,e,s,i,a){let o=this.w,r=o.config.yaxis[s].axisBorder,n=31+r.offsetX;if(o.config.yaxis[s].opposite&&(n=-31-r.offsetX),r.show){let c=t.drawLine(n,o.layout.translateY+r.offsetY-2,n,o.layout.gridHeight+o.layout.translateY+r.offsetY+2,r.color,0,r.width);e.add(c)}o.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(n,i,r,o.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){let e=this.w,s=new F(this.w),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.layout.translateXAxisX}, ${e.layout.translateXAxisY})`});i.add(a);let o=e.globals.yAxisScale[t].result.length-1,r=e.layout.gridWidth/o+.1,n=r+e.config.xaxis.labels.offsetX,c=e.formatters.xLabelFormatter,l=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice()),h=e.labelData.timescaleLabels;if(h.length>0&&(this.xaxisLabels=h.slice(),l=h.slice(),o=l.length),e.config.xaxis.labels.show)for(let d=h.length?0:o;h.length?d=0;h.length?d++:d--){let g=c?.(l[d],d,e),p=e.layout.gridWidth+e.globals.padHorizontal-(n-r+e.config.xaxis.labels.offsetX);if(h.length){let x=this.axesUtils.getLabel(l,h,p,d,this.drawnLabels,this.xaxisFontSize);p=x.x,g=x.text,this.drawnLabels.push(x.text),d===0&&e.globals.skipFirstTimelinelabel&&(g=""),d===l.length-1&&e.globals.skipLastTimelinelabel&&(g="")}let f=s.drawText({x:p,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-(e.config.xaxis.position==="top"?e.layout.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:g,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.axisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:`apexcharts-xaxis-label ${e.config.xaxis.labels.style.cssClass}`});a.add(f),this.addTooltip(f,g),n+=r}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}inversedYAxisBorder(t){let e=this.w,s=new F(this.w),i=e.config.xaxis.axisBorder;if(i.show){let a=0;e.config.chart.type==="bar"&&e.axisFlags.isXNumeric&&(a-=15);let o=s.drawLine(e.globals.padHorizontal+a+i.offsetX,this.xAxisoffX,e.layout.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(o):t.add(o)}}inversedYAxisTitleText(t){let e=this.w,s=new F(this.w);if(e.config.xaxis.title.text!==void 0){let i=s.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),a=s.drawText({x:e.layout.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:`apexcharts-xaxis-title-text ${e.config.xaxis.title.style.cssClass}`});i.add(a),t.add(i)}}yAxisTitleRotate(t,e){let s=this.w,i=new F(this.w),a=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),o=a?a.getBoundingClientRect():{width:0,height:0},r=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),n=r?r.getBoundingClientRect():{width:0,height:0};if(r){let c=this.xPaddingForYAxisTitle(t,o,n,e);r.setAttribute("x",String(c.xPos-(e?10:0)));let l=i.rotateAroundCenter(r);r.setAttribute("transform",`rotate(${e?s.config.yaxis[t].title.rotate*-1:s.config.yaxis[t].title.rotate} ${l.x} ${l.y})`)}}xPaddingForYAxisTitle(t,e,s,i){let a=this.w,o=0,r=10;return a.config.yaxis[t].title.text===void 0||t<0?{xPos:o,padd:0}:(i?o=e.width+a.config.yaxis[t].title.offsetX+s.width/2+r/2:(o=e.width*-1+a.config.yaxis[t].title.offsetX+r/2+s.width/2,a.globals.isBarHorizontal&&(r=25,o=e.width*-1-a.config.yaxis[t].title.offsetX-r)),{xPos:o,padd:r})}setYAxisXPosition(t,e){let s=this.w,i=0,a=0,o=18,r=1;s.config.yaxis.length>1&&(this.multipleYs=!0),s.config.yaxis.forEach((n,c)=>{let l=s.globals.ignoreYAxisIndexes.includes(c)||!n.show||n.floating||t[c].width===0,h=t[c].width+e[c].width;n.opposite?s.globals.isBarHorizontal?(a=s.layout.gridWidth+s.layout.translateX-1,s.globals.translateYAxisX[c]=a-n.labels.offsetX):(a=s.layout.gridWidth+s.layout.translateX+r,l||(r+=h+20),s.globals.translateYAxisX[c]=a-n.labels.offsetX+20):(i=s.layout.translateX-o,l||(o+=h+20),s.globals.translateYAxisX[c]=i+n.labels.offsetX)})}setYAxisTextAlignments(){let t=this.w;Array.from(t.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((s,i)=>{let a=t.config.yaxis[i];if(a&&!a.floating&&a.labels.align!==void 0){let o=t.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${i}'] .apexcharts-yaxis-texts-g`),r=Array.from(t.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${i}'] .apexcharts-yaxis-label`)),n=o.getBoundingClientRect();r.forEach(c=>{c.setAttribute("text-anchor",a.labels.align)}),a.labels.align==="left"&&!a.opposite?o.setAttribute("transform",`translate(-${n.width}, 0)`):a.labels.align==="center"?o.setAttribute("transform",`translate(${n.width/2*(a.opposite?1:-1)}, 0)`):a.labels.align==="right"&&a.opposite&&o.setAttribute("transform",`translate(${n.width}, 0)`)}})}},Le=class{constructor(t,e){this.w=t,this.ctx=e,this.documentEvent=this.documentEvent.bind(this)}addEventListener(t,e){let s=this.w;Object.prototype.hasOwnProperty.call(s.globals.events,t)?s.globals.events[t].push(e):s.globals.events[t]=[e]}removeEventListener(t,e){let s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;let i=s.globals.events[t].indexOf(e);i!==-1&&s.globals.events[t].splice(i,1)}fireEvent(t,e){let s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;(!e||!e.length)&&(e=[]);let i=s.globals.events[t],a=i.length;for(let o=0;o{s?.addEventListener(i,a=>{let o=a.target.getAttribute("i")===null&&t.interact.capturedSeriesIndex!==-1?t.interact.capturedSeriesIndex:a.target.getAttribute("i"),r=a.target.getAttribute("j")===null&&t.interact.capturedDataPointIndex!==-1?t.interact.capturedDataPointIndex:a.target.getAttribute("j"),n=Object.assign({},t,{seriesIndex:t.globals.axisCharts?o:0,dataPointIndex:r});a.type==="keydown"?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&(e.ctx.keyboardNavigation&&e.ctx.keyboardNavigation.handleKey(a),typeof t.config.chart.events.keyDown=="function"&&t.config.chart.events.keyDown(a,e,n),e.ctx.events.fireEvent("keydown",[a,e,n])):a.type==="keyup"?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&(typeof t.config.chart.events.keyUp=="function"&&t.config.chart.events.keyUp(a,e,n),e.ctx.events.fireEvent("keyup",[a,e,n])):a.type==="mousemove"||a.type==="touchmove"?typeof t.config.chart.events.mouseMove=="function"&&t.config.chart.events.mouseMove(a,e,n):a.type==="mouseleave"||a.type==="touchleave"?typeof t.config.chart.events.mouseLeave=="function"&&t.config.chart.events.mouseLeave(a,e,n):(a.type==="mouseup"&&a.which===1||a.type==="touchend")&&(typeof t.config.chart.events.click=="function"&&t.config.chart.events.click(a,e,n),e.ctx.events.fireEvent("click",[a,e,n]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(i=>{t.dom.baseEl.addEventListener(i,this.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}documentEvent(t){let e=this.w,s=t.target.className;if(t.type==="click"){let i=e.dom.baseEl.querySelector(".apexcharts-menu");i&&i.classList.contains("apexcharts-menu-open")&&s!=="apexcharts-menu-icon"&&i.classList.remove("apexcharts-menu-open")}e.interact.clientX=t.type==="touchmove"?t.touches[0].clientX:t.clientX,e.interact.clientY=t.type==="touchmove"?t.touches[0].clientY:t.clientY}},De=class{constructor(t){this.w=t}setCurrentLocaleValues(t){let e=this.w.config.chart.locales,s=Y.getApex();s.chart&&s.chart.locales&&s.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(s.chart.locales));let i=e.filter(a=>a.name===t)[0];if(i){let a=D.extend(Os,i);this.w.globals.locale=a.options}else throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options")}},Te=class{constructor(t,e){this.w=t,this.ctx=e}drawAxis(t,e){let s=this.w.globals,i=this.w.config,a=new At(this.w,this.ctx,e),o=new Nt(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale},e);if(s.axisCharts&&t!=="radar"){let r,n;s.isBarHorizontal?(n=o.drawYaxisInversed(0),r=a.drawXaxisInversed(0),this.w.dom.elGraphical.add(r),this.w.dom.elGraphical.add(n)):(r=a.drawXaxis(),this.w.dom.elGraphical.add(r),i.yaxis.map((c,l)=>{if(s.ignoreYAxisIndexes.indexOf(l)===-1&&(n=o.drawYaxis(l),this.w.dom.Paper.add(n),this.w.config.grid.position==="back")){let h=this.w.dom.Paper.children()[1];h&&(h.remove(),this.w.dom.Paper.add(h))}}))}}},zt=class{constructor(t){this.w=t}drawXCrosshairs(){let t=this.w,e=new F(this.w),s=new J(this.w),i=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,o=t.config.xaxis.crosshairs.fill.type,r=i.colorFrom,n=i.colorTo,c=i.opacityFrom,l=i.opacityTo,h=i.stops,d="none",g=a.enabled,p=a.left,f=a.top,x=a.blur,m=a.color,b=a.opacity,v=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){o==="gradient"&&(v=e.drawGradient("vertical",r,n,c,l,null,h,[]));let y=e.drawRect();t.config.xaxis.crosshairs.width===1&&(y=e.drawLine(0,0,0,0));let w=t.layout.gridHeight;(!D.isNumber(w)||w<0)&&(w=0);let A=t.config.xaxis.crosshairs.width;(!D.isNumber(A)||Number(A)<0)&&(A=0),y.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:w,width:A,height:w,fill:v,filter:d,"fill-opacity":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,"stroke-width":t.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":t.config.xaxis.crosshairs.stroke.dashArray}),g&&(y=s.dropShadow(y,{left:p,top:f,blur:x,color:m,opacity:b})),t.dom.elGraphical.add(y)}}drawYCrosshairs(){let t=this.w,e=new F(this.w),s=t.config.yaxis[0].crosshairs,i=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){let o=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,s.stroke.dashArray,s.stroke.width);o.attr({class:"apexcharts-ycrosshairs"}),t.dom.elGraphical.add(o)}let a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.dom.elGraphical.add(a)}},Me=class{constructor(t){this.w=t}checkResponsiveConfig(t){let e=this.w,s=e.config;if(s.responsive.length===0)return;let i=s.responsive.slice();i.sort((r,n)=>r.breakpoint>n.breakpoint?1:n.breakpoint>r.breakpoint?-1:0).reverse();let a=new vt({}),o=(r={})=>{let n=i[0].breakpoint,c=Y.isBrowser()?window.innerWidth>0?window.innerWidth:screen.width:0;if(c>n){let l=D.clone(e.globals.initialConfig);l.series=D.clone(e.config.series);let h=Z.extendArrayProps(a,l,e);r=D.extend(h,r),r=D.extend(e.config,r),this.overrideResponsiveOptions(r)}else for(let l=0;l-1&&(t[s].data=[]);return t}highlightSeries(t){var e;let s=this.w,i=this.getSeriesByName(t),a=parseInt((e=i?.getAttribute("data:realIndex"))!=null?e:"",10),o="highlightSeriesEls",r=s.globals.cachedSelectors[o];r||(r=s.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),s.globals.cachedSelectors[o]=r);let n=null,c=null,l=null;if(s.globals.axisCharts||s.config.chart.type==="radialBar")if(s.globals.axisCharts){n=s.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${a}']`),c=s.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${a}']`);let h=s.globals.seriesYAxisReverseMap[a];l=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${h}']`)}else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}']`);else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}'] path`);for(let h=0;h{for(let n=0;n{for(let c=0;c=r.from&&(lMath.max(h,d.to),0);o(c,l)}else t.type==="mouseout"&&a("remove")}getActiveConfigSeriesIndex(t="asc",e=[]){let s=this.w,i=0;if(s.config.series.length>1){let a=s.config.series.map((o,r)=>{let n=()=>s.globals.comboCharts?e.length===0||e.length&&e.indexOf(s.config.series[r].type)>-1:!0;return o.data&&o.data.length>0&&s.globals.collapsedSeriesIndices.indexOf(r)===-1&&n()?r:-1});for(let o=t==="asc"?0:a.length-1;t==="asc"?o=0;t==="asc"?o++:o--)if(a[o]!==-1){i=a[o];break}}return i}getBarSeriesIndices(){return this.w.globals.comboCharts?this.w.config.series.map((e,s)=>e.type==="bar"||e.type==="column"?s:-1).filter(e=>e!==-1):this.w.config.series.map((e,s)=>s)}getPreviousPaths(){var t,e,s,i;let a=this.w;a.globals.previousPaths=[];function o(l,h,d){let g=l[h].childNodes,p={type:d,paths:[],realIndex:l[h].getAttribute("data:realIndex")};for(let f=0;fa.dom.baseEl.querySelectorAll(`.apexcharts-${l}-series .apexcharts-series`);["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(l=>{let h=r(l);for(let d=0;d0)for(let l=0;lh[g].getAttribute(x),f={x:parseFloat((t=p("x"))!=null?t:"0"),y:parseFloat((e=p("y"))!=null?e:"0"),width:parseFloat((s=p("width"))!=null?s:"0"),height:parseFloat((i=p("height"))!=null?i:"0")};d.push({rect:f,color:h[g].getAttribute("color")})}a.globals.previousPaths.push(d)}a.globals.axisCharts||(a.globals.previousPaths=a.seriesData.series)}clearPreviousPaths(){let t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){let t=this.w,e=this,s=t.config.noData,i=new F(e.w),a=t.globals.svgWidth/2,o=t.globals.svgHeight/2,r="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,s.align==="left"?(a=10,r="start"):s.align==="right"&&(a=t.globals.svgWidth-10,r="end"),s.verticalAlign==="top"?o=50:s.verticalAlign==="bottom"&&(o=t.globals.svgHeight-50),a=a+s.offsetX,o=o+parseInt(s.style.fontSize,10)+2+s.offsetY,s.text!==void 0&&s.text!==""){let n=i.drawText({x:a,y:o,text:s.text,textAnchor:r,fontSize:s.style.fontSize,fontFamily:s.style.fontFamily,foreColor:s.style.color,opacity:1,cssClass:"apexcharts-text-nodata"});t.dom.Paper.add(n)}}setNullSeriesToZeroValues(t){let e=this.w;for(let s=0;ss.length>0?s:[])}},Pe=class{constructor(t){this.w=t,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}checkHeatmapDistributed(){let{chart:t,plotOptions:e}=this.w.config;return t.type==="treemap"&&e.treemap&&e.treemap.distributed||t.type==="heatmap"&&e.heatmap&&e.heatmap.distributed}checkBarDistributed(){let{chart:t,plotOptions:e}=this.w.config;return e.bar&&e.bar.distributed&&(t.type==="bar"||t.type==="rangeBar")}init(){this.setDefaultColors()}setDefaultColors(){var t;let e=this.w,s=new D;e.dom.elWrap.classList.add(`apexcharts-theme-${e.config.theme.mode||"light"}`);let i=(t=e.config.theme.accessibility)==null?void 0:t.colorBlindMode;if(i){e.globals.colors=this.getColorBlindColors(i),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors);let r=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],r),this.applyDataLabelsColors(r),this.applyRadarPolygonsColors(),this.applyMarkersColors(r),i==="highContrast"&&e.dom.elWrap.classList.add("apexcharts-high-contrast");return}let a=[...e.config.colors||e.config.fill.colors||[]];e.globals.colors=this.getColors(a),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.seriesData.series,s));let o=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],o),this.applyDataLabelsColors(o),this.applyRadarPolygonsColors(),this.applyMarkersColors(o)}getColors(t){let e=this.w;return!t||t.length===0?this.predefined():Array.isArray(t)&&t.length>0&&typeof t[0]=="function"?(this.isColorFn=!0,e.config.series.map((s,i)=>{let a=t[i]||t[0];return typeof a=="function"?a({value:e.globals.axisCharts?e.seriesData.series[i][0]||0:e.seriesData.series[i],seriesIndex:i,dataPointIndex:i,w:this.w}):a})):t}applySeriesColors(t,e){t.forEach((s,i)=>{s&&(e[i]=s)})}getMonochromeColors(t,e,s){let{color:i,shadeIntensity:a,shadeTo:o}=t,r=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,n=1/(r/a),c=0;return Array.from({length:r},()=>{let l=o==="dark"?s.shadeColor(c*-1,i):s.shadeColor(c,i);return c+=n,l})}applyColorTypes(t,e){let s=this.w;t.forEach(i=>{s.globals[i].colors=s.config[i].colors===void 0?this.isColorFn?s.config.colors:e:s.config[i].colors.slice(),this.pushExtraColors(s.globals[i].colors)})}applyDataLabelsColors(t){let e=this.w;e.globals.dataLabels.style.colors=e.config.dataLabels.style.colors===void 0?t:e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50)}applyRadarPolygonsColors(){let t=this.w;t.globals.radarPolygons.fill.colors=t.config.plotOptions.radar.polygons.fill.colors===void 0?[t.config.theme.mode==="dark"?"#343A3F":"none"]:t.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(t.globals.radarPolygons.fill.colors,20)}applyMarkersColors(t){let e=this.w;e.globals.markers.colors=e.config.markers.colors===void 0?t:e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}pushExtraColors(t,e,s=null){let i=this.w,a=e||i.seriesData.series.length;if(s===null&&(s=this.isBarDistributed||this.isHeatmapDistributed||i.config.chart.type==="heatmap"&&i.config.plotOptions.heatmap&&i.config.plotOptions.heatmap.colorScale.inverse),s&&i.seriesData.series.length&&(a=i.seriesData.series[i.globals.maxValsInArrayIndex].length*i.seriesData.series.length),t.lengtht.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}getDatalabelsRect(){let t=this.w,e=[];t.config.series.forEach((r,n)=>{r.data.forEach((c,l)=>{let d=(g=>t.config.dataLabels.formatter(g,{seriesIndex:n,dataPointIndex:l,w:t}))(t.seriesData.series[n][l]);e.push(d)})});let s=D.getLargestStringFromArr(e),i=new F(this.w),a=t.config.dataLabels.style,o=i.getTextRects(s,parseInt(a.fontSize).toString(),a.fontFamily);return{width:o.width*1.05,height:o.height}}getLargestStringFromMultiArr(t,e){let s=this.w,i=t;if(s.axisFlags.isMultiLineX){let a=e.map(n=>Array.isArray(n)?n.length:1),o=Math.max(...a),r=a.indexOf(o);i=e[r]}return i}},Fe=class{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){let t=this.w,e=t.labelData.labels.slice();t.config.xaxis.convertedCatToNumeric&&e.length===0&&(e=t.labelData.categoryLabels);let s;if(t.labelData.timescaleLabels.length>0){let i=this.getxAxisTimeScaleLabelsCoords();s={width:i.width,height:i.height},t.layout.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=(t.config.legend.position==="left"||t.config.legend.position==="right")&&!t.config.legend.floating?this.dCtx.lgRect.width:0;let i=t.formatters.xLabelFormatter,a=D.getLargestStringFromArr(e),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,e);t.globals.isBarHorizontal&&(a=t.globals.yAxisScale[0].result.reduce((d,g)=>d.length>g.length?d:g,0),o=a);let r=new yt(this.w),n=a;a=r.xLabelFormat(i,a,n,{i:void 0,dateFormatter:new j(this.w).formatDate,w:t}),o=r.xLabelFormat(i,o,n,{i:void 0,dateFormatter:new j(this.w).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&typeof a>"u"||String(a).trim()==="")&&(a="1",o=a);let c=new F(this.w),l=c.getTextRects(a,t.config.xaxis.labels.style.fontSize),h=l;if(a!==o&&(h=c.getTextRects(o,t.config.xaxis.labels.style.fontSize)),s={width:l.width>=h.width?l.width:h.width,height:l.height>=h.height?l.height:h.height},s.width*e.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&t.config.xaxis.labels.rotate!==0||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.layout.rotateXLabels=!0;let d=g=>c.getTextRects(g,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,`rotate(${t.config.xaxis.labels.rotate} 0 0)`,!1);l=d(a),a!==o&&(h=d(o)),s.height=(l.height>h.height?l.height:h.height)/1.5,s.width=l.width>h.width?l.width:h.width}}else t.layout.rotateXLabels=!1}return t.config.xaxis.labels.show||(s={width:0,height:0}),{width:s.width,height:s.height}}getxAxisGroupLabelsCoords(){var t;let e=this.w;if(!e.labelData.hasXaxisGroups)return{width:0,height:0};let s=((t=e.config.xaxis.group.style)==null?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,i=e.labelData.groups.map(h=>h.title),a,o=D.getLargestStringFromArr(i),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(o,i),n=new F(this.w),c=n.getTextRects(o,s),l=c;return o!==r&&(l=n.getTextRects(r,s)),a={width:c.width>=l.width?c.width:l.width,height:c.height>=l.height?c.height:l.height},e.config.xaxis.labels.show||(a={width:0,height:0}),{width:a.width,height:a.height}}getxAxisTitleCoords(){let t=this.w,e=0,s=0;if(t.config.xaxis.title.text!==void 0){let a=new F(this.w).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=a.width,s=a.height}return{width:e,height:s}}getxAxisTimeScaleLabelsCoords(){let t=this.w;this.dCtx.timescaleLabels=t.labelData.timescaleLabels.slice();let e=this.dCtx.timescaleLabels.map(r=>r.value),s=e.reduce((r,n)=>typeof r>"u"?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):r.length>n.length?r:n,0),a=new F(this.w).getTextRects(s,t.config.xaxis.labels.style.fontSize);return a.width*1.05*e.length>t.layout.gridWidth&&t.config.xaxis.labels.rotate!==0&&(t.globals.overlappingXLabels=!0),a}additionalPaddingXLabels(t){let e=this.w,s=e.globals,i=e.config,a=i.xaxis.type,o=t.width;s.skipLastTimelinelabel=!1,s.skipFirstTimelinelabel=!1;let r=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,n=h=>s.collapsedSeriesIndices.indexOf(h)!==-1,c=h=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){let d=this.dCtx.timescaleLabels[0],p=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+o/1.75-this.dCtx.yAxisWidthRight,f=d.position-o/1.75+this.dCtx.yAxisWidthLeft,x=e.config.legend.position==="right"&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;p>s.svgWidth-e.layout.translateX-x&&(s.skipLastTimelinelabel=!0),f<-((!h.show||h.floating)&&(i.chart.type==="bar"||i.chart.type==="candlestick"||i.chart.type==="rangeBar"||i.chart.type==="boxPlot")?o/1.75:10)&&(s.skipFirstTimelinelabel=!0)}else a==="datetime"?this.dCtx.gridPad.right{i.yaxis.length>1&&n(d)||c(h)};i.yaxis.forEach((h,d)=>{r?(this.dCtx.gridPad.left{let c={seriesIndex:n,dataPointIndex:-1,w:t},l=t.globals.yAxisScale[n],h=0;if(!o.isYAxisHidden(n)&&r.labels.show&&r.labels.minWidth!==void 0&&(h=r.labels.minWidth),!o.isYAxisHidden(n)&&r.labels.show&&l.result.length){let d=t.formatters.yLabelFormatters[n],g=l.niceMin===Number.MIN_VALUE?0:l.niceMin,p=l.result.reduce((y,w)=>{var A,C;return((A=String(d(y,c)))==null?void 0:A.length)>((C=String(d(w,c)))==null?void 0:C.length)?y:w},g);p=d(p,c);let f=p;if((typeof p>"u"||p.length===0)&&(p=l.niceMax),String(p).length===1&&(p=p+".0",f=p),t.globals.isBarHorizontal){a=0;let y=t.labelData.labels.slice();p=D.getLargestStringFromArr(y),p=d(p,{seriesIndex:n,dataPointIndex:-1,w:t}),f=this.dCtx.dimHelpers.getLargestStringFromMultiArr(p,y)}let x=new F(this.w),m="rotate(".concat(r.labels.rotate," 0 0)"),b=x.getTextRects(p,r.labels.style.fontSize,r.labels.style.fontFamily,m,!1),v=b;p!==f&&(v=x.getTextRects(f,r.labels.style.fontSize,r.labels.style.fontFamily,m,!1)),i.push({width:(h>v.width||h>b.width?h:v.width>b.width?v.width:b.width)+a,height:v.height>b.height?v.height:b.height})}else i.push({width:e,height:s})}),i}getyAxisTitleCoords(){let t=this.w,e=[];return t.config.yaxis.map(s=>{if(s.show&&s.title.text!==void 0){let i=new F(this.w),a="rotate(".concat(s.title.rotate," 0 0)"),o=i.getTextRects(s.title.text,s.title.style.fontSize,s.title.style.fontFamily,a,!1);e.push({width:o.width,height:o.height})}else e.push({width:0,height:0})}),e}getTotalYAxisWidth(){let t=this.w,e=0,s=0,i=0,a=t.globals.yAxisScale.length>1?10:0,o=new rt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale}),r=function(c){return t.globals.ignoreYAxisIndexes.indexOf(c)>-1},n=(c,l)=>{let h=t.config.yaxis[l].floating,d=0;c.width>0&&!h?(d=c.width+a,r(l)&&(d=d-c.width-a)):d=h||o.isYAxisHidden(l)?0:5,t.config.yaxis[l].opposite?i=i+d:s=s+d,e=e+d};return t.layout.yLabelsCoords.map((c,l)=>{n(c,l)}),t.layout.yTitleCoords.map((c,l)=>{n(c,l)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.layout.yLabelsCoords[0].width+t.layout.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=s,this.dCtx.yAxisWidthRight=i,e}},Re=class{constructor(t){this.w=t.w,this.dCtx=t}gridPadForColumnsInNumericAxis(t){let{w:e}=this,{config:s,globals:i}=e;if(i.noData||i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.series.length)return 0;let a=h=>["bar","rangeBar","candlestick","boxPlot"].includes(h),o=s.chart.type,r=0,n=a(o)?s.series.length:1;i.comboBarCount>0&&(n=i.comboBarCount),i.collapsedSeries.forEach(h=>{a(h.type)&&(n-=1)}),s.chart.stacked&&(n=1);let c=a(o)||i.comboBarCount>0,l=Math.abs(i.initialMaxX-i.initialMinX);if(c&&e.axisFlags.isXNumeric&&!i.isBarHorizontal&&n>0&&l!==0){l<=3&&(l=i.dataPoints);let h=l/t,d=i.minXDiff&&i.minXDiff/h>0?i.minXDiff/h:0;d>t/2&&(d/=2),r=d*parseInt(s.plotOptions.bar.columnWidth,10)/100,r<1&&(r=1),i.barPadForNumericAxis=r}return r}gridPadFortitleSubtitle(){let{w:t}=this,{globals:e}=t,s=this.dCtx.isSparkline||!e.axisCharts?0:10;["title","subtitle"].forEach(r=>{t.config[r].text!==void 0?s+=t.config[r].margin:s+=this.dCtx.isSparkline||!e.axisCharts?0:5}),t.config.legend.show&&t.config.legend.position==="bottom"&&!t.config.legend.floating&&!e.axisCharts&&(s+=10);let a=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),o=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");t.layout.gridHeight-=a.height+o.height+s,t.layout.translateY+=a.height+o.height+s}setGridXPosForDualYAxis(t,e){let{w:s}=this,i=new rt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});s.config.yaxis.forEach((a,o)=>{s.globals.ignoreYAxisIndexes.indexOf(o)===-1&&!a.floating&&!i.isYAxisHidden(o)&&(a.opposite&&(s.layout.translateX-=e[o].width+t[o].width+parseInt(a.labels.style.fontSize,10)/1.2+12),s.layout.translateX<2&&(s.layout.translateX=2))})}},Tt=class{constructor(t,e){this.w=t,this.ctx=e,this.theme=e.theme,this.timeScale=e.timeScale,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new Ei(this),this.dimYAxis=new Xe(this),this.dimXAxis=new Fe(this),this.dimGrid=new Re(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0,this.datalabelsCoords={width:0,height:0},this.xAxisWidth=0,this.timescaleLabels=[]}plotCoords(){let t=this.w,e=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};let s=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width;this.isSparkline&&((t.config.markers.discrete.length>0||t.config.markers.size>0)&&Object.entries(this.gridPad).forEach(([a,o])=>{this.gridPad[a]=Math.max(o,this.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(s/2,this.gridPad.top),this.gridPad.bottom=Math.max(s/2,this.gridPad.bottom)),e.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),t.layout.gridHeight=t.layout.gridHeight-this.gridPad.top-this.gridPad.bottom,t.layout.gridWidth=t.layout.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;let i=this.dimGrid.gridPadForColumnsInNumericAxis(t.layout.gridWidth);return t.layout.gridWidth=t.layout.gridWidth-i*2,t.layout.translateX=t.layout.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),t.layout.translateY=t.layout.translateY+this.gridPad.top,{layout:{gridHeight:t.layout.gridHeight,gridWidth:t.layout.gridWidth,translateX:t.layout.translateX,translateY:t.layout.translateY,translateXAxisX:t.layout.translateXAxisX,translateXAxisY:t.layout.translateXAxisY,rotateXLabels:t.layout.rotateXLabels,xAxisHeight:t.layout.xAxisHeight,xAxisLabelsHeight:t.layout.xAxisLabelsHeight,xAxisGroupLabelsHeight:t.layout.xAxisGroupLabelsHeight,xAxisLabelsWidth:t.layout.xAxisLabelsWidth,yLabelsCoords:t.layout.yLabelsCoords,yTitleCoords:t.layout.yTitleCoords}}}setDimensionsForAxisCharts(){let t=this.w,e=t.globals,s=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.layout.yLabelsCoords=[],t.layout.yTitleCoords=[],t.config.yaxis.map((g,p)=>{t.layout.yLabelsCoords.push({width:s[p].width,index:p}),t.layout.yTitleCoords.push({width:i[p].width,index:p})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();let a=this.dimXAxis.getxAxisLabelsCoords(),o=this.dimXAxis.getxAxisGroupLabelsCoords(),r=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,r,o),t.layout.translateXAxisY=t.layout.rotateXLabels?this.xAxisHeight/8:-4,t.layout.translateXAxisX=t.layout.rotateXLabels&&t.axisFlags.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(t.layout.rotateXLabels=!1,t.layout.translateXAxisY=-1*(parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5)),t.layout.translateXAxisY=t.layout.translateXAxisY+t.config.xaxis.labels.offsetY,t.layout.translateXAxisX=t.layout.translateXAxisX+t.config.xaxis.labels.offsetX;let n=this.yAxisWidth,c=this.xAxisHeight;t.layout.xAxisLabelsHeight=this.xAxisHeight-r.height,t.layout.xAxisGroupLabelsHeight=t.layout.xAxisLabelsHeight-a.height,t.layout.xAxisLabelsWidth=this.xAxisWidth,t.layout.xAxisHeight=this.xAxisHeight;let l=10;(t.config.chart.type==="radar"||this.isSparkline)&&(n=0,c=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||t.config.chart.type==="treemap")&&(n=0,c=0,l=0),!this.isSparkline&&t.config.chart.type!=="treemap"&&this.dimXAxis.additionalPaddingXLabels(a);let h=()=>{t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-this.lgRect.height-c-(!this.isSparkline&&t.config.chart.type!=="treemap"?t.layout.rotateXLabels?10:15:0),t.layout.gridWidth=e.svgWidth-n-this.datalabelsCoords.width*2};switch(t.config.xaxis.position==="top"&&(l=t.layout.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":t.layout.translateY=l,h();break;case"top":t.layout.translateY=this.lgRect.height+l,h();break;case"left":t.layout.translateY=l,t.layout.translateX=this.lgRect.width+n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-c-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-this.datalabelsCoords.width*2;break;case"right":t.layout.translateY=l,t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-c-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-this.datalabelsCoords.width*2-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,s),new Nt(this.w,{theme:this.theme,timeScale:this.timeScale}).setYAxisXPosition(s,i)}setDimensionsForNonAxisCharts(){let t=this.w,e=t.globals,s=t.config,i=0;t.config.legend.show&&!t.config.legend.floating&&(i=20);let a=s.chart.type==="pie"||s.chart.type==="polarArea"||s.chart.type==="donut"?"pie":"radialBar",o=s.plotOptions[a].offsetY,r=s.plotOptions[a].offsetX;if(!s.legend.show||s.legend.floating){t.layout.gridHeight=e.svgHeight;let n=t.dom.elWrap.getBoundingClientRect().width;t.layout.gridWidth=Math.min(n,t.layout.gridHeight),t.layout.translateY=o,t.layout.translateX=r+(e.svgWidth-t.layout.gridWidth)/2;return}switch(s.legend.position){case"bottom":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=o-10,t.layout.translateX=r+(e.svgWidth-t.layout.gridWidth)/2;break;case"top":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=this.lgRect.height+o+10,t.layout.translateX=r+(e.svgWidth-t.layout.gridWidth)/2;break;case"left":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i,t.layout.gridHeight=s.chart.height!=="auto"?e.svgHeight:t.layout.gridWidth,t.layout.translateY=o,t.layout.translateX=r+this.lgRect.width+i;break;case"right":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i-5,t.layout.gridHeight=s.chart.height!=="auto"?e.svgHeight:t.layout.gridWidth,t.layout.translateY=o,t.layout.translateX=r+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,s){let i=this.w,a=i.labelData.hasXaxisGroups?2:1,o=s.height+t.height+e.height,r=i.axisFlags.isMultiLineX?1.2:Bs,n=i.layout.rotateXLabels?22:10,l=i.layout.rotateXLabels&&i.config.legend.position==="bottom"?10:0;this.xAxisHeight=o*r+a*n+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight{h+=g.labels.minWidth,d+=g.labels.maxWidth}),this.yAxisWidthd&&(this.yAxisWidth=d)}},Ws=1440,_e=Ws*60,Fi=10/_e,Ie=class{constructor(t,e){this.w=t,this.ctx=e,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){let s=this.w;if(s.globals.allSeriesCollapsed)return s.labelData.labels=[],s.labelData.timescaleLabels=[],[];let i=new j(this.w),a=(e-t)/(1e3*_e);this.determineInterval(a),s.interact.disableZoomIn=!1,s.interact.disableZoomOut=!1,a5e4&&(s.interact.disableZoomOut=!0);let o=i.getTimeUnitsfromTimestamp(t,e),r=s.layout.gridWidth/a,n=r/24,c=n/60,l=c/60,h=Math.floor(a*24),d=Math.floor(a*Ws),g=Math.floor(a*_e),p=Math.floor(a),f=Math.floor(a/30),x=Math.floor(a/365),m={minMillisecond:o.minMillisecond,minSecond:o.minSecond,minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear},b=m.minMillisecond,v=m.minSecond,y=m.minMinute,w=m.minHour,A=m.minDate,C=m.minDate,L=m.minMonth,k=m.minYear,S={firstVal:m,currentMillisecond:b,currentSecond:v,currentMinute:y,currentHour:w,currentMonthDate:A,currentDate:C,currentMonth:L,currentYear:k,daysWidthOnXAxis:r,hoursWidthOnXAxis:n,minutesWidthOnXAxis:c,secondsWidthOnXAxis:l,numberOfSeconds:g,numberOfMinutes:d,numberOfHours:h,numberOfDays:p,numberOfMonths:f,numberOfYears:x};switch(this.tickInterval){case"years":{this.generateYearScale(S);break}case"months":case"half_year":{this.generateMonthScale(S);break}case"months_days":case"months_fortnight":case"days":case"week_days":{this.generateDayScale(S);break}case"hours":{this.generateHourScale(S);break}case"minutes_fives":case"minutes":this.generateMinuteScale(S);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(S);break}let T=this.timeScaleArray.map(M=>{let E={position:M.position,unit:M.unit,year:M.year,day:M.day?M.day:1,hour:M.hour?M.hour:0,month:M.month+1};return M.unit==="month"?W(I({},E),{day:1,value:M.value+1}):M.unit==="day"||M.unit==="hour"?W(I({},E),{value:M.value}):M.unit==="minute"?W(I({},E),{value:M.value,minute:M.value}):M.unit==="second"?W(I({},E),{value:M.value,minute:M.minute,second:M.second}):M});return T.filter(M=>{let E=1,X=Math.ceil(s.layout.gridWidth/120),_=M.value;s.config.xaxis.tickAmount!==void 0&&(X=s.config.xaxis.tickAmount),T.length>X&&(E=Math.floor(T.length/X));let R=!1,N=!1;switch(this.tickInterval){case"years":M.unit==="year"&&(R=!0);break;case"half_year":E=7,M.unit==="year"&&(R=!0);break;case"months":E=1,M.unit==="year"&&(R=!0);break;case"months_fortnight":E=15,(M.unit==="year"||M.unit==="month")&&(R=!0),_===30&&(N=!0);break;case"months_days":E=10,M.unit==="month"&&(R=!0),_===30&&(N=!0);break;case"week_days":E=8,M.unit==="month"&&(R=!0);break;case"days":E=1,M.unit==="month"&&(R=!0);break;case"hours":M.unit==="day"&&(R=!0);break;case"minutes_fives":_%5!==0&&(N=!0);break;case"seconds_tens":_%10!==0&&(N=!0);break;case"seconds_fives":_%5!==0&&(N=!0);break}if(this.tickInterval==="hours"||this.tickInterval==="minutes_fives"||this.tickInterval==="seconds_tens"||this.tickInterval==="seconds_fives"){if(!N)return!0}else if((_%E===0||R)&&!N)return!0})}recalcDimensionsBasedOnFormat(t){let e=this.w,s=this.formatDates(t),i=this.removeOverlappingTS(s);e.labelData.timescaleLabels=i.slice();let o=new Tt(this.w,this.ctx).plotCoords();this.ctx._writeLayoutCoords(o.layout)}determineInterval(t){let e=t/365,s=t*24,i=s*60,a=i*60;switch(!0){case e>5:this.tickInterval="years";break;case t>800:this.tickInterval="half_year";break;case t>180:this.tickInterval="months";break;case t>90:this.tickInterval="months_fortnight";break;case t>60:this.tickInterval="months_days";break;case t>30:this.tickInterval="week_days";break;case t>2:this.tickInterval="days";break;case s>2.4:this.tickInterval="hours";break;case i>15:this.tickInterval="minutes_fives";break;case i>5:this.tickInterval="minutes";break;case i>1:this.tickInterval="seconds_tens";break;case a>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds";break}}generateYearScale({firstVal:t,currentMonth:e,currentYear:s,daysWidthOnXAxis:i,numberOfYears:a}){let o=t.minYear,r=0,n=new j(this.w),c="year";if(t.minDate>1||t.minMonth>0){let d=n.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);r=(n.determineDaysOfYear(t.minYear)-d+1)*i,o=t.minYear+1,this.timeScaleArray.push({position:r,value:o,unit:c,year:o,month:1})}else t.minDate===1&&t.minMonth===0&&this.timeScaleArray.push({position:r,value:o,unit:c,year:s,month:D.monthMod(e+1)});let l=o,h=r;for(let d=0;d1){n=(c.determineDaysOfMonths(s+1,t.minYear)-e+1)*a,r=D.monthMod(s+1);let f=i+h,x=D.monthMod(r),m=r;r===0&&(l="year",m=f,x=1,h+=1,f=f+h),this.timeScaleArray.push({position:n,value:m,unit:l,year:f,month:x})}else this.timeScaleArray.push({position:n,value:r,unit:l,year:i,month:D.monthMod(s)});let d=r+1,g=n;for(let p=0,f=1;p{let y=o.determineDaysOfMonths(b+1,v);return m>y&&(b=b+1,c=1,r="month",p=b),b},h=24-t.minHour,d=0,g=h*i,p=n,f=l(c,e,s);t.minHour===0&&t.minDate===1?(g=0,p=D.monthMod(t.minMonth),r="month",c=t.minDate):t.minDate!==1&&t.minHour===0&&t.minMinute===0&&(g=0,n=t.minDate,c=n,p=n,f=l(c,e,s),p!==1&&(r="day")),this.timeScaleArray.push({position:g,value:p,unit:r,year:this._getYear(s,f,d),month:D.monthMod(f),day:c});let x=g;for(let m=0;m{let A=r.determineDaysOfMonths(w+1,i);return y>A&&(x=1,w=w+1),{month:w,date:x}},h=(y,w)=>{let A=r.determineDaysOfMonths(w+1,i);return y>A&&(w=w+1),w},d=60-(t.minMinute+t.minSecond/60),g=d*a,p=t.minHour+1,f=p;d===60&&(g=0,p=t.minHour,f=p);let x=e;f>=24&&(f=0,x+=1,c="day",p=x);let b=l(x,s).month;b=h(x,b),c==="day"&&(p=x),this.timeScaleArray.push({position:g,value:p,unit:c,day:x,hour:f,year:i,month:D.monthMod(b)}),f++;let v=g;for(let y=0;y=24&&(f=0,x+=1,c="day",b=l(x,b).month,b=h(x,b));let w=this._getYear(i,b,n);v=60*a+v;let A=f===0?x:f;this.timeScaleArray.push({position:v,value:A,unit:c,hour:f,day:x,year:w,month:D.monthMod(b)}),f++}}generateMinuteScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:o,currentYear:r,minutesWidthOnXAxis:n,secondsWidthOnXAxis:c,numberOfMinutes:l}){let h=new j(this.w),d=0,g="minute",f=(60-e-t/1e3)*c,x=s+1;e===0&&t===0&&(f=0,x=s);let m=a,b=o,v=r,y=i,w=f;for(let A=0;A=60&&(x=0,y+=1,y===24)){y=0,m+=1;let C=h.determineDaysOfMonths(b+1,this._getYear(v,b,d));m>C&&(m=1,b+=1)}this.timeScaleArray.push({position:w,value:x,unit:g,hour:y,minute:x,day:m,year:this._getYear(v,b,d),month:D.monthMod(b)}),w+=n,x++}}generateSecondScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:o,currentYear:r,secondsWidthOnXAxis:n,numberOfSeconds:c}){let h="second",g=(1e3-t)/1e3*n,p=e+1;t===0&&(g=0,p=e);let f=s,x=a,m=o,b=r,v=i,y=g;for(let w=0;w=60&&(f++,p=0,f>=60&&(v++,f=0,v===24&&(v=0))),this.timeScaleArray.push({position:y,value:p,unit:h,hour:v,minute:f,second:p,day:x,year:this._getYear(b,m,0),month:D.monthMod(m)}),y+=n,p++}createRawDateString(t,e){let s=t.year;return t.month===0&&(t.month=1),s+="-"+("0"+t.month.toString()).slice(-2),t.unit==="day"?s+="-"+("0"+e).slice(-2):s+="-"+("0"+(t.day?t.day:"1")).slice(-2),t.unit==="hour"?s+="T"+("0"+e).slice(-2):s+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),t.unit==="minute"?s+=":"+("0"+e).slice(-2):s+=":"+(t.minute?("0"+t.minute).slice(-2):"00"),t.unit==="second"?s+=":"+("0"+e).slice(-2):s+=":00",this.utc&&(s+=".000Z"),s}formatDates(t){let e=this.w;return t.map(i=>{let a=i.value.toString(),o=new j(this.w),r=this.createRawDateString(i,a),n=o.getDate(o.parseDate(r));if(this.utc||(n=o.getDate(o.parseDateWithTimezone(r))),e.config.xaxis.labels.format===void 0){let c="dd MMM",l=e.config.xaxis.labels.datetimeFormatter;i.unit==="year"&&(c=l.year),i.unit==="month"&&(c=l.month),i.unit==="day"&&(c=l.day),i.unit==="hour"&&(c=l.hour),i.unit==="minute"&&(c=l.minute),i.unit==="second"&&(c=l.second),a=o.formatDate(n,c)}else a=o.formatDate(n,e.config.xaxis.labels.format);return{dateString:r,position:i.position,value:a,unit:i.unit,year:i.year,month:i.month}})}removeOverlappingTS(t){let e=new F(this.w),s=!1,i;t.length>0&&t[0].value&&t.every(r=>r.value.length===t[0].value.length)&&(s=!0,i=e.getTextRects(t[0].value,this.w.config.xaxis.labels.style.fontSize).width);let a=0,o=t.map((r,n)=>{if(n>0&&this.w.config.xaxis.labels.hideOverlappingLabels){let c=s?i:e.getTextRects(t[a].value,this.w.config.xaxis.labels.style.fontSize).width,l=t[a].position;return r.position>l+c+10?(a=n,r):null}else return r});return o=o.filter(r=>r!==null),o}_getYear(t,e,s){return t+Math.floor(e/12)+s}},Ye="__apexcharts_registry__";globalThis[Ye]||(globalThis[Ye]={});function Gs(){return globalThis[Ye]}function Xi(u){Object.assign(Gs(),u)}function et(u){let t=Gs()[u];if(!t)throw new Error(`ApexCharts: chart type "${u}" is not registered. Import it via ApexCharts.use() or use the full apexcharts bundle.`);return t}var Ne=class{constructor(t,e,s){this.w=e,this.ctx=s,this.el=t}setupElements(){let{globals:t,config:e}=this.w,s=e.chart.type,i=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"],a=[...i,"radar","heatmap","treemap"];t.axisCharts=a.includes(s),t.xyCharts=i.includes(s),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(s)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,this.w.dom.baseEl=this.el,this.w.dom.elWrap=z.createElementNS("http://www.w3.org/1999/xhtml","div"),F.setAttrs(this.w.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(this.w.dom.elWrap);let o=Y.isBrowser()?window.SVG:global.SVG;if(this.w.dom.Paper=o().addTo(this.w.dom.elWrap),this.w.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),this.w.dom.Paper.node.style.background=e.theme.mode==="dark"&&!e.chart.background?"#343A3F":e.theme.mode==="light"&&!e.chart.background?"#fff":e.chart.background,this.setSVGDimensions(),this.w.dom.elLegendForeign=z.createElementNS(V,"foreignObject"),F.setAttrs(this.w.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),this.w.dom.elLegendWrap=z.createElementNS("http://www.w3.org/1999/xhtml","div"),this.w.dom.elLegendWrap.classList.add("apexcharts-legend"),this.w.dom.elWrap.appendChild(this.w.dom.elLegendWrap),this.w.dom.Paper.node.appendChild(this.w.dom.elLegendForeign),e.chart.accessibility.enabled){let r=this.getAccessibleChartLabel(),n=e.chart.accessibility.keyboard.enabled&&e.chart.accessibility.keyboard.navigation.enabled?"application":"img";if(this.w.dom.Paper.attr({role:n,"aria-label":r}),e.chart.accessibility.description){let c=z.createElementNS(V,"desc");c.textContent=e.chart.accessibility.description,this.w.dom.Paper.node.insertBefore(c,this.w.dom.elLegendForeign.nextSibling)}}this.w.dom.elGraphical=this.w.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),this.w.dom.elDefs=this.w.dom.Paper.defs(),this.w.dom.Paper.add(this.w.dom.elGraphical),this.w.dom.elGraphical.add(this.w.dom.elDefs)}plotChartType(t,e){let{w:s,ctx:i}=this,{config:a,globals:o}=s,r={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},n=a.chart.type||"line",c=null,l=0;this.w.seriesData.series.forEach((b,v)=>{var y,w;let A=((y=t[v])==null?void 0:y.type)==="column"?"bar":((w=t[v])==null?void 0:w.type)||(n==="column"?"bar":n);r[A]?(A==="rangeArea"?(r[A].series.push(this.w.rangeData.seriesRangeStart[v]),r[A].seriesRangeEnd.push(this.w.rangeData.seriesRangeEnd[v])):r[A].series.push(b),r[A].i.push(v),A==="bar"&&(s.globals.columnSeries=r.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(A)?c=A:console.warn(`You have specified an unrecognized series type (${A}).`),n!==A&&A!=="scatter"&&l++}),l>0&&(c&&console.warn(`Chart or series type ${c} cannot appear with other chart or series types.`),r.bar.series.length>0&&a.plotOptions.bar.horizontal&&(l-=r.bar.series.length,r.bar={series:[],i:[]},s.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),o.comboCharts||(o.comboCharts=l>0);let d=r.line.series.length>0||r.area.series.length>0||r.scatter.series.length>0||r.bubble.series.length>0||r.rangeArea.series.length>0||!o.comboCharts&&["line","area","scatter","bubble","rangeArea"].includes(a.chart.type)?new(et("line"))(i.w,i,e):null,p=r.candlestick.series.length>0||r.boxPlot.series.length>0||!o.comboCharts&&["candlestick","boxPlot"].includes(a.chart.type)?new(et("candlestick"))(i.w,i,e):null,f=!o.comboCharts&&["pie","donut","polarArea"].includes(a.chart.type);i.pie=f?new(et("pie"))(i.w,i):null;let x=r.rangeBar.series.length>0||!o.comboCharts&&a.chart.type==="rangeBar";i.rangeBar=x?new(et("rangeBar"))(i.w,i,e):null;let m=[];if(o.comboCharts){let b=new Z(this.w);if(r.area.series.length>0&&m.push(...b.drawSeriesByGroup(r.area,o.areaGroups,"area",d)),r.bar.series.length>0)if(a.chart.stacked){let v=new(et("barStacked"))(i.w,i,e);m.push(v.draw(r.bar.series,r.bar.i))}else i.bar=new(et("bar"))(i.w,i,e),m.push(i.bar.draw(r.bar.series,r.bar.i));if(r.rangeArea.series.length>0&&m.push(d.draw(r.rangeArea.series,"rangeArea",r.rangeArea.i,r.rangeArea.seriesRangeEnd)),r.line.series.length>0&&m.push(...b.drawSeriesByGroup(r.line,o.lineGroups,"line",d)),r.candlestick.series.length>0&&m.push(p.draw(r.candlestick.series,"candlestick",r.candlestick.i)),r.boxPlot.series.length>0&&m.push(p.draw(r.boxPlot.series,"boxPlot",r.boxPlot.i)),r.rangeBar.series.length>0&&m.push(i.rangeBar.draw(r.rangeBar.series,r.rangeBar.i)),r.scatter.series.length>0){let v=new(et("line"))(i.w,i,e,!0);m.push(v.draw(r.scatter.series,"scatter",r.scatter.i))}if(r.bubble.series.length>0){let v=new(et("line"))(i.w,i,e,!0);m.push(v.draw(r.bubble.series,"bubble",r.bubble.i))}}else{let b=a.chart.type;switch(b){case"line":m=d.draw(this.w.seriesData.series,"line");break;case"area":m=d.draw(this.w.seriesData.series,"area");break;case"bar":a.chart.stacked?m=new(et("barStacked"))(i.w,i,e).draw(this.w.seriesData.series):(i.bar=new(et("bar"))(i.w,i,e),m=i.bar.draw(this.w.seriesData.series));break;case"candlestick":m=p.draw(this.w.seriesData.series,"candlestick");break;case"boxPlot":m=p.draw(this.w.seriesData.series,b);break;case"rangeBar":m=i.rangeBar.draw(this.w.seriesData.series);break;case"rangeArea":m=d.draw(this.w.rangeData.seriesRangeStart,"rangeArea",void 0,this.w.rangeData.seriesRangeEnd);break;case"heatmap":{m=new(et("heatmap"))(i.w,i,e).draw(this.w.seriesData.series);break}case"treemap":{m=new(et("treemap"))(i.w,i).draw(this.w.seriesData.series);break}case"pie":case"donut":case"polarArea":m=i.pie.draw(this.w.seriesData.series);break;case"radialBar":{m=new(et("radialBar"))(i.w,i).draw(this.w.seriesData.series);break}case"radar":{m=new(et("radar"))(i.w,i).draw(this.w.seriesData.series);break}default:m=d.draw(this.w.seriesData.series)}}return m}setSVGDimensions(){var t;let{globals:e,config:s}=this.w;s.chart.width=s.chart.width||"100%",s.chart.height=s.chart.height||"auto";let i=s.chart.width,a=s.chart.height;e.svgWidth=NaN,e.svgHeight=NaN;let o=D.getDimensions(this.el),r=i.toString().split(/[0-9]+/g).pop();r==="%"?D.isNumber(o[0])&&(o[0].width===0&&(o=D.getDimensions(this.el.parentNode)),e.svgWidth=o[0]*parseInt(i,10)/100):(r==="px"||r==="")&&(e.svgWidth=parseInt(i,10));let n=String(a).toString().split(/[0-9]+/g).pop();if(a!=="auto"&&a!=="")if(n==="%"){let c=D.getDimensions(this.el.parentNode);e.svgHeight=c[1]*parseInt(a,10)/100}else e.svgHeight=parseInt(a,10);else e.svgHeight=e.axisCharts?e.svgWidth/1.61:e.svgWidth/1.2;if(e.svgWidth=Math.max(e.svgWidth,0),e.svgHeight=Math.max(e.svgHeight,0),F.setAttrs(this.w.dom.Paper.node,{width:e.svgWidth,height:e.svgHeight}),n!=="%"&&Y.isBrowser()){let c=s.chart.sparkline.enabled?0:e.axisCharts?s.chart.parentHeightOffset:0,l=this.w.dom.Paper.node;(t=l.parentNode)!=null&&t.parentNode&&(l.parentNode.parentNode.style.minHeight=`${e.svgHeight+c}px`)}this.w.dom.elWrap.style.width=`${e.svgWidth}px`,this.w.dom.elWrap.style.height=`${e.svgHeight}px`}shiftGraphPosition(){let{globals:t}=this.w,{translateY:e,translateX:s}=t;F.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${s}, ${e})`})}resizeNonAxisCharts(){var t,e;let{w:s}=this,i=0,a=s.config.chart.sparkline.enabled?1:15;a+=s.config.grid.padding.bottom,["top","bottom"].includes(s.config.legend.position)&&s.config.legend.show&&!s.config.legend.floating&&(i=((e=(t=this.ctx.legend)==null?void 0:t.legendHelpers.getLegendDimensions().clwh)!=null?e:0)+7);let o=s.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),r=s.globals.radialSize*2.05;if(o&&!s.config.chart.sparkline.enabled&&s.config.plotOptions.radialBar.startAngle!==0){let c=D.getBoundingClientRect(o);r=c.bottom;let l=c.bottom-c.top;r=Math.max(s.globals.radialSize*2.05,l)}let n=Math.ceil(r+this.w.layout.translateY+i+a);this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(n)),!(s.config.chart.height&&String(s.config.chart.height).includes("%"))&&(this.w.dom.elWrap.style.height=`${n}px`,F.setAttrs(this.w.dom.Paper.node,{height:n}),Y.isBrowser()&&(this.w.dom.Paper.node.parentNode.parentNode.style.minHeight=`${n}px`))}coreCalculations(){new Yt(this.w).init()}resetGlobals(){let t=()=>this.w.config.series.map(()=>[]),e=new Zt,{globals:s}=this.w,i={dataWasParsed:this.w.axisFlags.dataWasParsed,originalSeries:s.originalSeries};e.initGlobalVars(s),s.seriesXvalues=t(),s.seriesYvalues=t(),i.dataWasParsed&&(this.w.axisFlags.dataWasParsed=i.dataWasParsed,s.originalSeries=i.originalSeries)}isMultipleY(){return Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1?(this.w.globals.isMultipleYAxis=!0,!0):!1}xySettings(){let{w:t}=this,e=null;if(t.globals.axisCharts){if(t.config.xaxis.crosshairs.position==="back"&&new zt(this.w).drawXCrosshairs(),t.config.yaxis[0].crosshairs.position==="back"&&new zt(this.w).drawYCrosshairs(),t.config.xaxis.type==="datetime"&&t.config.xaxis.labels.formatter===void 0){this.ctx.timeScale=new Ie(this.w,this.ctx);let i=[];isFinite(t.globals.minX)&&isFinite(t.globals.maxX)&&!t.globals.isBarHorizontal?i=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minX,t.globals.maxX):t.globals.isBarHorizontal&&(i=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minY,t.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(i)}e=new Z(this.w).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.interact.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}setupBrushHandler(){let{ctx:t,w:e}=this;if(e.config.chart.brush.enabled&&typeof e.config.chart.events.selection!="function"){let s=Array.isArray(e.config.chart.brush.targets)?e.config.chart.brush.targets:[e.config.chart.brush.target];s.forEach(i=>{let a=t.constructor.getChartByID(i);a.w.globals.brushSource=this.ctx,typeof a.w.config.chart.events.zoomed!="function"&&(a.w.config.chart.events.zoomed=()=>this.updateSourceChart(a)),typeof a.w.config.chart.events.scrolled!="function"&&(a.w.config.chart.events.scrolled=()=>this.updateSourceChart(a))}),e.config.chart.events.selection=(i,a)=>{s.forEach(o=>{t.constructor.getChartByID(o).ctx.updateHelpers._updateOptions({xaxis:{min:a.xaxis.min,max:a.xaxis.max}},!1,!1,!1,!1)})}}}getAccessibleChartLabel(){let t=this.w,e=t.config,s="";if(e.chart.accessibility&&e.chart.accessibility.description)s=e.chart.accessibility.description;else if(e.title.text){let i=e.chart.type;s=`${e.title.text}. ${i} chart`,e.subtitle.text&&(s+=`. ${e.subtitle.text}`)}else{let i=e.chart.type,a=t.seriesData.series.length||(e.series?e.series.length:0);s=`${i} chart with ${a} data series`}return s}},Ot=class u{constructor(t,{resetGlobals:e=()=>{},isMultipleY:s=()=>{}}={}){this.w=t,this.resetGlobals=e,this.isMultipleY=s,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new Z(this.w),this.activeSeriesIndex=0}getFirstDataPoint(){let t=this.w.config.series,e=new K(this.w);this.activeSeriesIndex=e.getActiveConfigSeriesIndex();let s=t[this.activeSeriesIndex];return s&&s.data&&s.data.length>0&&s.data[0]!==null&&typeof s.data[0]<"u"?s.data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){var t;let e=this.getFirstDataPoint();if(!e||typeof e.x>"u")return!1;let s=(t=this.w.config.series[this.activeSeriesIndex])==null?void 0:t.data;if(s){let i=a=>a&&typeof a.x<"u";for(let a=1;a=5?this.twoDSeries.push(D.parseNumber(r[4])):this.twoDSeries.push(D.parseNumber(c)),this.w.axisFlags.dataFormatXNumeric=!0),s.xaxis.type==="datetime"){let h=new Date(n).getTime();this.twoDSeriesX.push(h)}else this.twoDSeriesX.push(n);typeof l<"u"&&(this.threeDSeries.push(l),this.w.axisFlags.isDataXYZ=!0)}}handleFormatXY(t,e){let s=this.w.config,i=this.w.globals,a=new j(this.w),o=t[e].data,r=e;i.collapsedSeriesIndices.indexOf(e)>-1&&(r=this.activeSeriesIndex);let n=t[r].data;for(let c=0;c"u"&&(this.seriesGoals[e]=[]),typeof l.goals<"u"&&Array.isArray(l.goals)?this.seriesGoals[e].push(l.goals):this.seriesGoals[e].push(null),typeof l.z<"u"&&(this.threeDSeries.push(l.z),this.w.axisFlags.isDataXYZ=!0)}for(let c=0;c{i&&i.forEach(a=>{let o=a.y,r=o.length;if(!(r<=1))for(let n=0;n{if(!o.has(n.x)){let c={x:n.x,overlaps:new Set,y:[]};o.set(n.x,c),r.push(c)}}),t==="array")for(let n=0;np.slice(1):d=p=>Array.isArray(p[1])?p[1]:[]:d=g=>Array.isArray(g.y)?g.y:[];for(let g=0;g=2&&(o.push(p[0]),r.push(p[1]),a?(n.push(p[2]),c.push(p[3]),l.push(p[4])):(c.push(p[2]),l.push(p[3])))}return{o,h:r,m:n,l:c,c:l}}parseDataAxisCharts(t){var e,s;let i=this.w.config,a=this.w.globals,o=new j(this.w),r=i.labels.length>0?i.labels.slice():i.xaxis.categories.slice();this.w.axisFlags.isRangeBar=i.chart.type==="rangeBar"&&a.isBarHorizontal,this.w.labelData.hasXaxisGroups=i.xaxis.type==="category"&&i.xaxis.group.groups.length>0,this.w.labelData.hasXaxisGroups&&(this.w.labelData.groups=i.xaxis.group.groups),t.forEach((h,d)=>{h.name!==void 0?this.w.seriesData.seriesNames.push(h.name):this.w.seriesData.seriesNames.push("series-"+parseInt(String(d+1),10))}),this.coreUtils.setSeriesYAxisMappings();let n=[],c=[...new Set(i.series.map(h=>h.group))];i.series.forEach((h,d)=>{let g=c.indexOf(h.group);n[g]||(n[g]=[]),n[g].push(this.w.seriesData.seriesNames[d])}),this.w.labelData.seriesGroups=n;let l=()=>{for(let h=0;h"u"){console.error("It is a possibility that you may have not included 'data' property in series.");return}let d=i.chart.dataReducer;if(d?.enabled&&this.isMultiFormat()&&t[h].data.length>((e=d.threshold)!=null?e:500)&&(t[h]=W(I({},t[h]),{data:u.lttbDownsample(t[h].data,(s=d.targetPoints)!=null?s:250)})),(i.chart.type==="rangeBar"||i.chart.type==="rangeArea"||t[h].type==="rangeBar"||t[h].type==="rangeArea")&&(this.w.axisFlags.isRangeData=!0,this.handleRangeData(t,h)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,h):this.isFormatXY()&&this.handleFormatXY(t,h),(i.chart.type==="candlestick"||t[h].type==="candlestick"||i.chart.type==="boxPlot"||t[h].type==="boxPlot")&&this.handleCandleStickBoxData(t,h),this.w.seriesData.series.push(this.twoDSeries),this.w.labelData.labels.push(this.twoDSeriesX),this.w.seriesData.seriesX.push(this.twoDSeriesX),this.w.seriesData.seriesGoals=this.seriesGoals,h===this.activeSeriesIndex&&!this.fallbackToCategory&&(this.w.axisFlags.isXNumeric=!0);else{i.xaxis.type==="datetime"?(this.w.axisFlags.isXNumeric=!0,l(),this.w.seriesData.seriesX.push(this.twoDSeriesX)):i.xaxis.type==="numeric"&&(this.w.axisFlags.isXNumeric=!0,r.length>0&&(this.twoDSeriesX=r,this.w.seriesData.seriesX.push(this.twoDSeriesX))),this.w.labelData.labels.push(this.twoDSeriesX);let g=t[h].data.map(p=>D.parseNumber(p));this.w.seriesData.series.push(g)}this.w.seriesData.seriesZ.push(this.threeDSeries),t[h].color!==void 0?this.w.seriesData.seriesColors.push(t[h].color):this.w.seriesData.seriesColors.push(void 0)}return this.w}parseDataNonAxisCharts(t){let e=this.w.config,s=Array.isArray(t)&&t.every(o=>typeof o=="number")&&e.labels.length>0,i=Array.isArray(t)&&t.some(o=>o&&typeof o=="object"&&o.data||o&&typeof o=="object"&&o.parsing);if(s&&i&&console.warn("ApexCharts: Both old format (numeric series + labels) and new format (series objects with data/parsing) detected. Using old format for backward compatibility."),s){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=e.labels.slice();for(let o=0;otypeof o=="number")){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=[];for(let o=0;o{let r=D.parseNumber(o);return r>100&&console.warn(`ApexCharts: RadialBar value ${r} > 100, consider using percentage values (0-100)`),r}));for(let o=0;o{e.__apexParsed&&delete e.__apexParsed})}extractPieDataFromSeries(t){let e=[],s=[];if(!Array.isArray(t))return console.warn("ApexCharts: Expected array for series data"),{values:[],labels:[]};if(t.length===0)return console.warn("ApexCharts: Empty series array"),{values:[],labels:[]};let i=t[0];if(typeof i=="object"&&i!==null&&i.data)this.extractPieDataFromSeriesObjects(t,e,s);else return console.warn("ApexCharts: Unsupported series format for pie/donut/radialBar. Expected series objects with data property."),{values:[],labels:[]};return{values:e,labels:s}}extractPieDataFromSeriesObjects(t,e,s){t.forEach((i,a)=>{if(!i.data||!Array.isArray(i.data)){console.warn(`ApexCharts: Series ${a} has no valid data array`);return}i.data.forEach(o=>{typeof o=="object"&&o!==null?o.x!==void 0&&o.y!==void 0?(s.push(String(o.x)),e.push(D.parseNumber(o.y))):console.warn("ApexCharts: Invalid data point format for pie chart. Expected {x, y} format:",o):console.warn("ApexCharts: Expected object data point, got:",typeof o)})})}handleExternalLabelsData(t){let e=this.w.config;if(e.xaxis.categories.length>0)this.w.labelData.labels=e.xaxis.categories;else if(e.labels.length>0)this.w.labelData.labels=e.labels.slice();else if(this.fallbackToCategory){if(this.w.labelData.labels=this.w.labelData.labels[0],this.w.rangeData.seriesRange.length){this.w.rangeData.seriesRange.map(i=>{i.forEach(a=>{this.w.labelData.labels.indexOf(a.x)<0&&a.x&&this.w.labelData.labels.push(a.x)})});let s=this.w.labelData.labels;if(s.length>0&&(typeof s[0]=="number"||typeof s[0]=="string"))this.w.labelData.labels=[...new Set(s)];else{let i=new Map;for(let a of s){let o=JSON.stringify(a);i.has(o)||i.set(o,a)}this.w.labelData.labels=Array.from(i.values())}}e.xaxis.convertedCatToNumeric&&(new wt(e).convertCatToNumericXaxis(e,this.w.seriesData.seriesX[0]),this._generateExternalLabels(t))}else this._generateExternalLabels(t)}_generateExternalLabels(t){let e=this.w.globals,s=this.w.config,i=[];if(e.axisCharts){if(this.w.seriesData.series.length>0)if(this.isFormatXY()){let a=s.series.map(r=>{let n=new Map;for(let c of r.data)n.has(c.x)||n.set(c.x,c);return Array.from(n.values())}),o=a.reduce((r,n,c,l)=>l[r].length>n.length?r:c,0);for(let r=0;ro+1);for(let a=0;as.xaxis.labels.formatter(a))),this.w.axisFlags.noLabelsProvided=!0}parseRawDataIfNeeded(t){let e=this.w.config,s=this.w.globals,i=e.parsing;if(this.w.axisFlags.dataWasParsed||!i&&!t.some(o=>o.parsing))return t;let a=t.map((o,r)=>{var n,c,l;if(!o.data||!Array.isArray(o.data)||o.data.length===0)return o;let h={x:((n=o.parsing)==null?void 0:n.x)||i?.x,y:((c=o.parsing)==null?void 0:c.y)||i?.y,z:((l=o.parsing)==null?void 0:l.z)||i?.z};if(!h.x&&!h.y)return o;let d=o.data[0];if(typeof d=="object"&&d!==null&&(Object.prototype.hasOwnProperty.call(d,"x")||Object.prototype.hasOwnProperty.call(d,"y"))||Array.isArray(d))return o;if(!h.x||!h.y||Array.isArray(h.y)&&h.y.length===0)return console.warn(`ApexCharts: Series ${r} has parsing config but missing x or y field specification`),o;let g=o.data.map((p,f)=>{if(typeof p!="object"||p===null)return console.warn(`ApexCharts: Series ${r}, data point ${f} is not an object, skipping parsing`),p;let x=this.getNestedValue(p,h.x),m,b;if(Array.isArray(h.y)){let y=h.y.map(w=>this.getNestedValue(p,w));this.w.config.chart.type==="bubble"?(y.length<2&&console.warn(`ApexCharts: series[${r}] bubble chart requires parseData.y to have at least 2 fields (y and z). Got: ${JSON.stringify(h.y)}`),m=y[0]):m=y}else m=this.getNestedValue(p,h.y);h.z&&(b=this.getNestedValue(p,h.z)),x===void 0&&console.warn(`ApexCharts: Series ${r}, data point ${f} missing field '${h.x}'`),m===void 0&&console.warn(`ApexCharts: Series ${r}, data point ${f} missing field '${h.y}'`);let v={x,y:m,z:void 0};if(this.w.config.chart.type==="bubble"&&Array.isArray(h.y)&&h.y.length===2){let y=this.getNestedValue(p,h.y[1]);y!==void 0&&(v.z=y)}return b!==void 0&&(v.z=b),v});return W(I({},o),{data:g,__apexParsed:!0})});return this.w.axisFlags.dataWasParsed=!0,s.originalSeries||(s.originalSeries=D.clone(t)),a}getNestedValue(t,e){if(!t||typeof t!="object"||!e)return;if(e.indexOf(".")===-1)return t[e];let s=e.split("."),i=t;for(let a=0;a=s||e<3)return t;let i=!Array.isArray(t[0]),a=i?l=>l.x:l=>l[0],o=i?l=>l.y:l=>l[1],r=[];r.push(t[0]);let n=(s-2)/(e-2),c=0;for(let l=0;ly&&(y=C,w=A)}r.push(t[w]),c=w}return r.push(t[s-1]),r}excludeCollapsedSeriesInYAxis(){let t=this.w,e=[];t.globals.seriesYAxisMap.forEach((s,i)=>{let a=0;s.forEach(o=>{t.globals.collapsedSeriesIndices.indexOf(o)!==-1&&a++}),a>0&&a==s.length&&e.push(i)}),t.globals.ignoreYAxisIndexes=e.map(s=>s)}},ze=class{constructor(t,e){this.w=t,this.ctx=e}_updateOptions(t,e=!1,s=!0,i=!0,a=!1){return new Promise(o=>{let r=[this.ctx];i&&(r=this.ctx.getSyncedCharts()),this.w.globals.isExecCalled&&(r=[this.ctx],this.w.globals.isExecCalled=!1),r.forEach((n,c)=>{let l=n.w;if(l.globals.shouldAnimate=s,e||(l.globals.resized=!0,l.globals.dataChanged=!0,s&&n.series.getPreviousPaths()),t&&typeof t=="object"&&(n.config=new vt(t),t=Z.extendArrayProps(n.config,t,l),n.w.globals.chartID!==this.w.globals.chartID&&delete t.series,l.config=D.extend(l.config,t),a&&(l.globals.lastXAxis=t.xaxis?D.clone(t.xaxis):[],l.globals.lastYAxis=t.yaxis?D.clone(t.yaxis):[],l.globals.initialConfig=D.extend({},l.config),l.globals.initialSeries=D.clone(l.config.series),t.series))){for(let h=0;h{c===r.length-1&&o(n)})})})}_updateSeries(t,e,s=!1){return new Promise(i=>{let a=this.w;a.globals.shouldAnimate=e,a.globals.dataChanged=!0,It.invalidateSelectors(a),e&&this.ctx.series.getPreviousPaths();let o=a.config.series.length;this.ctx.data.resetParsingFlags();let r=this.ctx.data.parseData(t);return this.ctx._writeParsedSeriesData(r.seriesData),this.ctx._writeParsedRangeData(r.rangeData),this.ctx._writeParsedCandleData(r.candleData),this.ctx._writeParsedLabelData(r.labelData),this.ctx._writeParsedAxisFlags(r.axisFlags),s&&(a.globals.initialConfig&&(a.globals.initialConfig.series=D.clone(a.config.series)),a.globals.initialSeries=D.clone(a.config.series)),this._canUseFastPath(t,o,a)?this.ctx.fastUpdate(e).then(()=>{i(this.ctx)}):this.ctx.update().then(()=>{i(this.ctx)})})}_canUseFastPath(t,e,s){return!(!s.dom.elGraphical||!s.globals.axisCharts||t.length!==e||s.globals.collapsedSeries.length>0||s.globals.comboCharts)}_extendSeries(t,e){let s=this.w,i=s.config.series[e];return W(I({},s.config.series[e]),{name:t.name?t.name:i?.name,color:t.color?t.color:i?.color,type:t.type?t.type:i?.type,group:t.group?t.group:i?.group,hidden:typeof t.hidden<"u"?t.hidden:i?.hidden,data:t.data?t.data:i?.data,zIndex:typeof t.zIndex<"u"?t.zIndex:e})}toggleDataPointSelection(t,e){let s=this.w,i=null,a=`.apexcharts-series[data\\:realIndex='${t}']`;if(s.globals.axisCharts?i=s.dom.Paper.findOne(`${a} path[j='${e}'], ${a} circle[j='${e}'], ${a} rect[j='${e}']`):typeof e>"u"&&(i=s.dom.Paper.findOne(`${a} path[j='${t}']`),(s.config.chart.type==="pie"||s.config.chart.type==="polarArea"||s.config.chart.type==="donut")&&this.ctx.pie.pieClicked(t)),i)new F(this.w).pathMouseDown(i,null);else return console.warn("toggleDataPointSelection: Element not found"),null;return i.node?i.node:null}forceXAxisUpdate(t){let e=this.w;return["min","max"].forEach(i=>{typeof t.xaxis[i]<"u"&&(e.config.xaxis[i]=t.xaxis[i],e.globals.lastXAxis[i]=t.xaxis[i])}),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric&&(t=new wt(t).convertCatToNumericXaxis(t,this.ctx)),t}forceYAxisUpdate(t){return t.chart&&t.chart.stacked&&t.chart.stackType==="100%"&&(Array.isArray(t.yaxis)?t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100}):(t.yaxis.min=0,t.yaxis.max=100)),t}revertDefaultAxisMinMax(t){let e=this.w,s=e.globals.lastXAxis,i=e.globals.lastYAxis;t&&t.xaxis&&(s=t.xaxis),t&&t.yaxis&&(i=t.yaxis);let a=s;e.config.xaxis.min=a.min,e.config.xaxis.max=a.max;let o=r=>{if(typeof i[r]<"u"){let n=i[r];e.config.yaxis[r].min=n.min,e.config.yaxis[r].max=n.max}};e.config.yaxis.map((r,n)=>{e.interact.zoomed||typeof i[n]<"u"?o(n):typeof this.ctx.opts.yaxis[n]<"u"&&(r.min=this.ctx.opts.yaxis[n].min,r.max=this.ctx.opts.yaxis[n].max)})}},Qt=class{constructor(t){this.w=t.w,this.ttCtx=t}getNearestValues({hoverArea:t,elGrid:e,clientX:s,clientY:i}){var a,o;let r=this.w,n=e.getBoundingClientRect(),c=n.width,l=n.height,h=c/(r.globals.dataPoints-1),d=l/r.globals.dataPoints,g=this.hasBars();(r.globals.comboCharts||g)&&!r.config.xaxis.convertedCatToNumeric&&(h=c/r.globals.dataPoints);let p=s-n.left-r.globals.barPadForNumericAxis,f=i-n.top;p<0||f<0||p>c||f>l?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):r.interact.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):r.interact.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));let m=Math.round(p/h),b=Math.floor(f/d);g&&!r.config.xaxis.convertedCatToNumeric&&(m=Math.ceil(p/h),m=m-1);let v=null,y=null,w=r.globals.seriesXvalues.map(C=>C.filter(L=>D.isNumber(L))),A=r.globals.seriesYvalues.map(C=>C.filter(L=>D.isNumber(L)));if(r.axisFlags.isXNumeric){let C=this.ttCtx.getElGrid();if(!C)return{hoverX:p,hoverY:f};let L=C.getBoundingClientRect(),k=p*(L.width/c),S=f*(L.height/l);y=this.closestInMultiArray(k,S,w,A),v=y.index,m=(a=y.j)!=null?a:0,v!==null&&r.globals.hasNullValues&&(w=r.globals.seriesXvalues[v],y=this.closestInArray(k,w),m=(o=y.j)!=null?o:0)}return r.interact.capturedSeriesIndex=v===null?-1:v,(!m||m<1)&&(m=0),r.globals.isBarHorizontal?r.interact.capturedDataPointIndex=b:r.interact.capturedDataPointIndex=m,{capturedSeries:v,j:r.globals.isBarHorizontal?b:m,hoverX:p,hoverY:f}}getFirstActiveXArray(t){let e=this.w,s=0,i=t.map((a,o)=>a.length>0?o:-1);for(let a=0;aa.globals.collapsedSeriesIndices.indexOf(l)===-1&&a.globals.ancillaryCollapsedSeriesIndices.indexOf(l)===-1,r=1/0,n=null,c=null;for(let l=0;ltypeof a[0]<"u");if(i.length>0)for(let a=0;a{var n;return!((n=this.w.globals.collapsedSeriesIndices)!=null&&n.includes(r))}))||[];for(let o=0;oi+a.getBBox().height,0)}getElMarkers(t){return typeof t=="number"?this.w.dom.baseEl.querySelectorAll(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers-wrap > *`):this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}getAllMarkers(t=!1){let e=[...this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap")];t&&(e=e.filter(i=>{let a=Number(i.getAttribute("data:realIndex"));return this.w.globals.collapsedSeriesIndices.indexOf(a)===-1})),e.sort((i,a)=>{var o=Number(i.getAttribute("data:realIndex")),r=Number(a.getAttribute("data:realIndex"));return ro?-1:0});let s=[];return e.forEach(i=>{s.push(i.querySelector(".apexcharts-marker"))}),s}hasMarkers(t){return this.getElMarkers(t).length>0}getPathFromPoint(t,e){let s=Number(t.getAttribute("cx")),i=Number(t.getAttribute("cy")),a=t.getAttribute("shape");return new F(this.w).getMarkerPath(s,i,a,e)}getElBars(){return this.w.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}hasBars(){return this.getElBars().length>0}getHoverMarkerSize(t){let e=this.w,s=e.config.markers.hover.size;return s===void 0&&(s=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),s}toggleAllTooltipSeriesGroups(t){let e=this.w,s=this.ttCtx;s.allTooltipSeriesGroups.length===0&&(s.allTooltipSeriesGroups=e.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));let i=s.allTooltipSeriesGroups;for(let a=0;an.seriesData.seriesGoals[m]&&n.seriesData.seriesGoals[m][e]&&Array.isArray(n.seriesData.seriesGoals[m][e]),{xVal:d,zVal:g,xAxisTTVal:p}=s,f="",x=n.globals.colors[t];e!==null&&n.config.plotOptions.bar.distributed&&(x=n.globals.colors[e]);for(let m=0,b=n.seriesData.series.length-1;m{var C,L,k,S;return n.axisFlags.isRangeData?v.yLbFormatter((L=(C=n.rangeData.seriesRangeStart)==null?void 0:C[A])==null?void 0:L[e],{series:n.rangeData.seriesRangeStart,seriesIndex:A,dataPointIndex:e,w:n})+" - "+v.yLbFormatter((S=(k=n.rangeData.seriesRangeEnd)==null?void 0:k[A])==null?void 0:S[e],{series:n.rangeData.seriesRangeEnd,seriesIndex:A,dataPointIndex:e,w:n}):v.yLbFormatter(n.seriesData.series[A][e],{series:n.seriesData.series,seriesIndex:A,dataPointIndex:e,w:n})};if(a)v=this.getFormatters(y),f=this.getSeriesName({fn:v.yLbTitleFormatter,index:y,seriesIndex:t,j:e}),x=n.globals.colors[y],c=w(y),h(y)&&(l=n.seriesData.seriesGoals[y][e].map(A=>({attrs:A,val:v.yLbFormatter(A.value,{seriesIndex:y,dataPointIndex:e,w:n})})));else{let A=(r=o?.target)==null?void 0:r.getAttribute("fill");A&&(A.indexOf("url")!==-1?A.indexOf("Pattern")!==-1&&(x=n.dom.baseEl.querySelector(A.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):x=A),c=w(t),h(t)&&Array.isArray(n.seriesData.seriesGoals[t][e])&&(l=n.seriesData.seriesGoals[t][e].map(C=>({attrs:C,val:v.yLbFormatter(C.value,{seriesIndex:t,dataPointIndex:e,w:n})})))}}e===null&&(c=v.yLbFormatter(n.seriesData.series[t],W(I({},n),{seriesIndex:t,dataPointIndex:t}))),this.DOMHandling({i:t,t:y,j:e,ttItems:i,values:{val:c,goalVals:l,xVal:d,xAxisTTVal:p,zVal:g},seriesName:f,shared:a,pColor:x})}}getFormatters(t){let e=this.w,s=e.formatters.yLabelFormatters[t],i;return e.formatters.ttVal!==void 0?Array.isArray(e.formatters.ttVal)?(s=e.formatters.ttVal[t]&&e.formatters.ttVal[t].formatter,i=e.formatters.ttVal[t]&&e.formatters.ttVal[t].title&&e.formatters.ttVal[t].title.formatter):(s=e.formatters.ttVal.formatter,typeof e.formatters.ttVal.title.formatter=="function"&&(i=e.formatters.ttVal.title.formatter)):i=e.config.tooltip.y.title.formatter,typeof s!="function"&&(e.formatters.yLabelFormatters[0]?s=e.formatters.yLabelFormatters[0]:s=function(a){return a}),typeof i!="function"&&(i=function(a){return a?a+": ":""}),{yLbFormatter:s,yLbTitleFormatter:i}}getSeriesName({fn:t,index:e,seriesIndex:s,j:i}){let a=this.w;return t(String(a.seriesData.seriesNames[e]),{series:a.seriesData.series,seriesIndex:s,dataPointIndex:i,w:a})}DOMHandling({t,j:e,ttItems:s,values:i,seriesName:a,shared:o,pColor:r}){let n=this.w,c=this.ttCtx,{val:l,goalVals:h,xVal:d,xAxisTTVal:g,zVal:p}=i,f=null;f=s[t].children,n.config.tooltip.fillSeriesColor&&(s[t].style.backgroundColor=r,f[0].style.display="none"),c.showTooltipTitle&&(c.tooltipTitle===null&&(c.tooltipTitle=n.dom.baseEl.querySelector(".apexcharts-tooltip-title")),c.tooltipTitle&&(c.tooltipTitle.innerHTML=d)),c.isXAxisTooltipEnabled&&c.xaxisTooltipText&&(c.xaxisTooltipText.innerHTML=g!==""?g:d);let x=s[t].querySelector(".apexcharts-tooltip-text-y-label");x&&(x.innerHTML=a||"");let m=s[t].querySelector(".apexcharts-tooltip-text-y-value");m&&(m.innerHTML=typeof l<"u"?l:""),f[0]&&f[0].classList.contains("apexcharts-tooltip-marker")&&(n.config.tooltip.marker.fillColors&&Array.isArray(n.config.tooltip.marker.fillColors)&&(r=n.config.tooltip.marker.fillColors[t]),n.config.tooltip.fillSeriesColor?f[0].style.backgroundColor=r:f[0].style.color=r),n.config.tooltip.marker.show||(f[0].style.display="none");let b=s[t].querySelector(".apexcharts-tooltip-text-goals-label"),v=s[t].querySelector(".apexcharts-tooltip-text-goals-value");if(h.length&&n.seriesData.seriesGoals[t]){let y=()=>{let w="
",A="
";h.forEach(C=>{w+=`
${C.attrs.name}
`,A+=`
${C.val}
`}),b.innerHTML=w+"
",v.innerHTML=A+"
"};o?n.seriesData.seriesGoals[t][e]&&Array.isArray(n.seriesData.seriesGoals[t][e])?y():(b.innerHTML="",v.innerHTML=""):y()}else b.innerHTML="",v.innerHTML="";if(p!==null){let y=s[t].querySelector(".apexcharts-tooltip-text-z-label");y.innerHTML=n.config.tooltip.z.title;let w=s[t].querySelector(".apexcharts-tooltip-text-z-value");w.innerHTML=typeof p<"u"?p:""}if(o&&f[0]){if(n.config.tooltip.hideEmptySeries){let y=s[t].querySelector(".apexcharts-tooltip-marker"),w=s[t].querySelector(".apexcharts-tooltip-text");parseFloat(l)==0?(y.style.display="none",w.style.display="none"):(y.style.display="block",w.style.display="block")}typeof l>"u"||l===null||n.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||n.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(c.tConfig.enabledOnSeries)&&c.tConfig.enabledOnSeries.indexOf(t)===-1?f[0].parentNode.style.display="none":f[0].parentNode.style.display=n.config.tooltip.items.display}else Array.isArray(c.tConfig.enabledOnSeries)&&c.tConfig.enabledOnSeries.indexOf(t)===-1&&(f[0].parentNode.style.display="none")}toggleActiveInactiveSeries(t,e){let s=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");let i=s.dom.baseEl.querySelector(`.apexcharts-tooltip-series-group-${e}`);if(i){let a=i;a.classList.add("apexcharts-active"),a.style.display=s.config.tooltip.items.display}}}getValuesToPrint({i:t,j:e}){var s,i,a,o,r,n,c,l;let h=this.w,d=h.seriesData.seriesX.map(y=>y.length>0?y:[]),g="",p="",f=null,x=null,m={series:h.seriesData.series,seriesIndex:t,dataPointIndex:e,w:h},b=h.formatters.ttZFormatter;if(e===null)x=h.seriesData.series[t];else if(h.axisFlags.isXNumeric&&h.config.chart.type!=="treemap"){if(g=d[t][e],d[t].length===0){let y=this.tooltipUtil.getFirstActiveXArray(d);g=d[y][e]}}else new Ot(this.w).isFormatXY()?g=typeof h.config.series[t].data[e]<"u"?h.config.series[t].data[e].x:"":g=typeof h.labelData.labels[e]<"u"?h.labelData.labels[e]:"";let v=g;return h.axisFlags.isXNumeric&&h.config.xaxis.type==="datetime"?g=new yt(this.w).xLabelFormat(h.formatters.ttKeyFormatter,v,v,{i:void 0,dateFormatter:new j(this.w).formatDate,w:this.w}):h.globals.isBarHorizontal?g=h.formatters.yLabelFormatters[0](v,m):g=(a=(i=(s=h.formatters).xLabelFormatter)==null?void 0:i.call(s,v,m))!=null?a:v,h.config.tooltip.x.formatter!==void 0&&(g=(n=(r=(o=h.formatters).ttKeyFormatter)==null?void 0:r.call(o,v,m))!=null?n:v),h.seriesData.seriesZ.length>0&&h.seriesData.seriesZ[t].length>0&&(f=b?.(h.seriesData.seriesZ[t][e],h)),typeof h.config.xaxis.tooltip.formatter=="function"?p=(l=(c=h.formatters).xaxisTooltipFormatter)==null?void 0:l.call(c,v,m):p=g,{val:Array.isArray(x)?x.join(" "):x,xVal:Array.isArray(g)?g.join(" "):g,xAxisTTVal:Array.isArray(p)?p.join(" "):p,zVal:f}}handleCustomTooltip({i:t,j:e,y1:s,y2:i,w:a}){let o=this.ttCtx.getElTooltip(),r=a.config.tooltip.custom;Array.isArray(r)&&r[t]&&(r=r[t]);let n=r({series:a.seriesData.series,seriesIndex:t,dataPointIndex:e,y1:s,y2:i,w:a});o&&(typeof n=="string"||typeof n=="number"?o.innerHTML=String(n):(n instanceof Element||typeof n.nodeName=="string")&&(o.innerHTML="",o.appendChild(n.cloneNode(!0))))}},te=class{constructor(t){this.ttCtx=t,this.w=t.w}moveXCrosshairs(t,e=null){let s=this.ttCtx,i=this.w,a=s.getElXCrosshairs(),o=t-s.xcrosshairsWidth/2,r=i.labelData.labels.slice().length;if(e!==null&&(o=i.layout.gridWidth/r*e),a!==null&&!i.globals.isBarHorizontal&&(a.setAttribute("x",String(o)),a.setAttribute("x1",String(o)),a.setAttribute("x2",String(o)),a.setAttribute("y2",String(i.layout.gridHeight)),a.classList.add("apexcharts-active")),o<0&&(o=0),o>i.layout.gridWidth&&(o=i.layout.gridWidth),s.isXAxisTooltipEnabled){let n=o;(i.config.xaxis.crosshairs.width==="tickWidth"||i.config.xaxis.crosshairs.width==="barWidth")&&(n=o+s.xcrosshairsWidth/2),this.moveXAxisTooltip(n)}}moveYCrosshairs(t){let e=this.ttCtx;e.ycrosshairs!==null&&F.setAttrs(e.ycrosshairs,{y1:t,y2:t}),e.ycrosshairsHidden!==null&&F.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}moveXAxisTooltip(t){var e,s;let i=this.w,a=this.ttCtx;if(a.xaxisTooltip!==null&&a.xcrosshairsWidth!==0){a.xaxisTooltip.classList.add("apexcharts-active");let o=a.xaxisOffY+i.config.xaxis.tooltip.offsetY+i.layout.translateY+1+i.config.xaxis.offsetY,n=a.xaxisTooltip.getBoundingClientRect().width;if(t=t-n/2,!isNaN(t)){t=t+i.layout.translateX;let l=new F(this.w).getTextRects((s=(e=a.xaxisTooltipText)==null?void 0:e.innerHTML)!=null?s:"",i.config.xaxis.labels.style.fontSize);a.xaxisTooltipText&&(a.xaxisTooltipText.style.minWidth=l.width+"px"),a.xaxisTooltip.style.left=t+"px",a.xaxisTooltip.style.top=o+"px"}}}moveYAxisTooltip(t){var e,s;let i=this.w,a=this.ttCtx;a.yaxisTTEls===null&&(a.yaxisTTEls=[...i.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);let o=parseInt((s=(e=a.ycrosshairsHidden)==null?void 0:e.getAttribute("y1"))!=null?s:"0",10),r=i.layout.translateY+o;if(a.yaxisTTEls){let n=a.yaxisTTEls[t].getBoundingClientRect(),c=n.height,l=i.globals.translateYAxisX[t]-2;i.config.yaxis[t].opposite&&(l=l-n.width),r=r-c/2,i.globals.ignoreYAxisIndexes.indexOf(t)===-1&&r>0&&ri.layout.gridWidth/2&&(c=c-r.ttWidth-n-10),c>i.layout.gridWidth-r.ttWidth-10&&(c=i.layout.gridWidth-r.ttWidth),c<-20&&(c=-20),i.config.tooltip.followCursor){let h=a.getElGrid();if(!h)return;let d=h.getBoundingClientRect();c=a.e.clientX-d.left,c>i.layout.gridWidth/2&&(c=c-a.tooltipRect.ttWidth),l=a.e.clientY+i.layout.translateY-d.top,l>i.layout.gridHeight/2&&(l=l-a.tooltipRect.ttHeight)}else i.globals.isBarHorizontal||r.ttHeight/2+l>i.layout.gridHeight&&(l=i.layout.gridHeight-r.ttHeight+i.layout.translateY);isNaN(c)||(c=c+i.layout.translateX,o&&(o.style.left=c+"px",o.style.top=l+"px"))}moveMarkers(t,e){var s;let i=this.w,a=this.ttCtx;if(i.globals.markers.size[t]>0){let o=i.dom.baseEl.querySelectorAll(` .apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker`);for(let r=0;r0){let m=(r=x.getAttribute("shape"))!=null?r:"circle",b=d.getMarkerPath(l,h,m,p*1.5);x.setAttribute("d",b)}this.moveXCrosshairs(l),c.fixedTooltip||this.moveTooltip(l,h,p)}moveDynamicPointsOnHover(t){var e,s;let i=this.ttCtx,a=i.w,o=0,r=0,n=0,c=a.globals.pointsArray,l=new K(this.w),h=new F(this.w);n=l.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);let d=i.tooltipUtil.getHoverMarkerSize(n);if((e=c[n])!=null&&e[t]&&(o=c[n][t][0],r=c[n][t][1]),isNaN(o))return;let g=i.tooltipUtil.getAllMarkers();if(g.length)for(let p=0;p"u"&&g.splice(p,0,null),f&&f.length){let x=c[p][t][1],m;g[p].setAttribute("cx",o);let b=(s=g[p].getAttribute("shape"))!=null?s:"circle";if(a.config.chart.type==="rangeArea"&&!a.globals.comboCharts){let v=t+a.seriesData.series[p].length;m=c[p][v][1];let y=Math.abs(x-m)/2;x=x-y}if(x!==null&&!isNaN(x)&&x0){let v=h.getMarkerPath(o,x,b,d);g[p].setAttribute("d",v)}else g[p].setAttribute("d","")}}this.moveXCrosshairs(o),i.fixedTooltip||this.moveTooltip(o,r||a.layout.gridHeight,d)}moveStickyTooltipOverBars(t,e){var s,i,a;let o=this.w,r=this.ttCtx,n=o.globals.columnSeries?o.globals.columnSeries.length:o.seriesData.series.length;o.config.chart.stacked&&(n=o.globals.barGroups.length);let c=n>=2&&n%2===0?Math.floor(n/2):Math.floor(n/2)+1;o.globals.isBarHorizontal&&(c=new K(this.w).getActiveConfigSeriesIndex("desc")+1);let l=o.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-candlestick-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-rangebar-series .apexcharts-series[rel='${c}'] path[j='${t}']`);!l&&typeof e=="number"&&(l=o.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'], + .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'], + .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'], + .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}']`));let h=l?parseFloat((s=l.getAttribute("cx"))!=null?s:"0"):0,d=l?parseFloat((i=l.getAttribute("cy"))!=null?i:"0"):0,g=l?parseFloat((a=l.getAttribute("barWidth"))!=null?a:"0"):0,p=r.getElGrid();if(!p)return;let f=p.getBoundingClientRect(),x=l&&(l.classList.contains("apexcharts-candlestick-area")||l.classList.contains("apexcharts-boxPlot-area"));o.axisFlags.isXNumeric?(l&&!x&&(h=h-(n%2!==0?g/2:0)),l&&x&&(h=h-g/2)):o.globals.isBarHorizontal||(h=r.xAxisTicksPositions[t-1]+r.dataPointsDividedWidth/2,isNaN(h)&&(h=r.xAxisTicksPositions[t]-r.dataPointsDividedWidth/2)),o.globals.isBarHorizontal?d=d-r.tooltipRect.ttHeight:o.config.tooltip.followCursor?d=r.e.clientY-f.top-r.tooltipRect.ttHeight/2:d+r.tooltipRect.ttHeight+15>o.layout.gridHeight&&(d=o.layout.gridHeight),o.globals.isBarHorizontal||this.moveXCrosshairs(h),r.fixedTooltip||this.moveTooltip(h,d||o.layout.gridHeight)}},Be=class{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new te(t)}drawDynamicPoints(){let t=this.w,e=new F(this.w),s=new gt(this.w,this.ctx),i=[...t.dom.baseEl.querySelectorAll(".apexcharts-series")];t.config.chart.stacked&&i.sort((a,o)=>parseFloat(a.getAttribute("data:realIndex"))-parseFloat(o.getAttribute("data:realIndex")));for(let a=0;a0){let o=this.ttCtx.tooltipUtil.getPathFromPoint(s[i],a);s[i].setAttribute("d",o)}else s[i].setAttribute("d","M0,0")}}},He=class{constructor(t){this.w=t.w;let e=this.w;this.ttCtx=t,this.isVerticalGroupedRangeBar=!e.globals.isBarHorizontal&&e.config.chart.type==="rangeBar"&&e.config.plotOptions.bar.rangeBarGroupRows}getAttr(t,e){var s;return parseFloat((s=t.target.getAttribute(e))!=null?s:"")}handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a}){var o,r;let n=this.ttCtx,c=this.w;if(t.target.classList.contains(`apexcharts-${a}-rect`)){let l=this.getAttr(t,"i"),h=this.getAttr(t,"j"),d=this.getAttr(t,"cx"),g=this.getAttr(t,"cy"),p=this.getAttr(t,"width"),f=this.getAttr(t,"height");if(n.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:l,j:h,shared:!1,e:t}),c.interact.capturedSeriesIndex=l,c.interact.capturedDataPointIndex=h,s=d+n.tooltipRect.ttWidth/2+p,i=g+n.tooltipRect.ttHeight/2-f/2,n.tooltipPosition.moveXCrosshairs(d+p/2),s>c.layout.gridWidth/2&&(s=d-n.tooltipRect.ttWidth/2+p),n.w.config.tooltip.followCursor){let x=c.dom.elWrap.getBoundingClientRect();s=((o=c.interact.clientX)!=null?o:0)-x.left-(s>c.layout.gridWidth/2?n.tooltipRect.ttWidth:0),i=((r=c.interact.clientY)!=null?r:0)-x.top-(i>c.layout.gridHeight/2?n.tooltipRect.ttHeight:0)}}return{x:s,y:i}}handleMarkerTooltip({e:t,opt:e,x:s,y:i}){let a=this.w,o=this.ttCtx,r,n;if(t.target.classList.contains("apexcharts-marker")){let c=parseInt(e.paths.getAttribute("cx"),10),l=parseInt(e.paths.getAttribute("cy"),10),h=parseFloat(e.paths.getAttribute("val"));if(n=parseInt(e.paths.getAttribute("rel"),10),r=parseInt(e.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,o.intersect){let d=D.findAncestor(e.paths,"apexcharts-series");d&&(r=parseInt(d.getAttribute("data:realIndex"),10))}if(o.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:r,j:n,shared:o.showOnIntersect?!1:a.config.tooltip.shared,e:t}),t.type==="mouseup"&&o.markerClick(t,r,n),a.interact.capturedSeriesIndex=r,a.interact.capturedDataPointIndex=n,s=c,i=l+a.layout.translateY-o.tooltipRect.ttHeight*1.4,o.w.config.tooltip.followCursor){let d=o.getElGrid();if(!d)return{x:s,y:i};let g=d.getBoundingClientRect();i=o.e.clientY+a.layout.translateY-g.top}h<0&&(i=l),o.marker.enlargeCurrentPoint(n,e.paths,s,i)}return{x:s,y:i}}handleBarTooltip({e:t,opt:e}){let s=this.w,i=this.ttCtx,a=i.getElTooltip(),o=0,r=0,n=0,c=0,l,h=this.getBarTooltipXY({e:t,opt:e});if(h.j===null&&h.barHeight===0&&h.barWidth===0)return;c=h.i;let d=h.j;s.interact.capturedSeriesIndex=c,s.interact.capturedDataPointIndex=d!==null?d:s.interact.capturedDataPointIndex,s.globals.isBarHorizontal&&i.tooltipUtil.hasBars()||!s.config.tooltip.shared?(r=h.x,n=h.y,l=Array.isArray(s.config.stroke.width)?s.config.stroke.width[c]:s.config.stroke.width,o=r):!s.globals.comboCharts&&!s.config.tooltip.shared&&(o=o/2),isNaN(n)&&(n=s.globals.svgHeight-i.tooltipRect.ttHeight),r+i.tooltipRect.ttWidth>s.layout.gridWidth?r=r-i.tooltipRect.ttWidth:r<0&&(r=0),!(i.w.config.tooltip.followCursor&&!i.getElGrid())&&(i.tooltip===null&&(i.tooltip=s.dom.baseEl.querySelector(".apexcharts-tooltip")),s.config.tooltip.shared||(s.globals.comboBarCount>0?i.tooltipPosition.moveXCrosshairs(o+l/2):i.tooltipPosition.moveXCrosshairs(o)),!i.fixedTooltip&&(!s.config.tooltip.shared||s.globals.isBarHorizontal&&i.tooltipUtil.hasBars())&&(n=n+s.layout.translateY-i.tooltipRect.ttHeight/2,a&&(a.style.left=r+s.layout.translateX+"px",a.style.top=n+"px")))}getBarTooltipXY({e:t,opt:e}){let s=this.w,i=null,a=this.ttCtx,o=0,r=0,n=0,c=0,l=0,h=t.target.classList;if(h.contains("apexcharts-bar-area")||h.contains("apexcharts-candlestick-area")||h.contains("apexcharts-boxPlot-area")||h.contains("apexcharts-rangebar-area")){let d=t.target,g=d.getBoundingClientRect(),p=e.elGrid.getBoundingClientRect(),f=g.height;l=g.height;let x=g.width,m=parseInt(d.getAttribute("cx"),10),b=parseInt(d.getAttribute("cy"),10);c=parseFloat(d.getAttribute("barWidth"));let v=t.type==="touchmove"?t.touches[0].clientX:t.clientX;i=parseInt(d.getAttribute("j"),10),o=parseInt(d.parentNode.getAttribute("rel"),10)-1;let y=d.getAttribute("data-range-y1"),w=d.getAttribute("data-range-y2");s.globals.comboCharts&&(o=parseInt(d.parentNode.getAttribute("data:realIndex"),10));let A=L=>(s.axisFlags.isXNumeric?L=m-x/2:this.isVerticalGroupedRangeBar?L=m+x/2:L=m-a.dataPointsDividedWidth+x/2,L),C=()=>b-a.dataPointsDividedHeight+f/2-a.tooltipRect.ttHeight/2;a.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:o,j:i,y1:y?parseInt(y,10):null,y2:w?parseInt(w,10):null,shared:a.showOnIntersect?!1:s.config.tooltip.shared,e:t}),s.config.tooltip.followCursor?s.globals.isBarHorizontal?(r=v-p.left+15,n=C()):(r=A(r),n=t.clientY-p.top-a.tooltipRect.ttHeight/2-15):s.globals.isBarHorizontal?(r=m,a.xyRatios&&r0&&a.setAttribute("width",String(i.xcrosshairsWidth))}handleYCrosshair(){let t=this.w,e=this.ttCtx;e.ycrosshairs=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}drawYaxisTooltipText(t,e,s){let i=this.ttCtx,a=this.w,o=a.globals,r=o.seriesYAxisMap[t];if(i.yaxisTooltips[t]&&r.length>0){let n=a.formatters.yLabelFormatters[t],c=i.getElGrid();if(!c)return;let l=c.getBoundingClientRect(),h=r[0],d=0;s.yRatio.length>1&&(d=h);let g=(e-l.top)*s.yRatio[d],p=o.maxYArr[h]-o.minYArr[h],f=o.minYArr[h]+(p-g);a.config.yaxis[t].reversed&&(f=o.maxYArr[h]-(p-g)),i.tooltipPosition.moveYCrosshairs(e-l.top),i.yaxisTooltipText[t].innerHTML=n(f),i.tooltipPosition.moveYAxisTooltip(t)}}},Ge=class{constructor(t,e){this.w=t,this.ctx=e,this.tConfig=t.config.tooltip,this.tooltipUtil=new Qt(this),this.tooltipLabels=new Oe(this),this.tooltipPosition=new te(this),this.marker=new Be(this),this.intersect=new He(this),this.axesTooltip=new We(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.xaxisTooltipText=null,this.yaxisTooltip=null,this.yaxisTooltipText=null,this.yaxisTTEls=null,this.xaxisOffY=0,this.yaxisOffX=0,this.xcrosshairsWidth=0,this.ycrosshairs=null,this.ycrosshairsHidden=null,this.tooltip=null,this.e=null,this.isBarShared=!t.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now(),this.dimensionUpdateScheduled=!1,this.xyRatios=null,this.isXAxisTooltipEnabled=!1,this.yaxisTooltips=[],this.allTooltipSeriesGroups=[],this.xAxisTicksPositions=null,this.dataPointsDividedHeight=0,this.dataPointsDividedWidth=0,this.tooltipTitle=null,this.legendLabels=null,this.ttItems=null,this.seriesBound=null,this.seriesHoverTimeout=void 0,this.clientX=0,this.clientY=0,this.barSeriesHeight=0,this.tooltipRect={x:0,y:0,ttWidth:0,ttHeight:0}}setupDimensionCache(){let t=this.w,e=this.getElTooltip();e&&(this.updateDimensionCache(),typeof ResizeObserver<"u"&&!t.globals.resizeObserver&&(t.globals.resizeObserver=new ResizeObserver(()=>{this.dimensionUpdateScheduled||(this.dimensionUpdateScheduled=!0,requestAnimationFrame(()=>{this.updateDimensionCache(),this.dimensionUpdateScheduled=!1}))}),t.globals.resizeObserver.observe(e)))}updateDimensionCache(){let t=this.w,e=this.getElTooltip();if(!e)return;let s=e.getBoundingClientRect();t.globals.dimensionCache.tooltip={width:s.width,height:s.height,lastUpdate:Date.now()}}getCachedDimensions(){let t=this.w;if(t.globals.dimensionCache.tooltip){let s=t.globals.dimensionCache.tooltip;if(Date.now()-s.lastUpdate<1e3)return{ttWidth:s.width,ttHeight:s.height}}this.updateDimensionCache();let e=t.globals.dimensionCache.tooltip;return e?{ttWidth:e.width,ttHeight:e.height}:{ttWidth:0,ttHeight:0}}getElTooltip(t){return t||(t=this),t.w.dom.baseEl?t.w.dom.baseEl.querySelector(".apexcharts-tooltip"):null}getElXCrosshairs(){return this.w.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}getElGrid(){return this.w.dom.baseEl.querySelector(".apexcharts-grid")}drawTooltip(t){let e=this.w;this.xyRatios=t,this.isXAxisTooltipEnabled=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map(a=>!!(a.show&&a.tooltip.enabled&&e.globals.axisCharts)),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);let s=z.createElementNS("http://www.w3.org/1999/xhtml","div");if(s.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&s.classList.add(e.config.tooltip.cssClass),s.classList.add(`apexcharts-theme-${this.tConfig.theme||"light"}`),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&(s.setAttribute("role","tooltip"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.setAttribute("aria-hidden","true")),e.dom.elWrap.appendChild(s),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();let a=new At(this.w,this.ctx,void 0);this.xAxisTicksPositions=a.getXAxisTicksPositions()}if((e.globals.comboCharts||this.tConfig.intersect||e.config.chart.type==="rangeBar")&&!this.tConfig.shared&&(this.showOnIntersect=!0),(e.config.markers.size===0||e.globals.markers.largestSize===0)&&this.marker.drawDynamicPoints(),e.globals.collapsedSeries.length===e.seriesData.series.length)return;this.dataPointsDividedHeight=e.layout.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.layout.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=z.createElementNS("http://www.w3.org/1999/xhtml","div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,s.appendChild(this.tooltipTitle));let i=e.seriesData.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(this.showOnIntersect?i=1:i=e.seriesData.series.length),this.legendLabels=e.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(i),this.addSVGEvents(),this.setupDimensionCache()}createTTElements(t){let e=this.w,s=[],i=this.getElTooltip();if(!i)return s;for(let a=0;a{let d=z.createElementNS("http://www.w3.org/1999/xhtml","div");d.classList.add(`apexcharts-tooltip-${h}-group`);let g=z.createElementNS("http://www.w3.org/1999/xhtml","span");g.classList.add(`apexcharts-tooltip-text-${h}-label`),d.appendChild(g);let p=z.createElementNS("http://www.w3.org/1999/xhtml","span");p.classList.add(`apexcharts-tooltip-text-${h}-value`),d.appendChild(p),l.appendChild(d)}),o.appendChild(l),i.appendChild(o),s.push(o)}return s}addSVGEvents(){let t=this.w,e=t.config.chart.type,s=this.getElTooltip();if(!s)return;let i=e==="bar"||e==="candlestick"||e==="boxPlot"||e==="rangeBar",a=e==="area"||e==="line"||e==="scatter"||e==="bubble"||e==="radar",o=t.dom.Paper.node,r=this.getElGrid();r&&(this.seriesBound=r.getBoundingClientRect());let n=[],c=[],l={hoverArea:o,elGrid:r,tooltipEl:s,tooltipY:n,tooltipX:c,ttItems:this.ttItems},h;if(t.globals.axisCharts&&(a?h=t.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):i?h=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):(e==="heatmap"||e==="treemap")&&(h=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),h&&h.length))for(let g=0;g0&&this.addPathsEventListeners(g,l),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(l)}}drawFixedTooltipRect(){let t=this.w,e=this.getElTooltip();if(!e)return{x:0,y:0,ttWidth:0,ttHeight:0};let s=e.getBoundingClientRect(),i=s.width+10,a=s.height+10,o=this.tConfig.fixed.offsetX,r=this.tConfig.fixed.offsetY,n=this.tConfig.fixed.position.toLowerCase();return n.indexOf("right")>-1&&(o=o+t.globals.svgWidth-i+10),n.indexOf("bottom")>-1&&(r=r+t.globals.svgHeight-a-10),e.style.left=o+"px",e.style.top=r+"px",{x:o,y:r,ttWidth:i,ttHeight:a}}addDatapointEventsListeners(t){let s=this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(s,t)}addPathsEventListeners(t,e){let s=this;for(let i=0;it[i].addEventListener(r,s.onSeriesHover.bind(s,a),{capture:!1,passive:!0}))}}onSeriesHover(t,e){let i=Date.now()-this.lastHoverTime;i>=20?this.seriesHover(t,e):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(()=>{this.seriesHover(t,e)},20-i))}seriesHover(t,e){this.lastHoverTime=Date.now();let s=[],i=this.w;i.config.chart.group&&(s=this.ctx.getGroupedCharts()),!(i.globals.axisCharts&&(i.globals.minX===-1/0&&i.globals.maxX===1/0||i.globals.dataPoints===0))&&(s.length?s.forEach(a=>{let o=this.getElTooltip(a),r={paths:t.paths,tooltipEl:o,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:a.w.globals.tooltip.ttItems};a.w.globals.minX===this.w.globals.minX&&a.w.globals.maxX===this.w.globals.maxX&&a.w.globals.tooltip.seriesHoverByContext({chartCtx:a,ttCtx:a.w.globals.tooltip,opt:r,e})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e}))}seriesHoverByContext({chartCtx:t,ttCtx:e,opt:s,e:i}){let a=t.w;if(!this.getElTooltip(t))return;let r=e.getCachedDimensions();e.tooltipRect={x:0,y:0,ttWidth:r.ttWidth,ttHeight:r.ttHeight},e.e=i,e.tooltipUtil.hasBars()&&!a.globals.comboCharts&&!e.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries&&new K(t.w).toggleSeriesOnHover(i,i.target.parentNode),a.globals.axisCharts?e.axisChartsTooltips({e:i,opt:s,tooltipRect:e.tooltipRect}):e.nonAxisChartsTooltips({e:i,opt:s,tooltipRect:e.tooltipRect}),e.fixedTooltip&&e.drawFixedTooltipRect()}axisChartsTooltips({e:t,opt:e}){var s;let i=this.w,a,o,r=e.elGrid.getBoundingClientRect(),n=t.type==="touchmove"?t.touches[0].clientX:t.clientX,c=t.type==="touchmove"?t.touches[0].clientY:t.clientY;if(this.clientY=c,this.clientX=n,i.interact.capturedSeriesIndex=-1,i.interact.capturedDataPointIndex=-1,cr.top+r.height){this.handleMouseOut(e);return}if(Array.isArray(this.tConfig.enabledOnSeries)&&!i.config.tooltip.shared){let p=parseInt(e.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(p)<0){this.handleMouseOut(e);return}}let l=this.getElTooltip();if(!l)return;let h=this.getElXCrosshairs(),d=[];i.config.chart.group&&(d=this.ctx.getSyncedCharts());let g=i.globals.xyCharts||i.config.chart.type==="bar"&&!i.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||i.globals.comboCharts&&this.tooltipUtil.hasBars();if(t.type==="mousemove"||t.type==="touchmove"||t.type==="mouseup"){if(i.globals.collapsedSeries.length+i.globals.ancillaryCollapsedSeries.length===i.seriesData.series.length)return;h!==null&&h.classList.add("apexcharts-active");let p=(s=this.yaxisTooltips)==null?void 0:s.filter(x=>x===!0),f=this.ycrosshairs;if(f!==null&&p?.length&&f.classList.add("apexcharts-active"),g&&!this.showOnIntersect||d.length>1)this.handleStickyTooltip(t,n,c,e);else if(i.config.chart.type==="heatmap"||i.config.chart.type==="treemap"){let x=this.intersect.handleHeatTreeTooltip({e:t,opt:e,x:a,y:o,type:i.config.chart.type});a=x.x,o=x.y,l.style.left=a+"px",l.style.top=o+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:t,opt:e}),this.tooltipUtil.hasMarkers(0)&&this.intersect.handleMarkerTooltip({e:t,opt:e,x:a,y:o});if(this.yaxisTooltips&&this.yaxisTooltips.length)for(let x=0;x{let g=d.getAttribute("data:default-text");d.innerHTML=decodeURIComponent(g??"")})))}handleStickyTooltip(t,e,s,i){let a=this.w,o=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:e,clientY:s}),r=o.j,n=o.capturedSeries;n!==null&&a.globals.collapsedSeriesIndices.includes(n??-1)&&(n=null);let c=i.elGrid.getBoundingClientRect();if(o.hoverX<0||o.hoverX>c.width){this.handleMouseOut(i);return}if(n!==null)this.handleStickyCapturedSeries(t,n??-1,i,r??0);else if(this.tooltipUtil.isXoverlap(r??0)||a.globals.isBarHorizontal){let l=a.seriesData.series.findIndex((h,d)=>!a.globals.collapsedSeriesIndices.includes(d));this.create(t,this,l,r??0,i.ttItems)}}handleStickyCapturedSeries(t,e,s,i){let a=this.w;if(!this.tConfig.shared&&a.seriesData.series[e][i]===null){this.handleMouseOut(s);return}if(typeof a.seriesData.series[e][i]<"u")this.tConfig.shared&&this.tooltipUtil.isXoverlap(i)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,i,s.ttItems):this.create(t,this,e,i,s.ttItems,!1);else if(this.tooltipUtil.isXoverlap(i)){let o=a.seriesData.series.findIndex((r,n)=>!a.globals.collapsedSeriesIndices.includes(n));this.create(t,this,o,i,s.ttItems)}}deactivateHoverFilter(){let t=this.w,e=new F(this.w,this.ctx),s=t.dom.Paper.find(".apexcharts-bar-area");for(let i=0;i{let n=r.getAttribute("data:default-text");r.innerHTML=decodeURIComponent(n??"")}))}markerClick(t,e,s){let i=this.w;typeof i.config.chart.events.markerClick=="function"&&i.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:s,w:i}),this.ctx.events.fireEvent("markerClick",[t,this.ctx,{seriesIndex:e,dataPointIndex:s,w:i}])}create(t,e,s,i,a,o=null){var r,n,c,l,h,d,g,p,f,x,m,b,v,y,w,A,C,L,k;let S=this.w,T=e;t.type==="mouseup"&&this.markerClick(t,s,i),o===null&&(o=this.tConfig.shared);let P=this.tooltipUtil.hasMarkers(s),M=this.tooltipUtil.getElBars(),E=()=>{S.globals.markers.largestSize>0?T.marker.enlargePoints(i):T.tooltipPosition.moveDynamicPointsOnHover(i)};if(S.config.legend.tooltipHoverFormatter){let R=S.config.legend.tooltipHoverFormatter,N=Array.from((r=this.legendLabels)!=null?r:[]);N.forEach(O=>{let B=O.getAttribute("data:default-text");O.innerHTML=decodeURIComponent(B??"")});for(let O=0;O0)){let R=new F(this.w,this.ctx),N=S.dom.Paper.find(`.apexcharts-bar-area[j='${i}']`);this.deactivateHoverFilter(),T.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&E(),T.tooltipPosition.moveStickyTooltipOverBars(i,s);for(let B=0;Be.instance||new u(e))}findOne(t){let e=this.node.querySelector(t);return e?e.instance||new u(e):null}on(t,e){let s=t.split(".")[0];return this._listeners.push({event:t,eventType:s,handler:e}),this.node.addEventListener(s,e),this}off(t,e){if(!t&&!e)this._listeners.forEach(s=>{this.node.removeEventListener(s.eventType,s.handler)}),this._listeners=[];else if(t&&!e){let s=t.split(".")[0];this._listeners=this._listeners.filter(i=>i.eventType===s?(this.node.removeEventListener(i.eventType,i.handler),!1):!0)}else{let s=t.split(".")[0];this._listeners=this._listeners.filter(i=>i.eventType===s&&i.handler===e?(this.node.removeEventListener(i.eventType,i.handler),!1):!0)}return this}each(t,e){return Array.from(this.node.children).forEach(i=>{let a=i.instance||new u(i);t.call(a),e&&a.each(t,e)}),this}removeClass(t){return t==="*"?this.node.removeAttribute("class"):this.node.classList.remove(t),this}children(){return Array.from(this.node.childNodes).filter(t=>t.nodeType===1).map(t=>t.instance||new u(t))}hide(){return this.node.style.display="none",this}show(){return this.node.style.display="",this}bbox(){if(typeof this.node.getBBox=="function")try{return this.node.getBBox()}catch{}return{x:0,y:0,width:0,height:0}}tspan(t){let e=z.createElementNS("http://www.w3.org/2000/svg","tspan");return e.textContent=t,this.node.appendChild(e),new u(e)}plot(t){return typeof t=="string"&&this.attr("d",t),this}animate(){throw new Error("Animation module not loaded")}filterWith(){throw new Error("Filter module not loaded")}unfilter(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this}filterer(){return this._filter}},Ri=0,$e=class extends tt{constructor(t,e,s){let i=e==="radial"?"radialGradient":"linearGradient",a=z.createElementNS(V,i);super(a),this._id="SvgjsGradient"+ ++Ri,this.attr("id",this._id),typeof s=="function"&&s(new Ve(this));let o=t.node.querySelector("defs");o||(o=z.createElementNS(V,"defs"),t.node.appendChild(o)),o.appendChild(this.node)}stop(t,e,s){let i=z.createElementNS(V,"stop");return i.setAttribute("offset",t),i.setAttribute("stop-color",e),s!==void 0&&i.setAttribute("stop-opacity",String(s)),this.node.appendChild(i),this}from(t,e){return this.attr({x1:t,y1:e})}to(t,e){return this.attr({x2:t,y2:e})}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}},Ve=class{constructor(t){this.gradient=t}stop(t,e,s){return this.gradient.stop(t,e,s),this}},_i=0,Ue=class extends tt{constructor(t,e,s,i){let a=z.createElementNS(V,"pattern");if(super(a),this._id="SvgjsPattern"+ ++_i,this.attr({id:this._id,width:e,height:s,patternUnits:"userSpaceOnUse"}),typeof i=="function"){let r=new Bt(this.node);i(r)}let o=t.node.querySelector("defs");o||(o=z.createElementNS(V,"defs"),t.node.appendChild(o)),o.appendChild(this.node)}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}},Bt=class u extends tt{line(t,e,s,i){let a=this._make("line");return t!==void 0&&a.attr({x1:t,y1:e,x2:s,y2:i}),a}rect(t,e){let s=this._make("rect");return t!==void 0&&s.attr({width:t,height:e}),s}circle(t){let e=this._make("circle");return t!==void 0&&e.attr({r:t/2,cx:t/2,cy:t/2}),e}path(t){let e=this._make("path");return t&&e.attr("d",t),e}polygon(t){let e=this._make("polygon");return t&&e.attr("points",t),e}group(){return this._makeContainer("g")}defs(){return this._makeContainer("defs")}plain(t){let e=z.createElementNS(V,"text");e.textContent=t;let s=new tt(e);return this.node.appendChild(e),s}text(t){let e=z.createElementNS(V,"text"),s=new tt(e);return this.node.appendChild(e),typeof t=="function"&&t(new qe(e)),s}image(t,e){let s=z.createElementNS(V,"image");s.setAttributeNS("http://www.w3.org/1999/xlink","href",t);let i=new tt(s);if(this.node.appendChild(s),typeof e=="function"){let a=new Image;a.onload=function(){i.size(a.width,a.height),e.call(i,{width:a.width,height:a.height})},a.src=t}return i}gradient(t,e){return new $e(this,t,e)}pattern(t,e,s){return new Ue(this,t,e,s)}_make(t){let e=z.createElementNS(V,t);return this.node.appendChild(e),new tt(e)}_makeContainer(t){let e=z.createElementNS(V,t);return this.node.appendChild(e),new u(e)}},qe=class{constructor(t){this.textNode=t}tspan(t){let e=z.createElementNS(V,"tspan");return e.textContent=t,this.textNode.appendChild(e),new Ze(e,this.textNode)}},Ze=class{constructor(t,e){this.node=t,this.textNode=e}newLine(){return this.node.setAttribute("dy","1.1em"),this.node.dataset.newline="1",this}},Ii=0,je=class extends tt{constructor(){let t=z.createElementNS(V,"filter");super(t),this._id="SvgjsFilter"+ ++Ii,this.attr("id",this._id)}size(t,e,s,i){return this.attr({width:t,height:e,x:s,y:i})}},Ke=class{constructor(t){this.filter=t}colorMatrix(t){return this._primitive("feColorMatrix",t)}offset(t){return this._primitive("feOffset",t)}gaussianBlur(t){return this._primitive("feGaussianBlur",t)}flood(t){return this._primitive("feFlood",t)}composite(t){return this._primitive("feComposite",t)}merge(t){let e=z.createElementNS(V,"feMerge");return t.forEach(s=>{let i=z.createElementNS(V,"feMergeNode");i.setAttribute("in",s),e.appendChild(i)}),this.filter.node.appendChild(e),new tt(e)}_primitive(t,e){let s=z.createElementNS(V,t);for(let i in e)s.setAttribute(i,e[i]);return this.filter.node.appendChild(s),new tt(s)}};function Yi(u){u.prototype.filterWith=function(t){let e=new je;this._filter=e;let s=this.node;for(;s&&s.nodeName!=="svg";)s=s.parentNode;if(s){let i=s.querySelector("defs");i||(i=z.createElementNS(V,"defs"),s.insertBefore(i,s.firstChild)),i.appendChild(e.node)}return t(new Ke(e)),this.attr("filter","url(#"+e._id+")"),this},u.prototype.unfilter=function(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this},u.prototype.filterer=function(){return this._filter}}function Ts(u){if(!u||typeof u!="string")return[["M",0,0]];let t=[],e=/([MmLlHhVvCcSsQqTtAaZz])\s*/g,s=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,i,a=[],o=[];for(;(i=e.exec(u))!==null;)a.push(i[1]),o.push(i.index);for(let r=0;r{for(let o=1;os&&(s=r),ni&&(i=n))}}),t===1/0?{x:0,y:0,width:0,height:0}:{x:t,y:e,width:s-t,height:i-e}}function Ni(u){return u.map(t=>t.join(" ")).join(" ")}function Ps(u){switch(u[0]){case"z":case"Z":u[0]="L",u[1]=this.start[0],u[2]=this.start[1];break;case"H":u[0]="L",u[2]=this.pos[1];break;case"V":u[0]="L",u[2]=u[1],u[1]=this.pos[0];break;case"T":u[0]="Q",u[3]=u[1],u[4]=u[2],u[1]=this.reflection[1],u[2]=this.reflection[0];break;case"S":u[0]="C",u[6]=u[4],u[5]=u[3],u[4]=u[2],u[3]=u[1],u[2]=this.reflection[1],u[1]=this.reflection[0];break}return u}function Es(u){var t=u.length;return this.pos=[u[t-2],u[t-1]],"SCQT".indexOf(u[0])!=-1&&(this.reflection=[2*this.pos[0]-u[t-4],2*this.pos[1]-u[t-3]]),u}function Fs(u){var t,e=[u];switch(u[0]){case"M":return this.pos=this.start=[u[1],u[2]],e;case"L":u[5]=u[3]=u[1],u[6]=u[4]=u[2],u[1]=this.pos[0],u[2]=this.pos[1];break;case"Q":u[6]=u[4],u[5]=u[3],u[4]=u[4]*1/3+u[2]*2/3,u[3]=u[3]*1/3+u[1]*2/3,u[2]=this.pos[1]*1/3+u[2]*2/3,u[1]=this.pos[0]*1/3+u[1]*2/3;break;case"A":e=zi((t=this.pos)!=null?t:[],u),u=e[0];break}return u[0]="C",this.pos=[u[5],u[6]],this.reflection=[2*u[5]-u[3],2*u[6]-u[4]],e}function Xs(u,t){if(t===!1)return!1;for(var e=t,s=u.length;e1&&(d=Math.sqrt(d),e=d*e,s=d*s),g=new _t(0,0,0,0,0,0).rotate(i).scale(1/e,1/s).rotate(-i),c=c.transform(g),l=l.transform(g),p=[l.x-c.x,l.y-c.y],x=p[0]*p[0]+p[1]*p[1],f=Math.sqrt(x),p[0]/=f,p[1]/=f,m=x<4?Math.sqrt(1-x/4):0,a===o&&(m*=-1),b=new at((l.x+c.x)/2+m*-p[1],(l.y+c.y)/2+m*p[0]),v=new at(c.x-b.x,c.y-b.y),y=new at(l.x-b.x,l.y-b.y),w=Math.acos(v.x/Math.sqrt(v.x*v.x+v.y*v.y)),v.y<0&&(w*=-1),A=Math.acos(y.x/Math.sqrt(y.x*y.x+y.y*y.y)),y.y<0&&(A*=-1),o&&w>A&&(A+=2*Math.PI),!o&&w>16&255,s>>8&255,s&255,1]}let t=u.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return t?[+t[1],+t[2],+t[3],t[4]!==void 0?+t[4]:1]:null}function Gi(u,t,e){return`rgba(${Math.round(u[0]+(t[0]-u[0])*e)},${Math.round(u[1]+(t[1]-u[1])*e)},${Math.round(u[2]+(t[2]-u[2])*e)},${u[3]+(t[3]-u[3])*e})`}var Je=class u{constructor(t,e,s){this.el=t,this.duration=e??300,this.delay=s||0,this._attrTarget=null,this._plotTarget=null,this._afterCb=null,this._duringCb=null,this._next=null,this._root=null,this._scheduled=!1}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t){return this._plotTarget=t,this._schedule(),this}after(t){return this._afterCb=t,this._schedule(),this}during(t){return this._duringCb=t,this._schedule(),this}animate(t,e){let s=new u(this.el,t,e);return this._next=s,s._root=this._root||this,s}_schedule(){let t=this._root||this;t._scheduled||(t._scheduled=!0,queueMicrotask(()=>t._executeChain()))}_executeChain(){let t=[],e=this;for(;e;)t.push(e),e=e._next;let s=0;t.forEach(i=>{s+=i.delay,i._execute(s),s+=i.duration})}_execute(t){let e=this.el,s=this.duration;if(s<=1){let a=()=>{this._attrTarget&&e.attr(this._attrTarget),this._plotTarget&&e.plot(this._plotTarget),this._afterCb&&this._afterCb.call(e)};t>0?setTimeout(a,t):a();return}let i=()=>{let a={},o={},r={};if(this._attrTarget)for(let h of Object.keys(this._attrTarget)){let d=e.attr(h);a[h]=d;let g=Rs(d),p=Rs(String(this._attrTarget[h]));g&&p&&(o[h]=g,r[h]=p)}let n=null;if(this._plotTarget){let h=e.attr("d")||"";try{n=Hi(h,this._plotTarget)}catch{n=null}}let c=performance.now(),l=h=>{let d=h-c,g=Math.min(d/s,1),p=Wi(g);if(this._attrTarget)if(g>=1)e.attr(this._attrTarget);else{let f={};for(let x of Object.keys(this._attrTarget))if(o[x]&&r[x])f[x]=Gi(o[x],r[x],p);else{let m=parseFloat(a[x]),b=parseFloat(this._attrTarget[x]);!isNaN(m)&&!isNaN(b)&&(f[x]=m+(b-m)*p)}e.attr(f)}n&&g<1&&e.attr("d",n(p)),this._duringCb&&this._duringCb(p),g<1?z.requestAnimationFrame(l):(this._plotTarget&&e.attr("d",this._plotTarget),this._afterCb&&this._afterCb.call(e))};z.requestAnimationFrame(l)};t>0?setTimeout(i,t):i()}};function $i(u){u.prototype.animate=function(t,e){return new Je(this,t,e)}}function Vi(u){u.prototype.draggable=function(t){if(t===!1)return this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=null),this;let e=this,s=t||{},i=a=>{if(a.button&&a.button!==0)return;a.stopPropagation();let r=a.type==="touchstart"?a.touches[0]:a,n=e.node,c=parseFloat(n.getAttribute("x"))||0,l=parseFloat(n.getAttribute("y"))||0,h=r.clientX,d=r.clientY,g=n.ownerSVGElement,p=null;g&&(p=g.getScreenCTM());let f=m=>{let b=m.type==="touchmove"?m.touches[0]:m,v=b.clientX-h,y=b.clientY-d;p&&(v=v/p.a,y=y/p.d);let w=c+v,A=l+y,C=parseFloat(n.getAttribute("width"))||0,L=parseFloat(n.getAttribute("height"))||0;s.minX!==void 0&&ws.maxX&&(w=s.maxX-C),s.maxY!==void 0&&A+L>s.maxY&&(A=s.maxY-L);let k={x:w,y:A,w:C,h:L,x2:w+C,y2:A+L},S=new CustomEvent("dragmove",{detail:{handler:{move:function(T,P){n.setAttribute("x",T),n.setAttribute("y",P)}},box:k}});n.dispatchEvent(S)},x=()=>{Y.isBrowser()&&(document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",x),document.removeEventListener("touchend",x))};Y.isBrowser()&&(document.addEventListener("mousemove",f),document.addEventListener("touchmove",f),document.addEventListener("mouseup",x),document.addEventListener("touchend",x))};return e.node.addEventListener("mousedown",i),e.node.addEventListener("touchstart",i),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",i),e.node.removeEventListener("touchstart",i)},e}}function Ui(u){u.prototype.select=function(t){if(t===!1)return this._selectCleanup&&(this._selectCleanup(),this._selectCleanup=null),this;let e=this,{createHandle:s,updateHandle:i}=t,a=document.createElementNS(V,"g");a.setAttribute("class","svg_select_points");let o=e.node.parentNode;o&&o.appendChild(a);let r={},n=["t","b","l","r","lt","rt","lb","rb"];n.forEach((l,h)=>{let d=new Bt(document.createElementNS(V,"g"));a.appendChild(d.node);let g=s(d,[0,0],h,[],l);r[l]={group:d,handle:g}});let c=()=>{let l=parseFloat(e.attr("x"))||0,h=parseFloat(e.attr("y"))||0,d=parseFloat(e.attr("width"))||0,g=parseFloat(e.attr("height"))||0,p=e.node.getAttribute("transform");p?a.setAttribute("transform",p):a.removeAttribute("transform");let f={t:[l+d/2,h],b:[l+d/2,h+g],l:[l,h+g/2],r:[l+d,h+g/2],lt:[l,h],rt:[l+d,h],lb:[l,h+g],rb:[l+d,h+g]};n.forEach(x=>{r[x]&&f[x]&&i(r[x].group,f[x])})};return c(),e._selectHandles=a,e._selectHandlesMap=r,e._updateSelectPositions=c,e._selectCleanup=()=>{a.parentNode&&a.parentNode.removeChild(a),e._selectHandles=null,e._selectHandlesMap=null,e._updateSelectPositions=null},e},u.prototype.resize=function(t){if(t===!1)return this._resizeCleanup&&(this._resizeCleanup(),this._resizeCleanup=null),this;let e=this,s=e._selectHandlesMap;if(!s)return e;let i=[],a=o=>{let r=s[o];if(!r||!r.group||!r.group.node)return;let n=r.group.node,c=l=>{if(l.button&&l.button!==0)return;l.stopPropagation();let g=(l.type==="touchstart"?l.touches[0]:l).clientX,p=e.node.ownerSVGElement,f=null;p&&(f=p.getScreenCTM());let x=parseFloat(e.attr("x"))||0,m=parseFloat(e.attr("width"))||0,b=y=>{let A=(y.type==="touchmove"?y.touches[0]:y).clientX-g;f&&(A=A/f.a);let C=x,L=m;o==="l"?(C=x+A,L=m-A):o==="r"&&(L=m+A),L<0&&(L=0),e.attr({x:C,width:L}),e._updateSelectPositions&&e._updateSelectPositions();let k=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(k)},v=()=>{Y.isBrowser()&&(document.removeEventListener("mousemove",b),document.removeEventListener("touchmove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v));let y=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(y)};Y.isBrowser()&&(document.addEventListener("mousemove",b),document.addEventListener("touchmove",b),document.addEventListener("mouseup",v),document.addEventListener("touchend",v))};n.addEventListener("mousedown",c),n.addEventListener("touchstart",c),i.push(()=>{n.removeEventListener("mousedown",c),n.removeEventListener("touchstart",c)})};return a("l"),a("r"),e._resizeCleanup=()=>{i.forEach(o=>o())},e}}Yi(tt);$i(tt);Vi(tt);Ui(tt);function ee(){let u=z.createElementNS(V,"svg"),t=new Bt(u);return t.attr({xmlns:V}),t}ee.xlink="http://www.w3.org/1999/xlink";Y.isBrowser()&&typeof window.SVG>"u"&&(window.SVG=ee);Y.isBrowser()?(typeof window.SVG>"u"&&(window.SVG=ee),typeof window.Apex>"u"&&(window.Apex={})):typeof global<"u"&&(typeof global.Apex>"u"&&(global.Apex={}),typeof global.SVG>"u"&&(global.SVG=ee));var $s=class Qe{static registerFeatures(t){for(let[e,s]of Object.entries(t))Qe._featureRegistry.set(e,s)}constructor(t){this.ctx=t,this.w=t.w}initModules(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new ft(this.w,this.ctx),this.ctx.axes=new Te(this.w,this.ctx),this.ctx.core=new Ne(this.ctx.el,this.w,this.ctx),this.ctx.config=new vt({}),this.ctx.data=new Ot(this.w,{resetGlobals:()=>this.ctx.core.resetGlobals(),isMultipleY:()=>this.ctx.core.isMultipleY()}),this.ctx.grid=new Kt(this.w,this.ctx),this.ctx.graphics=new F(this.w,this.ctx),this.ctx.coreUtils=new Z(this.w),this.ctx.crosshairs=new zt(this.w),this.ctx.events=new Le(this.w,this.ctx),this.ctx.fill=new st(this.w),this.ctx.localization=new De(this.w),this.ctx.options=new lt,this.ctx.responsive=new Me(this.w),this.ctx.series=new K(this.w,{toggleDataSeries:(...e)=>{var s;return(s=this.ctx.legend)==null?void 0:s.legendHelpers.toggleDataSeries(...e)},revertDefaultAxisMinMax:()=>this.ctx.updateHelpers.revertDefaultAxisMinMax(),updateSeries:(...e)=>this.ctx.updateHelpers._updateSeries(...e)}),this.ctx.theme=new Pe(this.w),this.ctx.formatters=new yt(this.w),this.ctx.titleSubtitle=new Ee(this.w),this.ctx.dimensions=new Tt(this.w,this.ctx),this.ctx.updateHelpers=new ze(this.w,this.ctx);let t=new Ge(this.w,this.ctx);this.w.globals.tooltip=t,Object.defineProperty(this.ctx,"tooltip",{get(){return this.w.globals.tooltip},configurable:!0}),this._initOptionalModules()}_initOptionalModules(){let t=Qe._featureRegistry,e=this.w,s=this.ctx,i=t.get("exports");s.exports=i?new i(e,s):null;let a=t.get("legend");s.legend=a?new a(e,s):null;let o=t.get("toolbar");Object.defineProperty(s,"toolbar",{get(){var c;return!this._toolbar&&o&&(this._toolbar=new o(e,this)),(c=this._toolbar)!=null?c:null},configurable:!0});let r=t.get("zoomPanSelection");Object.defineProperty(s,"zoomPanSelection",{get(){var c;return!this._zoomPanSelection&&r&&(this._zoomPanSelection=new r(e,this)),(c=this._zoomPanSelection)!=null?c:null},configurable:!0});let n=t.get("keyboardNavigation");Object.defineProperty(s,"keyboardNavigation",{get(){var c;return!this._keyboardNavigation&&n&&(this._keyboardNavigation=new n(e,this)),(c=this._keyboardNavigation)!=null?c:null},configurable:!0})}};$($s,"_featureRegistry",new Map);var Ut=$s,se=class{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){this.ctx._zoomPanSelection&&this.ctx._zoomPanSelection.destroy(),this.ctx._toolbar&&this.ctx._toolbar.destroy(),this.w.globals.resizeObserver&&typeof this.w.globals.resizeObserver.disconnect=="function"&&(this.w.globals.resizeObserver.disconnect(),this.w.globals.resizeObserver=null),It.invalidateAll(this.w),t?(this.ctx._zoomPanSelection=null,this.ctx._toolbar=null,this.ctx._keyboardNavigation=null):(this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx._zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx._toolbar=null,this.ctx.localization=null,this.ctx._keyboardNavigation=null,this.ctx.w.globals.tooltip=null),this.clearDomElements({isUpdating:t})}killSVG(t){t.each(function(){this.removeClass("*"),this.off()},!0),t.clear()}clearDomElements({isUpdating:t}){let e=this.w.dom;if(Y.isBrowser()){let s=e.Paper.node;s.parentNode&&s.parentNode.parentNode&&!t&&(s.parentNode.parentNode.style.minHeight="unset");let i=e.baseEl;if(i&&this.ctx.eventList.forEach(a=>{i.removeEventListener(a,this.ctx.events.documentEvent)}),this.ctx.el!==null)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(e.Paper),e.Paper.remove()}e.elWrap=null,e.elGraphical=null,e.elLegendWrap=null,e.elLegendForeign=null,e.baseEl=null,e.elGridRect=null,e.elGridRectMask=null,e.elGridRectBarMask=null,e.elGridRectMarkerMask=null,e.elForecastMask=null,e.elNonForecastMask=null,e.elDefs=null}},ts=new WeakMap;function qi(u,t){if(Y.isSSR())return;let e=!1;if(u.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){let i=u.getBoundingClientRect();(u.style.display==="none"||i.width===0)&&(e=!0)}let s=new ResizeObserver(i=>{e&&t.call(u,i),e=!0});u.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(u.children).forEach(i=>s.observe(i)):s.observe(u),ts.set(t,s)}function Zi(u,t){if(Y.isSSR())return;let e=ts.get(t);e&&(e.disconnect(),ts.delete(t))}var ji=`@keyframes opaque { + 0% { + opacity: 0 + } + + to { + opacity: 1 + } +} + +@keyframes resizeanim { + + 0%, + to { + opacity: 0 + } +} + +.apexcharts-canvas { + position: relative; + direction: ltr !important; + user-select: none +} + +.apexcharts-canvas ::-webkit-scrollbar { + -webkit-appearance: none; + width: 6px +} + +.apexcharts-canvas ::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: rgba(0, 0, 0, .5); + box-shadow: 0 0 1px rgba(255, 255, 255, .5); + -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5) +} + +.apexcharts-inner { + position: relative +} + +.apexcharts-text tspan { + font-family: inherit +} + +rect.legend-mouseover-inactive, +.legend-mouseover-inactive rect, +.legend-mouseover-inactive path, +.legend-mouseover-inactive circle, +.legend-mouseover-inactive line, +.legend-mouseover-inactive text.apexcharts-yaxis-title-text, +.legend-mouseover-inactive text.apexcharts-yaxis-label { + transition: .15s ease all; + opacity: .2 +} + +.apexcharts-legend-text { + padding-left: 15px; + margin-left: -15px; +} + +.apexcharts-legend-series[role="button"]:focus { + outline: 2px solid #008FFB; + outline-offset: 2px; +} + +.apexcharts-legend-series[role="button"]:focus:not(:focus-visible) { + outline: none; +} + +.apexcharts-legend-series[role="button"]:focus-visible { + outline: 2px solid #008FFB; + outline-offset: 2px; +} + +.apexcharts-series-collapsed { + opacity: 0 +} + +/* Keyboard navigation focus indicator on SVG data elements. + SVG elements don't support CSS outline, so we use stroke. */ +.apexcharts-bar-area.apexcharts-keyboard-focused, +.apexcharts-candlestick-area.apexcharts-keyboard-focused, +.apexcharts-boxPlot-area.apexcharts-keyboard-focused, +.apexcharts-rangebar-area.apexcharts-keyboard-focused, +.apexcharts-pie-area.apexcharts-keyboard-focused, +.apexcharts-heatmap-rect.apexcharts-keyboard-focused, +.apexcharts-treemap-rect.apexcharts-keyboard-focused { + stroke: #008FFB; + stroke-width: 2; + stroke-opacity: 1; +} + +.apexcharts-tooltip { + border-radius: 5px; + box-shadow: 2px 2px 6px -4px #999; + cursor: default; + font-size: 14px; + left: 62px; + opacity: 0; + pointer-events: none; + position: absolute; + top: 20px; + display: flex; + flex-direction: column; + overflow: hidden; + white-space: nowrap; + z-index: 12; + transition: .15s ease all +} + +.apexcharts-tooltip.apexcharts-active { + opacity: 1; + transition: .15s ease all +} + +.apexcharts-tooltip.apexcharts-theme-light { + border: 1px solid #e3e3e3; + background: rgba(255, 255, 255, .96) +} + +.apexcharts-tooltip.apexcharts-theme-dark { + color: #fff; + background: rgba(30, 30, 30, .8) +} + +.apexcharts-tooltip * { + font-family: inherit +} + +.apexcharts-tooltip-title { + padding: 6px; + font-size: 15px; + margin-bottom: 4px +} + +.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title { + background: #eceff1; + border-bottom: 1px solid #ddd +} + +.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title { + background: rgba(0, 0, 0, .7); + border-bottom: 1px solid #333 +} + +.apexcharts-tooltip-text-goals-value, +.apexcharts-tooltip-text-y-value, +.apexcharts-tooltip-text-z-value { + display: inline-block; + margin-left: 5px; + font-weight: 600 +} + +.apexcharts-tooltip-text-goals-label:empty, +.apexcharts-tooltip-text-goals-value:empty, +.apexcharts-tooltip-text-y-label:empty, +.apexcharts-tooltip-text-y-value:empty, +.apexcharts-tooltip-text-z-value:empty, +.apexcharts-tooltip-title:empty { + display: none +} + +.apexcharts-tooltip-text-goals-label, +.apexcharts-tooltip-text-goals-value { + padding: 6px 0 5px +} + +.apexcharts-tooltip-goals-group, +.apexcharts-tooltip-text-goals-label, +.apexcharts-tooltip-text-goals-value { + display: flex +} + +.apexcharts-tooltip-text-goals-label:not(:empty), +.apexcharts-tooltip-text-goals-value:not(:empty) { + margin-top: -6px +} + +.apexcharts-tooltip-marker { + display: inline-block; + position: relative; + width: 16px; + height: 16px; + font-size: 16px; + line-height: 16px; + margin-right: 4px; + text-align: center; + vertical-align: middle; + color: inherit; +} + +.apexcharts-tooltip-marker::before { + content: ""; + display: inline-block; + width: 100%; + text-align: center; + color: currentcolor; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + font-size: 26px; + font-family: Arial, Helvetica, sans-serif; + line-height: 14px; + font-weight: 900; +} + +.apexcharts-tooltip-marker[shape="circle"]::before { + content: "\\25CF"; +} + +.apexcharts-tooltip-marker[shape="square"]::before, +.apexcharts-tooltip-marker[shape="rect"]::before { + content: "\\25A0"; + transform: translate(-1px, -2px); +} + +.apexcharts-tooltip-marker[shape="line"]::before { + content: "\\2500"; +} + +.apexcharts-tooltip-marker[shape="diamond"]::before { + content: "\\25C6"; + font-size: 28px; +} + +.apexcharts-tooltip-marker[shape="triangle"]::before { + content: "\\25B2"; + font-size: 22px; +} + +.apexcharts-tooltip-marker[shape="cross"]::before { + content: "\\2715"; + font-size: 18px; +} + +.apexcharts-tooltip-marker[shape="plus"]::before { + content: "\\2715"; + transform: rotate(45deg) translate(-1px, -1px); + font-size: 18px; +} + +.apexcharts-tooltip-marker[shape="star"]::before { + content: "\\2605"; + font-size: 18px; +} + +.apexcharts-tooltip-marker[shape="sparkle"]::before { + content: "\\2726"; + font-size: 20px; +} + +.apexcharts-tooltip-series-group { + padding: 0 10px; + display: none; + text-align: left; + justify-content: left; + align-items: center +} + +.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker { + opacity: 1 +} + +.apexcharts-tooltip-series-group.apexcharts-active, +.apexcharts-tooltip-series-group:last-child { + padding-bottom: 4px +} + +.apexcharts-tooltip-y-group { + padding: 6px 0 5px +} + +.apexcharts-custom-tooltip, +.apexcharts-tooltip-box { + padding: 4px 8px +} + +.apexcharts-tooltip-boxPlot { + display: flex; + flex-direction: column-reverse +} + +.apexcharts-tooltip-box>div { + margin: 4px 0 +} + +.apexcharts-tooltip-box span.value { + font-weight: 700 +} + +.apexcharts-tooltip-rangebar { + padding: 5px 8px +} + +.apexcharts-tooltip-rangebar .category { + font-weight: 600; + color: #777 +} + +.apexcharts-tooltip-rangebar .series-name { + font-weight: 700; + display: block; + margin-bottom: 5px +} + +.apexcharts-xaxistooltip, +.apexcharts-yaxistooltip { + opacity: 0; + pointer-events: none; + color: #373d3f; + font-size: 13px; + text-align: center; + border-radius: 2px; + position: absolute; + z-index: 10; + background: #eceff1; + border: 1px solid #90a4ae +} + +.apexcharts-xaxistooltip { + padding: 9px 10px; + transition: .15s ease all +} + +.apexcharts-xaxistooltip.apexcharts-theme-dark { + background: rgba(0, 0, 0, .7); + border: 1px solid rgba(0, 0, 0, .5); + color: #fff +} + +.apexcharts-xaxistooltip:after, +.apexcharts-xaxistooltip:before { + left: 50%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none +} + +.apexcharts-xaxistooltip:after { + border-color: transparent; + border-width: 6px; + margin-left: -6px +} + +.apexcharts-xaxistooltip:before { + border-color: transparent; + border-width: 7px; + margin-left: -7px +} + +.apexcharts-xaxistooltip-bottom:after, +.apexcharts-xaxistooltip-bottom:before { + bottom: 100% +} + +.apexcharts-xaxistooltip-top:after, +.apexcharts-xaxistooltip-top:before { + top: 100% +} + +.apexcharts-xaxistooltip-bottom:after { + border-bottom-color: #eceff1 +} + +.apexcharts-xaxistooltip-bottom:before { + border-bottom-color: #90a4ae +} + +.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after, +.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before { + border-bottom-color: rgba(0, 0, 0, .5) +} + +.apexcharts-xaxistooltip-top:after { + border-top-color: #eceff1 +} + +.apexcharts-xaxistooltip-top:before { + border-top-color: #90a4ae +} + +.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after, +.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before { + border-top-color: rgba(0, 0, 0, .5) +} + +.apexcharts-xaxistooltip.apexcharts-active { + opacity: 1; + transition: .15s ease all +} + +.apexcharts-yaxistooltip { + padding: 4px 10px +} + +.apexcharts-yaxistooltip.apexcharts-theme-dark { + background: rgba(0, 0, 0, .7); + border: 1px solid rgba(0, 0, 0, .5); + color: #fff +} + +.apexcharts-yaxistooltip:after, +.apexcharts-yaxistooltip:before { + top: 50%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none +} + +.apexcharts-yaxistooltip:after { + border-color: transparent; + border-width: 6px; + margin-top: -6px +} + +.apexcharts-yaxistooltip:before { + border-color: transparent; + border-width: 7px; + margin-top: -7px +} + +.apexcharts-yaxistooltip-left:after, +.apexcharts-yaxistooltip-left:before { + left: 100% +} + +.apexcharts-yaxistooltip-right:after, +.apexcharts-yaxistooltip-right:before { + right: 100% +} + +.apexcharts-yaxistooltip-left:after { + border-left-color: #eceff1 +} + +.apexcharts-yaxistooltip-left:before { + border-left-color: #90a4ae +} + +.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after, +.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before { + border-left-color: rgba(0, 0, 0, .5) +} + +.apexcharts-yaxistooltip-right:after { + border-right-color: #eceff1 +} + +.apexcharts-yaxistooltip-right:before { + border-right-color: #90a4ae +} + +.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after, +.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before { + border-right-color: rgba(0, 0, 0, .5) +} + +.apexcharts-yaxistooltip.apexcharts-active { + opacity: 1 +} + +.apexcharts-yaxistooltip-hidden { + display: none +} + +.apexcharts-xcrosshairs, +.apexcharts-ycrosshairs { + pointer-events: none; + opacity: 0; + transition: .15s ease all +} + +.apexcharts-xcrosshairs.apexcharts-active, +.apexcharts-ycrosshairs.apexcharts-active { + opacity: 1; + transition: .15s ease all +} + +.apexcharts-ycrosshairs-hidden { + opacity: 0 +} + +.apexcharts-selection-rect { + cursor: move +} + +.svg_select_shape { + stroke-width: 1; + stroke-dasharray: 10 10; + stroke: black; + stroke-opacity: 0.1; + pointer-events: none; + fill: none; +} + +.svg_select_handle { + stroke-width: 3; + stroke: black; + fill: none; +} + +.svg_select_handle_r { + cursor: e-resize; +} + +.svg_select_handle_l { + cursor: w-resize; +} + +.apexcharts-svg.apexcharts-zoomable.hovering-zoom { + cursor: crosshair +} + +.apexcharts-svg.apexcharts-zoomable.hovering-pan { + cursor: move +} + +.apexcharts-menu-icon, +.apexcharts-pan-icon, +.apexcharts-reset-icon, +.apexcharts-selection-icon, +.apexcharts-toolbar-custom-icon, +.apexcharts-zoom-icon, +.apexcharts-zoomin-icon, +.apexcharts-zoomout-icon { + cursor: pointer; + width: 20px; + height: 20px; + line-height: 24px; + color: #6e8192; + text-align: center +} + +.apexcharts-menu-icon svg, +.apexcharts-reset-icon svg, +.apexcharts-zoom-icon svg, +.apexcharts-zoomin-icon svg, +.apexcharts-zoomout-icon svg { + fill: #6e8192 +} + +.apexcharts-selection-icon svg { + fill: #444; + transform: scale(.76) +} + +.apexcharts-theme-dark .apexcharts-menu-icon svg, +.apexcharts-theme-dark .apexcharts-pan-icon svg, +.apexcharts-theme-dark .apexcharts-reset-icon svg, +.apexcharts-theme-dark .apexcharts-selection-icon svg, +.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg, +.apexcharts-theme-dark .apexcharts-zoom-icon svg, +.apexcharts-theme-dark .apexcharts-zoomin-icon svg, +.apexcharts-theme-dark .apexcharts-zoomout-icon svg { + fill: #f3f4f5 +} + +.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg, +.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg, +.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg { + fill: #008ffb +} + +.apexcharts-theme-light .apexcharts-menu-icon:hover svg, +.apexcharts-theme-light .apexcharts-reset-icon:hover svg, +.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg, +.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg, +.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg, +.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg { + fill: #333 +} + +.apexcharts-menu-icon, +.apexcharts-selection-icon { + position: relative +} + +.apexcharts-reset-icon { + margin-left: 5px +} + +.apexcharts-menu-icon, +.apexcharts-reset-icon, +.apexcharts-zoom-icon { + transform: scale(.85) +} + +.apexcharts-zoomin-icon, +.apexcharts-zoomout-icon { + transform: scale(.7) +} + +.apexcharts-zoomout-icon { + margin-right: 3px +} + +.apexcharts-pan-icon { + transform: scale(.62); + position: relative; + left: 1px; + top: 0 +} + +.apexcharts-pan-icon svg { + fill: #fff; + stroke: #6e8192; + stroke-width: 2 +} + +.apexcharts-pan-icon.apexcharts-selected svg { + stroke: #008ffb +} + +.apexcharts-pan-icon:not(.apexcharts-selected):hover svg { + stroke: #333 +} + +.apexcharts-toolbar { + position: absolute; + z-index: 11; + max-width: 176px; + text-align: right; + border-radius: 3px; + padding: 0 6px 2px; + display: flex; + justify-content: space-between; + align-items: center +} + +.apexcharts-menu { + background: #fff; + position: absolute; + top: 100%; + border: 1px solid #ddd; + border-radius: 3px; + padding: 3px; + right: 10px; + opacity: 0; + min-width: 110px; + transition: .15s ease all; + pointer-events: none +} + +.apexcharts-menu.apexcharts-menu-open { + opacity: 1; + pointer-events: all; + transition: .15s ease all +} + +.apexcharts-menu-item { + padding: 6px 7px; + font-size: 12px; + cursor: pointer +} + +.apexcharts-theme-light .apexcharts-menu-item:hover { + background: #eee +} + +.apexcharts-theme-dark .apexcharts-menu { + background: rgba(0, 0, 0, .7); + color: #fff +} + +@media screen and (min-width:768px) { + .apexcharts-canvas:hover .apexcharts-toolbar { + opacity: 1 + } +} + +/* Toolbar keyboard accessibility: show toolbar when any button inside it is focused */ +.apexcharts-toolbar:focus-within { + opacity: 1 +} + +/* Focus indicator for toolbar icon buttons */ +.apexcharts-menu-icon:focus-visible, +.apexcharts-pan-icon:focus-visible, +.apexcharts-reset-icon:focus-visible, +.apexcharts-selection-icon:focus-visible, +.apexcharts-toolbar-custom-icon:focus-visible, +.apexcharts-zoom-icon:focus-visible, +.apexcharts-zoomin-icon:focus-visible, +.apexcharts-zoomout-icon:focus-visible { + outline: 2px solid #008FFB; + outline-offset: 2px; + border-radius: 2px +} + +/* Focus indicator for hamburger menu items */ +.apexcharts-menu-item:focus-visible { + outline: 2px solid #008FFB; + outline-offset: -2px; + background: #eee +} + +.apexcharts-canvas .apexcharts-element-hidden, +.apexcharts-datalabel.apexcharts-element-hidden, +.apexcharts-hide .apexcharts-series-points { + opacity: 0; +} + +.apexcharts-hidden-element-shown { + opacity: 1; + transition: 0.25s ease all; +} + +.apexcharts-datalabel, +.apexcharts-datalabel-label, +.apexcharts-datalabel-value, +.apexcharts-datalabels, +.apexcharts-pie-label { + cursor: default; + pointer-events: none +} + +.apexcharts-pie-label-delay { + opacity: 0; + animation-name: opaque; + animation-duration: .3s; + animation-fill-mode: forwards; + animation-timing-function: ease +} + +.apexcharts-radialbar-label { + cursor: pointer; +} + +.apexcharts-annotation-rect, +.apexcharts-area-series .apexcharts-area, +.apexcharts-gridline, +.apexcharts-line, +.apexcharts-point-annotation-label, +.apexcharts-radar-series path:not(.apexcharts-marker), +.apexcharts-radar-series polygon, +.apexcharts-toolbar svg, +.apexcharts-tooltip .apexcharts-marker, +.apexcharts-xaxis-annotation-label, +.apexcharts-yaxis-annotation-label, +.apexcharts-zoom-rect, +.no-pointer-events { + pointer-events: none +} + +.apexcharts-tooltip-active .apexcharts-marker { + transition: .15s ease all +} + +.apexcharts-radar-series .apexcharts-yaxis { + pointer-events: none; +} + +.resize-triggers { + animation: 1ms resizeanim; + visibility: hidden; + opacity: 0; + height: 100%; + width: 100%; + overflow: hidden +} + +.contract-trigger:before, +.resize-triggers, +.resize-triggers>div { + content: " "; + display: block; + position: absolute; + top: 0; + left: 0 +} + +.resize-triggers>div { + height: 100%; + width: 100%; + background: #eee; + overflow: auto +} + +.contract-trigger:before { + overflow: hidden; + width: 200%; + height: 200% +} + +.apexcharts-bar-goals-markers { + pointer-events: none +} + +.apexcharts-bar-shadows { + pointer-events: none +} + +.apexcharts-rangebar-goals-markers { + pointer-events: none +} + +.apexcharts-disable-transitions * { + transition: none !important; +}`,nt=class u{constructor(t,e){$(this,"core"),$(this,"responsive"),$(this,"axes"),$(this,"grid"),$(this,"graphics"),$(this,"coreUtils"),$(this,"crosshairs"),$(this,"events"),$(this,"fill"),$(this,"localization"),$(this,"options"),$(this,"series"),$(this,"theme"),$(this,"formatters"),$(this,"titleSubtitle"),$(this,"dimensions"),$(this,"updateHelpers"),$(this,"tooltip"),$(this,"data"),$(this,"animations"),$(this,"exports"),$(this,"legend"),$(this,"toolbar"),$(this,"zoomPanSelection"),$(this,"keyboardNavigation"),$(this,"annotations"),$(this,"timeScale"),$(this,"_keyboardNavigation"),$(this,"windowResizeHandler"),$(this,"parentResizeHandler"),$(this,"publicMethods",[]),$(this,"eventList",[]),$(this,"config"),this.opts=e,this.ctx=this,this.w=new Ce(e).init(),this.el=t,this.w.globals.cuid=D.randomId(),this.w.globals.chartID=this.w.config.chart.id?D.escapeString(this.w.config.chart.id):this.w.globals.cuid,new Ut(this).initModules(),this.lastUpdateOptions=null,this.create=this.create.bind(this),Y.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){var t,e;return(e=(t=this.w)==null?void 0:t.config)!=null&&e.chart?new Promise((s,i)=>{var a;if(D.elementExists(this.el)){typeof Apex._chartInstances>"u"&&(Apex._chartInstances=[]),this.w.config.chart.id&&Apex._chartInstances.push({id:this.w.globals.chartID,group:this.w.config.chart.group,chart:this}),this.setLocale(this.w.config.chart.defaultLocale);let o=this.w.config.chart.events.beforeMount;if(typeof o=="function"&&o(this,this.w),this.events.fireEvent("beforeMount",[this,this.w]),Y.isBrowser()){window.addEventListener("resize",this.windowResizeHandler),qi(this.el.parentNode,this.parentResizeHandler);let n=this.el.getRootNode&&this.el.getRootNode(),c=D.is("ShadowRoot",n),l=this.el.ownerDocument,h=c?n.getElementById("apexcharts-css"):l.getElementById("apexcharts-css");if(!h){h=z.createElementNS("http://www.w3.org/1999/xhtml","style"),h.id="apexcharts-css",h.textContent=ji;let d=((a=this.opts.chart)==null?void 0:a.nonce)||this.w.config.chart.nonce;d&&h.setAttribute("nonce",d),c?n.prepend(h):this.w.config.chart.injectStyleSheet!==!1&&l.head.appendChild(h)}}let r=this.create(this.w.config.series,{});if(!r)return s(this);this.mount(r).then(()=>{typeof this.w.config.chart.events.mounted=="function"&&this.w.config.chart.events.mounted(this,this.w),this.events.fireEvent("mounted",[this,this.w]),s(r)}).catch(n=>{var c,l;let h=n instanceof Error?n:new Error(String(n)),d=h;d.chartId=(l=(c=this.w)==null?void 0:c.globals)==null?void 0:l.chartID,d.el=this.el,i(h)})}else i(new Error("Element not found"))}):Promise.reject(new Error("ApexCharts: chart configuration is missing or invalid. Ensure the options object includes a `chart` property."))}create(t,e){var s;let i=this.w;this.core||new Ut(this).initModules();let a=this.w.globals;if(a.noData=!1,a.animationEnded=!1,!D.elementExists(this.el)||(this.responsive.checkResponsiveConfig(e),i.config.xaxis.convertedCatToNumeric&&new wt(i.config).convertCatToNumericXaxis(i.config,this.ctx),this.core.setupElements(),i.config.chart.type==="treemap"&&(i.config.grid.show=!1,i.config.yaxis[0].show=!1),a.svgWidth===0))return a.animationEnded=!0,null;let o=t;t.forEach((m,b)=>{m.hidden&&(o=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:b}))});let r=Z.checkComboSeries(o,i.config.chart.type);a.comboCharts=r.comboCharts,a.comboBarCount=r.comboBarCount;let n=o.every(m=>m.data&&m.data.length===0);(o.length===0||n&&a.collapsedSeries.length<1)&&this.series.handleNoData(),Y.isBrowser()&&this.events.setupEventHandlers();let c=this.data.parseData(o);this._writeParsedSeriesData(c.seriesData),this._writeParsedRangeData(c.rangeData),this._writeParsedCandleData(c.candleData),this._writeParsedLabelData(c.labelData),this._writeParsedAxisFlags(c.axisFlags),this.theme.init(),new gt(this.w,this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),(!a.noData||a.collapsedSeries.length===i.seriesData.series.length||i.config.legend.showForSingleSeries)&&((s=this.legend)==null||s.init()),this.series.hasAllSeriesEqualX(),a.axisCharts&&(this.core.coreCalculations(),i.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar&&(this.ctx.toolbar.minX=i.globals.minX,this.ctx.toolbar.maxX=i.globals.maxX)),this.formatters.heatmapLabelFormatters(),new Z(this.w).getLargestMarkerSize();let d=this.dimensions.plotCoords();this._writeLayoutCoords(d.layout);let g=this.core.xySettings();this.grid.createGridMask();let p=this.core.plotChartType(o,g),f=new ct(this.w,this);f.bringForward(),i.config.dataLabels.background.enabled&&f.dataLabelsBackground(),this.core.shiftGraphPosition(),i.globals.dataPoints>50&&i.dom.elWrap.classList.add("apexcharts-disable-transitions");let x={plot:{left:i.layout.translateX,top:i.layout.translateY,width:i.layout.gridWidth,height:i.layout.gridHeight}};return{elGraph:p,xyRatios:g,dimensions:x}}mount(t=null){let e=this,s=e.w;return new Promise((i,a)=>{var o,r,n,c,l,h,d,g,p;if(e.el===null)return a(new Error("Not enough data to display or target element not found"));(t===null||s.globals.allSeriesCollapsed)&&e.series.handleNoData(),e.grid=new Kt(e.w,e);let f=e.grid.drawGrid(),x=Ut._featureRegistry.get("annotations");if(e.annotations=x?new x(e.w,{theme:e.theme,timeScale:e.timeScale}):null,(o=e.annotations)==null||o.drawImageAnnos(),(r=e.annotations)==null||r.drawTextAnnos(),s.config.grid.position==="back"&&(f&&s.dom.elGraphical.add(f.el),(n=f?.elGridBorders)!=null&&n.node&&s.dom.elGraphical.add(f.elGridBorders)),Array.isArray(t.elGraph))for(let v=0;v{s.globals.ignoreYAxisIndexes.indexOf(y)===-1&&b.yAxisTitleRotate(y,v.opposite)})),(l=e.annotations)==null||l.drawAxesAnnotations(),!s.globals.noData){if(Y.isBrowser()&&s.config.tooltip.enabled&&!s.globals.noData&&((h=e.w.globals.tooltip)==null||h.drawTooltip(t.xyRatios)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.config.chart.accessibility.keyboard.navigation.enabled&&((d=e.keyboardNavigation)==null||d.init()),Y.isBrowser()&&s.globals.axisCharts&&(s.axisFlags.isXNumeric||s.config.xaxis.convertedCatToNumeric||s.axisFlags.isRangeBar))(s.config.chart.zoom.enabled||s.config.chart.selection&&s.config.chart.selection.enabled||s.config.chart.pan&&s.config.chart.pan.enabled)&&((g=e.zoomPanSelection)==null||g.init({xyRatios:t.xyRatios}));else{let v=s.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(w=>{v[w]=!1})}s.config.chart.toolbar.show&&!s.globals.allSeriesCollapsed&&((p=e.toolbar)==null||p.createToolbar())}s.globals.memory.methodsToExec.length>0&&s.globals.memory.methodsToExec.forEach(v=>{v.method(v.params,!1,v.context)}),!s.globals.axisCharts&&!s.globals.noData&&e.core.resizeNonAxisCharts(),i(e)})}destroy(){Y.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),Zi(this.el.parentNode,this.parentResizeHandler));let t=this.w.config.chart.id;t&&Apex._chartInstances.forEach((e,s)=>{e.id===D.escapeString(t)&&Apex._chartInstances.splice(s,1)}),this._keyboardNavigation&&this._keyboardNavigation.destroy(),new se(this.ctx).clear({isUpdating:!1})}updateOptions(t,e=!1,s=!0,i=!0,a=!0){let o=this.w;if(o.interact.selection=void 0,this.lastUpdateOptions){if(D.shallowEqual(this.lastUpdateOptions,t))return Promise.resolve(this);if(t.series&&this.lastUpdateOptions.series&&JSON.stringify(this.lastUpdateOptions.series)===JSON.stringify(t.series)){let r=I({},t),n=I({},this.lastUpdateOptions);if(delete r.series,delete n.series,D.shallowEqual(r,n))return Promise.resolve(this)}}return t.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map((r,n)=>this.updateHelpers._extendSeries(r,n))),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,e,s,i,a)}updateSeries(t=[],e=!0,s=!0){return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,s)}appendSeries(t,e=!0,s=!0){this.data.resetParsingFlags();let i=this.w.config.series.slice();return i.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(i,e,s)}appendData(t,e=!0){let s=this;s.data.resetParsingFlags(),s.w.globals.dataChanged=!0,s.series.getPreviousPaths();let i=s.w.config.series.slice();for(let a=0;a{if(this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(t))return e(this);this.lastUpdateOptions=D.clone(t),new se(this.ctx).clear({isUpdating:!0});let i=this.create(this.w.config.series,t??{});if(!i)return e(this);this.mount(i).then(()=>{typeof this.w.config.chart.events.updated=="function"&&this.w.config.chart.events.updated(this,this.w),this.events.fireEvent("updated",[this,this.w]),this.w.globals.isDirty=!0,e(this)}).catch(a=>{s(a)})})}fastUpdate(t){return new Promise((e,s)=>{var i;try{let a=this.w,o=a.globals;o.shouldAnimate=t,o.dataChanged=!0,o.animationEnded=!1,It.invalidateSelectors(a);let r=a.globals;r.maxY=-Number.MAX_VALUE,r.minY=Number.MIN_VALUE,r.minYArr=[],r.maxYArr=[],r.maxX=-Number.MAX_VALUE,r.minX=Number.MAX_VALUE,r.initialMaxX=-Number.MAX_VALUE,r.initialMinX=Number.MAX_VALUE,r.yAxisScale=[],r.xAxisScale=null,r.xAxisTicksPositions=[],r.xRange=0,r.yRange=[],r.zRange=0,r.xTickAmount=0,r.multiAxisTickAmount=0,r.pointsArray=[],r.dataLabelsRects=[],r.lastDrawnDataLabelsIndexes=[],r.textRectsCache=new Map,r.domCache=new Map,r.cachedSelectors={},r.disableZoomIn=!1,r.disableZoomOut=!1,o.axisCharts&&(this.core.coreCalculations(),a.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters());let n=this.core.xySettings(),c=a.dom.elGraphical.node;c.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-datalabels-background").forEach(f=>{var x;return(x=f.parentNode)==null?void 0:x.removeChild(f)});let h=this.core.plotChartType(a.config.series,n),d=c.querySelector(".apexcharts-grid"),g=Array.isArray(h)?h:[h];d&&a.config.grid.position==="front"?g.forEach(f=>{let x=f&&f.node?f.node:f;x&&c.insertBefore(x,d)}):g.forEach(f=>{a.dom.elGraphical.add(f)});let p=new ct(a,this);p.bringForward(),a.config.dataLabels.background.enabled&&p.dataLabelsBackground(),Y.isBrowser()&&a.config.tooltip.enabled&&!o.noData&&((i=a.globals.tooltip)==null||i.drawTooltip(n)),typeof a.config.chart.events.updated=="function"&&a.config.chart.events.updated(this,a),this.events.fireEvent("updated",[this,a]),o.isDirty=!0,e(this)}catch(a){s(a)}})}getSyncedCharts(){let t=this.getGroupedCharts(),e=[this];return t.length&&(e=[],t.forEach(s=>{e.push(s)})),e}getGroupedCharts(){return Apex._chartInstances.filter(t=>{if(t.group)return!0}).map(t=>this.w.config.chart.group===t.group?t.chart:this)}static getChartByID(t){let e=D.escapeString(t);if(!Apex._chartInstances)return;let s=Apex._chartInstances.filter(i=>i.id===e)[0];return s&&s.chart}static initOnLoad(){var t;let e=document.querySelectorAll("[data-apexcharts]");for(let s=0;s{this.w.globals.resized=!0,this.w.globals.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){var t;clearTimeout((t=this.w.globals.resizeTimer)!=null?t:void 0);let{redrawOnWindowResize:e}=this.w.config.chart;typeof e=="function"&&(e=e()),e&&this._windowResize()}},Vs=`.apexcharts-flip-y { + transform: scaleY(-1) translateY(-100%); + transform-origin: top; + transform-box: fill-box; +} +.apexcharts-flip-x { + transform: scaleX(-1); + transform-origin: center; + transform-box: fill-box; +} +.apexcharts-legend { + display: flex; + overflow: auto; + padding: 0 10px; +} +.apexcharts-legend.apexcharts-legend-group-horizontal { + flex-direction: column; +} +.apexcharts-legend-group { + display: flex; +} +.apexcharts-legend-group-vertical { + flex-direction: column-reverse; +} +.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top { + flex-wrap: wrap +} +.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left { + flex-direction: column; + bottom: 0; +} +.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left { + justify-content: flex-start; + align-items: flex-start; +} +.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center { + justify-content: center; + align-items: center; +} +.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right { + justify-content: flex-end; + align-items: flex-end; +} +.apexcharts-legend-series { + cursor: pointer; + line-height: normal; + display: flex; + align-items: center; +} +.apexcharts-legend-text { + position: relative; + font-size: 14px; +} +.apexcharts-legend-text *, .apexcharts-legend-marker * { + pointer-events: none; +} +.apexcharts-legend-marker { + position: relative; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + margin-right: 1px; +} + +.apexcharts-legend-series.apexcharts-no-click { + cursor: auto; +} +.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series { + display: none !important; +} +.apexcharts-inactive-legend { + opacity: 0.45; +} `,ie=class{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return new DOMParser().parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){let s=parseFloat(t.getAttributeNS(null,"width")),i=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",s*e),t.setAttributeNS(null,"height",i*e),t.setAttributeNS(null,"viewBox","0 0 "+s+" "+i)}getSvgString(t){return new Promise(e=>{let s=this.w,i=t||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;i||(i=1);let a=s.globals.svgWidth*i,o=s.globals.svgHeight*i,r=s.dom.elWrap.cloneNode(!0);r.style.width=a+"px",r.style.height=o+"px";let n=new XMLSerializer().serializeToString(r),c=s.config.legend.show&&s.dom.elLegendWrap&&s.dom.elLegendWrap.children.length>0,l=` + .apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect { + display: none; + } + `;c&&(l+=Vs);let h=` + + +
+ + ${n} +
+
+
+ `,d=this.svgStringToNode(h);i!==1&&this.scaleSvgNode(d,i),this.convertImagesToBase64(d).then(()=>{h=new XMLSerializer().serializeToString(d),e(h.replace(/ /g," "))})})}convertImagesToBase64(t){let e=t.getElementsByTagName("image"),s=Array.from(e).map(i=>{let a=i.getAttributeNS("http://www.w3.org/1999/xlink","href");return a&&!a.startsWith("data:")?this.getBase64FromUrl(a).then(o=>{i.setAttributeNS("http://www.w3.org/1999/xlink","href",o)}).catch(o=>{console.error("Error converting image to base64:",o)}):Promise.resolve()});return Promise.all(s)}getBase64FromUrl(t){return Y.isSSR()?Promise.resolve(t):new Promise((e,s)=>{let i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{let a=document.createElement("canvas");a.width=i.width,a.height=i.height;let o=a.getContext("2d");o&&o.drawImage(i,0,0),e(a.toDataURL())},i.onerror=s,i.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{let s=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(s))})})}dataURI(t){return Y.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{let s=this.w,i=t?t.scale||t.width/s.globals.svgWidth:1,a=document.createElement("canvas");a.width=s.globals.svgWidth*i,a.height=parseInt(s.dom.elWrap.style.height,10)*i;let o=s.config.chart.background==="transparent"||!s.config.chart.background?"#fff":s.config.chart.background,r=a.getContext("2d");r&&(r.fillStyle=o,r.fillRect(0,0,a.width*i,a.height*i),this.getSvgString(i).then(n=>{let c="data:image/svg+xml,"+encodeURIComponent(n),l=new Image;l.crossOrigin="anonymous",l.onload=()=>{r.drawImage(l,0,0);let h=a;if(h.msToBlob){let d=h.msToBlob();e({blob:d})}else{let d=a.toDataURL("image/png");e({imgURI:d})}},l.src=c}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){let t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,s=t?{scale:t}:e?{width:e}:void 0;this.dataURI(s).then(({imgURI:i,blob:a})=>{a?navigator.msSaveOrOpenBlob(a,this.w.globals.chartID+".png"):this.triggerDownload(i,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:s=",",lineDelimiter:i=` +`}){let a=this.w;t||(t=a.config.series);let o=[],r=[],n="",c="\uFEFF",l=a.seriesData.series.map((y,w)=>a.globals.collapsedSeriesIndices.indexOf(w)===-1?y:[]),h=y=>typeof a.config.chart.toolbar.export.csv.categoryFormatter=="function"?a.config.chart.toolbar.export.csv.categoryFormatter(y):a.config.xaxis.type==="datetime"&&String(y).length>=10?new Date(y).toDateString():D.isNumber(y)?y:y.split(s).join(""),d=y=>typeof a.config.chart.toolbar.export.csv.valueFormatter=="function"?a.config.chart.toolbar.export.csv.valueFormatter(y):y,g=Math.max(...t.map(y=>y.data?y.data.length:0)),p=new Ot(this.w),f=new rt(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),x=y=>{let w="";if(!a.globals.axisCharts)w=a.config.labels[y];else{if(a.config.xaxis.type==="category"||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){let A=a.formatters.yLabelFormatters[0],L=new K(this.ctx.w).getActiveConfigSeriesIndex();w=A(a.labelData.labels[y],{seriesIndex:L,dataPointIndex:y,w:a})}else w=f.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,y).text;a.config.xaxis.type==="datetime"&&(a.config.xaxis.categories.length?w=a.config.xaxis.categories[y]:a.config.labels.length&&(w=a.config.labels[y]))}return w===null?"nullvalue":(Array.isArray(w)&&(w=w.join(" ")),D.isNumber(w)?w:w.split(s).join(""))},m=()=>[...Array(g)].map(()=>""),b=(y,w)=>{var A;if(o.length&&w===0&&r.push(o.join(s)),y.data){y.data=y.data.length&&y.data||m();for(let C=0;C{let y=new Set,w={};t.forEach((A,C)=>{A?.data.forEach(L=>{let k,S;if(p.isFormatXY())k=L.x,S=L.y;else if(p.isFormat2DArray())k=L[0],S=L[1];else return;w[k]||(w[k]=Array(t.length).fill("")),w[k][C]=d(S),y.add(k)})}),o.length&&r.push(o.join(s)),Array.from(y).sort().forEach(A=>{r.push([h(A),w[A].join(s)])})};o.push(a.config.chart.toolbar.export.csv.headerCategory),a.config.chart.type==="boxPlot"?(o.push("minimum"),o.push("q1"),o.push("median"),o.push("q3"),o.push("maximum")):a.config.chart.type==="candlestick"?(o.push("open"),o.push("high"),o.push("low"),o.push("close")):a.config.chart.type==="rangeBar"?(o.push("minimum"),o.push("maximum")):t.map((y,w)=>{let A=(y.name?y.name:`series-${w}`)+"";a.globals.axisCharts&&o.push(A.split(s).join("")?A.split(s).join(""):`series-${w}`)}),a.globals.axisCharts||(o.push(a.config.chart.toolbar.export.csv.headerValue),r.push(o.join(s))),!a.globals.allSeriesHasEqualX&&a.globals.axisCharts&&!a.config.xaxis.categories.length&&!a.config.labels.length?v():t.map((y,w)=>{a.globals.axisCharts?b(y,w):(o=[],o.push(h(a.labelData.labels[w])),o.push(d(l[w])),r.push(o.join(s)))}),n+=r.join(i),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent(c+n),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,s){if(Y.isSSR())return;let i=document.createElement("a");i.href=t,i.download=(e||this.w.globals.chartID)+s,document.body.appendChild(i),i.click(),document.body.removeChild(i)}};nt.registerFeatures({exports:ie});var Ki=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(Y.isSSR())return null;let t=document.createElement("style");t.setAttribute("type","text/css");let e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);let s=document.createTextNode(Vs);return t.appendChild(s),t}getLegendDimensions(){let e=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!e)return{clwh:0,clww:0};let{width:s,height:i}=e.getBoundingClientRect();return{clwh:i,clww:s}}appendToForeignObject(){var t;let e=this.getLegendStyles();this.w.config.chart.injectStyleSheet!==!1&&e&&((t=this.w.dom.elLegendForeign)==null||t.appendChild(e))}toggleDataSeries(t,e){var s,i;let a=this.w;if(a.globals.axisCharts||a.config.chart.type==="radialBar"){a.globals.resized=!0;let o=null,r=null;if(a.globals.risingSeries=[],a.globals.axisCharts){if(o=a.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`),!o)return;r=parseInt((s=o.getAttribute("data:realIndex"))!=null?s:"",10)}else{if(o=a.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!o)return;r=parseInt((i=o.getAttribute("rel"))!=null?i:"",10)-1}if(e?[{cs:a.globals.collapsedSeries,csi:a.globals.collapsedSeriesIndices},{cs:a.globals.ancillaryCollapsedSeries,csi:a.globals.ancillaryCollapsedSeriesIndices}].forEach(c=>{let l=c.cs,h=c.csi;this.riseCollapsedSeries(l,h,r)}):this.hideSeries({seriesEl:o,realIndex:r}),a.config.chart.accessibility.enabled){let n=a.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(n){let c=a.globals.collapsedSeriesIndices.includes(r)||a.globals.ancillaryCollapsedSeriesIndices.includes(r);n.setAttribute("aria-pressed",c?"true":"false");let l=n.querySelector(".apexcharts-legend-text"),h=l?l.textContent:a.seriesData.seriesNames[t],d=c?"hidden":"visible";n.setAttribute("aria-label",`${h}, ${d}. Press Enter or Space to toggle.`)}}}else{let o=a.dom.Paper.findOne(` .apexcharts-series[rel='${t+1}'] path`),r=a.config.chart.type;if(r==="pie"||r==="polarArea"||r==="donut"){let n=a.config.plotOptions.pie.donut.labels;new F(this.w).pathMouseDown(o,null),this.lgCtx.printDataLabelsInner(o.node,n)}if(a.config.chart.accessibility.enabled){let n=a.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(n){let c=a.globals.collapsedSeriesIndices.includes(t);n.setAttribute("aria-pressed",c?"true":"false");let l=n.querySelector(".apexcharts-legend-text"),h=l?l.textContent:a.seriesData.seriesNames[t],d=c?"hidden":"visible";n.setAttribute("aria-label",`${h}, ${d}. Press Enter or Space to toggle.`)}}}}getSeriesAfterCollapsing({realIndex:t}){var e;let s=this.w,i=s.globals,a=D.clone(s.config.series);if(i.axisCharts){let o=s.config.yaxis[i.seriesYAxisReverseMap[t]],r={index:t,data:a[t].data.slice(),type:a[t].type||s.config.chart.type};if(o&&o.show&&o.showAlways)i.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(i.ancillaryCollapsedSeries.push(r),i.ancillaryCollapsedSeriesIndices.push(t));else if(i.collapsedSeriesIndices.indexOf(t)<0){i.collapsedSeries.push(r),i.collapsedSeriesIndices.push(t);let n=i.risingSeries.indexOf(t);i.risingSeries.splice(n,1)}}else i.collapsedSeries.push({index:t,data:a[t],type:(e=s.config.series[t].type)!=null?e:"line"}),i.collapsedSeriesIndices.push(t);return i.allSeriesCollapsed=i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.config.series.length,this._getSeriesBasedOnCollapsedState(a)}hideSeries({seriesEl:t,realIndex:e}){let s=this.w,i=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let o=0;o0){for(let o=0;o{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],s++)}):t.forEach((i,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(t[a]=0,s++)}),e.globals.allSeriesCollapsed=s===t.length,t}},es=class{constructor(t,e){this.w=t,this.ctx=e,this.printDataLabelsInner=(...s)=>{var i;return(i=e.pie)==null?void 0:i.printDataLabelsInner(...s)},this.updateSeries=(...s)=>e.updateHelpers._updateSeries(...s),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed=this.w.config.chart.type==="bar"&&this.w.config.plotOptions.bar.distributed&&this.w.config.series.length===1,this.legendHelpers=new Ki(this)}init(){let t=this.w,e=t.globals,s=t.config,i=s.legend.showForSingleSeries&&this.w.seriesData.series.length===1||this.isBarsDistributed||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!e.axisCharts)&&s.legend.show){let a=t.dom.elLegendWrap;for(;a.firstChild;)a.removeChild(a.firstChild);this.drawLegends(),s.legend.position==="bottom"||s.legend.position==="top"?this.legendAlignHorizontal():(s.legend.position==="right"||s.legend.position==="left")&&this.legendAlignVertical()}}createLegendMarker({i:t,fillcolor:e}){let s=this.w,i=z.createElement("span");i.classList.add("apexcharts-legend-marker");let a=s.config.legend.markers.shape||s.config.markers.shape,o=a;Array.isArray(a)&&(o=a[t]);let r=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[t]):parseFloat(s.config.legend.markers.size),n=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[t]):parseFloat(s.config.legend.markers.offsetX),c=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[t]):parseFloat(s.config.legend.markers.offsetY),l=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[t]):parseFloat(s.config.legend.markers.strokeWidth),h=i.style;if(h.height=(r+l)*2+"px",h.width=(r+l)*2+"px",h.left=n+"px",h.top=c+"px",s.config.legend.markers.customHTML)h.background="transparent",h.color=e[t],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[t]&&(i.innerHTML=s.config.legend.markers.customHTML[t]()):i.innerHTML=s.config.legend.markers.customHTML();else{let g=new gt(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${o}`,seriesIndex:t,strokeWidth:l,size:r}),f=(Y.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),x=new F(this.w).drawMarker(0,0,W(I({},g),{pointFillColor:Array.isArray(e)?e[t]:g.pointFillColor,shape:o}));s.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(b=>{b.node.classList.contains("apexcharts-marker-triangle")?b.node.style.transform="translate(50%, 45%)":b.node.style.transform="translate(50%, 50%)"}),f.add(x)}return i}drawLegends(){var t;let e=this,s=this.w,i=s.dom.elLegendWrap,a=s.config.legend.fontFamily,o=s.seriesData.seriesNames,r=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if(s.config.chart.type==="heatmap"){let h=s.config.plotOptions.heatmap.colorScale.ranges;o=h.map(d=>d.name?d.name:d.from+" - "+d.to),r=h.map(d=>d.color)}else this.isBarsDistributed&&(o=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(o=s.config.legend.customLegendItems);let n=s.formatters.legendFormatter,c=s.config.legend.inverseOrder,l=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((h,d)=>{l[d]=z.createElement("div"),l[d].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${d}`),s.config.legend.clusterGroupedSeriesOrientation==="horizontal"?i.classList.add("apexcharts-legend-group-horizontal"):l[d].classList.add("apexcharts-legend-group-vertical")});for(let h=c?o.length-1:0;c?h>=0:h<=o.length-1;c?h--:h++){let d=n(o[h],{seriesIndex:h,w:s}),g=!1,p=!1;if(s.globals.collapsedSeries.length>0)for(let y=0;y0)for(let y=0;y{var A,C;y.includes((C=(A=s.config.series[h])==null?void 0:A.name)!=null?C:"")&&(i.appendChild(l[w]),l[w].appendChild(x))}):i.appendChild(x),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),x.classList.add("apexcharts-legend-series"),x.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",F.setAttrs(x,{rel:h+1,seriesName:D.escapeString(o[h]),"data:collapsed":g||p}),(g||p)&&x.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||x.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",e.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&s.config.legend.customLegendItems.length===0&&(s.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){let s=this.w,i=s.dom.elLegendWrap,a=i.clientHeight,o=0,r=0;if(s.config.legend.position==="bottom")r=s.globals.svgHeight-Math.min(a,s.globals.svgHeight/2)-5;else if(s.config.legend.position==="top"){let c=new Tt(this.w,this.ctx),l=c.dimHelpers.getTitleSubtitleCoords("title").height,h=c.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(l>0?l-10:0)+(h>0?h-10:0)}i.style.position="absolute",o=o+t+s.config.legend.offsetX,r=r+e+s.config.legend.offsetY,i.style.left=o+"px",i.style.top=r+"px",s.config.legend.position==="right"&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px"),["width","height"].forEach(c=>{i&&i.style[c]&&(i.style[c]=parseInt(String(s.config.legend[c]),10)+"px")})}legendAlignHorizontal(){let t=this.w,e=t.dom.elLegendWrap;e.style.right="0";let s=new Tt(this.w,this.ctx),i=s.dimHelpers.getTitleSubtitleCoords("title"),a=s.dimHelpers.getTitleSubtitleCoords("subtitle"),o=20,r=0;t.config.legend.position==="top"&&(r=i.height+a.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(o,r)}legendAlignVertical(){let t=this.w,e=this.legendHelpers.getLegendDimensions(),s=20,i=0;t.config.legend.position==="left"&&(i=20),t.config.legend.position==="right"&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,s)}onLegendHovered(t){var e;let s=this.w,i=t.target,a=i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker");if(s.config.chart.type!=="heatmap"&&!this.isBarsDistributed)!i.classList.contains("apexcharts-inactive-legend")&&a&&new K(this.ctx.w).toggleSeriesOnHover(t,i);else if(a){let o=parseInt((e=i.getAttribute("rel"))!=null?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,o,this.w]),new K(this.ctx.w).highlightRangeInSeries(t,i)}}onLegendKeyDown(t){let e=this,s=this.w,i=t.target;if((i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))&&(t.key==="Enter"||t.key===" ")){t.preventDefault();let o=i.getAttribute("rel");e.onLegendClick(t),o!==null&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{let r=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${o}"]`);r&&r.focus()})}}onLegendClick(t){var e;let s=this.w,i=t.target;if(!s.config.legend.customLegendItems.length&&(i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))){let a=parseInt((e=i.getAttribute("rel"))!=null?e:"0",10)-1,o=i.getAttribute("data:collapsed")==="true",r=this.w.config.chart.events.legendClick;typeof r=="function"&&r(this.ctx,a,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,a,this.w]);let n=this.w.config.legend.markers.onClick;typeof n=="function"&&i.classList.contains("apexcharts-legend-marker")&&(n(this.ctx,a,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,a,this.w])),s.config.chart.type!=="treemap"&&s.config.chart.type!=="heatmap"&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(a,o)}}};nt.registerFeatures({legend:es});var Ji=` + + + + + + + +`,Qi=` + + + +`,ta=` + + +`,ea=` + + + +`,sa=` + + + +`,ia=` + + +`,aa='',ae=class{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){let t=this.w,e=()=>z.createElementNS("http://www.w3.org/1999/xhtml","div"),s=e();if(s.setAttribute("class","apexcharts-toolbar"),s.style.top=t.config.chart.toolbar.offsetY+"px",s.style.right=-t.config.chart.toolbar.offsetX+3+"px",t.dom.elWrap.appendChild(s),this.elZoom=e(),this.elZoomIn=e(),this.elZoomOut=e(),this.elPan=e(),this.elSelection=e(),this.elZoomReset=e(),this.elMenuIcon=e(),this.elMenu=e(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let r=0;r{let l=r.toLowerCase();this.t[l]&&t.config.chart.zoom.enabled&&i.push({el:n,icon:typeof this.t[l]=="string"?this.t[l]:c,title:this.localeValues[r],class:`apexcharts-${l}-icon`})};a("zoomIn",this.elZoomIn,ea),a("zoomOut",this.elZoomOut,sa);let o=r=>{this.t[r]&&t.config.chart[r].enabled&&i.push({el:r==="zoom"?this.elZoom:this.elSelection,icon:typeof this.t[r]=="string"?this.t[r]:r==="zoom"?Qi:ia,title:this.localeValues[r==="zoom"?"selectionZoom":"selection"],class:`apexcharts-${r}-icon`})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&i.push({el:this.elPan,icon:typeof this.t.pan=="string"?this.t.pan:Ji,title:this.localeValues.pan,class:"apexcharts-pan-icon"}),a("reset",this.elZoomReset,ta),this.t.download&&i.push({el:this.elMenuIcon,icon:typeof this.t.download=="string"?this.t.download:aa,title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let r=0;r{r.index&&D.moveIndexInArray(i,n,r.index)});for(let r=0;r{l.classList.contains("exportSVG")?l.addEventListener("click",this.handleDownload.bind(this,"svg")):l.classList.contains("exportPNG")?l.addEventListener("click",this.handleDownload.bind(this,"png")):l.classList.contains("exportCSV")&&l.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let l=0;l{l.addEventListener("keydown",h=>{if(h.key==="Enter"||h.key===" "){h.preventDefault();let d=l.className;l.click(),requestAnimationFrame(()=>{let g=this.w.dom.baseEl;if(!g)return;let p=d.split(" ").find(x=>x.startsWith("apexcharts-"));if(!p)return;let f=g.querySelector(`.${p}`);f&&f.focus()})}})}),(n=this.elMenuIcon)==null||n.addEventListener("keydown",l=>{var h;(l.key==="ArrowDown"||l.key==="ArrowUp")&&(l.preventDefault(),(h=this.elMenu)!=null&&h.classList.contains("apexcharts-menu-open")||this.toggleMenu(),window.setTimeout(()=>{let d=l.key==="ArrowDown"?0:this.elMenuItems.length-1;this.elMenuItems[d]&&this.elMenuItems[d].focus()},20))}),this.elMenuItems.forEach((l,h)=>{l.addEventListener("keydown",d=>{var g;d.key==="ArrowDown"?(d.preventDefault(),(this.elMenuItems[h+1]||this.elMenuItems[0]).focus()):d.key==="ArrowUp"?(d.preventDefault(),(this.elMenuItems[h-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()):d.key==="Escape"||d.key==="Tab"?(this._closeMenu(),(g=this.elMenuIcon)==null||g.focus(),d.key==="Tab"||d.preventDefault()):(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(s=>{s.ctx.toolbar.toggleOtherControls();let i=t==="selection"?s.ctx.toolbar.elSelection:s.ctx.toolbar.elZoom,a=t==="selection"?"selectionEnabled":"zoomEnabled";s.w.globals[a]=!s.w.globals[a],i.classList.contains(s.ctx.toolbar.selectedClass)?i.classList.remove(s.ctx.toolbar.selectedClass):i.classList.add(s.ctx.toolbar.selectedClass),i.setAttribute("aria-pressed",String(s.w.globals[a]))})}getToolbarIconsReference(){let t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),t==="pan"?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;let e=t==="pan"?this.elPan:this.elZoom,s=t==="pan"?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),s&&s.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(e=>{e.ctx.toolbar.toggleOtherControls(),e.w.interact.panEnabled=!e.w.interact.panEnabled,e.ctx.toolbar.elPan.classList.contains(e.ctx.toolbar.selectedClass)?e.ctx.toolbar.elPan.classList.remove(e.ctx.toolbar.selectedClass):e.ctx.toolbar.elPan.classList.add(e.ctx.toolbar.selectedClass),e.ctx.toolbar.elPan.setAttribute("aria-pressed",String(e.w.interact.panEnabled))})}toggleOtherControls(){let t=this.w;t.interact.panEnabled=!1,t.interact.zoomEnabled=!1,t.interact.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(s=>{s&&s.classList.remove(this.selectedClass)})}handleZoomIn(){let t=this.w;t.axisFlags.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY);let e=(this.minX+this.maxX)/2,s=(this.minX+e)/2,i=(this.maxX+e)/2,a=this._getNewMinXMaxX(s,i);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){let t=this.w;if(t.axisFlags.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY),t.config.xaxis.type==="datetime"&&new Date(this.minX).getUTCFullYear()<1e3)return;let e=(this.minX+this.maxX)/2,s=this.minX-(e-this.minX),i=this.maxX-(e-this.maxX),a=this._getNewMinXMaxX(s,i);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){let s=this.w.config.xaxis.convertedCatToNumeric;return{minX:s?Math.floor(t):t,maxX:s?Math.floor(e):e}}zoomUpdateOptions(t,e){let s=this.w;if(t===void 0&&e===void 0){this.handleZoomReset();return}if(s.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=s.globals.dataPoints),e-t<2))return;let i={min:t,max:e},a=this.getBeforeZoomRange(i,void 0);a&&(i=a.xaxis);let o={xaxis:i};if(!s.globals.initialConfig)return;let r=D.clone(s.globals.initialConfig.yaxis);s.config.chart.group||(o.yaxis=r),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,r)}zoomCallback(t,e){typeof this.ev.zoomed=="function"&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let s=null;return typeof this.ev.beforeZoom=="function"&&(s=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),s}toggleMenu(){window.setTimeout(()=>{var t,e,s;(t=this.elMenu)!=null&&t.classList.contains("apexcharts-menu-open")?this._closeMenu():((e=this.elMenu)==null||e.classList.add("apexcharts-menu-open"),(s=this.elMenuIcon)==null||s.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;(t=this.elMenu)==null||t.classList.remove("apexcharts-menu-open"),(e=this.elMenuIcon)==null||e.setAttribute("aria-expanded","false")}handleDownload(t){let e=this.w,s=new ie(this.w,this.ctx);switch(t){case"svg":s.exportToSVG();break;case"png":s.exportToPng();break;case"csv":s.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter});break}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(e=>{let s=e.w;if(s.globals.lastXAxis.min=s.globals.initialConfig.xaxis.min,s.globals.lastXAxis.max=s.globals.initialConfig.xaxis.max,e.updateHelpers.revertDefaultAxisMinMax(),typeof s.config.chart.events.beforeResetZoom=="function"){let a=s.config.chart.events.beforeResetZoom(e,s);a&&e.updateHelpers.revertDefaultAxisMinMax(a)}typeof s.config.chart.events.zoomed=="function"&&e.ctx.toolbar.zoomCallback({min:s.config.xaxis.min,max:s.config.xaxis.max}),s.interact.zoomed=!1;let i=e.ctx.series.emptyCollapsedSeries(D.clone(s.globals.initialSeries));e.updateHelpers._updateSeries(i,s.config.chart.animations.dynamicAnimation.enabled)})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}},ss=class extends ae{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new F(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none",this.debounceTimer=null,this.debounceDelay=100,this.wheelDelay=400}init({xyRatios:t}){let e=this.w,s=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=e.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new Se(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),e.config.chart.selection.type==="x"?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):e.config.chart.selection.type==="y"?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(i=>{var a;(a=this.hoverArea)==null||a.addEventListener(i,s.svgMouseEvents.bind(s,t),{capture:!1,passive:!0})}),e.config.chart.zoom.enabled&&e.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",s.mouseWheelEvent.bind(s),{capture:!1,passive:!1}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}svgMouseEvents(t,e){var s;let i=this.w,a=this.ctx.toolbar,o=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,a.enableZoomPanFromToolbar(r==="pan"?"zoom":"pan")):this.shiftWasPressed&&(a.enableZoomPanFromToolbar(r),this.shiftWasPressed=!1),!e.target)return;let n=e.target.classList,c;if(e.target.parentNode&&e.target.parentNode!==null&&(c=e.target.parentNode.classList),!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||c&&c.contains("apexcharts-toolbar"))){if(this.clientX=e.type==="touchmove"||e.type==="touchstart"?e.touches[0].clientX:e.type==="touchend"?e.changedTouches[0].clientX:e.clientX,this.clientY=e.type==="touchmove"||e.type==="touchstart"?e.touches[0].clientY:e.type==="touchend"?e.changedTouches[0].clientY:e.clientY,e.type==="mousedown"&&e.which===1||e.type==="touchstart"){let h=(s=this.gridRect)==null?void 0:s.getBoundingClientRect();if(!h)return;this.startX=this.clientX-h.left-i.globals.barPadForNumericAxis,this.startY=this.clientY-h.top,this.dragged=!1,this.w.interact.mousedown=!0}(e.type==="mousemove"&&e.which===1||e.type==="touchmove")&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:o,xyRatios:t})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:o}))),(e.type==="mouseup"||e.type==="touchend"||e.type==="mouseleave")&&this.handleMouseUp({zoomtype:o}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var s;let i=this.w,a=(s=this.gridRect)==null?void 0:s.getBoundingClientRect();a&&(this.w.interact.mousedown||e)&&(this.endX=this.clientX-a.left-i.globals.barPadForNumericAxis,this.endY=this.clientY-a.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}mouseWheelEvent(t){let e=this.w;t.preventDefault();let s=Date.now();s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s)},this.debounceDelay)}executeMouseWheelZoom(t){var e;let s=this.w;this.minX=s.axisFlags.isRangeBar?s.globals.minY:s.globals.minX,this.maxX=s.axisFlags.isRangeBar?s.globals.maxY:s.globals.maxX;let i=(e=this.gridRect)==null?void 0:e.getBoundingClientRect();if(!i)return;let a=(t.clientX-i.left)/i.width,o=this.minX,r=this.maxX,n=r-o,c=.5,l=1.5,h,d,g;if(t.deltaY<0){h=c*n;let f=o+a*n;d=f-h/2,g=f+h/2}else h=l*n,d=o-h/2,g=r+h/2;if(!s.axisFlags.isRangeBar){d=Math.max(d,s.globals.initialMinX),g=Math.min(g,s.globals.initialMaxX);let f=(s.globals.initialMaxX-s.globals.initialMinX)*.01;if(g-d0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(s,i,a,o,r)=>r==="l"||r==="r"?s.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):s.circle(0),updateHandle:(s,i)=>s.center(i[0],i[1])}).resize().on("resize",()=>{let s=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:s,isResized:!0})}))}preselectedSelection(){let t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled){if(typeof t.interact.selection<"u"&&t.interact.selection!==null)this.drawSelectionRect(W(I({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(t.config.chart.selection.xaxis.min!==void 0&&t.config.chart.selection.xaxis.max!==void 0){let s=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,i=t.layout.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-s;t.axisFlags.isRangeBar&&(s=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,i=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);let a={x:s,y:0,width:i,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),typeof t.config.chart.events.selection=="function"&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}}drawSelectionRect({x:t,y:e,width:s,height:i,translateX:a=0,translateY:o=0}){let r=this.w,n=this.zoomRect,c=this.selectionRect;if(this.dragged||r.interact.selection!==null){let l={transform:"translate("+a+", "+o+")"};r.interact.zoomEnabled&&this.dragged&&(s<0&&(s=1),n.attr({x:t,y:e,width:s,height:i,fill:r.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":r.config.chart.zoom.zoomedArea.fill.opacity,stroke:r.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":r.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":r.config.chart.zoom.zoomedArea.stroke.opacity}),F.setAttrs(n.node,l)),r.interact.selectionEnabled&&(c.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,fill:r.config.chart.selection.fill.color,"fill-opacity":r.config.chart.selection.fill.opacity,stroke:r.config.chart.selection.stroke.color,"stroke-width":r.config.chart.selection.stroke.width,"stroke-dasharray":r.config.chart.selection.stroke.dashArray,"stroke-opacity":r.config.chart.selection.stroke.opacity}),F.setAttrs(c.node,l))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){var s;let i=this.w,a=t,o=(s=this.gridRect)==null?void 0:s.getBoundingClientRect();if(!o)return;let r=a.startX-1,n=a.startY,c=!1,l=!1,h=a.clientX-o.left-i.globals.barPadForNumericAxis,d=a.clientY-o.top,g=h-r,p=d-n,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(g+r)>i.layout.gridWidth?g=i.layout.gridWidth-r:h<0&&(g=r),r>h&&(c=!0,g=Math.abs(g)),n>d&&(l=!0,p=Math.abs(p)),e==="x"?f={x:c?r-g:r,y:0,width:g,height:i.layout.gridHeight}:e==="y"?f={x:0,y:l?n-p:n,width:i.layout.gridWidth,height:p}:f={x:c?r-g:r,y:l?n-p:n,width:g,height:p},f=W(I({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),a.drawSelectionRect(f),a.selectionDragging("resizing"),f}selectionDragging(t,e){var s;let i=this.w;if(!e)return;e.preventDefault();let{handler:a,box:o}=e.detail,r=this.constraints,{x:n,y:c}=o;nr.x2&&(n=r.x2-o.w),o.y2>r.y2&&(c=r.y2-o.h),a.move(n,c);let l=this.xyRatios,h=this.selectionRect,d=0;t==="resizing"&&(d=30);let g=f=>parseFloat(h.node.getAttribute(f)),p={x:g("x"),y:g("y"),width:g("width"),height:g("height")};i.interact.selection=p,typeof i.config.chart.events.selection=="function"&&i.interact.selectionEnabled&&(clearTimeout((s=this.w.globals.selectionResizeTimer)!=null?s:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{var f;let x=(f=this.gridRect)==null?void 0:f.getBoundingClientRect();if(!x)return;let m=h.node.getBoundingClientRect(),b,v,y,w;if(i.axisFlags.isRangeBar)b=i.globals.yAxisScale[0].niceMin+(m.left-x.left)*l.invertedYRatio,v=i.globals.yAxisScale[0].niceMin+(m.right-x.left)*l.invertedYRatio,y=0,w=1;else{if(!i.globals.xAxisScale)return;b=i.globals.xAxisScale.niceMin+(m.left-x.left)*l.xRatio,v=i.globals.xAxisScale.niceMin+(m.right-x.left)*l.xRatio,y=i.globals.yAxisScale[0].niceMin+(x.bottom-m.bottom)*l.yRatio[0],w=i.globals.yAxisScale[0].niceMax-(m.top-x.top)*l.yRatio[0]}let A={xaxis:{min:b,max:v},yaxis:{min:y,max:w}};i.config.chart.events.selection(this.ctx,A),i.config.chart.brush.enabled&&i.config.chart.events.brushScrolled!==void 0&&i.config.chart.events.brushScrolled(this.ctx,A)},d))}selectionDrawn({context:t,zoomtype:e}){var s,i;let a=this.w,o=t,r=this.xyRatios,n=this.ctx.toolbar,c=a.interact.zoomEnabled?o.zoomRect.node.getBoundingClientRect():o.selectionRect.node.getBoundingClientRect(),l=o.gridRect.getBoundingClientRect(),h=c.left-l.left-a.globals.barPadForNumericAxis,d=c.right-l.left-a.globals.barPadForNumericAxis,g=c.top-l.top,p=c.bottom-l.top,f,x;if(a.axisFlags.isRangeBar)f=a.globals.yAxisScale[0].niceMin+h*r.invertedYRatio,x=a.globals.yAxisScale[0].niceMin+d*r.invertedYRatio;else{let v=(i=(s=a.globals.xAxisScale)==null?void 0:s.niceMin)!=null?i:0;f=v+h*r.xRatio,x=v+d*r.xRatio}let m=[],b=[];if(a.config.yaxis.forEach((v,y)=>{let w=a.globals.seriesYAxisMap[y][0],A=a.globals.yAxisScale[y].niceMax-r.yRatio[w]*g,C=a.globals.yAxisScale[y].niceMax-r.yRatio[w]*p;m.push(A),b.push(C)}),o.dragged&&(o.dragX>10||o.dragY>10)&&f!==x){if(a.interact.zoomEnabled){if(!a.globals.initialConfig)return;let v=D.clone(a.globals.initialConfig.yaxis),y=D.clone(a.globals.initialConfig.xaxis);if(a.interact.zoomed=!0,a.config.xaxis.convertedCatToNumeric&&(f=Math.floor(f),x=Math.floor(x),f<1&&(f=1,x=a.globals.dataPoints),x-f<2&&(x=f+1)),(e==="xy"||e==="x")&&(y={min:f,max:x}),(e==="xy"||e==="y")&&v.forEach((A,C)=>{v[C].min=b[C],v[C].max=m[C]}),n){let A=n.getBeforeZoomRange(y,v);A&&(y=A.xaxis?A.xaxis:y,v=A.yaxis?A.yaxis:v)}let w={xaxis:y};a.config.chart.group||(w.yaxis=v),o.ctx.updateHelpers._updateOptions(w,!1,o.w.config.chart.animations.dynamicAnimation.enabled),typeof a.config.chart.events.zoomed=="function"&&n.zoomCallback(y,v)}else if(a.interact.selectionEnabled){let v=null,y=null;if(y={min:f,max:x},e==="xy"||e==="y"){let w=D.clone(a.config.yaxis);v=w,w.forEach((A,C)=>{w[C].min=b[C],w[C].max=m[C]})}a.interact.selection=o.selection,typeof a.config.chart.events.selection=="function"&&a.config.chart.events.selection(o.ctx,{xaxis:y,yaxis:v})}}}panDragging({context:t}){var e;let s=this.w,i=t;if(typeof s.interact.lastClientPosition.x<"u"){let r=s.interact.lastClientPosition.x-i.clientX,n=((e=s.interact.lastClientPosition.y)!=null?e:0)-i.clientY;Math.abs(r)>Math.abs(n)&&r>0?this.moveDirection="left":Math.abs(r)>Math.abs(n)&&r<0?this.moveDirection="right":Math.abs(n)>Math.abs(r)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(r)&&n<0&&(this.moveDirection="down")}s.interact.lastClientPosition={x:i.clientX,y:i.clientY};let a=s.axisFlags.isRangeBar?s.globals.minY:s.globals.minX,o=s.axisFlags.isRangeBar?s.globals.maxY:s.globals.maxX;i.panScrolled(a,o)}panScrolled(t,e){let s=this.w,i=this.xyRatios;if(!s.globals.initialConfig)return;let a=D.clone(s.globals.initialConfig.yaxis),o=i.xRatio,r=s.globals.minX,n=s.globals.maxX;s.axisFlags.isRangeBar&&(o=i.invertedYRatio,r=s.globals.minY,n=s.globals.maxY),this.moveDirection==="left"?(t=r+s.layout.gridWidth/15*o,e=n+s.layout.gridWidth/15*o):this.moveDirection==="right"&&(t=r-s.layout.gridWidth/15*o,e=n-s.layout.gridWidth/15*o),s.axisFlags.isRangeBar||(ts.globals.initialMaxX)&&(t=r,e=n);let l={xaxis:{min:t,max:e}};s.config.chart.group||(l.yaxis=a),this.updateScrolledChart(l,t,e)}updateScrolledChart(t,e,s){let i=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),typeof i.config.chart.events.scrolled=="function"){let a={xaxis:{min:e,max:s}};i.config.chart.events.scrolled(this.ctx,a),this.ctx.events.fireEvent("scrolled",a)}}};nt.registerFeatures({toolbar:ae,zoomPanSelection:ss});var le=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var s,i;let a=this.w;if(t.label.orientation==="vertical"){let o=e!==null?e:0,r=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${o}']`);if(r!==null){let n=r.getBBox();r.setAttribute("x",String(parseFloat((s=r.getAttribute("x"))!=null?s:"0")-n.height+4));let c=t.label.position==="top"?n.width:-n.width;r.setAttribute("y",String(parseFloat((i=r.getAttribute("y"))!=null?i:"0")+c));let{x:l,y:h}=this.annoCtx.graphics.rotateAroundCenter(r);r.setAttribute("transform",`rotate(-90 ${l} ${h})`)}}}addBackgroundToAnno(t,e){let s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;let i=s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;let a=i.getBoundingClientRect(),o=i.getBBox(),r=a.width/o.width||1,n=t.getBoundingClientRect(),{left:c,right:l,top:h,bottom:d}=e.label.style.padding;e.label.orientation==="vertical"&&([h,d,c,l]=[c,l,h,d]);let g=(n.left-a.left)/r-c,p=(n.top-a.top)/r-h,f=this.annoCtx.graphics.drawRect(g-s.globals.barPadForNumericAxis,p,n.width/r+c+l,n.height/r+h+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&f.node.classList.add(e.id),f}annotationsBackground(){let t=this.w,e=(s,i,a)=>{let o=t.dom.baseEl.querySelector(`.apexcharts-${a}-annotations .apexcharts-${a}-annotation-label[rel='${i}']`);if(o){let r=o.parentNode,n=this.addBackgroundToAnno(o,s);n&&(r?.insertBefore(n.node,o),s.label.mouseEnter&&n.node.addEventListener("mouseenter",s.label.mouseEnter.bind(this,s)),s.label.mouseLeave&&n.node.addEventListener("mouseleave",s.label.mouseLeave.bind(this,s)),s.label.click&&n.node.addEventListener("click",s.label.click.bind(this,s)))}};t.config.annotations.xaxis.forEach((s,i)=>e(s,i,"xaxis")),t.config.annotations.yaxis.forEach((s,i)=>e(s,i,"yaxis")),t.config.annotations.points.forEach((s,i)=>e(s,i,"point"))}getY1Y2(t,e){var s,i;let a=this.w,o=t==="y1"?e.y:e.y2,r,n=!1;if(this.annoCtx.invertAxis){let c=a.config.xaxis.convertedCatToNumeric?a.labelData.categoryLabels:a.labelData.labels,l=c.indexOf(o),h=a.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${l+1})`);r=h?parseFloat((s=h.getAttribute("y"))!=null?s:"0"):(a.layout.gridHeight/c.length-1)*(l+1)-a.globals.barHeight,e.seriesIndex!==void 0&&a.globals.barHeight&&(r-=a.globals.barHeight/2*(a.seriesData.series.length-1)-a.globals.barHeight*e.seriesIndex)}else{let c=a.globals.seriesYAxisMap[e.yAxisIndex][0],l=a.config.yaxis[e.yAxisIndex].logarithmic?new Z(this.w).getLogVal(a.config.yaxis[e.yAxisIndex].logBase,o,c)/a.globals.yLogRatio[c]:(o-a.globals.minYArr[c])/(a.globals.yRange[c]/a.layout.gridHeight);r=a.layout.gridHeight-Math.min(Math.max(l,0),a.layout.gridHeight),n=l>a.layout.gridHeight||l<0,e.marker&&(e.y===void 0||e.y===null)&&(r=0),(i=a.config.yaxis[e.yAxisIndex])!=null&&i.reversed&&(r=l)}return typeof o=="string"&&o.includes("px")&&(r=parseFloat(o)),{yP:r,clipped:n}}getX1X2(t,e){let s=this.w,i=t==="x1"?e.x:e.x2,a=this.annoCtx.invertAxis?s.globals.minY:s.globals.minX,o=this.annoCtx.invertAxis?s.globals.maxY:s.globals.maxX,r=this.annoCtx.invertAxis?s.globals.yRange[0]:s.globals.xRange,n=!1,c=this.annoCtx.inversedReversedAxis?(o-i)/(r/s.layout.gridWidth):(i-a)/(r/s.layout.gridWidth);return(s.config.xaxis.type==="category"||s.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!s.axisFlags.dataFormatXNumeric&&(s.config.chart.sparkline.enabled||(c=this.getStringX(i))),typeof i=="string"&&i.includes("px")&&(c=parseFloat(i)),i==null&&e.marker&&(c=s.layout.gridWidth),e.seriesIndex!==void 0&&s.globals.barWidth&&!this.annoCtx.invertAxis&&(c-=s.globals.barWidth/2*(s.seriesData.series.length-1)-s.globals.barWidth*e.seriesIndex),typeof c!="number"&&(c=0,n=!0),parseFloat(c.toFixed(10))>parseFloat(s.layout.gridWidth.toFixed(10))?(c=s.layout.gridWidth,n=!0):c<0&&(c=0,n=!0),{x:c,clipped:n}}getStringX(t){var e;let s=this.w,i=t;s.config.xaxis.convertedCatToNumeric&&s.labelData.categoryLabels.length&&(t=s.labelData.categoryLabels.indexOf(String(t))+1);let a=s.labelData.labels.map(r=>Array.isArray(r)?r.join(" "):r).indexOf(t),o=s.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return o&&(i=parseFloat((e=o.getAttribute("x"))!=null?e:"0")),i}},is=class{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new le(this.annoCtx)}addXaxisAnnotation(t,e,s){let i=this.w,a=this.helpers.getX1X2("x1",t),o=a.x,r=a.clipped,n=!0,c,l=t.label.text,h=t.strokeDashArray;if(D.isNumber(o)){if(t.x2===null||typeof t.x2>"u"){if(!r){let d=this.annoCtx.graphics.drawLine(o+t.offsetX,0+t.offsetY,o+t.offsetX,i.layout.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(d.node),t.id&&d.node.classList.add(t.id)}}else{let d=this.helpers.getX1X2("x2",t);if(c=d.x,n=d.clipped,c{this.addXaxisAnnotation(s,e.node,i)}),e}},as=class{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new le(this.annoCtx),this.axesUtils=new rt(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,s){let i=this.w,a=t.strokeDashArray,o=this.helpers.getY1Y2("y1",t),r=o.yP,n=o.clipped,c,l=!0,h=!1,d=t.label.text;if(t.y2===null||typeof t.y2>"u"){if(!n){h=!0;let g=this.annoCtx.graphics.drawLine(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),r+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(g.node),t.id&&g.node.classList.add(t.id)}}else{if(o=this.helpers.getY1Y2("y2",t),c=o.yP,l=o.clipped,c>r){let g=r;r=c,c=g}if(!(n&&l)){h=!0;let g=this.annoCtx.graphics.drawRect(0+t.offsetX,c+t.offsetY,this._getYAxisAnnotationWidth(t),r-c,0,t.fillColor,t.opacity,1,t.borderColor,a);g.node.classList.add("apexcharts-annotation-rect"),g.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(g.node),t.id&&g.node.classList.add(t.id)}}if(h){let g=t.label.position==="right"?i.layout.gridWidth:t.label.position==="center"?i.layout.gridWidth/2:0,p=this.annoCtx.graphics.drawText({x:g+t.label.offsetX,y:(c??r)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});p.attr({rel:s}),e.appendChild(p.node)}}_getYAxisAnnotationWidth(t){let e=this.w,s=e.layout.gridWidth;return t.width.indexOf("%")>-1?s=e.layout.gridWidth*parseInt(t.width,10)/100:s=parseInt(t.width,10),s+t.offsetX}drawYAxisAnnotations(){let t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((s,i)=>{s.yAxisIndex=this.axesUtils.translateYAxisIndex(s.yAxisIndex),this.axesUtils.isYAxisHidden(s.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(s.yAxisIndex)||this.addYaxisAnnotation(s,e.node,i)}),e}},os=class{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new le(this.annoCtx)}addPointAnnotation(t,e,s){if(this.w.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;let a=this.helpers.getX1X2("x1",t),o=a.x,r=a.clipped,n=this.helpers.getY1Y2("y1",t),c=n.yP,l=n.clipped;if(D.isNumber(o)&&!(l||r)){let h={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`},d=this.annoCtx.graphics.drawMarker(o+t.marker.offsetX,c+t.marker.offsetY,h);e.appendChild(d.node);let g=t.label.text?t.label.text:"",p=this.annoCtx.graphics.drawText({x:o+t.label.offsetX,y:c+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:g,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(p.attr({rel:s}),e.appendChild(p.node),t.customSVG.SVG){let f=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});f.attr({transform:`translate(${o+t.customSVG.offsetX}, ${c+t.customSVG.offsetY})`}),f.node.innerHTML=t.customSVG.SVG,e.appendChild(f.node)}if(t.image.path){let f=t.image.width?t.image.width:20,x=t.image.height?t.image.height:20;d=this.annoCtx.addImage({x:o+t.image.offsetX-f/2,y:c+t.image.offsetY-x/2,width:f,height:x,path:t.image.path,appendTo:".apexcharts-point-annotations"})}t.mouseEnter&&d.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&d.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&d.node.addEventListener("click",t.click.bind(this,t))}}drawPointAnnotations(){let t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((s,i)=>{this.addPointAnnotation(s,e.node,i)}),e}},rs=class{constructor(t,{theme:e=null,timeScale:s=null}={}){this.w=t,this.theme=e,this.timeScale=s,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new F(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new le(this),this.xAxisAnnotations=new is(this),this.yAxisAnnotations=new as(this),this.pointsAnnotations=new os(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){let t=this.w;if(t.globals.axisCharts&&t.globals.dataPoints){let e=this.yAxisAnnotations.drawYAxisAnnotations(),s=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,o=[e,s,i],r=[s.node,e.node,i.node];for(let n=0;n<3;n++)t.dom.elGraphical.add(o[n]),a&&!t.globals.resized&&!t.globals.dataChanged&&t.config.chart.type!=="scatter"&&t.config.chart.type!=="bubble"&&t.globals.dataPoints>1&&r[n].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[n],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(e=>{this.addImage(e)})}drawTextAnnos(){this.w.config.annotations.texts.map(e=>{this.addText(e)})}addXaxisAnnotation(t,e,s){this.xAxisAnnotations.addXaxisAnnotation(t,e,s)}addYaxisAnnotation(t,e,s){this.yAxisAnnotations.addYaxisAnnotation(t,e,s)}addPointAnnotation(t,e,s){this.pointsAnnotations.addPointAnnotation(t,e,s)}addText(t){let{x:e,y:s,text:i,textAnchor:a,foreColor:o,fontSize:r,fontFamily:n,fontWeight:c,cssClass:l,backgroundColor:h,borderWidth:d,strokeDashArray:g,borderRadius:p,borderColor:f,appendTo:x=".apexcharts-svg",paddingLeft:m=4,paddingRight:b=4,paddingBottom:v=2,paddingTop:y=2}=t,w=this.w,A=this.graphics.drawText({x:e,y:s,text:i,textAnchor:a||"start",fontSize:r||"12px",fontWeight:c||"regular",fontFamily:n||w.config.chart.fontFamily,foreColor:o||w.config.chart.foreColor,cssClass:"apexcharts-text "+l?l:""}),C=w.dom.baseEl.querySelector(x);C&&C.appendChild(A.node);let L=A.bbox();if(i){let k=this.graphics.drawRect(L.x-m,L.y-y,L.width+m+b,L.height+v+y,p,h||"transparent",1,d,f,g);C.insertBefore(k.node,A.node)}}addImage(t){let e=this.w,{path:s,x:i=0,y:a=0,width:o=20,height:r=20,appendTo:n=".apexcharts-svg"}=t,c=e.dom.Paper.image(s);c.size(o,r).move(i,a);let l=e.dom.baseEl.querySelector(n);return l&&l.appendChild(c.node),c}addXaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"xaxis",contextMethod:s.addXaxisAnnotation}),s}addYaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"yaxis",contextMethod:s.addYaxisAnnotation}),s}addPointAnnotationExternal(t,e,s){return typeof this.invertAxis>"u"&&(this.invertAxis=s.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"point",contextMethod:s.addPointAnnotation}),s}addAnnotationExternal({params:t,pushToMemory:e,context:s,type:i,contextMethod:a}){let o=s,r=o.w,n=r.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),c=n.childNodes.length+1,l=new lt,h=Object.assign({},i==="xaxis"?l.xAxisAnnotation:i==="yaxis"?l.yAxisAnnotation:l.pointAnnotation),d=D.extend(h,t);switch(i){case"xaxis":this.addXaxisAnnotation(d,n,c);break;case"yaxis":this.addYaxisAnnotation(d,n,c);break;case"point":this.addPointAnnotation(d,n,c);break}let g=r.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${c}']`),p=this.helpers.addBackgroundToAnno(g,d);return p&&n.insertBefore(p.node,g),e&&r.globals.memory.methodsToExec.push({context:o,id:d.id?d.id:D.randomId(),method:a,label:"addAnnotation",params:t}),s}clearAnnotations(t){let e=t.w,s=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let i=e.globals.memory.methodsToExec.length-1;i>=0;i--)(e.globals.memory.methodsToExec[i].label==="addText"||e.globals.memory.methodsToExec[i].label==="addAnnotation")&&e.globals.memory.methodsToExec.splice(i,1);Array.prototype.forEach.call(s,i=>{for(;i.firstChild;)i.removeChild(i.firstChild)})}removeAnnotation(t,e){let s=t.w,i=s.dom.baseEl.querySelectorAll(`.${e}`);i&&(s.globals.memory.methodsToExec.map((a,o)=>{a.id===e&&s.globals.memory.methodsToExec.splice(o,1)}),Object.keys(s.config.annotations).forEach(a=>{let o=s.config.annotations[a];Array.isArray(o)&&(s.config.annotations[a]=o.filter(r=>r.id!==e))}),Array.prototype.forEach.call(i,a=>{a.parentElement.removeChild(a)}))}};nt.registerFeatures({annotations:rs});var ns=class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this)}init(){let e=this.w.dom.Paper.node;e&&(e.setAttribute("tabindex","0"),e.addEventListener("focus",this._onFocus),e.addEventListener("blur",this._onBlur),e.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){let t=this.w,e=t.dom.Paper&&t.dom.Paper.node;e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),this.ctx.events.removeEventListener("legendClick",this._onLegendClick))}handleKey(t){}_onFocus(){this._isNavEnabled()&&(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint())}_onBlur(){this.active=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){if(!(!this._isNavEnabled()||!this.active))switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"Escape":t.preventDefault(),this.active=!1,this._hideFocus();break}}_move(t,e){let s=this.w,i=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(t!==0){let a=this.w.globals.tooltip;if(a&&a.tConfig&&a.tConfig.shared){let l=this.dataPointIndex;if(a.tooltipUtil&&a.tooltipUtil.isXoverlap(l)&&a.tooltipUtil.isInitialSeriesSameLen())return}let o=this._getSeriesCount(),r=this.seriesIndex+t,n=0;for(;n=o&&(r=i?0:o-1),!!s.globals.collapsedSeriesIndices.includes(r));)r+=t,n++;this.seriesIndex=r;let c=this._getDataPointCount(r);this.dataPointIndex>=c&&(this.dataPointIndex=c-1)}if(e!==0){let a=this._getDataPointCount(this.seriesIndex),o=this.dataPointIndex+e;o<0&&(o=i?a-1:0),o>=a&&(o=i?0:a-1),this.dataPointIndex=o,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){let t=this.w,e=this.seriesIndex,s=this._getDataPointCount(e),i=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a0;n?this._showScatterBubblePoint(t,e,s):c?r?s.marker.enlargePoints(e):s.tooltipPosition.moveDynamicPointOnHover(e,t):r?s.tooltipPosition.moveDynamicPointsOnHover(e):s.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,s){let i=this.w.dom.baseEl;this._enlargedScatterMarker&&(s.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);let a=i.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return;let o=a.querySelector(`.apexcharts-marker[rel='${e}']`);o&&(s.marker.enlargeCurrentPoint(e,o),this._enlargedScatterMarker=o)}_showTooltipNonAxis(t,e,s,i){var a,o;let r=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:e,shared:!1});let n=i.getBoundingClientRect(),c=n.width||s.tooltipRect.ttWidth||0,l=n.height||s.tooltipRect.ttHeight||0,h=r.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`);if(h){let d=parseFloat((a=h.getAttribute("data:cx"))!=null?a:""),g=parseFloat((o=h.getAttribute("data:cy"))!=null?o:"");if(!isNaN(d)&&!isNaN(g)){let p=r.dom.Paper.node.getBoundingClientRect(),f=r.dom.elWrap.getBoundingClientRect(),x=p.left-f.left,m=p.top-f.top;i.style.left=x+d-c/2+"px",i.style.top=m+g-l-10+"px"}}}_showTooltipRadialBar(t,e,s,i){var a;let o=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,shared:!1});let{ttWidth:r=0,ttHeight:n=0}=s.getCachedDimensions(),c=o.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(c){let l=parseFloat((a=c.getAttribute("data:angle"))!=null?a:"")||0,d=(o.config.plotOptions.radialBar.startAngle||0)+l/2,g=o.layout.gridWidth/2,p=o.layout.gridHeight/2,f=o.globals.radialSize||Math.min(o.layout.gridWidth,o.layout.gridHeight)/2,x=o.seriesData.series.length,m=f/Math.max(x,1),b=f-t*m,v=b-m,y=(b+v)/2,w=D.polarToCartesian(g,p,y,d),A=w.x+(o.layout.translateX||0),C=w.y+(o.layout.translateY||0);i.style.left=A-r/2+"px",i.style.top=C-n-10+"px"}}_showTooltipHeatTree(t,e,s,i,a){var o,r;let n=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:e,shared:!1});let c=i.getBoundingClientRect(),l=c.width||s.tooltipRect.ttWidth||0,h=c.height||s.tooltipRect.ttHeight||0,d=a==="heatmap"?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",g=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(g){let p=n.dom.elWrap.getBoundingClientRect(),f=g.getBoundingClientRect(),x=f.left-p.left,m=f.top-p.top,b=f.width,v=f.height,y=parseFloat((o=g.getAttribute("cx"))!=null?o:""),w=parseFloat((r=g.getAttribute("width"))!=null?r:"");s.tooltipPosition.moveXCrosshairs(y+w/2);let A=x+b+l/2,C=m+v/2-h/2;x+b>n.layout.gridWidth/2&&(A=x-l/2),i.style.left=A+"px",i.style.top=C+"px"}}_applyFocusClass(t,e){this._removeFocusClass();let s=this._getFocusableElement(t,e);s&&(s.classList.add("apexcharts-keyboard-focused"),this._focusedEl=s)}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl=null)}_leaveHoveredBar(){this._hoveredBarEl&&(new F(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null)}_getFocusableElement(t,e){let s=this.w,i=s.config.chart.type,a=s.dom.baseEl;return i==="pie"||i==="donut"||i==="polarArea"?a.querySelector(`.apexcharts-pie-area[j='${e}']`):i==="heatmap"?a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):i==="treemap"?a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):i==="radialBar"?a.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`):i==="bar"||i==="candlestick"||i==="boxPlot"||i==="rangeBar"?a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`):a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){let e=this.w.globals.tooltip;if(!e)return;let s={type:"mouseup",clientX:0,clientY:0};e.markerClick(s,this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){let t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){let t=this.w,e=t.config.chart.type;return e==="pie"||e==="donut"||e==="polarArea"?1:t.seriesData.series.length}_getDataPointCount(t){let e=this.w,s=e.config.chart.type;if(s==="pie"||s==="donut"||s==="polarArea")return e.seriesData.series.length;let i=e.seriesData.series;return i[t]&&Array.isArray(i[t])?i[t].length:0}_clampCursor(){let t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);let e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){let t=this.w,e=t.globals,s=this.seriesIndex;if(!t.interact.zoomed)return;let i=t.seriesData.seriesX&&t.seriesData.seriesX[s];if(!i||!i.length)return;let a=e.minX,o=e.maxX;if(a===void 0||o===void 0)return;let r=i[this.dataPointIndex];if(r>=a&&r<=o)return;let n=i.length;for(let c=0;c=a&&i[c]<=o){this.dataPointIndex=c;return}}_snapToVisibleRangeInDirection(t){let e=this.w,s=e.globals,i=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[i];if(!a||!a.length)return;let o=s.minX,r=s.maxX;if(o===void 0||r===void 0)return;let n=a.length;if(t>=0){for(let c=0;c=o&&a[c]<=r){this.dataPointIndex=c;return}}else for(let c=n-1;c>=0;c--)if(a[c]>=o&&a[c]<=r){this.dataPointIndex=c;return}}_isDataPointVisible(t,e){let s=this.w,i=s.globals;if(!s.interact.zoomed)return!0;let a=s.seriesData.seriesX&&s.seriesData.seriesX[t];if(!a)return!0;let o=a[e];return o===void 0?!0:o>=i.minX&&o<=i.maxX}};nt.registerFeatures({keyboardNavigation:ns});var ls=class{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){let{x:e,y:s,y1:i,y2:a,i:o,j:r,realIndex:n,columnGroupIndex:c,series:l,barHeight:h,barWidth:d,barXPosition:g,barYPosition:p,visibleSeries:f}=t,x=this.w,m=new F(this.barCtx.w),b=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[n]:this.barCtx.strokeWidth,v,y;x.axisFlags.isXNumeric&&!x.globals.isBarHorizontal?(v=e+d*(f+1),y=s+h*(f+1)-b):(v=e+d*f,y=s+h*f);let w=null,A=null,C=e,L=s,k={},S=x.config.dataLabels,T=this.barCtx.barOptions.dataLabels,P=this.barCtx.barOptions.dataLabels.total;typeof p<"u"&&this.barCtx.isRangeBar&&(y=p,L=p),typeof g<"u"&&this.barCtx.isVerticalGroupedRangeBar&&(v=g,C=g);let M=S.offsetX,E=S.offsetY,X={width:0,height:0};if(x.config.dataLabels.enabled){let R=x.seriesData.series[o][r];X=m.getTextRects(x.config.dataLabels.formatter?x.config.dataLabels.formatter(R,W(I({},x),{seriesIndex:o,dataPointIndex:r,w:x})):x.formatters.yLabelFormatters[0](R),parseFloat(S.style.fontSize).toString())}let _={x:e,y:s,i:o,j:r,realIndex:n,columnGroupIndex:c,bcx:v,bcy:y,barHeight:h,barWidth:d,textRects:X,strokeWidth:b,dataLabelsX:C,dataLabelsY:L,dataLabelsConfig:S,barDataLabelsConfig:T,barTotalDataLabelsConfig:P,offX:M,offY:E};return this.barCtx.isHorizontal?k=this.calculateBarsDataLabelsPosition(_):k=this.calculateColumnsDataLabelsPosition(_),w=this.drawCalculatedDataLabels({x:k.dataLabelsX,y:k.dataLabelsY,val:this.barCtx.isRangeBar?[i,a]:x.config.chart.stackType==="100%"?l[n][r]:x.seriesData.series[n][r],i:n,j:r,barWidth:d,barHeight:h,textRects:X,dataLabelsConfig:S}),x.config.chart.stacked&&P.enabled&&(A=this.drawTotalDataLabels({x:k.totalDataLabelsX,y:k.totalDataLabelsY,barWidth:d,barHeight:h,realIndex:n,textAnchor:k.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:n,j:r}),dataLabelsConfig:S,barTotalDataLabelsConfig:P})),{dataLabelsPos:k,dataLabels:w,totalDataLabels:A}}getStackedTotalDataLabel({realIndex:t,j:e}){let s=this.w,i=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(i=this.totalFormatter(i,W(I({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),i}calculateColumnsDataLabelsPosition(t){let e=this.w,{i:s,j:i,realIndex:a,y:o,bcx:r,barWidth:n,barHeight:c,textRects:l,dataLabelsX:h,dataLabelsY:d,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:f,strokeWidth:x,offX:m,offY:b}=t,v,y,w="middle",A=r;c=Math.abs(c);let C=e.config.plotOptions.bar.dataLabels.orientation==="vertical",{zeroEncounters:L}=this.barCtx.barHelpers.getZeroValueEncounters({i:s,j:i});r=r-x/2;let k=e.layout.gridWidth/e.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?h+=n/2:(e.axisFlags.isXNumeric?h=r-n/2+m:h=r-k+n/2+m,!e.config.chart.stacked&&L>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(h-=n*L)),C&&(h=h+l.height/2-x/2-2);let S=e.seriesData.series[s][i]<0,T=o;switch(this.barCtx.isReversed&&(T=o+(S?c:-c)),p.position){case"center":C?S?d=T-c/2+b:d=T+c/2-b:S?d=T-c/2+l.height/2+b:d=T+c/2+l.height/2-b;break;case"bottom":C?S?d=T-c+b:d=T+c-b:S?d=T-c+l.height+x+b:d=T+c-l.height/2+x-b;break;case"top":C?S?d=T+b:d=T-b:S?d=T-l.height/2-b:d=T+l.height+b;break}let P=T;if(e.labelData.seriesGroups.forEach(M=>{var E;(E=this.barCtx[M.join(",")])==null||E.prevY.forEach(X=>{S?P=Math.max(X[i],P):P=Math.min(X[i],P)})}),this.barCtx.lastActiveBarSerieIndex===a&&f.enabled){let X=new F(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:a,j:i}),g.fontSize);S?v=P-X.height/2-b-f.offsetY+18:v=P+X.height+b+f.offsetY-18;let _=k;y=A+(e.axisFlags.isXNumeric?-n*e.globals.barGroups.length/2:e.globals.barGroups.length*n/2-(e.globals.barGroups.length-1)*n-_)+f.offsetX}return e.config.chart.stacked||(d<0?d=0+x:d+l.height/3>e.layout.gridHeight&&(d=e.layout.gridHeight-x)),{bcx:r,bcy:o,dataLabelsX:h,dataLabelsY:d,totalDataLabelsX:y,totalDataLabelsY:v,totalDataLabelsAnchor:w}}calculateBarsDataLabelsPosition(t){let e=this.w,{x:s,i,j:a,realIndex:o,bcy:r,barHeight:n,barWidth:c,textRects:l,dataLabelsX:h,strokeWidth:d,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:f,offX:x,offY:m}=t,b=e.layout.gridHeight/e.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i,j:a});c=Math.abs(c);let y=r-(this.barCtx.isRangeBar?0:b)+n/2+l.height/2+m-3;!e.config.chart.stacked&&v>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(y-=n*v);let w,A,C="start",L=e.seriesData.series[i][a]<0,k=s;switch(this.barCtx.isReversed&&(k=s+(L?-c:c),C=L?"start":"end"),p.position){case"center":L?h=k+c/2-x:h=Math.max(l.width/2,k-c/2)+x;break;case"bottom":L?h=k+c-d-x:h=k-c+d+x;break;case"top":L?h=k-d-x:h=k-d+x;break}let S=k;if(e.labelData.seriesGroups.forEach(T=>{var P;(P=this.barCtx[T.join(",")])==null||P.prevX.forEach(M=>{L?S=Math.min(M[a],S):S=Math.max(M[a],S)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){let P=new F(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:a}),g.fontSize);L?(w=S-d-x-f.offsetX,C="end"):w=S+x+f.offsetX+(this.barCtx.isReversed?-(c+d):d),A=y-l.height/2+P.height/2+f.offsetY+d,e.globals.barGroups.length>1&&(A=A-e.globals.barGroups.length/2*(n/2))}return e.config.chart.stacked||(g.textAnchor==="start"?h-l.width<0?h=L?l.width+d:d:h+l.width>e.layout.gridWidth&&(h=L?e.layout.gridWidth-d:e.layout.gridWidth-l.width-d):g.textAnchor==="middle"?h-l.width/2<0?h=l.width/2+d:h+l.width/2>e.layout.gridWidth&&(h=e.layout.gridWidth-l.width/2-d):g.textAnchor==="end"&&(h<1?h=l.width+d:h+1>e.layout.gridWidth&&(h=e.layout.gridWidth-l.width-d))),{bcx:s,bcy:r,dataLabelsX:h,dataLabelsY:y,totalDataLabelsX:w,totalDataLabelsY:A,totalDataLabelsAnchor:C}}drawCalculatedDataLabels({x:t,y:e,val:s,i,j:a,textRects:o,barHeight:r,barWidth:n,dataLabelsConfig:c}){let l=this.w,h="rotate(0)";l.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(h=`rotate(-90, ${t}, ${e})`);let d=new ct(this.barCtx.w,this.barCtx.ctx),g=new F(this.barCtx.w),p=c.formatter,f=null,x=l.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!x){f=g.group({class:"apexcharts-data-labels",transform:h});let m="";typeof s<"u"&&(m=p(s,W(I({},l),{seriesIndex:i,dataPointIndex:a,w:l}))),!s&&l.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(m="");let b=l.seriesData.series[i][a]<0,v=l.config.plotOptions.bar.dataLabels.position;if(l.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(v==="top"&&(b?c.textAnchor="end":c.textAnchor="start"),v==="center"&&(c.textAnchor="middle"),v==="bottom"&&(b?c.textAnchor="end":c.textAnchor="start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){let w=g.getTextRects(m,parseFloat(c.style.fontSize).toString());nMath.abs(n)&&(m=""):o.height/1.6>Math.abs(r)&&(m=""));let y=I({},c);this.barCtx.isHorizontal&&s<0&&(c.textAnchor==="start"?y.textAnchor="end":c.textAnchor==="end"&&(y.textAnchor="start")),d.plotDataLabelsText({x:t,y:e,text:m,i,j:a,parent:f,dataLabelsConfig:y,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return f}drawTotalDataLabels({x:t,y:e,val:s,realIndex:i,textAnchor:a,barTotalDataLabelsConfig:o}){let r=new F(this.barCtx.w),n;return o.enabled&&typeof t<"u"&&typeof e<"u"&&this.barCtx.lastActiveBarSerieIndex===i&&(n=r.drawText({x:t,y:e,foreColor:o.style.color,text:s,textAnchor:a,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),n}},oa=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){let e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let i=0;ie.globals.minX&&e.seriesData.seriesX[s][i]s.map(i=>"none"))),this.barCtx.seriesLen===0&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){let e=this.w,s,i,a,o,r,n,c,l,h=e.globals.dataPoints;this.barCtx.isRangeBar&&(h=e.labelData.labels.length);let d=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/h,r=a/d,e.axisFlags.isXNumeric&&(a=e.layout.gridHeight/this.barCtx.totalItems,r=a/this.barCtx.seriesLen),r=r*parseInt(this.barCtx.barOptions.barHeight,10)/100,String(this.barCtx.barOptions.barHeight).indexOf("%")===-1&&(r=parseInt(this.barCtx.barOptions.barHeight,10)),l=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?this.barCtx.baseLineInvertedY*2:0),this.barCtx.isFunnel&&(l=e.layout.gridWidth/2),i=(a-r*this.barCtx.seriesLen)/2;else{if(o=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(o=e.layout.gridWidth/e.globals.dataPoints),n=o/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){let g=this.barCtx.xRatio;e.globals.minXDiff&&e.globals.minXDiff!==.5&&e.globals.minXDiff/g>0&&(o=e.globals.minXDiff/g),n=o/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}String(this.barCtx.barOptions.columnWidth).indexOf("%")===-1&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),c=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?this.barCtx.baseLineY[this.barCtx.translationsIndex]*2:0),e.axisFlags.isXNumeric?s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x:s=e.globals.padHorizontal+D.noExponents(o-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=r,e.globals.barWidth=n,{x:s,y:i,yDivision:a,xDivision:o,barHeight:r,barWidth:n,zeroH:c,zeroW:l}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(s=>{t[s]||(t[s]={}),t[s].prevY=[],t[s].prevX=[],t[s].prevYF=[],t[s].prevXF=[],t[s].prevYVal=[],t[s].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(s=>{t[s]||(t[s]={}),t[s].xArrj=[],t[s].xArrjF=[],t[s].xArrjVal=[],t[s].yArrj=[],t[s].yArrjF=[],t[s].yArrjVal=[]})}getPathFillColor(t,e,s,i){var a,o,r,n;let c=this.w,l=new st(this.barCtx.w),h=null,d=this.barCtx.barOptions.distributed?s:e,g=!1;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(x=>{t[e][s]>=x.from&&t[e][s]<=x.to&&(h=x.color,g=!0)}),{color:l.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:i,dataPointIndex:s,color:h,value:t[e][s],fillConfig:(a=c.config.series[e].data[s])==null?void 0:a.fill,fillType:(r=(o=c.config.series[e].data[s])==null?void 0:o.fill)!=null&&r.type?(n=c.config.series[e].data[s])==null?void 0:n.fill.type:Array.isArray(c.config.fill.type)?c.config.fill.type[i]:c.config.fill.type}),useRangeColor:g}}getStrokeWidth(t,e,s){let i=0,a=this.w;return typeof this.barCtx.series[t][e]>"u"||this.barCtx.series[t][e]===null||a.config.chart.type==="bar"&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(i=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),i}createBorderRadiusArr(t){var e;let s=this.w,i=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,a=t.length,o=((e=t[0])==null?void 0:e.length)|0,r=Array.from({length:a},()=>Array(o).fill(i?"top":"none"));if(i)return r;let n=this.w.config.chart.type;for(let c=0;c0?(l.push(g),d++):p<0&&(h.push(g),d++)}if(l.length>0&&h.length===0)if(l.length===1)r[l[0]][c]=n==="bar"&&o===1?"top":"both";else{let g=l[0],p=l[l.length-1];for(let f of l)f===g?r[f][c]=n==="bar"&&o===1?"top":"bottom":f===p?r[f][c]="top":r[f][c]="none"}else if(h.length>0&&l.length===0)if(h.length===1)r[h[0]][c]="both";else{let g=Math.max(...h),p=Math.min(...h);for(let f of h)f===g?r[f][c]="bottom":f===p?r[f][c]="top":r[f][c]="none"}else if(l.length>0&&h.length>0){let g=l[l.length-1];for(let f of l)f===g?r[f][c]="top":r[f][c]="none";let p=Math.max(...h);for(let f of h)f===p?r[f][c]="bottom":r[f][c]="none"}else if(d===1){let g=l[0]||h[0];r[g][c]="both"}}return r}barBackground({j:t,i:e,x1:s,x2:i,y1:a,y2:o,elSeries:r}){let n=this.w,c=new F(this.barCtx.w),h=new K(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);let d=this.barCtx.barOptions.colors.backgroundBarColors[t],g=c.drawRect(typeof s<"u"?s:0,typeof a<"u"?a:0,typeof i<"u"?i:n.layout.gridWidth,typeof o<"u"?o:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,d,this.barCtx.barOptions.colors.backgroundBarOpacity);r.add(g),g.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:n,realIndex:c,i:l,j:h,w:d}){var g;let p=new F(this.barCtx.w);a=Array.isArray(a)?a[c]:a,a||(a=0);let f=t,x=e;(g=d.config.series[c].data[h])!=null&&g.columnWidthOffset&&(x=e-d.config.series[c].data[h].columnWidthOffset/2,f=t+d.config.series[c].data[h].columnWidthOffset);let m=a/2,b=x+m,v=x+f-m,y=(r[l][h]>=0?1:-1)*(o?-1:1);s+=.001-m*y,i+=.001+m*y;let w=p.move(b,s),A=p.move(b,s),C=p.line(v,s);if(d.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(c,h,!1)),w=w+p.line(b,i)+p.line(v,i)+C+(d.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[c][h]==="both"?" Z":" z"),A=A+p.line(b,s)+C+C+C+C+C+p.line(b,s)+(d.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[c][h]==="both"?" Z":" z"),this.arrBorderRadius[c][h]!=="none"&&(w=p.roundPathCorners(w,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let L=this.barCtx;L=this.barCtx[n],L.yArrj.push(i-m*y),L.yArrjF.push(Math.abs(s-i+a*y)),L.yArrjVal.push(this.barCtx.series[l][h])}return{pathTo:w,pathFrom:A}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:n,realIndex:c,i:l,j:h,w:d}){var g;let p=new F(this.barCtx.w);a=Array.isArray(a)?a[c]:a,a||(a=0);let f=t,x=e;(g=d.config.series[c].data[h])!=null&&g.barHeightOffset&&(f=t-d.config.series[c].data[h].barHeightOffset/2,x=e+d.config.series[c].data[h].barHeightOffset);let m=a/2,b=f+m,v=f+x-m,y=(r[l][h]>=0?1:-1)*(o?-1:1);s+=.001+m*y,i+=.001-m*y;let w=p.move(s,b),A=p.move(s,b);d.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(c,h,!1));let C=p.line(s,v);if(w=w+p.line(i,b)+p.line(i,v)+C+(d.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[c][h]==="both"?" Z":" z"),A=A+p.line(s,b)+C+C+C+C+C+p.line(s,b)+(d.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[c][h]==="both"?" Z":" z"),this.arrBorderRadius[c][h]!=="none"&&(w=p.roundPathCorners(w,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let L=this.barCtx;L=this.barCtx[n],L.xArrj.push(i+m*y),L.xArrjF.push(Math.abs(s-i-a*y)),L.xArrjVal.push(this.barCtx.series[l][h])}return{pathTo:w,pathFrom:A}}checkZeroSeries({series:t}){let e=this.w;for(let s=0;s{n.push({[t]:t==="x"?this.getXForValue(l,e,!1):this.getYForValue(l,s,o,!1),attrs:h})};if(r.seriesData.seriesGoals[i]&&r.seriesData.seriesGoals[i][a]&&Array.isArray(r.seriesData.seriesGoals[i][a])&&r.seriesData.seriesGoals[i][a].forEach(l=>{c(l.value,l)}),this.barCtx.barOptions.isDumbbell&&r.rangeData.seriesRange.length){let l=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:r.globals.colors,h={strokeHeight:t==="x"?0:r.globals.markers.size[i],strokeWidth:t==="x"?r.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(l[i])?l[i][0]:l[i]};c(r.rangeData.seriesRangeStart[i][a],h),c(r.rangeData.seriesRangeEnd[i][a],W(I({},h),{strokeColor:Array.isArray(l[i])?l[i][1]:l[i]}))}return n}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:i,barWidth:a,barHeight:o}){let r=new F(this.barCtx.w),n=r.group({className:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let c=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(l=>{if(l.x>=-1&&l.x<=r.w.layout.gridWidth+1){let h=typeof l.attrs.strokeHeight<"u"?l.attrs.strokeHeight:o/2,d=e+h+o/2;c=r.drawLine(l.x,d-h*2,l.x,d,l.attrs.strokeColor?l.attrs.strokeColor:void 0,l.attrs.strokeDashArray,l.attrs.strokeWidth?l.attrs.strokeWidth:2,l.attrs.strokeLineCap),n.add(c)}}):Array.isArray(i)&&i.forEach(l=>{if(l.y>=-1&&l.y<=r.w.layout.gridHeight+1){let h=typeof l.attrs.strokeWidth<"u"?l.attrs.strokeWidth:a/2,d=t+h+a/2;c=r.drawLine(d-h*2,l.y,d,l.y,l.attrs.strokeColor?l.attrs.strokeColor:void 0,l.attrs.strokeDashArray,l.attrs.strokeHeight?l.attrs.strokeHeight:2,l.attrs.strokeLineCap),n.add(c)}}),n}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:i,j:a}){let o=this.w,{x:r,x1:n,barYPosition:c}=t,{x:l,x1:h,barYPosition:d}=e,g=c+e.barHeight,p=new F(this.barCtx.w),f=new D,x=p.move(n,g)+p.line(r,g)+p.line(l,d)+p.line(h,d)+p.line(n,g)+(o.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[i][a]==="both"?" Z":" z");return p.drawPath({d:x,fill:f.shadeColor(.5,D.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;let i=this.w,a=0,o=0;return(i.config.plotOptions.bar.horizontal?i.seriesData.series.map((n,c)=>c):((s=i.globals.columnSeries)==null?void 0:s.i.map(n=>n))||[]).forEach(n=>{let c=i.globals.seriesPercent[n][e];c&&a++,no.indexOf(e.seriesData.seriesNames[t])>-1),i=this.barCtx.columnGroupIndices,a=i.indexOf(s);return a<0&&(i.push(s),a=i.length-1),{groupIndex:s,columnGroupIndex:a}}},pt=class{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,this.xyRatios!==null&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;let i=new K(this.w);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];let a=i.getBarSeriesIndices(),o=new Z(this.w);this.stackedSeriesTotals=o.getStackedSeriesTotals(this.w.config.series.map((r,n)=>a.indexOf(n)===-1?n:-1).filter(r=>r!==-1)),this.barHelpers=new oa(this)}draw(t,e){var s;let i=this.w,a=new F(this.w),o=new Z(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);let r=a.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let n=0,c=0;n0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[p],this.translationsIndex=p);let m=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;let b=this.barHelpers.initialPositions(p),{y:v,yDivision:y,zeroW:w,x:A,xDivision:C,zeroH:L}=b,k=b.barHeight,S=b.barWidth;h=v,l=A,this.isHorizontal||g.push(l+(S??0)/2);let T=a.group({class:"apexcharts-datalabels","data:realIndex":p});i.globals.delayedElements.push({el:T.node}),T.node.classList.add("apexcharts-element-hidden");let P=a.group({class:"apexcharts-bar-goals-markers"}),M=a.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:M.node}),M.node.classList.add("apexcharts-element-hidden");for(let E=0;E0){let B=this.barHelpers.drawBarShadow({color:typeof N.color=="string"&&((s=N.color)==null?void 0:s.indexOf("url"))===-1?N.color:D.hexToRgba(i.globals.colors[n]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:_,realIndex:p,j:E});M.add(B),i.config.chart.dropShadow.enabled&&new J(this.w).dropShadow(B,i.config.chart.dropShadow,p)}this.pathArr.push(_);let O=this.barHelpers.drawGoalLine({barXPosition:_.barXPosition,barYPosition:_.barYPosition,goalX:_.goalX,goalY:_.goalY,barHeight:k,barWidth:S});O&&P.add(O),h=_.y,l=_.x,E>0&&g.push(l+(S??0)/2),d.push(h),this.renderSeries(W(I({realIndex:p,pathFill:N.color},N.useRangeColor?{lineFill:N.color}:{}),{j:E,i:n,columnGroupIndex:f,pathFrom:_.pathFrom,pathTo:_.pathTo,strokeWidth:X,elSeries:x,x:l,y:h,series:t,barHeight:Math.abs(_.barHeight?_.barHeight:k),barWidth:Math.abs(_.barWidth?_.barWidth:S),elDataLabelsWrap:T,elGoalsMarkers:P,elBarShadows:M,visibleSeries:this.visibleI,type:"bar"}))}i.globals.seriesXvalues[p]=g,i.globals.seriesYvalues[p]=d,r.add(x)}return r}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:i,i:a,columnGroupIndex:o,pathFrom:r,pathTo:n,strokeWidth:c,elSeries:l,x:h,y:d,y1:g,y2:p,series:f,barHeight:x,barWidth:m,barXPosition:b,barYPosition:v,elDataLabelsWrap:y,elGoalsMarkers:w,elBarShadows:A,visibleSeries:C,type:L,classes:k}){let S=this.w,T=new F(this.w,this.ctx),P=!1;if(l._bindingsDelegated||(l._bindingsDelegated=!0,T.setupEventDelegation(l,`.apexcharts-${L}-area`)),!s){let _=function(N){let O=S.config.stroke.colors,B;return Array.isArray(O)&&O.length>0&&(B=O[N],B||(B=""),typeof B=="function")?B({value:S.seriesData.series[N][i],dataPointIndex:i,w:S}):B},R=typeof S.globals.stroke.colors[t]=="function"?_(t):S.globals.stroke.colors[t];s=this.barOptions.distributed?S.globals.stroke.colors[i]:R}let E=new ls(this).handleBarDataLabels({x:h,y:d,y1:g,y2:p,i:a,j:i,series:f,realIndex:t,columnGroupIndex:o,barHeight:x,barWidth:m,barXPosition:b,barYPosition:v,visibleSeries:C});S.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(m,S.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(m,S.globals.barPadForNumericAxis)>S.layout.gridWidth)&&(P=!0),S.config.series[a].data[i]&&S.config.series[a].data[i].strokeColor&&(s=S.config.series[a].data[i].strokeColor),this.isNullValue&&(e="none");let X=i/S.config.chart.animations.animateGradually.delay*(S.config.chart.animations.speed/S.globals.dataPoints)/2.4;if(!P){let _=T.renderPaths({i:a,j:i,realIndex:t,pathFrom:r,pathTo:n,stroke:s,strokeWidth:c,strokeLineCap:S.config.stroke.lineCap,fill:e,animationDelay:X,initialSpeed:S.config.chart.animations.speed,dataChangeSpeed:S.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${L}-area ${k}`,chartType:L,bindEventsOnPaths:!1});_.attr("clip-path",`url(#gridRectBarMask${S.globals.cuid})`);let R=S.config.forecastDataPoints;R.count>0&&i>=S.globals.dataPoints-R.count&&(_.node.setAttribute("stroke-dasharray",R.dashArray),_.node.setAttribute("stroke-width",R.strokeWidth),_.node.setAttribute("fill-opacity",R.fillOpacity)),typeof g<"u"&&typeof p<"u"&&(_.attr("data-range-y1",g),_.attr("data-range-y2",p)),new J(this.w).setSelectionFilter(_,t,i),l.add(_),_.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:i,val:S.seriesData.series[a][i],barHeight:x,barWidth:m}),E.dataLabels!==null&&y.add(E.dataLabels),E.totalDataLabels&&y.add(E.totalDataLabels),l.add(y),w&&l.add(w),A&&l.add(A)}return l}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,yDivision:r,elSeries:n}){let c=this.w,l=t.i,h=t.j,d;if(c.axisFlags.isXNumeric)o=(c.seriesData.seriesX[l][h]-c.globals.minX)/this.invertedXRatio-e,d=o+e*this.visibleI;else if(c.config.plotOptions.bar.hideZeroBarsWhenGrouped){let{nonZeroColumns:p,zeroEncounters:f}=this.barHelpers.getZeroValueEncounters({i:l,j:h});p>0&&(e=this.seriesLen*e/p),d=o+e*this.visibleI,d-=e*f}else d=o+e*this.visibleI;if(this.isFunnel){let p=i??0;i=p-(this.barHelpers.getXForValue(this.series[l][h],p)-p)/2}a=this.barHelpers.getXForValue(this.series[l][h],i??0);let g=this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:i,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:l,j:h,w:c});return c.axisFlags.isXNumeric||(o=o+r),this.barHelpers.barBackground({j:h,i:l,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:g.pathTo,pathFrom:g.pathFrom,x1:i,x:a,y:o,goalX:this.barHelpers.getGoalValues("x",i,null,l,h,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,strokeWidth:r,elSeries:n}){let c=this.w,l=t.realIndex,h=t.translationsIndex,d=t.i,g=t.j,p=t.bc,f;if(c.axisFlags.isXNumeric){let m=this.getBarXForNumericXAxis({x:e,j:g,realIndex:l,barWidth:a});e=m.x,f=m.barXPosition}else if(c.config.plotOptions.bar.hideZeroBarsWhenGrouped){let{nonZeroColumns:m,zeroEncounters:b}=this.barHelpers.getZeroValueEncounters({i:d,j:g});m>0&&(a=this.seriesLen*a/m),f=e+a*this.visibleI,f-=a*b}else f=e+a*this.visibleI;s=this.barHelpers.getYForValue(this.series[d][g],o,h);let x=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:a,y1:o,y2:s,strokeWidth:r,isReversed:this.isReversed,series:this.series,realIndex:l,i:d,j:g,w:c});return c.axisFlags.isXNumeric||(e=e+i),this.barHelpers.barBackground({bc:p,j:g,i:d,x1:f-r/2-a*this.visibleI,x2:a*this.seriesLen+r/2,elSeries:n}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,o,d,g,h),barXPosition:f,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:i}){let a=this.w,o=s;return a.seriesData.seriesX[s].length||(o=a.globals.maxValsInArrayIndex),D.isNumber(a.seriesData.seriesX[o][i])&&(t=(a.seriesData.seriesX[o][i]-a.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}getPreviousPath(t,e){let s=this.w,i="M 0 0";for(let a=0;a0&&parseInt(o.realIndex,10)===parseInt(String(t),10)&&typeof s.globals.previousPaths[a].paths[e]<"u"&&(i=s.globals.previousPaths[a].paths[e].d)}return i}},cs=class extends pt{draw(t,e){let s=this.w;this.graphics=new F(this.w),this.bar=new pt(this.w,this.ctx,this.xyRatios);let i=new Z(this.w);t=i.getLogSeries(t),this.yRatio=i.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),s.config.chart.stackType==="100%"&&(t=s.globals.comboCharts?e.map(n=>s.globals.seriesPercent[n]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);let a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),o=0,r=0;for(let n=0,c=0;n1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[l][0],f=l),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let x=this.graphics.group({class:"apexcharts-series",seriesName:D.escapeString(s.seriesData.seriesNames[l]),rel:n+1,"data:realIndex":l});K.addCollapsedClassToSeries(this.w,x,l);let m=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":l}),b=this.graphics.group({class:"apexcharts-bar-goals-markers"}),v=this.initialPositions(o,r,void 0,void 0,void 0,void 0,f),{xDivision:y,yDivision:w,zeroH:A,zeroW:C}=v,L=v.barHeight,k=v.barWidth;r=v.y,o=v.x,s.globals.barHeight=L,s.globals.barWidth=k,this.barHelpers.initializeStackedXYVars(this),this.groupCtx.prevY.length===1&&this.groupCtx.prevY[0].every(S=>isNaN(S))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>A),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let S=0;S0||this.barHelpers.arrBorderRadius[l][S]==="top"&&s.seriesData.series[l][S]<0)&&(_=R),x=this.renderSeries(W(I({realIndex:l,pathFill:X.color},X.useRangeColor?{lineFill:X.color}:{}),{j:S,i:n,columnGroupIndex:d,pathFrom:M.pathFrom,pathTo:M.pathTo,strokeWidth:T,elSeries:x,x:o,y:r,series:t,barHeight:L,barWidth:k,elDataLabelsWrap:m,elGoalsMarkers:b,type:"bar",visibleSeries:d,classes:_}))}s.globals.seriesXvalues[l]=g,s.globals.seriesYvalues[l]=p,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),a.add(x)}return a}initialPositions(t,e,s,i,a,o,r){let n=this.w,c,l;if(this.isHorizontal){i=n.layout.gridHeight/n.globals.dataPoints;let d=n.config.plotOptions.bar.barHeight;String(d).indexOf("%")===-1?c=parseInt(d,10):c=i*parseInt(d,10)/100,o=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(i-c)/2}else{s=n.layout.gridWidth/n.globals.dataPoints,l=s;let d=n.config.plotOptions.bar.columnWidth;n.axisFlags.isXNumeric&&n.globals.dataPoints>1?(s=n.globals.minXDiff/this.xRatio,l=s*parseInt(this.barOptions.columnWidth,10)/100):String(d).indexOf("%")===-1?l=parseInt(d,10):l*=parseInt(d,10)/100,this.isReversed?a=this.baseLineY[r]:a=n.layout.gridHeight-this.baseLineY[r],t=n.globals.padHorizontal+(s-l)/2}let h=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:i,xDivision:s,barHeight:(c??0)/h,barWidth:(l??0)/h,zeroH:a,zeroW:o}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,columnGroupIndex:r,seriesGroup:n,yDivision:c,elSeries:l}){var h,d,g,p,f;let x=this.w,m=o+r*e,b,v=t.i,y=t.j,w=t.realIndex,A=t.translationsIndex,C=0;for(let S=0;S0){let S=i;this.groupCtx.prevXVal[L-1][y]<0?S=((h=this.series[v])==null?void 0:h[y])>=0?this.groupCtx.prevX[L-1][y]+C-(this.isReversed?C:0)*2:this.groupCtx.prevX[L-1][y]:this.groupCtx.prevXVal[L-1][y]>=0&&(S=((d=this.series[v])==null?void 0:d[y])>=0?this.groupCtx.prevX[L-1][y]:this.groupCtx.prevX[L-1][y]-C+(this.isReversed?C:0)*2),b=S}else b=i;((g=this.series[v])==null?void 0:g[y])===null?a=b:a=b+((p=this.series[v])==null?void 0:p[y])/this.invertedYRatio-(this.isReversed?((f=this.series[v])==null?void 0:f[y])/this.invertedYRatio:0)*2;let k=this.barHelpers.getBarpaths({barYPosition:m,barHeight:e,x1:b,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:n,i:v,j:y,w:x});return this.barHelpers.barBackground({j:y,i:v,y1:m,y2:e,elSeries:l}),o=o+c,{pathTo:k.pathTo,pathFrom:k.pathFrom,goalX:this.barHelpers.getGoalValues("x",i,null,v,y,A),barXPosition:b,barYPosition:m,x:a,y:o}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,columnGroupIndex:r,seriesGroup:n,elSeries:c}){var l,h,d,g,p,f,x,m,b;let v=this.w,y=t.i,w=t.j,A=t.bc,C=t.realIndex,L=t.translationsIndex;if(v.axisFlags.isXNumeric){let E=v.seriesData.seriesX[C][w];E||(E=0),e=(E-v.globals.minX)/this.xRatio-a/2*v.globals.barGroups.length}let k=e+r*a,S,T=0;for(let E=0;E0&&!v.axisFlags.isXNumeric||P>0&&v.axisFlags.isXNumeric&&v.seriesData.seriesX[C-1][w]===v.seriesData.seriesX[C][w]){let E,X,_=Math.min(this.yRatio.length+1,C+1);if(this.groupCtx.prevY[P-1]!==void 0&&this.groupCtx.prevY[P-1].length){for(let R=1;R<_;R++)if(!isNaN((l=this.groupCtx.prevY[P-R])==null?void 0:l[w])){X=this.groupCtx.prevY[P-R][w];break}}for(let R=1;R<_;R++)if(((h=this.groupCtx.prevYVal[P-R])==null?void 0:h[w])<0){E=((d=this.series[y])==null?void 0:d[w])>=0?X-T+(this.isReversed?T:0)*2:X;break}else if(((g=this.groupCtx.prevYVal[P-R])==null?void 0:g[w])>=0){E=((p=this.series[y])==null?void 0:p[w])>=0?X:X+T-(this.isReversed?T:0)*2;break}typeof E>"u"&&(E=v.layout.gridHeight),(f=this.groupCtx.prevYF[0])!=null&&f.every(R=>R===0)&&this.groupCtx.prevYF.slice(1,P).every(R=>R.every(N=>isNaN(N)))?S=o:S=E}else S=o;(x=this.series[y])!=null&&x[w]?s=S-((m=this.series[y])==null?void 0:m[w])/this.yRatio[L]+(this.isReversed?((b=this.series[y])==null?void 0:b[w])/this.yRatio[L]:0)*2:s=S;let M=this.barHelpers.getColumnPaths({barXPosition:k,barWidth:a,y1:S,y2:s,yRatio:this.yRatio[L],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:n,realIndex:t.realIndex,i:y,j:w,w:v});return this.barHelpers.barBackground({bc:A,j:w,i:y,x1:k,x2:a,elSeries:c}),{pathTo:M.pathTo,pathFrom:M.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,o,y,w,0),barXPosition:k,x:v.axisFlags.isXNumeric?e:e+i,y:s}}},oe=class extends pt{draw(t,e,s){let i=this.w,a=new F(this.w),o=i.globals.comboCharts?e:i.config.chart.type,r=new st(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&this.candlestickOptions.type==="ohlc",this.coreUtils=new Z(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);let n=a.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let c=0;c0&&(this.visibleI=this.visibleI+1);let m=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[p][0],m=p);let b=this.barHelpers.initialPositions(p),{y:v,barHeight:y,yDivision:w,zeroW:A,x:C,barWidth:L,xDivision:k,zeroH:S}=b;h=v,l=C,g.push(l+(L??0)/2);let T=a.group({class:"apexcharts-datalabels","data:realIndex":p}),P=a.group({class:"apexcharts-bar-goals-markers"});for(let M=0;M0&&g.push(l+(L??0)/2),d.push(h),X.pathTo.forEach((N,O)=>{let B=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?X.color[O]:i.globals.stroke.colors[c],G=r.fillPath({seriesNumber:p,dataPointIndex:M,color:X.color[O],value:t[c][M]});this.renderSeries({realIndex:p,pathFill:G,lineFill:B,j:M,i:c,pathFrom:X.pathFrom,pathTo:N,strokeWidth:E,elSeries:x,x:l,y:h,series:t,columnGroupIndex:f,barHeight:y,barWidth:L,elDataLabelsWrap:T,elGoalsMarkers:P,visibleSeries:this.visibleI,type:i.config.chart.type})})}i.globals.seriesXvalues[p]=g,i.globals.seriesYvalues[p]=d,n.add(x)}return n}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a,strokeWidth:o}){var r,n;let c=this.w,l=new F(this.w),h=t.i,d=t.j,{colors:g}=c.config.plotOptions.candlestick,{colors:p}=this.boxOptions,f=t.realIndex,x=E=>Array.isArray(E)?E[f]:E,m=x(g.upward),b=x(g.downward),v=this.yRatio[t.translationsIndex],y=this.getOHLCValue(f,d),w=a,A=a,C=y.o"u"||((n=this.series[h])==null?void 0:n[d])===null?(L=a,k=a):(L=a-L/v,k=a-k/v,w=a-y.h/v,A=a-y.l/v,S=a-y.m/v);let P,M=l.move(T+i/2,L);if(c.globals.previousPaths.length>0&&(M=this.getPreviousPath(f,d)),this.isOHLC){let E=T+i/2,X=a-y.o/v,_=a-y.c/v;P=[l.move(E,w)+l.line(E,A)+l.move(E,X)+l.line(T,X)+l.move(E,_)+l.line(T+i,_)]}else this.isBoxPlot?P=[l.move(T,L)+l.line(T+i/2,L)+l.line(T+i/2,w)+l.line(T+i/4,w)+l.line(T+i-i/4,w)+l.line(T+i/2,w)+l.line(T+i/2,L)+l.line(T+i,L)+l.line(T+i,S)+l.line(T,S)+l.line(T,L+o/2),l.move(T,S)+l.line(T+i,S)+l.line(T+i,k)+l.line(T+i/2,k)+l.line(T+i/2,A)+l.line(T+i-i/4,A)+l.line(T+i/4,A)+l.line(T+i/2,A)+l.line(T+i/2,k)+l.line(T,k)+l.line(T,S)+"z"]:P=[l.move(T,k)+l.line(T+i/2,k)+l.line(T+i/2,w)+l.line(T+i/2,k)+l.line(T+i,k)+l.line(T+i,L)+l.line(T+i/2,L)+l.line(T+i/2,A)+l.line(T+i/2,L)+l.line(T,L)+l.line(T,k-o/2)];return M=M+l.move(T,L),c.axisFlags.isXNumeric||(e=e+s),{pathTo:P,pathFrom:M,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,a,h,d,t.translationsIndex),barXPosition:T,color:C}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a,strokeWidth:o}){var r,n;let c=this.w,l=new F(this.w),h=t.i,d=t.j,g=t.realIndex,{colors:p}=c.config.plotOptions.candlestick,{colors:f}=this.boxOptions,x=P=>Array.isArray(P)?P[g]:P,m=this.invertedYRatio,b=this.getOHLCValue(g,d),v=b.o"u"||((n=this.series[h])==null?void 0:n[d])===null?(A=a,C=a):(A=a+A/m,C=a+C/m,y=a+b.h/m,w=a+b.l/m,L=a+b.m/m);let S=l.move(A,k+i/2);c.globals.previousPaths.length>0&&(S=this.getPreviousPath(g,d));let T=[l.move(A,k)+l.line(A,k+i/2)+l.line(y,k+i/2)+l.line(y,k+i/2-i/4)+l.line(y,k+i/2+i/4)+l.line(y,k+i/2)+l.line(A,k+i/2)+l.line(A,k+i)+l.line(L,k+i)+l.line(L,k)+l.line(A+o/2,k),l.move(L,k)+l.line(L,k+i)+l.line(C,k+i)+l.line(C,k+i/2)+l.line(w,k+i/2)+l.line(w,k+i-i/4)+l.line(w,k+i/4)+l.line(w,k+i/2)+l.line(C,k+i/2)+l.line(C,k)+l.line(L,k)+"z"];return S=S+l.move(A,k),c.axisFlags.isXNumeric||(e=e+s),{pathTo:T,pathFrom:S,x:C,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,h,d,0),barYPosition:k,color:v}}getOHLCValue(t,e){let s=this.w,i=this.coreUtils,a=h=>h[t]&&h[t][e]!=null?i.getLogValAtSeriesIndex(h[t][e],t):0,o=a(s.candleData.seriesCandleH),r=a(s.candleData.seriesCandleO),n=a(s.candleData.seriesCandleM),c=a(s.candleData.seriesCandleC),l=a(s.candleData.seriesCandleL);return{o:this.isBoxPlot?o:r,h:this.isBoxPlot?r:o,m:n,l:this.isBoxPlot?c:l,c:this.isBoxPlot?l:c}}},re=class{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){let t=this.w,e=!1,s=t.config.plotOptions[t.config.chart.type];return s.colorScale.ranges.length>0&&s.colorScale.ranges.map(i=>{i.from<=0&&(e=!0)}),e}getShadeColor(t,e,s,i){let a=this.w,o=1,r=a.config.plotOptions[t].shadeIntensity,n=this.determineColor(t,e,s);a.globals.hasNegs||i?a.config.plotOptions[t].reverseNegativeShade?n.percent<0?o=n.percent/100*(r*1.25):o=(1-n.percent/100)*(r*1.25):n.percent<=0?o=1-(1+n.percent/100)*r:o=(1-n.percent/100)*r:(o=1-n.percent/100,t==="treemap"&&(o=(1-n.percent/100)*(r*1.25)));let c=n.color,l=new D;if(a.config.plotOptions[t].enableShades)if(this.w.config.theme.mode==="dark"){let h=l.shadeColor(o*-1,n.color);c=D.hexToRgba(D.isColorHex(h)?h:D.rgb2hex(h),a.config.fill.opacity)}else{let h=l.shadeColor(o,n.color);c=D.hexToRgba(D.isColorHex(h)?h:D.rgb2hex(h),a.config.fill.opacity)}return{color:c,colorProps:n}}determineColor(t,e,s){let i=this.w,a=i.seriesData.series[e][s],o=i.config.plotOptions[t],r=o.colorScale.inverse?s:e;o.distributed&&i.config.chart.type==="treemap"&&(r=s);let n=i.globals.colors[r],c=null,l=Math.min(...i.seriesData.series[e]),h=Math.max(...i.seriesData.series[e]);!o.distributed&&t==="heatmap"&&(l=i.globals.minY,h=i.globals.maxY),typeof o.colorScale.min<"u"&&(l=o.colorScale.mini.globals.maxY?o.colorScale.max:i.globals.maxY);let d=Math.abs(h)+Math.abs(l),g=100*a/(d===0?d-1e-6:d);return o.colorScale.ranges.length>0&&o.colorScale.ranges.map(f=>{if(a>=f.from&&a<=f.to){n=f.color,c=f.foreColor?f.foreColor:null,l=f.from,h=f.to;let x=Math.abs(h)+Math.abs(l);g=100*a/(x===0?x-1e-6:x)}}),{color:n,foreColor:c,percent:g}}calculateDataLabels({text:t,x:e,y:s,i,j:a,colorProps:o,fontSize:r}){let c=this.w.config.dataLabels,l=new F(this.w),h=new ct(this.w,this.ctx),d=null;if(c.enabled){d=l.group({class:"apexcharts-data-labels"});let g=c.offsetX,p=c.offsetY,f=e+g,x=s+parseFloat(c.style.fontSize)/3+p;h.plotDataLabelsText({x:f,y:x,text:t,i,j:a,color:o.foreColor,parent:d,fontSize:r,dataLabelsConfig:c})}return d}},hs=class{constructor(t,e,s){this.ctx=e,this.w=t,this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new re(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){let e=this.w,s=new F(this.w,this.ctx),i=s.group({class:"apexcharts-heatmap"});i.attr("clip-path",`url(#gridRectMask${e.globals.cuid})`);let a=e.layout.gridWidth/e.globals.dataPoints,o=e.layout.gridHeight/e.seriesData.series.length,r=0,n=!1;this.negRange=this.helpers.checkColorRange();let c=t.slice();e.config.yaxis[0].reversed&&(n=!0,c.reverse());for(let h=n?0:c.length-1;n?h=0;n?h++:h--){let d=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:D.escapeString(e.seriesData.seriesNames[h]),rel:h+1,"data:realIndex":h});if(K.addCollapsedClassToSeries(this.w,d,h),s.setupEventDelegation(d,".apexcharts-heatmap-rect"),e.config.chart.dropShadow.enabled){let x=e.config.chart.dropShadow;new J(this.w).dropShadow(d,x,h)}let g=0,p=e.config.plotOptions.heatmap.shadeIntensity,f=0;for(let x=0;x=c[h].length)break;let m=this.helpers.getShadeColor(e.config.chart.type,h,f,this.negRange),b=m.color,v=m.colorProps;e.config.fill.type==="image"&&(b=new st(this.w).fillPath({seriesNumber:h,dataPointIndex:f,opacity:e.globals.hasNegs?v.percent<0?1-(1+v.percent/100):p+v.percent/100:v.percent/100,patternID:D.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:a,height:e.config.fill.image.height?e.config.fill.image.height:o}));let y=this.rectRadius,w=s.drawRect(g,r,a,o,y);if(w.attr({cx:g,cy:r}),w.node.classList.add("apexcharts-heatmap-rect"),d.add(w),w.attr({fill:b,i:h,index:h,j:f,val:t[h][f],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?b:e.globals.stroke.colors[0],color:b}),e.config.chart.animations.enabled&&!e.globals.dataChanged){let k=1;e.globals.resized||(k=e.config.chart.animations.speed),this.animateHeatMap(w,g,r,a,o,k)}if(e.globals.dataChanged){let k=1;if(this.dynamicAnim.enabled&&e.globals.shouldAnimate){k=this.dynamicAnim.speed;let S=e.globals.previousPaths[h]&&e.globals.previousPaths[h][f]&&e.globals.previousPaths[h][f].color;S||(S="rgba(255, 255, 255, 0)"),this.animateHeatColor(w,D.isColorHex(S)?S:D.rgb2hex(S),D.isColorHex(b)?b:D.rgb2hex(b),k)}}let A=e.config.dataLabels.formatter,C=A(e.seriesData.series[h][f],{value:e.seriesData.series[h][f],seriesIndex:h,dataPointIndex:f,w:e}),L=this.helpers.calculateDataLabels({text:C,x:g+a/2,y:r+o/2,i:h,j:f,colorProps:v,series:c});L!==null&&d.add(L),g=g+a,f++}r=r+o,i.add(d)}let l=e.globals.yAxisScale[0].result.slice();return e.config.yaxis[0].reversed?l.unshift(""):l.push(""),e.globals.yAxisScale[0].result=l,i}animateHeatMap(t,e,s,i,a,o){let r=new ft(this.w);r.animateRect(t,{x:e+i/2,y:s+a/2,width:0,height:0},{x:e,y:s,width:i,height:a},o,()=>{r.animationCompleted(t)})}animateHeatColor(t,e,s,i){t.attr({fill:e}).animate(i).attr({fill:s})}},ds=class{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e){let s=this.w;if((s.config.fill.type==="gradient"||s.config.fill.type[t]==="gradient")&&new Z(this.lineCtx.w).seriesHaveSameValues(t)){let a=e[t].slice();a[a.length-1]=a[a.length-1]+1e-6,e[t]=a}return e}calculatePoints({series:t,realIndex:e,x:s,y:i,i:a,j:o,prevY:r}){let n=this.w,c=[],l=[],h=this.lineCtx.categoryAxisCorrection+n.config.markers.offsetX;return n.axisFlags.isXNumeric&&(h=(n.seriesData.seriesX[e][0]-n.globals.minX)/this.lineCtx.xRatio+n.config.markers.offsetX),o===0&&(c.push(h),l.push(D.isNumber(t[a][0])?r+n.config.markers.offsetY:null)),c.push(s+n.config.markers.offsetX),l.push(D.isNumber(t[a][o+1])?i+n.config.markers.offsetY:null),{x:c,y:l}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:s}){let i=this.w;for(let a=0;a0&&parseInt(o.realIndex,10)===parseInt(s,10)&&(o.type==="line"?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):o.type==="area"&&(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[a].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[a].paths[1]&&(t=i.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:e}}determineFirstPrevY({i:t,realIndex:e,series:s,prevY:i,lineYPosition:a,translationsIndex:o}){var r,n,c;let l=this.w,h=l.config.chart.stacked&&!l.globals.comboCharts||l.config.chart.stacked&&l.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((r=this.w.config.series[e])==null?void 0:r.type)==="bar"||((n=this.w.config.series[e])==null?void 0:n.type)==="column");if(typeof((c=s[t])==null?void 0:c[0])<"u")h?t>0?a=this.lineCtx.prevSeriesY[t-1][0]:a=this.lineCtx.zeroY:a=this.lineCtx.zeroY,i=a-s[t][0]/this.lineCtx.yRatio[o]+(this.lineCtx.isReversed?s[t][0]/this.lineCtx.yRatio[o]:0)*2;else if(h&&t>0&&typeof s[t][0]>"u"){for(let d=t-1;d>=0;d--)if(s[d][0]!==null&&typeof s[d][0]<"u"){a=this.lineCtx.prevSeriesY[d][0],i=a;break}}return{prevY:i,lineYPosition:a}}},ra=u=>{let t=la(u),e=u.length-1,s=1e-6,i=[],a,o,r,n;for(let c=0;c9&&(n=r*3/Math.sqrt(n),t[c]=n*a,t[c+1]=n*o));for(let c=0;c<=e;c++)n=(u[Math.min(e,c+1)][0]-u[Math.max(0,c-1)][0])/(6*(1+t[c]*t[c])),i.push([n||0,t[c]*n||0]);return i},na=u=>{let t="";for(let e=0;e4?(t+=`C${s[0]}, ${s[1]}`,t+=`, ${s[2]}, ${s[3]}`,t+=`, ${s[4]}, ${s[5]}`):i>2&&(t+=`S${s[0]}, ${s[1]}`,t+=`, ${s[2]}, ${s[3]}`)}return t},_s={points(u){let t=ra(u),e=u[1],s=u[0],i=[],a=t[1],o=t[0];i.push(s,[s[0]+o[0],s[1]+o[1],e[0]-a[0],e[1]-a[1],e[0],e[1]]);for(let r=2,n=t.length;r1&&s[1].length<6){let i=s[0].length;s[1]=[s[0][i-2]*2-s[0][i-4],s[0][i-1]*2-s[0][i-3]].concat(s[1])}s[0]=s[0].slice(-2)}return s}};function fs(u,t){return(t[1]-u[1])/(t[0]-u[0])}function la(u){let t=[],e=u[0],s=u[1],i=t[0]=fs(e,s),a=1;for(let o=u.length-1;a1?g:0;this._initSerieVariables(t,d,g);let f=[],x=[],m=[],b=o.globals.padHorizontal+this.categoryAxisCorrection,v=1,y=[],w=[];K.addCollapsedClassToSeries(this.w,this.elSeries,g),o.axisFlags.isXNumeric&&o.seriesData.seriesX.length>0&&(b=(o.seriesData.seriesX[g][0]-o.globals.minX)/this.xRatio),m.push(b);let A=b,C,L=A,k=this.zeroY,S=this.zeroY,T=0;k=this.lineHelpers.determineFirstPrevY({i:d,realIndex:g,series:t,prevY:k,lineYPosition:T,translationsIndex:p}).prevY,o.config.stroke.curve==="monotoneCubic"&&t[d][0]===null?f.push(null):f.push(k);let M=k,E;n==="rangeArea"&&(E=this.lineHelpers.determineFirstPrevY({i:d,realIndex:g,series:i,prevY:S,lineYPosition:T,translationsIndex:p}),S=E.prevY,C=S,x.push(f[0]!==null?S:null));let X=this._calculatePathsFrom({type:n,series:t,i:d,realIndex:g,translationsIndex:p,prevX:L,prevY:k,prevY2:S}),_=[f[0]],R=[x[0]],N={type:n,series:t,realIndex:g,translationsIndex:p,i:d,x:b,y:v,pX:A,pY:M,pathsFrom:X,linePaths:y,areaPaths:w,seriesIndex:s,lineYPosition:T,xArrj:m,yArrj:f,y2Arrj:x,seriesRangeEnd:i},O=this._iterateOverDataPoints(W(I({},N),{iterations:n==="rangeArea"?t[d].length-1:void 0,isRangeStart:!0}));if(n==="rangeArea"){let B=this._calculatePathsFrom({series:i,i:d,realIndex:g,prevX:L,prevY:S}),G=this._iterateOverDataPoints(W(I({},N),{series:i,xArrj:[b],yArrj:_,y2Arrj:R,pY:C,areaPaths:O.areaPaths,pathsFrom:B,iterations:i[d].length-1,isRangeStart:!1})),H=O.linePaths.length/2;for(let q=0;qNumber(d.node.getAttribute("zIndex"))-Number(g.node.getAttribute("zIndex"))),o.config.chart.stacked)for(let d=h.length-1;d>=0;d--)c.add(h[d]);else for(let d=0;d1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],o=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[o]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?this.baseLineY[o]*2:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||i.config.plotOptions.area.fillTo==="end")&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;let r=i.config.series[s];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:typeof r.zIndex<"u"?r.zIndex:s,seriesName:D.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),i.globals.hasNullValues){let c=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});c!==null&&this.elPointsMain.add(c)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":s});let n=t[e].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":n,rel:e+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:s,realIndex:i,translationsIndex:a,prevX:o,prevY:r,prevY2:n}){let c=this.w,l=new F(this.w),h,d,g,p;if(e[s][0]===null){for(let f=0;f0){let f=this.lineHelpers.checkPreviousPaths({pathFromLine:g,pathFromArea:p,realIndex:i});g=f.pathFromLine,p=f.pathFromArea}return{prevX:o,prevY:r,linePath:h,areaPath:d,pathFromLine:g,pathFromArea:p}}_handlePaths({type:t,realIndex:e,i:s,paths:i}){let a=this.w,o=new F(this.w),r=new st(this.w);this.prevSeriesY.push(i.yArrj),a.globals.seriesXvalues[e]=i.xArrj,a.globals.seriesYvalues[e]=i.yArrj;let n=a.config.forecastDataPoints;if(n.count>0&&t!=="rangeArea"){let l=a.globals.seriesXvalues[e][a.globals.seriesXvalues[e].length-n.count-1],h=o.drawRect(l,0,a.layout.gridWidth,a.layout.gridHeight,0);a.dom.elForecastMask.appendChild(h.node);let d=o.drawRect(0,0,l,a.layout.gridHeight,0);a.dom.elNonForecastMask.appendChild(d.node)}this.pointsChart||a.globals.delayedElements.push({el:this.elPointsMain.node,index:e});let c={i:s,realIndex:e,animationDelay:s,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`};if(t==="area"){let l=r.fillPath({seriesNumber:e});for(let h=0;h0&&t!=="rangeArea"){let f=o.renderPaths(g);f.node.setAttribute("stroke-dasharray",n.dashArray),n.strokeWidth&&f.node.setAttribute("stroke-width",n.strokeWidth),this.elSeries.add(f),f.attr("clip-path",`url(#forecastMask${a.globals.cuid})`),p.attr("clip-path",`url(#nonForecastMask${a.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:s,realIndex:i,translationsIndex:a,i:o,x:r,y:n,pX:c,pY:l,pathsFrom:h,linePaths:d,areaPaths:g,seriesIndex:p,lineYPosition:f,xArrj:x,yArrj:m,y2Arrj:b,isRangeStart:v,seriesRangeEnd:y}){var w,A;let C=this.w,L=new F(this.w),k=this.yRatio,{prevY:S,linePath:T,areaPath:P,pathFromLine:M,pathFromArea:E}=h,X=D.isNumber(C.globals.minYArr[i])?C.globals.minYArr[i]:C.globals.minY;s||(s=C.globals.dataPoints>1?C.globals.dataPoints-1:C.globals.dataPoints);let _=(H,q)=>q-H/k[a]+(this.isReversed?H/k[a]:0)*2,R=n,N=C.config.chart.stacked&&!C.globals.comboCharts||C.config.chart.stacked&&C.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((w=this.w.config.series[i])==null?void 0:w.type)==="bar"||((A=this.w.config.series[i])==null?void 0:A.type)==="column"),O=C.config.stroke.curve;Array.isArray(O)&&(Array.isArray(p)?O=O[p[o]]:O=O[o]);let B=0,G;for(let H=0;H"u"||e[o][H+1]===null;if(C.axisFlags.isXNumeric){let ut=C.seriesData.seriesX[i][H+1];typeof C.seriesData.seriesX[i][H+1]>"u"&&(ut=C.seriesData.seriesX[i][s-1]),r=(ut-C.globals.minX)/this.xRatio}else r=r+this.xDivision;if(N)if(o>0&&C.globals.collapsedSeries.length{for(let ot=Xt;ot>0;ot--)if(C.globals.collapsedSeriesIndices.indexOf(p?.[ot]||ot)>-1)ot--;else return ot;return 0};f=this.prevSeriesY[ut(o-1)][H+1]}else f=this.zeroY;else f=this.zeroY;q?n=_(X,f):(n=_(e[o][H+1],f),t==="rangeArea"&&(R=_(y[o][H+1],f))),x.push(e[o][H+1]===null?null:r),q&&(C.config.stroke.curve==="smooth"||C.config.stroke.curve==="monotoneCubic")?(m.push(null),b.push(null)):(m.push(n),b.push(R));let Ft=this.lineHelpers.calculatePoints({series:e,x:r,y:n,realIndex:i,i:o,j:H,prevY:S}),it=this._createPaths({type:t,series:e,i:o,j:H,x:r,y:n,y2:R,xArrj:x,yArrj:m,y2Arrj:b,pX:c,pY:l,pathState:B,segmentStartX:G,linePath:T,areaPath:P,linePaths:d,areaPaths:g,curve:O,isRangeStart:v});g=it.areaPaths,d=it.linePaths,c=it.pX,l=it.pY,B=it.pathState,G=it.segmentStartX,P=it.areaPath,T=it.linePath,this.appendPathFrom&&!C.globals.hasNullValues&&!(O==="monotoneCubic"&&t==="rangeArea")&&(M+=L.line(r,this.areaBottomY),E+=L.line(r,this.areaBottomY)),this.handleNullDataPoints(e,Ft,o,H,i),this._handleMarkersAndLabels({type:t,pointsPos:Ft,i:o,j:H,realIndex:i,isRangeStart:v})}return{yArrj:m,xArrj:x,pathFromArea:E,areaPaths:g,pathFromLine:M,linePaths:d,linePath:T,areaPath:P}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:s,i,j:a,realIndex:o}){let r=this.w,n=new ct(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:o,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{r.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");let l=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:o,j:a+1});l!==null&&this.elPointsMain.add(l)}let c=n.drawDataLabel({type:t,isRangeStart:s,pos:e,i:o,j:a+1});c!==null&&this.elDataLabelsWrap.add(c)}_createPaths({type:t,series:e,i:s,j:i,x:a,y:o,xArrj:r,yArrj:n,y2:c,y2Arrj:l,pX:h,pY:d,pathState:g,segmentStartX:p,linePath:f,areaPath:x,linePaths:m,areaPaths:b,curve:v,isRangeStart:y}){let w=new F(this.w),A=this.areaBottomY,C=t==="rangeArea",L=t==="rangeArea"&&y;switch(v){case"monotoneCubic":{let k=y?n:l,S=(M,E)=>M.map((X,_)=>[X,E[_]]).filter(X=>X[1]!==null),T=M=>{let E=[],X=0;return M.forEach(_=>{_!==null?X++:X>0&&(E.push(X),X=0)}),X>0&&E.push(X),E},P=(M,E)=>{let X=T(M),_=[];for(let R=0,N=0;R1?_s.points(X):X,R=[];C&&(L?b=X:R=b.reverse());let N=0,O=0;if(P(E,_).forEach(B=>{N++;let G=na(B),H=O;O+=B.length;let q=O-1;L?f=w.move(X[H][0],X[H][1])+G:C?f=w.move(R[H][0],R[H][1])+w.line(X[H][0],X[H][1])+G+w.line(R[q][0],R[q][1]):(f=w.move(X[H][0],X[H][1])+G,x=f+w.line(X[q][0],A)+w.line(X[H][0],A)+"z",b.push(x)),m.push(f)}),C&&N>1&&!L){let B=m.slice(N).reverse();m.splice(N),B.forEach(G=>m.push(G))}g=0;break}}break}case"smooth":{let k=(a-h)*.35;if(e[s][i]===null)g=0;else switch(g){case 0:if(p=h,L?f=w.move(h,l[i])+w.line(h,d):f=w.move(h,d),x=w.move(h,d),e[s][i+1]===null||typeof e[s][i+1]>"u"){m.push(f),b.push(x);break}if(g=1,i=e[s].length-2&&(L&&(f+=w.curve(a,o,a,o,a,c)+w.move(a,c)),x+=w.curve(a,o,a,o,a,A)+w.line(p,A)+"z",m.push(f),b.push(x),g=-1)}break}h=a,d=o;break}default:{let k=(S,T,P)=>{let M="";switch(S){case"stepline":M=w.line(T,null,"H")+w.line(null,P,"V");break;case"linestep":M=w.line(null,P,"V")+w.line(T,null,"H");break;case"straight":M=w.line(T,P);break}return M};if(e[s][i]===null)g=0;else switch(g){case 0:if(p=h,L?f=w.move(h,l[i])+w.line(h,d):f=w.move(h,d),x=w.move(h,d),e[s][i+1]===null||typeof e[s][i+1]>"u"){m.push(f),b.push(x);break}if(g=1,i=e[s].length-2&&(L&&(f+=w.line(a,c)),x+=w.line(a,A)+w.line(p,A)+"z",m.push(f),b.push(x),g=-1)}break}h=a,d=o;break}}return{linePaths:m,areaPaths:b,pX:h,pY:d,pathState:g,segmentStartX:p,linePath:f,areaPath:x}}handleNullDataPoints(t,e,s,i,a){let o=this.w;if(t[s][i]===null&&o.config.markers.showNullDataPoints||t[s].length===1){let r=this.strokeWidth-o.config.markers.strokeWidth/2;r>0||(r=0);let n=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:i+1,pSize:r,alwaysDrawMarker:!0});n!==null&&this.elPointsMain.add(n)}}},ne=class{constructor(t){this.w=t}drawYAxisTexts(t,e,s,i){let a=this.w,o=a.config.yaxis[0],r=a.formatters.yLabelFormatters[0];return new F(this.w).drawText({x:t+o.labels.offsetX,y:e+o.labels.offsetY,text:r(i,s),textAnchor:"middle",fontSize:o.labels.style.fontSize,fontFamily:o.labels.style.fontFamily,foreColor:Array.isArray(o.labels.style.colors)?o.labels.style.colors[s]:o.labels.style.colors})}},Dt=class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=t.globals.stroke.colors!==void 0?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=this.defaultSize/2,this.centerX=t.layout.gridWidth/2,t.config.chart.type==="radialBar"?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;let s=t.config.plotOptions.pie.customScale,i=t.layout.gridWidth/2,a=t.layout.gridHeight/2;this.translateX=i-i*s,this.translateY=a-a*s,this.dataLabelsGroup=new F(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}draw(t){let e=this,s=this.w,i=new F(this.w),a=i.group({class:"apexcharts-pie"});if(s.globals.noData)return a;let o=0;for(let l=0;l{this.maxY=Math.max(this.maxY,l)}),s.config.yaxis[0].max&&(this.maxY=s.config.yaxis[0].max),s.config.grid.position==="back"&&this.chartType==="polarArea"&&this.drawPolarElements(a);for(let l=0;l{c.add(l)}),n.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${s.config.plotOptions.pie.customScale})`}),n.add(c),a.add(n),this.donutDataLabels.show){let l=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});a.add(l)}return s.config.grid.position==="front"&&this.chartType==="polarArea"&&this.drawPolarElements(a),a}drawArcs(t,e){let s=this.w,i=new J(this.w),a=new F(this.w),o=new st(this.w),r=a.group({class:"apexcharts-slices"}),n=this.initialAngle,c=this.initialAngle,l=this.initialAngle,h=this.initialAngle;this.strokeWidth=s.config.stroke.show?s.config.stroke.width:0;for(let d=0;d-1&&this.pieClicked(d),s.config.dataLabels.enabled){let A=b.x,C=b.y,L=100*p/this.fullAngle+"%";if(p!==0&&s.config.plotOptions.pie.dataLabels.minAngleToShowLabelthis.fullAngle?e.endAngle=e.endAngle-(a+n):a+n{d=p+(i-p)*f,o.animateStartingPos&&(d=a+(i-a)*f,g=e-a+(s-(e-a))*f),h=r.getPiePath({me:r,startAngle:g,angle:d,size:l}),t.node.setAttribute("data:pathOrig",h),t.attr({d:h})}):(h=r.getPiePath({me:r,startAngle:g,angle:i,size:l}),o.isTrack||(n.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",h),t.attr({d:h,"stroke-width":r.strokeWidth}))}pieClicked(t){let e=this.w,s=this,i=s.sliceSizes[t]+(e.config.plotOptions.pie.expandOnClick?4:0),a=e.dom.Paper.findOne(`.apexcharts-${s.chartType.toLowerCase()}-slice-${t}`);if(a.attr("data:pieClicked")==="true"){a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner();let c=a.attr("data:pathOrig");a.attr({d:c});return}else{let c=e.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(c,l=>{l.setAttribute("data:pieClicked","false");let h=l.getAttribute("data:pathOrig");h&&l.setAttribute("d",h)}),e.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true")}let o=parseInt(a.attr("data:startAngle"),10),r=parseInt(a.attr("data:angle"),10),n=s.getPiePath({me:s,startAngle:o,angle:r,size:i});r!==360&&a.plot(n)}getChangedPath(t,e){let s="";return this.dynamicAnim&&this.w.globals.dataChanged&&(s=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),s}getPiePath({me:t,startAngle:e,angle:s,size:i}){let a,o=new F(this.w),r=e,n=Math.PI*(r-90)/180,c=s+e;Math.ceil(c)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(c=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(c)>this.fullAngle&&(c-=this.fullAngle);let l=Math.PI*(c-90)/180,h=t.centerX+i*Math.cos(n),d=t.centerY+i*Math.sin(n),g=t.centerX+i*Math.cos(l),p=t.centerY+i*Math.sin(l),f=D.polarToCartesian(t.centerX,t.centerY,t.donutSize,c),x=D.polarToCartesian(t.centerX,t.centerY,t.donutSize,r),m=s>180?1:0,b=["M",h,d,"A",i,i,0,m,1,g,p];return t.chartType==="donut"?a=[...b,"L",f.x,f.y,"A",t.donutSize,t.donutSize,0,m,0,x.x,x.y,"L",h,d,"z"].join(" "):t.chartType==="pie"||t.chartType==="polarArea"?a=[...b,"L",t.centerX,t.centerY,"L",h,d].join(" "):a=[...b].join(" "),o.roundPathCorners(a,this.strokeWidth*2)}drawPolarElements(t){let e=this.w,s=new Jt(this.w),i=new F(this.w),a=new ne(this.w),o=i.group(),r=i.group(),n=s.niceScale(0,Math.ceil(this.maxY),0),c=n.result.reverse(),l=n.result.length;this.maxY=n.niceMax;let h=e.globals.radialSize,d=h/(l-1);for(let g=0;g1&&t.total.show&&(o=t.total.color);let r=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),n=a.dom.baseEl.querySelector(".apexcharts-datalabel-value"),c=t.value.formatter;s=c(s,a),!i&&typeof t.total.formatter=="function"&&(s=t.total.formatter(a));let l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",r!==null&&(r.textContent=e),n!==null&&(n.textContent=s),r!==null){let h=r;h.style.fill=o}}printDataLabelsInner(t,e){let s=this.w,i=t.getAttribute("data:value"),a=s.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];s.seriesData.series.length>1&&this.printInnerLabels(e,a,i,t);let o=s.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(o!==null){let r=o;r.style.opacity="1"}}drawSpokes(t){let e=this.w,s=new F(this.w),i=e.config.plotOptions.polarArea.spokes;if(i.strokeWidth===0)return;let a=[],o=360/e.seriesData.series.length;for(let r=0;r{let c=s.drawLine(r.x,r.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[n]:i.connectorColors);t.add(c)})}revertDataLabelsInner(){let t=this.w;if(this.donutDataLabels.show){let e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),s=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(s)}}},gs=class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new F(this.w),this.lineColorArr=t.globals.stroke.colors!==void 0?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight{let x=p.length===e.globals.dataPoints,m=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":x,seriesName:D.escapeString(e.seriesData.seriesNames[f]),rel:f+1,"data:realIndex":f});this.dataRadiusOfPercent[f]=[],this.dataRadius[f]=[],this.angleArr[f]=[],p.forEach((w,A)=>{let C=Math.abs(this.maxValue-this.minValue);w=w-this.minValue,this.isLog&&(w=this.coreUtils.getLogVal(this.logBase,w,0)),this.dataRadiusOfPercent[f][A]=w/C,this.dataRadius[f][A]=this.dataRadiusOfPercent[f][A]*this.size,this.angleArr[f][A]=A*this.disAngle}),h=this.getDataPointsPos(this.dataRadius[f],this.angleArr[f]);let b=this.createPaths(h,{x:0,y:0});d=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),g=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":f}),e.globals.delayedElements.push({el:d.node,index:f});let v={i:f,realIndex:f,animationDelay:f,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[f],strokeLineCap:e.config.stroke.lineCap},y=null;e.globals.previousPaths.length>0&&(y=this.getPreviousPath(f));for(let w=0;w{let L=new gt(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:f,dataPointIndex:A}),k=this.graphics.drawMarker(h[A].x,h[A].y,L);k.attr("rel",A),k.attr("j",A),k.attr("index",f),k.node.setAttribute("default-marker-size",L.pSize);let S=this.graphics.group({class:"apexcharts-series-markers"});S&&S.add(k),d.add(S),m.add(d);let T=e.config.dataLabels;if(T.enabled){let P=T.formatter(e.seriesData.series[f][A],{seriesIndex:f,dataPointIndex:A,w:e});a.plotDataLabelsText({x:h[A].x,y:h[A].y,text:P,textAnchor:"middle",i:f,j:f,parent:g,offsetCorrection:!1,dataLabelsConfig:I({},T)})}m.add(g)}),i.push(m)}),this.drawPolygons({parent:l}),e.config.xaxis.labels.show){let p=this.drawXAxisTexts();l.add(p)}return i.forEach(p=>{l.add(p)}),l.add(this.yaxisLabels),l}drawPolygons(t){let e=this.w,{parent:s}=t,i=new ne(this.w),a=e.globals.yAxisScale[0].result.reverse(),o=a.length,r=[],n=this.size/(o-1);for(let h=0;h{let g=D.getPolygonPos(h,this.dataPointsLen),p="";g.forEach((f,x)=>{if(d===0){let m=this.graphics.drawLine(f.x,f.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[x]:this.polygons.connectorColors);l.push(m)}x===0&&this.yaxisLabelsTextsPos.push({x:f.x,y:f.y}),p+=f.x+","+f.y+" "}),c.push(p)}),c.forEach((h,d)=>{let g=this.polygons.strokeColors,p=this.polygons.strokeWidth,f=this.graphics.drawPolygon(h,Array.isArray(g)?g[d]:g,Array.isArray(p)?p[d]:p,e.globals.radarPolygons.fill.colors[d]);s.add(f)}),l.forEach(h=>{s.add(h)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((h,d)=>{let g=i.drawYAxisTexts(h.x,h.y,d,a[d]);this.yaxisLabels.add(g)})}drawXAxisTexts(){let t=this.w,e=t.config.xaxis.labels,s=this.graphics.group({class:"apexcharts-xaxis"}),i=D.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((a,o)=>{let r=t.config.xaxis.labels.formatter,n=new ct(this.w,this.ctx);if(i[o]){let c=this.getTextPos(i[o],this.size),l=r(a,{seriesIndex:-1,dataPointIndex:o,w:t});n.plotDataLabelsText({x:c.newX,y:c.newY,text:l,textAnchor:c.textAnchor,i:o,j:o,parent:s,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[o]?e.style.colors[o]:"#a8a8a8",dataLabelsConfig:I({textAnchor:c.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",d=>{if(typeof t.config.chart.events.xAxisLabelClick=="function"){let g=Object.assign({},t,{labelIndex:o});t.config.chart.events.xAxisLabelClick(d,this.ctx,g)}})}}),s}createPaths(t,e){let s=[],i=[],a=[],o=[];if(t.length){i=[this.graphics.move(e.x,e.y)],o=[this.graphics.move(e.x,e.y)];let r=this.graphics.move(t[0].x,t[0].y),n=this.graphics.move(t[0].x,t[0].y);t.forEach((c,l)=>{r+=this.graphics.line(c.x,c.y),n+=this.graphics.line(c.x,c.y),l===t.length-1&&(r+="Z",n+="Z")}),s.push(r),a.push(n)}return{linePathsFrom:i,linePathsTo:s,areaPathsFrom:o,areaPathsTo:a}}getTextPos(t,e){let i="middle",a=t.x,o=t.y;return Math.abs(t.x)>=10?t.x>0?(i="start",a+=10):t.x<0&&(i="end",a-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?o-=10:t.y>0&&(o+=10)),{textAnchor:i,newX:a,newY:o}}getPreviousPath(t){let e=this.w,s=null;for(let i=0;i0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&typeof e.globals.previousPaths[i].paths[0]<"u"&&(s=e.globals.previousPaths[i].paths[0].d)}return s}getDataPointsPos(t,e,s=this.dataPointsLen){t=t||[],e=e||[];let i=[];for(let a=0;a=360&&(g=360-Math.abs(this.startAngle)-.1);let p=s.drawPath({d:"",stroke:h,strokeWidth:r*parseInt(l.strokeWidth,10)/100,fill:"none",strokeOpacity:l.opacity,classes:"apexcharts-radialbar-area"});if(l.dropShadow.enabled){let f=l.dropShadow;a.dropShadow(p,f)}c.add(p),p.attr("id","apexcharts-radialbarTrack-"+n),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:n,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(t){let e=this.w,s=new F(this.w),i=new st(this.w),a=new J(this.w),o=s.group(),r=this.getStrokeWidth(t);t.size=t.size-r/2;let n=e.config.plotOptions.radialBar.hollow.background,c=t.size-r*t.series.length-this.margin*t.series.length-r*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,l=c-e.config.plotOptions.radialBar.hollow.margin;e.config.plotOptions.radialBar.hollow.image!==void 0&&(n=this.drawHollowImage(t,o,c,n));let h=this.drawHollow({size:l,centerX:t.centerX,centerY:t.centerY,fill:n||"transparent"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){let f=e.config.plotOptions.radialBar.hollow.dropShadow;a.dropShadow(h,f)}let d=1;!this.radialDataLabels.total.show&&e.seriesData.series.length>1&&(d=0);let g=null;if(this.radialDataLabels.show){let f=e.dom.Paper.findOne(".apexcharts-datalabels-group");g=this.renderInnerDataLabels(f,this.radialDataLabels,{hollowSize:c,centerX:t.centerX,centerY:t.centerY,opacity:d})}e.config.plotOptions.radialBar.hollow.position==="back"&&(o.add(h),g&&o.add(g));let p=!1;e.config.plotOptions.radialBar.inverseOrder&&(p=!0);for(let f=p?t.series.length-1:0;p?f>=0:f100?100:t.series[f])/100,w=Math.round(this.totalAngle*y)+this.startAngle,A;e.globals.dataChanged&&(v=this.startAngle,A=Math.round(this.totalAngle*D.negToZero(e.globals.previousPaths[f])/100)+v),Math.abs(w)+Math.abs(b)>360&&(w=w-.01),Math.abs(A)+Math.abs(v)>360&&(A=A-.01);let k=w-b,S=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[f]:e.config.stroke.dashArray,T=s.drawPath({d:"",stroke:m,strokeWidth:r,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+f,strokeDashArray:S}),P=b+k/2,M=D.polarToCartesian(t.centerX,t.centerY,t.size,P);if(F.setAttrs(T.node,{"data:angle":k,"data:value":t.series[f],"data:cx":M.x,"data:cy":M.y}),e.config.chart.dropShadow.enabled){let X=e.config.chart.dropShadow;a.dropShadow(T,X,f)}if(a.setSelectionFilter(T,0,f),this.addListeners(T,this.radialDataLabels),x.add(T),T.attr({index:0,j:f}),this.barLabels.enabled){let X=D.polarToCartesian(t.centerX,t.centerY,t.size,b),_=this.barLabels.formatter(e.seriesData.seriesNames[f],{seriesIndex:f,w:e}),R=["apexcharts-radialbar-label"];this.barLabels.onClick||R.push("apexcharts-no-click");let N=this.barLabels.useSeriesColors?e.globals.colors[f]:e.config.chart.foreColor;N||(N=e.config.chart.foreColor);let O=X.x+this.barLabels.offsetX,B=X.y+this.barLabels.offsetY,G=s.drawText({x:O,y:B,text:_,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:N,cssClass:R.join(" ")});G.on("click",this.onBarLabelClick),G.attr({rel:f+1}),b!==0&&G.attr({"transform-origin":`${O} ${B}`,transform:`rotate(${b} 0 0)`}),x.add(G)}let E=0;this.initialAnim&&!e.globals.resized&&!e.globals.dataChanged&&(E=e.config.chart.animations.speed),e.globals.dataChanged&&(E=e.config.chart.animations.dynamicAnimation.speed),this.animDur=E/(t.series.length*1.2)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(T,{centerX:t.centerX,centerY:t.centerY,endAngle:w,startAngle:b,prevEndAngle:A,prevStartAngle:v,size:t.size,i:f,totalItems:2,animBeginArr:this.animBeginArr,dur:E,shouldSetPrevPaths:!0})}return{g:o,elHollow:h,dataLabels:g}}drawHollow(t){let s=new F(this.w).drawCircle(t.size*2);return s.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),s}drawHollowImage(t,e,s,i){let a=this.w,o=new st(this.w),r=D.randomId(),n=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)o.clippedImgArea({width:s,height:s,image:n,patternID:`pattern${a.globals.cuid}${r}`}),i=`url(#pattern${a.globals.cuid}${r})`;else{let c=a.config.plotOptions.radialBar.hollow.imageWidth,l=a.config.plotOptions.radialBar.hollow.imageHeight;if(c===void 0&&l===void 0){let h=a.dom.Paper.image(n,function(d){this.move(t.centerX-d.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-d.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(h)}else{let h=a.dom.Paper.image(n,function(){this.move(t.centerX-c/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-l/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(c,l)});e.add(h)}}return i}getStrokeWidth(t){let e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;let s=t.target,i=parseInt((e=s.getAttribute("rel"))!=null?e:"",10)-1,a=this.barLabels.onClick,o=this.w;a&&a(o.seriesData.seriesNames[i],{w:o,seriesIndex:i})}},us=class extends pt{draw(t,e){var s,i,a,o,r,n,c,l,h;let d=this.w,g=new F(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=d.rangeData.seriesRangeStart,this.seriesRangeEnd=d.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);let p=g.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let f=0;f0&&(this.visibleI=this.visibleI+1);let w=0;this.yRatio.length>1&&(this.yaxisIndex=d.globals.seriesYAxisReverseMap[b][0],w=b);let A=this.barHelpers.initialPositions(b),{y:C,zeroW:L,x:k,zeroH:S}=A,T=(s=A.barWidth)!=null?s:0,P=(i=A.barHeight)!=null?i:0,M=(a=A.yDivision)!=null?a:0,E=(o=A.xDivision)!=null?o:0;m=C,x=k;let X=g.group({class:"apexcharts-datalabels","data:realIndex":b}),_=g.group({class:"apexcharts-rangebar-goals-markers"});for(let R=0;R"u")break;if(this.isHorizontal){q=m+P*this.visibleI;let ot=(M-P*it)/2;if((c=(n=d.config.series[f].data)==null?void 0:n[R])!=null&&c.x){let Rt=this.detectOverlappingBars({i:f,j:R,barYPosition:q,srty:ot,barHeight:P,yDivision:M,initPositions:A});P=Rt.barHeight,q=Rt.barYPosition}G=this.drawRangeBarPaths(I({indexes:{i:f,j:R,realIndex:b},barHeight:P,barYPosition:q,zeroW:L,yDivision:M,y1:O,y2:B},Ft)),T=G.barWidth}else{d.axisFlags.isXNumeric&&(x=(d.seriesData.seriesX[f][R]-d.globals.minX)/this.xRatio-T/2),H=x+T*this.visibleI;let ot=(E-T*it)/2;if((h=(l=d.config.series[f].data)==null?void 0:l[R])!=null&&h.x){let Rt=this.detectOverlappingBars({i:f,j:R,barXPosition:H,srtx:ot,barWidth:T,xDivision:E,initPositions:A});T=Rt.barWidth,H=Rt.barXPosition}G=this.drawRangeColumnPaths(I({indexes:{i:f,j:R,realIndex:b,translationsIndex:w},barWidth:T,barXPosition:H,zeroH:S,xDivision:E},Ft)),P=G.barHeight}let ut=this.barHelpers.drawGoalLine({barXPosition:G.barXPosition,barYPosition:q,goalX:G.goalX,goalY:G.goalY,barHeight:P,barWidth:T});ut&&_.add(ut),m=G.y,x=G.x;let Xt=this.barHelpers.getPathFillColor(t,f,R,b);this.renderSeries({realIndex:b,pathFill:Xt.color,lineFill:Xt.useRangeColor?Xt.color:d.globals.stroke.colors[b],j:R,i:f,x,y:m,y1:O,y2:B,pathFrom:G.pathFrom,pathTo:G.pathTo,strokeWidth:N,elSeries:y,series:t,barHeight:P,barWidth:T,barXPosition:H,barYPosition:q,columnGroupIndex:v,elDataLabelsWrap:X,elGoalsMarkers:_,visibleSeries:this.visibleI,type:"rangebar"})}p.add(y)}return p}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:i,srty:a,srtx:o,barHeight:r,barWidth:n,yDivision:c,xDivision:l,initPositions:h}){var d,g,p,f;let x=this.w,m=[],b=(g=(d=x.config.series[t].data)==null?void 0:d[e])==null?void 0:g.rangeName,v=(f=(p=x.config.series[t].data)==null?void 0:p[e])==null?void 0:f.x,y=Array.isArray(v)?v.join(" "):v,w=x.labelData.labels.map(C=>Array.isArray(C)?C.join(" "):C).indexOf(y),A=x.rangeData.seriesRange[t].findIndex(C=>{var L;return C.x===y&&((L=C.overlaps)==null?void 0:L.size)>0});return this.isHorizontal?(x.config.plotOptions.bar.rangeBarGroupRows?s=a+c*w:s=a+r*this.visibleI+c*w,A>-1&&!x.config.plotOptions.bar.rangeBarOverlap&&(m=Array.from(x.rangeData.seriesRange[t][A].overlaps),m.indexOf(b)>-1&&(r=h.barHeight/m.length,s=r*this.visibleI+c*(100-parseInt(this.barOptions.barHeight,10))/100/2+r*(this.visibleI+m.indexOf(b))+c*w))):(w>-1&&!x.labelData.timescaleLabels.length&&(x.config.plotOptions.bar.rangeBarGroupRows?i=o+l*w:i=o+n*this.visibleI+l*w),A>-1&&!x.config.plotOptions.bar.rangeBarOverlap&&(m=Array.from(x.rangeData.seriesRange[t][A].overlaps),m.indexOf(b)>-1&&(n=h.barWidth/m.length,i=n*this.visibleI+l*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+m.indexOf(b))+l*w))),{barYPosition:s,barXPosition:i,barHeight:r,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:i,barXPosition:a,zeroH:o}){var r,n;let c=this.w,{i:l,j:h,realIndex:d,translationsIndex:g}=t,p=this.yRatio[g],f=this.getRangeValue(d,h),x=Math.min(f.start,f.end),m=Math.max(f.start,f.end);typeof((r=this.series[l])==null?void 0:r[h])>"u"||((n=this.series[l])==null?void 0:n[h])===null?x=o:(x=o-x/p,m=o-m/p);let b=Math.abs(m-x),v=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:x,y2:m,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:h,w:c});if(!c.axisFlags.isXNumeric)e=e+s;else{let y=this.getBarXForNumericXAxis({x:e,j:h,realIndex:d,barWidth:i});e=y.x,a=y.barXPosition}return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:b,x:e,y:f.start<0&&f.end<0?x:m,goalY:this.barHelpers.getGoalValues("y",null,o,l,h,g),barXPosition:a}}preventBarOverflow(t){let e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:i,yDivision:a,barHeight:o,barYPosition:r,zeroW:n}){let c=this.w,{realIndex:l,j:h}=t,d=this.preventBarOverflow(n+s/this.invertedYRatio),g=this.preventBarOverflow(n+i/this.invertedYRatio),p=this.getRangeValue(l,h),f=Math.abs(g-d),x=this.barHelpers.getBarpaths({barYPosition:r,barHeight:o,x1:d,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:l,realIndex:l,j:h,w:c});return c.axisFlags.isXNumeric||(e=e+a),{pathTo:x.pathTo,pathFrom:x.pathFrom,barWidth:f,x:p.start<0&&p.end<0?d:g,goalX:this.barHelpers.getGoalValues("x",n,null,l,h,0),y:e}}getRangeValue(t,e){let s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}};function Is(u,t){let e=0;for(let a=0;a=r}function Ns(u,t,e,s,i,a,o,r){if(o>=r){let n=s/r,c=a;for(let l=0;lh&&(h=p),d++;else{if(Ns(a,r,n,c,t,e,s,i),s>=i){let f=c/i;t+=f,s-=f}else{let f=c/s;e+=f,i-=f}n=0,c=0,l=1/0,h=-1/0}}return n>0&&Ns(a,r,n,c,t,e,s,i),a}function ha(u,t,e){let s=u.length,i=new Array(s);for(let r=0;r{let c=n.map(l=>Math.abs(l));o.push(c)}),this.negRange=this.helpers.checkColorRange(),e.config.series.forEach((n,c)=>{n.data.forEach(l=>{Array.isArray(this.labels[c])||(this.labels[c]=[]),this.labels[c].push(l.x)})}),da.generate(o,e.layout.gridWidth,e.layout.gridHeight).forEach((n,c)=>{var l;let h=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:D.escapeString(e.seriesData.seriesNames[c]),rel:c+1,"data:realIndex":c});if(s.setupEventDelegation(h,".apexcharts-treemap-rect"),e.config.chart.dropShadow.enabled){let f=e.config.chart.dropShadow;new J(this.w).dropShadow(a,f,c)}let d=s.group({class:"apexcharts-data-labels"}),g={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};n.forEach((f,x)=>{let m=f[0],b=f[1],v=f[2],y=f[3];g.xMin=Math.min(g.xMin,m),g.yMin=Math.min(g.yMin,b),g.xMax=Math.max(g.xMax,v),g.yMax=Math.max(g.yMax,y);let w=this.helpers.getShadeColor(e.config.chart.type,c,x,this.negRange),A=w.color,C=i.fillPath({color:A,seriesNumber:c,dataPointIndex:x}),L=s.drawRect(m,b,v-m,y-b,e.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,e.config.plotOptions.treemap.useFillColorAsStroke?A:e.globals.stroke.colors[c]);L.attr({cx:m,cy:b,index:c,i:c,j:x,width:v-m,height:y-b,fill:C}),L.node.classList.add("apexcharts-treemap-rect");let k={x:m+(v-m)/2,y:b+(y-b)/2,width:0,height:0},S={x:m,y:b,width:v-m,height:y-b};if(e.config.chart.animations.enabled&&!e.globals.dataChanged){let E=1;e.globals.resized||(E=e.config.chart.animations.speed),this.animateTreemap(L,k,S,E)}if(e.globals.dataChanged){let E=1;this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(E=this.dynamicAnim.speed,e.globals.previousPaths[c]&&e.globals.previousPaths[c][x]&&e.globals.previousPaths[c][x].rect&&(k=e.globals.previousPaths[c][x].rect),this.animateTreemap(L,k,S,E))}let T=this.getFontSize(f),P=e.config.dataLabels.formatter(this.labels[c][x],{value:e.seriesData.series[c][x],seriesIndex:c,dataPointIndex:x,w:e});e.config.plotOptions.treemap.dataLabels.format==="truncate"&&(T=parseInt(String(e.config.dataLabels.style.fontSize),10),P=this.truncateLabels(String(P),T,m,b,v,y));let M=null;e.seriesData.series[c][x]&&(M=this.helpers.calculateDataLabels({text:P,x:(m+v)/2,y:(b+y)/2+this.strokeWidth/2+T/3,i:c,j:x,colorProps:w,fontSize:T,series:t})),e.config.dataLabels.enabled&&M&&this.rotateToFitLabel(M,T,P,m,b,v,y),h.add(L),M!==null&&h.add(M)});let p=e.config.plotOptions.treemap.seriesTitle;if(e.config.series.length>1&&p&&p.show){let f=e.config.series[c].name||"";if(f&&g.xMin<1/0&&g.yMin<1/0){let{offsetX:x,offsetY:m,borderColor:b,borderWidth:v,borderRadius:y,style:w}=p,A=w.color||e.config.chart.foreColor,C={left:w.padding.left,right:w.padding.right,top:w.padding.top,bottom:w.padding.bottom},L=s.getTextRects(f,w.fontSize,w.fontFamily),k=L.width+C.left+C.right,S=L.height+C.top+C.bottom,T=g.xMin+(x||0),P=g.yMin+(m||0),M=s.drawRect(T,P,k,S,y,w.background,1,v,b),E=s.drawText({x:T+C.left,y:P+C.top+((l=L?.height)!=null?l:0)*.75,text:f,fontSize:w.fontSize,fontFamily:w.fontFamily,fontWeight:w.fontWeight,foreColor:A,cssClass:w.cssClass||""});h.add(M),h.add(E)}}h.add(d),a.add(h)}),a}getFontSize(t){let e=this.w;function s(r){let n,c=0;if(Array.isArray(r[0]))for(n=0;no-i&&c.width<=r-a){let l=n.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${l.x} ${l.y}) translate(${c.height/3})`)}}truncateLabels(t,e,s,i,a,o){let r=new F(this.w),c=r.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>a-s&&o-i>a-s?o-i:a-s,l=r.getTextBasedOnMaxWidth({text:t,maxWidth:c,fontSize:e});return t.length!==l.length&&c/e<5?"":l}animateTreemap(t,e,s,i){let a=new ft(this.w);a.animateRect(t,e,s,i,()=>{a.animationCompleted(t)})}};nt.use({line:mt,area:mt,scatter:mt,bubble:mt,rangeArea:mt,bar:pt,column:pt,barStacked:cs,rangeBar:us,candlestick:oe,boxPlot:oe,pie:Dt,donut:Dt,polarArea:Dt,radialBar:ps,radar:gs,heatmap:hs,treemap:xs});var Ai=vi();function or({options:u,chartId:t,theme:e,extraJsOptions:s}){return{chart:null,options:u,chartId:t,theme:e,extraJsOptions:s,init:function(){this.$wire.$on("updateOptions",({options:i})=>{i=Ai(i,this.extraJsOptions),this.updateChart(i)}),Alpine.effect(()=>{let i=Alpine.store("theme");this.$nextTick(()=>{this.chart===null?this.initChart():this.updateChart({theme:{mode:i},chart:{background:this.options.chart.background||"inherit"}})})}),document.querySelectorAll(".fi-wi-chart-filter > .fi-dropdown-panel").forEach(i=>{i.style.zIndex="20"})},initChart:function(){this.options.theme={mode:this.theme},this.options.chart.background=this.options.chart.background||"inherit",this.options=Ai(this.options,this.extraJsOptions),this.chart=new nt(document.querySelector(this.chartId),this.options),this.chart.render()},updateChart:function(i){this.chart.updateOptions(i,!1,!0,!0)}}}export{or as default}; +/*! Bundled license information: + +apexcharts/dist/apexcharts.esm.js: + (*! + * ApexCharts v5.10.4 + * (c) 2018-2026 ApexCharts + *) + (*! + * Path morphing for SVG path animations + * Based on svg.pathmorphing.js by Ulrich-Matthias Schäfer (MIT License) + * Refactored to be standalone (no SVG.js dependency) + *) +*/ diff --git a/resources/views/components/statistic-event-chart.blade.php b/resources/views/components/statistic-event-chart.blade.php new file mode 100644 index 00000000..15f02094 --- /dev/null +++ b/resources/views/components/statistic-event-chart.blade.php @@ -0,0 +1,26 @@ +
+ + +
{{ $record->country->name }} {{ $record->group->name }}
+
+ @if ($record->home->betsapi_image_id) + + @endif +
{{ $record->home->name }}
+
vs
+
{{ $record->away->name }}
+ @if ($record->away->betsapi_image_id) + + @endif +
+
+
+ + +
+
+ + @livewire(\App\Livewire\StatisticEventChart::class) +
diff --git a/resources/views/filament/tables/columns/statistic-event-column.blade.php b/resources/views/filament/tables/columns/statistic-event-column.blade.php new file mode 100644 index 00000000..79cb77fb --- /dev/null +++ b/resources/views/filament/tables/columns/statistic-event-column.blade.php @@ -0,0 +1,7 @@ + + + + + + @livewire('statistic-event-chart', ['record' => $record]) +