evui 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5621 -4954
- package/dist/index.umd.cjs +8 -7
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
(function(le,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(le=typeof globalThis<"u"?globalThis:le||self,o(le.evui={},le.Vue))})(this,function(le,o){"use strict";function pc(t,e){const n=Object.create(null),i=t.split(",");for(let s=0;s<i.length;s++)n[i[s]]=!0;return s=>!!n[s]}const Ls=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const il=()=>{},gc=/^on[^a-z]/,bc=t=>gc.test(t),lt=Object.assign,yc=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},xc=Object.prototype.hasOwnProperty,wi=(t,e)=>xc.call(t,e),Se=Array.isArray,an=t=>Li(t)==="[object Map]",Sc=t=>Li(t)==="[object Set]",Pe=t=>typeof t=="function",pt=t=>typeof t=="string",Ii=t=>typeof t=="symbol",Ae=t=>t!==null&&typeof t=="object",Cc=t=>(Ae(t)||Pe(t))&&Pe(t.then)&&Pe(t.catch),kc=Object.prototype.toString,Li=t=>kc.call(t),sl=t=>Li(t).slice(8,-1),wc=t=>Li(t)==="[object Object]",Ts=t=>pt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ic=(t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))})(t=>t.charAt(0).toUpperCase()+t.slice(1)),rn=(t,e)=>!Object.is(t,e),Lc=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})};let ol;const Ms=()=>ol||(ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vs(t){if(Se(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],s=pt(i)?Rc(i):vs(i);if(s)for(const l in s)e[l]=s[l]}return e}if(pt(t)||Ae(t))return t}const Tc=/;(?![^(]*\))/g,Mc=/:([^]+)/,vc=/\/\*[^]*?\*\//g;function Rc(t){const e={};return t.replace(vc,"").split(Tc).forEach(n=>{if(n){const i=n.split(Mc);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Rs(t){let e="";if(pt(t))e=t;else if(Se(t))for(let n=0;n<t.length;n++){const i=Rs(t[n]);i&&(e+=i+" ")}else if(Ae(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function ll(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let al;const Vs=t=>{const e=new Set(t);return e.w=0,e.n=0,e},rl=t=>(t.w&Gt)>0,cl=t=>(t.n&Gt)>0,Es=new WeakMap;let Tn=0,Gt=1;const Gs=30;let Ke;const zt=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Ws=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class Vc{constructor(e,n=null,i){this.fn=e,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=al){l&&l.active&&l.effects.push(s)}(this,i)}run(){if(!this.active)return this.fn();let e=Ke,n=At;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=Ke,Ke=this,At=!0,Gt=1<<++Tn,Tn<=Gs?(({deps:i})=>{if(i.length)for(let s=0;s<i.length;s++)i[s].w|=Gt})(this):dl(this),this.fn()}finally{Tn<=Gs&&(i=>{const{deps:s}=i;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];rl(r)&&!cl(r)?r.delete(i):s[l++]=r,r.w&=~Gt,r.n&=~Gt}s.length=l}})(this),Gt=1<<--Tn,Ke=this.parent,At=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ke===this?this.deferStop=!0:this.active&&(dl(this),this.onStop&&this.onStop(),this.active=!1)}}function dl(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let At=!0;const hl=[];function ul(){hl.push(At),At=!1}function fl(){const t=hl.pop();At=t===void 0||t}function $e(t,e,n){if(At&&Ke){let i=Es.get(t);i||Es.set(t,i=new Map);let s=i.get(n);s||i.set(n,s=Vs()),function(l,a){let r=!1;Tn<=Gs?cl(l)||(l.n|=Gt,r=!rl(l)):r=!l.has(Ke),r&&(l.add(Ke),Ke.deps.push(l),process.env.NODE_ENV!=="production"&&Ke.onTrack&&Ke.onTrack(lt({effect:Ke},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Ke,target:t,type:e,key:n}:void 0)}}function Wt(t,e,n,i,s,l){const a=Es.get(t);if(!a)return;let r=[];if(e==="clear")r=[...a.values()];else if(n==="length"&&Se(t)){const d=Number(i);a.forEach((h,u)=>{(u==="length"||!Ii(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),e){case"add":Se(t)?Ts(n)&&r.push(a.get("length")):(r.push(a.get(zt)),an(t)&&r.push(a.get(Ws)));break;case"delete":Se(t)||(r.push(a.get(zt)),an(t)&&r.push(a.get(Ws)));break;case"set":an(t)&&r.push(a.get(zt))}const c=process.env.NODE_ENV!=="production"?{target:t,type:e,key:n,newValue:i,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?Ti(r[0],c):Ti(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?Ti(Vs(d),c):Ti(Vs(d))}}function Ti(t,e){const n=Se(t)?t:[...t];for(const i of n)i.computed&&ml(i,e);for(const i of n)i.computed||ml(i,e)}function ml(t,e){(t!==Ke||t.allowRecurse)&&(process.env.NODE_ENV!=="production"&&t.onTrigger&&t.onTrigger(lt({effect:t},e)),t.scheduler?t.scheduler():t.run())}const Ec=pc("__proto__,__v_isRef,__isVue"),pl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ii)),gl=Gc();function Gc(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const i=ge(this);for(let l=0,a=this.length;l<a;l++)$e(i,"get",l+"");const s=i[e](...n);return s===-1||s===!1?i[e](...n.map(ge)):s}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...n){ul();const i=ge(this)[e].apply(this,n);return fl(),i}}),t}function Wc(t){const e=ge(this);return $e(e,"has",t),e.hasOwnProperty(t)}class bl{constructor(e=!1,n=!1){this._isReadonly=e,this._shallow=n}get(e,n,i){const s=this._isReadonly,l=this._shallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return l;if(n==="__v_raw"&&i===(s?l?Tl:Ll:l?Kc:Il).get(e))return e;const a=Se(e);if(!s){if(a&&wi(gl,n))return Reflect.get(gl,n,i);if(n==="hasOwnProperty")return Wc}const r=Reflect.get(e,n,i);return(Ii(n)?pl.has(n):Ec(n))?r:(s||$e(e,"get",n),l?r:_e(r)?a&&Ts(n)?r:r.value:Ae(r)?s?vl(r):Ml(r):r)}}class Zc extends bl{constructor(e=!1){super(!1,e)}set(e,n,i,s){let l=e[n];if(_t(l)&&_e(l)&&!_e(i))return!1;if(!this._shallow&&(Ps(i)||_t(i)||(l=ge(l),i=ge(i)),!Se(e)&&_e(l)&&!_e(i)))return l.value=i,!0;const a=Se(e)&&Ts(n)?Number(n)<e.length:wi(e,n),r=Reflect.set(e,n,i,s);return e===ge(s)&&(a?rn(i,l)&&Wt(e,"set",n,i,l):Wt(e,"add",n,i)),r}deleteProperty(e,n){const i=wi(e,n),s=e[n],l=Reflect.deleteProperty(e,n);return l&&i&&Wt(e,"delete",n,void 0,s),l}has(e,n){const i=Reflect.has(e,n);return Ii(n)&&pl.has(n)||$e(e,"has",n),i}ownKeys(e){return $e(e,"iterate",Se(e)?"length":zt),Reflect.ownKeys(e)}}class yl extends bl{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&ll(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&ll(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Xc=new Zc,Nc=new yl,Pc=new yl(!0),Zs=t=>t,Mi=t=>Reflect.getPrototypeOf(t);function vi(t,e,n=!1,i=!1){const s=ge(t=t.__v_raw),l=ge(e);n||(rn(e,l)&&$e(s,"get",e),$e(s,"get",l));const{has:a}=Mi(s),r=i?Zs:n?Ys:Bs;return a.call(s,e)?r(t.get(e)):a.call(s,l)?r(t.get(l)):void(t!==s&&t.get(e))}function Ri(t,e=!1){const n=this.__v_raw,i=ge(n),s=ge(t);return e||(rn(t,s)&&$e(i,"has",t),$e(i,"has",s)),t===s?n.has(t):n.has(t)||n.has(s)}function Vi(t,e=!1){return t=t.__v_raw,!e&&$e(ge(t),"iterate",zt),Reflect.get(t,"size",t)}function xl(t){t=ge(t);const e=ge(this);return Mi(e).has.call(e,t)||(e.add(t),Wt(e,"add",t,t)),this}function Sl(t,e){e=ge(e);const n=ge(this),{has:i,get:s}=Mi(n);let l=i.call(n,t);l?process.env.NODE_ENV!=="production"&&wl(n,i,t):(t=ge(t),l=i.call(n,t));const a=s.call(n,t);return n.set(t,e),l?rn(e,a)&&Wt(n,"set",t,e,a):Wt(n,"add",t,e),this}function Cl(t){const e=ge(this),{has:n,get:i}=Mi(e);let s=n.call(e,t);s?process.env.NODE_ENV!=="production"&&wl(e,n,t):(t=ge(t),s=n.call(e,t));const l=i?i.call(e,t):void 0,a=e.delete(t);return s&&Wt(e,"delete",t,void 0,l),a}function kl(){const t=ge(this),e=t.size!==0,n=process.env.NODE_ENV!=="production"?an(t)?new Map(t):new Set(t):void 0,i=t.clear();return e&&Wt(t,"clear",void 0,void 0,n),i}function Ei(t,e){return function(n,i){const s=this,l=s.__v_raw,a=ge(l),r=e?Zs:t?Ys:Bs;return!t&&$e(a,"iterate",zt),l.forEach((c,d)=>n.call(i,r(c),r(d),s))}}function Gi(t,e,n){return function(...i){const s=this.__v_raw,l=ge(s),a=an(l),r=t==="entries"||t===Symbol.iterator&&a,c=t==="keys"&&a,d=s[t](...i),h=n?Zs:e?Ys:Bs;return!e&&$e(l,"iterate",c?Ws:zt),{next(){const{value:u,done:f}=d.next();return f?{value:u,done:f}:{value:r?[h(u[0]),h(u[1])]:h(u),done:f}},[Symbol.iterator](){return this}}}}function Zt(t){return function(...e){if(process.env.NODE_ENV!=="production"){const n=e[0]?`on key "${e[0]}" `:"";console.warn(`${Ic(t)} operation ${n}failed: target is readonly.`,ge(this))}return t!=="delete"&&(t==="clear"?void 0:this)}}function Dc(){const t={get(s){return vi(this,s)},get size(){return Vi(this)},has:Ri,add:xl,set:Sl,delete:Cl,clear:kl,forEach:Ei(!1,!1)},e={get(s){return vi(this,s,!1,!0)},get size(){return Vi(this)},has:Ri,add:xl,set:Sl,delete:Cl,clear:kl,forEach:Ei(!1,!0)},n={get(s){return vi(this,s,!0)},get size(){return Vi(this,!0)},has(s){return Ri.call(this,s,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ei(!0,!1)},i={get(s){return vi(this,s,!0,!0)},get size(){return Vi(this,!0)},has(s){return Ri.call(this,s,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ei(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Gi(s,!1,!1),n[s]=Gi(s,!0,!1),e[s]=Gi(s,!1,!0),i[s]=Gi(s,!0,!0)}),[t,n,e,i]}const[Bc,Yc,Oc,Hc]=Dc();function Xs(t,e){const n=e?t?Hc:Oc:t?Yc:Bc;return(i,s,l)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?i:Reflect.get(wi(n,s)&&s in i?n:i,s,l)}const Fc={get:Xs(!1,!1)},zc={get:Xs(!0,!1)},Ac={get:Xs(!0,!0)};function wl(t,e,n){const i=ge(n);if(i!==n&&e.call(t,i)){const s=sl(t);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Il=new WeakMap,Kc=new WeakMap,Ll=new WeakMap,Tl=new WeakMap;function Ml(t){return _t(t)?t:Ns(t,!1,Xc,Fc,Il)}function vl(t){return Ns(t,!0,Nc,zc,Ll)}function Wi(t){return Ns(t,!0,Pc,Ac,Tl)}function Ns(t,e,n,i,s){if(!Ae(t))return process.env.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const l=s.get(t);if(l)return l;const a=(r=t).__v_skip||!Object.isExtensible(r)?0:function(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(sl(r));var r;if(a===0)return t;const c=new Proxy(t,a===2?i:n);return s.set(t,c),c}function Kt(t){return _t(t)?Kt(t.__v_raw):!(!t||!t.__v_isReactive)}function _t(t){return!(!t||!t.__v_isReadonly)}function Ps(t){return!(!t||!t.__v_isShallow)}function Ds(t){return Kt(t)||_t(t)}function ge(t){const e=t&&t.__v_raw;return e?ge(e):t}const Bs=t=>Ae(t)?Ml(t):t,Ys=t=>Ae(t)?vl(t):t;function _e(t){return!(!t||t.__v_isRef!==!0)}const _c={get:(t,e,n)=>{return _e(i=Reflect.get(t,e,n))?i.value:i;var i},set:(t,e,n,i)=>{const s=t[e];return _e(s)&&!_e(n)?(s.value=n,!0):Reflect.set(t,e,n,i)}},Ut=[];function gt(t,...e){if(process.env.NODE_ENV==="production")return;ul();const n=Ut.length?Ut[Ut.length-1].component:null,i=n&&n.appContext.config.warnHandler,s=function(){let l=Ut[Ut.length-1];if(!l)return[];const a=[];for(;l;){const r=a[0];r&&r.vnode===l?r.recurseCount++:a.push({vnode:l,recurseCount:0});const c=l.component&&l.component.parent;l=c&&c.vnode}return a}();if(i)Jt(i,n,11,[t+e.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${$l(n,l.type)}>`).join(`
|
|
1
|
+
(function(le,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(le=typeof globalThis<"u"?globalThis:le||self,o(le.evui={},le.Vue))})(this,function(le,o){"use strict";function Sc(t,e){const n=Object.create(null),i=t.split(",");for(let s=0;s<i.length;s++)n[i[s]]=!0;return s=>!!n[s]}const Ms=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const il=()=>{},Cc=/^on[^a-z]/,kc=t=>Cc.test(t),lt=Object.assign,wc=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Ic=Object.prototype.hasOwnProperty,Li=(t,e)=>Ic.call(t,e),Se=Array.isArray,an=t=>Mi(t)==="[object Map]",Lc=t=>Mi(t)==="[object Set]",Be=t=>typeof t=="function",pt=t=>typeof t=="string",Ti=t=>typeof t=="symbol",Ae=t=>t!==null&&typeof t=="object",Tc=t=>(Ae(t)||Be(t))&&Be(t.then)&&Be(t.catch),Mc=Object.prototype.toString,Mi=t=>Mc.call(t),sl=t=>Mi(t).slice(8,-1),vc=t=>Mi(t)==="[object Object]",vs=t=>pt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Rc=(t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))})(t=>t.charAt(0).toUpperCase()+t.slice(1)),rn=(t,e)=>!Object.is(t,e),Vc=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})};let ol;const Rs=()=>ol||(ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vs(t){if(Se(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],s=pt(i)?Zc(i):Vs(i);if(s)for(const l in s)e[l]=s[l]}return e}if(pt(t)||Ae(t))return t}const Ec=/;(?![^(]*\))/g,Wc=/:([^]+)/,Gc=/\/\*[^]*?\*\//g;function Zc(t){const e={};return t.replace(Gc,"").split(Ec).forEach(n=>{if(n){const i=n.split(Wc);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Es(t){let e="";if(pt(t))e=t;else if(Se(t))for(let n=0;n<t.length;n++){const i=Es(t[n]);i&&(e+=i+" ")}else if(Ae(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function ll(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let al;const Ws=t=>{const e=new Set(t);return e.w=0,e.n=0,e},rl=t=>(t.w&Wt)>0,cl=t=>(t.n&Wt)>0,Gs=new WeakMap;let Tn=0,Wt=1;const Zs=30;let Ke;const zt=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Xs=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class Xc{constructor(e,n=null,i){this.fn=e,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=al){l&&l.active&&l.effects.push(s)}(this,i)}run(){if(!this.active)return this.fn();let e=Ke,n=At;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=Ke,Ke=this,At=!0,Wt=1<<++Tn,Tn<=Zs?(({deps:i})=>{if(i.length)for(let s=0;s<i.length;s++)i[s].w|=Wt})(this):dl(this),this.fn()}finally{Tn<=Zs&&(i=>{const{deps:s}=i;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];rl(r)&&!cl(r)?r.delete(i):s[l++]=r,r.w&=~Wt,r.n&=~Wt}s.length=l}})(this),Wt=1<<--Tn,Ke=this.parent,At=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ke===this?this.deferStop=!0:this.active&&(dl(this),this.onStop&&this.onStop(),this.active=!1)}}function dl(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let At=!0;const hl=[];function ul(){hl.push(At),At=!1}function fl(){const t=hl.pop();At=t===void 0||t}function $e(t,e,n){if(At&&Ke){let i=Gs.get(t);i||Gs.set(t,i=new Map);let s=i.get(n);s||i.set(n,s=Ws()),function(l,a){let r=!1;Tn<=Zs?cl(l)||(l.n|=Wt,r=!rl(l)):r=!l.has(Ke),r&&(l.add(Ke),Ke.deps.push(l),process.env.NODE_ENV!=="production"&&Ke.onTrack&&Ke.onTrack(lt({effect:Ke},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Ke,target:t,type:e,key:n}:void 0)}}function Gt(t,e,n,i,s,l){const a=Gs.get(t);if(!a)return;let r=[];if(e==="clear")r=[...a.values()];else if(n==="length"&&Se(t)){const d=Number(i);a.forEach((h,u)=>{(u==="length"||!Ti(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),e){case"add":Se(t)?vs(n)&&r.push(a.get("length")):(r.push(a.get(zt)),an(t)&&r.push(a.get(Xs)));break;case"delete":Se(t)||(r.push(a.get(zt)),an(t)&&r.push(a.get(Xs)));break;case"set":an(t)&&r.push(a.get(zt))}const c=process.env.NODE_ENV!=="production"?{target:t,type:e,key:n,newValue:i,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?vi(r[0],c):vi(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?vi(Ws(d),c):vi(Ws(d))}}function vi(t,e){const n=Se(t)?t:[...t];for(const i of n)i.computed&&ml(i,e);for(const i of n)i.computed||ml(i,e)}function ml(t,e){(t!==Ke||t.allowRecurse)&&(process.env.NODE_ENV!=="production"&&t.onTrigger&&t.onTrigger(lt({effect:t},e)),t.scheduler?t.scheduler():t.run())}const Nc=Sc("__proto__,__v_isRef,__isVue"),pl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ti)),gl=Pc();function Pc(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const i=ge(this);for(let l=0,a=this.length;l<a;l++)$e(i,"get",l+"");const s=i[e](...n);return s===-1||s===!1?i[e](...n.map(ge)):s}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...n){ul();const i=ge(this)[e].apply(this,n);return fl(),i}}),t}function Bc(t){const e=ge(this);return $e(e,"has",t),e.hasOwnProperty(t)}class bl{constructor(e=!1,n=!1){this._isReadonly=e,this._shallow=n}get(e,n,i){const s=this._isReadonly,l=this._shallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return l;if(n==="__v_raw"&&i===(s?l?Tl:Ll:l?Qc:Il).get(e))return e;const a=Se(e);if(!s){if(a&&Li(gl,n))return Reflect.get(gl,n,i);if(n==="hasOwnProperty")return Bc}const r=Reflect.get(e,n,i);return(Ti(n)?pl.has(n):Nc(n))?r:(s||$e(e,"get",n),l?r:_e(r)?a&&vs(n)?r:r.value:Ae(r)?s?vl(r):Ml(r):r)}}class Dc extends bl{constructor(e=!1){super(!1,e)}set(e,n,i,s){let l=e[n];if(_t(l)&&_e(l)&&!_e(i))return!1;if(!this._shallow&&(Ds(i)||_t(i)||(l=ge(l),i=ge(i)),!Se(e)&&_e(l)&&!_e(i)))return l.value=i,!0;const a=Se(e)&&vs(n)?Number(n)<e.length:Li(e,n),r=Reflect.set(e,n,i,s);return e===ge(s)&&(a?rn(i,l)&&Gt(e,"set",n,i,l):Gt(e,"add",n,i)),r}deleteProperty(e,n){const i=Li(e,n),s=e[n],l=Reflect.deleteProperty(e,n);return l&&i&&Gt(e,"delete",n,void 0,s),l}has(e,n){const i=Reflect.has(e,n);return Ti(n)&&pl.has(n)||$e(e,"has",n),i}ownKeys(e){return $e(e,"iterate",Se(e)?"length":zt),Reflect.ownKeys(e)}}class yl extends bl{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&ll(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&ll(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Yc=new Dc,Oc=new yl,Hc=new yl(!0),Ns=t=>t,Ri=t=>Reflect.getPrototypeOf(t);function Vi(t,e,n=!1,i=!1){const s=ge(t=t.__v_raw),l=ge(e);n||(rn(e,l)&&$e(s,"get",e),$e(s,"get",l));const{has:a}=Ri(s),r=i?Ns:n?Hs:Os;return a.call(s,e)?r(t.get(e)):a.call(s,l)?r(t.get(l)):void(t!==s&&t.get(e))}function Ei(t,e=!1){const n=this.__v_raw,i=ge(n),s=ge(t);return e||(rn(t,s)&&$e(i,"has",t),$e(i,"has",s)),t===s?n.has(t):n.has(t)||n.has(s)}function Wi(t,e=!1){return t=t.__v_raw,!e&&$e(ge(t),"iterate",zt),Reflect.get(t,"size",t)}function xl(t){t=ge(t);const e=ge(this);return Ri(e).has.call(e,t)||(e.add(t),Gt(e,"add",t,t)),this}function Sl(t,e){e=ge(e);const n=ge(this),{has:i,get:s}=Ri(n);let l=i.call(n,t);l?process.env.NODE_ENV!=="production"&&wl(n,i,t):(t=ge(t),l=i.call(n,t));const a=s.call(n,t);return n.set(t,e),l?rn(e,a)&&Gt(n,"set",t,e,a):Gt(n,"add",t,e),this}function Cl(t){const e=ge(this),{has:n,get:i}=Ri(e);let s=n.call(e,t);s?process.env.NODE_ENV!=="production"&&wl(e,n,t):(t=ge(t),s=n.call(e,t));const l=i?i.call(e,t):void 0,a=e.delete(t);return s&&Gt(e,"delete",t,void 0,l),a}function kl(){const t=ge(this),e=t.size!==0,n=process.env.NODE_ENV!=="production"?an(t)?new Map(t):new Set(t):void 0,i=t.clear();return e&&Gt(t,"clear",void 0,void 0,n),i}function Gi(t,e){return function(n,i){const s=this,l=s.__v_raw,a=ge(l),r=e?Ns:t?Hs:Os;return!t&&$e(a,"iterate",zt),l.forEach((c,d)=>n.call(i,r(c),r(d),s))}}function Zi(t,e,n){return function(...i){const s=this.__v_raw,l=ge(s),a=an(l),r=t==="entries"||t===Symbol.iterator&&a,c=t==="keys"&&a,d=s[t](...i),h=n?Ns:e?Hs:Os;return!e&&$e(l,"iterate",c?Xs:zt),{next(){const{value:u,done:f}=d.next();return f?{value:u,done:f}:{value:r?[h(u[0]),h(u[1])]:h(u),done:f}},[Symbol.iterator](){return this}}}}function Zt(t){return function(...e){if(process.env.NODE_ENV!=="production"){const n=e[0]?`on key "${e[0]}" `:"";console.warn(`${Rc(t)} operation ${n}failed: target is readonly.`,ge(this))}return t!=="delete"&&(t==="clear"?void 0:this)}}function Fc(){const t={get(s){return Vi(this,s)},get size(){return Wi(this)},has:Ei,add:xl,set:Sl,delete:Cl,clear:kl,forEach:Gi(!1,!1)},e={get(s){return Vi(this,s,!1,!0)},get size(){return Wi(this)},has:Ei,add:xl,set:Sl,delete:Cl,clear:kl,forEach:Gi(!1,!0)},n={get(s){return Vi(this,s,!0)},get size(){return Wi(this,!0)},has(s){return Ei.call(this,s,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Gi(!0,!1)},i={get(s){return Vi(this,s,!0,!0)},get size(){return Wi(this,!0)},has(s){return Ei.call(this,s,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Gi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Zi(s,!1,!1),n[s]=Zi(s,!0,!1),e[s]=Zi(s,!1,!0),i[s]=Zi(s,!0,!0)}),[t,n,e,i]}const[zc,Ac,Kc,_c]=Fc();function Ps(t,e){const n=e?t?_c:Kc:t?Ac:zc;return(i,s,l)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?i:Reflect.get(Li(n,s)&&s in i?n:i,s,l)}const Uc={get:Ps(!1,!1)},Jc={get:Ps(!0,!1)},jc={get:Ps(!0,!0)};function wl(t,e,n){const i=ge(n);if(i!==n&&e.call(t,i)){const s=sl(t);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Il=new WeakMap,Qc=new WeakMap,Ll=new WeakMap,Tl=new WeakMap;function Ml(t){return _t(t)?t:Bs(t,!1,Yc,Uc,Il)}function vl(t){return Bs(t,!0,Oc,Jc,Ll)}function Xi(t){return Bs(t,!0,Hc,jc,Tl)}function Bs(t,e,n,i,s){if(!Ae(t))return process.env.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const l=s.get(t);if(l)return l;const a=(r=t).__v_skip||!Object.isExtensible(r)?0:function(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(sl(r));var r;if(a===0)return t;const c=new Proxy(t,a===2?i:n);return s.set(t,c),c}function Kt(t){return _t(t)?Kt(t.__v_raw):!(!t||!t.__v_isReactive)}function _t(t){return!(!t||!t.__v_isReadonly)}function Ds(t){return!(!t||!t.__v_isShallow)}function Ys(t){return Kt(t)||_t(t)}function ge(t){const e=t&&t.__v_raw;return e?ge(e):t}const Os=t=>Ae(t)?Ml(t):t,Hs=t=>Ae(t)?vl(t):t;function _e(t){return!(!t||t.__v_isRef!==!0)}const $c={get:(t,e,n)=>{return _e(i=Reflect.get(t,e,n))?i.value:i;var i},set:(t,e,n,i)=>{const s=t[e];return _e(s)&&!_e(n)?(s.value=n,!0):Reflect.set(t,e,n,i)}},Ut=[];function gt(t,...e){if(process.env.NODE_ENV==="production")return;ul();const n=Ut.length?Ut[Ut.length-1].component:null,i=n&&n.appContext.config.warnHandler,s=function(){let l=Ut[Ut.length-1];if(!l)return[];const a=[];for(;l;){const r=a[0];r&&r.vnode===l?r.recurseCount++:a.push({vnode:l,recurseCount:0});const c=l.component&&l.component.parent;l=c&&c.vnode}return a}();if(i)Jt(i,n,11,[t+e.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${$l(n,l.type)}>`).join(`
|
|
2
2
|
`),s]);else{const l=[`[Vue warn]: ${t}`,...e];s.length&&l.push(`
|
|
3
3
|
`,...function(a){const r=[];return a.forEach((c,d)=>{r.push(...d===0?[]:[`
|
|
4
|
-
`],...function({vnode:h,recurseCount:u}){const f=u>0?`... (${u} recursive calls)`:"",m=!!h.component&&h.component.parent==null,g=` at <${$l(h.component,h.type,m)}`,p=">"+f;return h.props?[g,...Uc(h.props),p]:[g+p]}(c))}),r}(s)),console.warn(...l)}fl()}function Uc(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(i=>{e.push(...Rl(i,t[i]))}),n.length>3&&e.push(" ..."),e}function Rl(t,e,n){return pt(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:_e(e)?(e=Rl(t,ge(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):Pe(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=ge(e),n?e:[`${t}=`,e])}const Vl={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function Jt(t,e,n,i){let s;try{s=i?t(...i):t()}catch(l){El(l,e,n)}return s}function Os(t,e,n,i){if(Pe(t)){const l=Jt(t,e,n,i);return l&&Cc(l)&&l.catch(a=>{El(a,e,n)}),l}const s=[];for(let l=0;l<t.length;l++)s.push(Os(t[l],e,n,i));return s}function El(t,e,n,i=!0){const s=e?e.vnode:null;if(e){let l=e.parent;const a=e.proxy,r=process.env.NODE_ENV!=="production"?Vl[n]:n;for(;l;){const d=l.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](t,a,r)===!1)return}l=l.parent}const c=e.appContext.config.errorHandler;if(c)return void Jt(c,null,10,[t,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=Vl[a];if(r&&(d=r,Ut.push(d)),gt("Unhandled error"+(h?` during execution of ${h}`:"")),r&&Ut.pop(),c)throw l;console.error(l)}else console.error(l);var d})(t,n,s,i)}let Zi=!1,Hs=!1;const at=[];let Xt=0;const cn=[];let bt=null,Nt=0;const Gl=Promise.resolve();let Fs=null;const Jc=100;function Wl(t){const e=Fs||Gl;return t?e.then(this?t.bind(this):t):e}function zs(t){at.length&&at.includes(t,Zi&&t.allowRecurse?Xt+1:Xt)||(t.id==null?at.push(t):at.splice(function(e){let n=Xt+1,i=at.length;for(;n<i;){const s=n+i>>>1,l=at[s],a=Mn(l);a<e||a===e&&l.pre?n=s+1:i=s}return n}(t.id),0,t),Zl())}function Zl(){Zi||Hs||(Hs=!0,Fs=Gl.then(Nl))}function Xl(t){Se(t)?cn.push(...t):bt&&bt.includes(t,t.allowRecurse?Nt+1:Nt)||cn.push(t),Zl()}const Mn=t=>t.id==null?1/0:t.id,jc=(t,e)=>{const n=Mn(t)-Mn(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function Nl(t){Hs=!1,Zi=!0,process.env.NODE_ENV!=="production"&&(t=t||new Map),at.sort(jc);const e=process.env.NODE_ENV!=="production"?n=>Pl(t,n):il;try{for(Xt=0;Xt<at.length;Xt++){const n=at[Xt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&e(n))continue;Jt(n,null,14)}}}finally{Xt=0,at.length=0,function(n){if(cn.length){const i=[...new Set(cn)];if(cn.length=0,bt)return void bt.push(...i);for(bt=i,process.env.NODE_ENV!=="production"&&(n=n||new Map),bt.sort((s,l)=>Mn(s)-Mn(l)),Nt=0;Nt<bt.length;Nt++)process.env.NODE_ENV!=="production"&&Pl(n,bt[Nt])||bt[Nt]();bt=null,Nt=0}}(t),Zi=!1,Fs=null,(at.length||cn.length)&&Nl(t)}}function Pl(t,e){if(t.has(e)){const n=t.get(e);if(n>Jc){const i=e.ownerInstance,s=i&&Ql(i.type);return gt(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}t.set(e,n+1)}else t.set(e,1)}const vn=new Set;process.env.NODE_ENV!=="production"&&(Ms().__VUE_HMR_RUNTIME__={createRecord:As(function(t,e){return Xi.has(t)?!1:(Xi.set(t,{initialDef:Rn(e),instances:new Set}),!0)}),rerender:As(function(t,e){const n=Xi.get(t);n&&(n.initialDef.render=e,[...n.instances].forEach(i=>{e&&(i.render=e,Rn(i.type).render=e),i.renderCache=[],i.update()}))}),reload:As(function(t,e){const n=Xi.get(t);if(!n)return;e=Rn(e),Dl(n.initialDef,e);const i=[...n.instances];for(const s of i){const l=Rn(s.type);vn.has(l)||(l!==n.initialDef&&Dl(l,e),vn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(vn.add(l),s.ceReload(e.styles),vn.delete(l)):s.parent?zs(s.parent.update):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Xl(()=>{for(const s of i)vn.delete(Rn(s.type))})})});const Xi=new Map;function Rn(t){return ql(t)?t.__vccOpts:t}function Dl(t,e){lt(t,e);for(const n in t)n==="__file"||n in e||delete t[n]}function As(t){return(e,n)=>{try{return t(e,n)}catch(i){console.error(i),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Vn=null,Qc=null;const $c=Symbol.for("v-ndc"),Ni={};function qc(t,e,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Ls){var r;process.env.NODE_ENV==="production"||e||(n!==void 0&>('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&>('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=w=>{gt("Invalid watch source: ",w,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=al===((r=un)==null?void 0:r.scope)?un:null;let h,u,f=!1,m=!1;if(_e(t)?(h=()=>t.value,f=Ps(t)):Kt(t)?(h=()=>t,i=!0):Se(t)?(m=!0,f=t.some(w=>Kt(w)||Ps(w)),h=()=>t.map(w=>_e(w)?w.value:Kt(w)?dn(w):Pe(w)?Jt(w,d,2):void(process.env.NODE_ENV!=="production"&&c(w)))):Pe(t)?h=e?()=>Jt(t,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),Os(t,d,3,[g])}:(h=il,process.env.NODE_ENV!=="production"&&c(t)),e&&i){const w=h;h=()=>dn(w())}let g=w=>{u=b.onStop=()=>{Jt(w,d,4),u=b.onStop=void 0}},p=m?new Array(t.length).fill(Ni):Ni;const y=()=>{if(b.active)if(e){const w=b.run();(i||f||(m?w.some((T,k)=>rn(T,p[k])):rn(w,p)))&&(u&&u(),Os(e,d,3,[w,p===Ni?void 0:m&&p[0]===Ni?[]:p,g]),p=w)}else b.run()};let C;y.allowRecurse=!!e,s==="sync"?C=y:s==="post"?C=()=>Fl(y,d&&d.suspense):(y.pre=!0,d&&(y.id=d.uid),C=()=>zs(y));const b=new Vc(h,C);return process.env.NODE_ENV!=="production"&&(b.onTrack=l,b.onTrigger=a),e?n?y():p=b.run():s==="post"?Fl(b.run.bind(b),d&&d.suspense):b.run(),()=>{b.stop(),d&&d.scope&&yc(d.scope.effects,b)}}function ed(t,e,n){const i=this.proxy,s=pt(t)?t.includes(".")?function(c,d){const h=d.split(".");return()=>{let u=c;for(let f=0;f<h.length&&u;f++)u=u[h[f]];return u}}(i,t):()=>i[t]:t.bind(i,i);let l;Pe(e)?l=e:(l=e.handler,n=e);const a=un;jl(this);const r=qc(s,l.bind(i),n);return a?jl(a):ld(),r}function dn(t,e){if(!Ae(t)||t.__v_skip||(e=e||new Set).has(t))return t;if(e.add(t),_e(t))dn(t.value,e);else if(Se(t))for(let n=0;n<t.length;n++)dn(t[n],e);else if(Sc(t)||an(t))t.forEach(n=>{dn(n,e)});else if(wc(t))for(const n in t)dn(t[n],e);return t}const Ks=t=>t?4&t.vnode.shapeFlag?function(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy((i=e.exposed,Lc(i,"__v_skip",!0),Kt(n=i)?n:new Proxy(n,_c)),{get:(s,l)=>l in s?s[l]:l in _s?_s[l](e):void 0,has:(s,l)=>l in s||l in _s}));var n,i}(t)||t.proxy:Ks(t.parent):null,_s=lt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>process.env.NODE_ENV!=="production"?Wi(t.props):t.props,$attrs:t=>process.env.NODE_ENV!=="production"?Wi(t.attrs):t.attrs,$slots:t=>process.env.NODE_ENV!=="production"?Wi(t.slots):t.slots,$refs:t=>process.env.NODE_ENV!=="production"?Wi(t.refs):t.refs,$parent:t=>Ks(t.parent),$root:t=>Ks(t.root),$emit:t=>t.emit,$options:t=>function(e){const n=e.type,{mixins:i,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=e.appContext,c=a.get(n);let d;return c?d=c:l.length||i||s?(d={},l.length&&l.forEach(h=>Pi(d,h,r,!0)),Pi(d,n,r)):d=n,Ae(n)&&a.set(n,d),d}(t),$forceUpdate:t=>t.f||(t.f=()=>zs(t.update)),$nextTick:t=>t.n||(t.n=Wl.bind(t.proxy)),$watch:t=>ed.bind(t)});function Bl(t){return Se(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}process.env.NODE_ENV;function Pi(t,e,n,i=!1){const{mixins:s,extends:l}=e;l&&Pi(t,l,n,!0),s&&s.forEach(a=>Pi(t,a,n,!0));for(const a in e)if(i&&a==="expose")process.env.NODE_ENV!=="production"&>('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=td[a]||n&&n[a];t[a]=r?r(t[a],e[a]):e[a]}return t}const td={data:Yl,props:Hl,emits:Hl,methods:En,computed:En,beforeCreate:Be,created:Be,beforeMount:Be,mounted:Be,beforeUpdate:Be,updated:Be,beforeDestroy:Be,beforeUnmount:Be,destroyed:Be,unmounted:Be,activated:Be,deactivated:Be,errorCaptured:Be,serverPrefetch:Be,components:En,directives:En,watch:function(t,e){if(!t)return e;if(!e)return t;const n=lt(Object.create(null),t);for(const i in e)n[i]=Be(t[i],e[i]);return n},provide:Yl,inject:function(t,e){return En(Ol(t),Ol(e))}};function Yl(t,e){return e?t?function(){return lt(Pe(t)?t.call(this,this):t,Pe(e)?e.call(this,this):e)}:e:t}function Ol(t){if(Se(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Be(t,e){return t?[...new Set([].concat(t,e))]:e}function En(t,e){return t?lt(Object.create(null),t,e):e}function Hl(t,e){return t?Se(t)&&Se(e)?[...new Set([...t,...e])]:lt(Object.create(null),Bl(t),Bl(e??{})):e}const Fl=function(t,e){e&&e.pendingBranch?Se(t)?e.effects.push(...t):e.effects.push(t):Xl(t)},zl=Symbol.for("v-fgt"),nd=Symbol.for("v-txt"),id=Symbol.for("v-cmt"),Al="__vInternal",Kl=({key:t})=>t??null,Di=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?pt(t)||_e(t)||Pe(t)?{i:Vn,r:t,k:e,f:!!n}:t:null),sd=process.env.NODE_ENV!=="production"?(...t)=>_l(...t):_l;function _l(t,e=null,n=null,i=0,s=null,l=!1){if(t&&t!==$c||(process.env.NODE_ENV==="production"||t||gt(`Invalid vnode type when creating vnode: ${t}.`),t=id),(a=t)&&a.__v_isVNode===!0){const c=Bi(t,e,!0);return n&&Us(c,n),c.patchFlag|=-2,c}var a;if(ql(t)&&(t=t.__vccOpts),e){e=function(h){return h?Ds(h)||Al in h?lt({},h):h:null}(e);let{class:c,style:d}=e;c&&!pt(c)&&(e.class=Rs(c)),Ae(d)&&(Ds(d)&&!Se(d)&&(d=lt({},d)),e.style=vs(d))}const r=pt(t)?1:(c=>c.__isSuspense)(t)?128:(c=>c.__isTeleport)(t)?64:Ae(t)?4:Pe(t)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&Ds(t)&>("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
5
|
-
Component that was made reactive: `,t=ge(t)),function(c,d=null,h=null,u=0,f=null,m=c===zl?0:1,g=!1,p=!1){const y={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Kl(d),ref:d&&Di(d),scopeId:Qc,slotScopeIds:null,children:h,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:m,patchFlag:u,dynamicProps:f,dynamicChildren:null,appContext:null,ctx:Vn};return p?(Us(y,h),128&m&&c.normalize(y)):h&&(y.shapeFlag|=pt(h)?8:16),process.env.NODE_ENV!=="production"&&y.key!=y.key&>("VNode created with invalid key (NaN). VNode type:",y.type),y}(t,e,n,i,s,r,l,!0)}function Bi(t,e,n=!1){const{props:i,ref:s,patchFlag:l,children:a}=t,r=e?function(...c){const d={};for(let h=0;h<c.length;h++){const u=c[h];for(const f in u)if(f==="class")d.class!==u.class&&(d.class=Rs([d.class,u.class]));else if(f==="style")d.style=vs([d.style,u.style]);else if(bc(f)){const m=d[f],g=u[f];!g||m===g||Se(m)&&m.includes(g)||(d[f]=m?[].concat(m,g):g)}else f!==""&&(d[f]=u[f])}return d}(i||{},e):i;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:r,key:r&&Kl(r),ref:e&&e.ref?n&&s?Se(s)?s.concat(Di(e)):[s,Di(e)]:Di(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Se(a)?a.map(Ul):a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==zl?l===-1?16:16|l:l,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Bi(t.ssContent),ssFallback:t.ssFallback&&Bi(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Ul(t){const e=Bi(t);return Se(t.children)&&(e.children=t.children.map(Ul)),e}function od(t=" ",e=0){return sd(nd,null,t,e)}function Us(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(Se(e))n=16;else if(typeof e=="object"){if(65&i){const s=e.default;return void(s&&(s._c&&(s._d=!1),Us(t,s()),s._c&&(s._d=!0)))}{n=32;const s=e._;s||Al in e||(e._ctx=Vn)}}else Pe(e)?(e={default:e,_ctx:Vn},n=32):(e=String(e),64&i?(n=16,e=[od(e)]):n=8);t.children=e,t.shapeFlag|=n}let Js,hn,un=null,Jl="__VUE_INSTANCE_SETTERS__";(hn=Ms()[Jl])||(hn=Ms()[Jl]=[]),hn.push(t=>un=t),Js=t=>{hn.length>1?hn.forEach(e=>e(t)):hn[0](t)};const jl=t=>{Js(t),t.scope.on()},ld=()=>{un&&un.scope.off(),Js(null)},ad=/(?:^|[-_])(\w)/g,rd=t=>t.replace(ad,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ql(t,e=!0){return Pe(t)?t.displayName||t.name:t.name||e&&t.__name}function $l(t,e,n=!1){let i=Ql(e);if(!i&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&t&&t.parent){const s=l=>{for(const a in l)if(l[a]===e)return a};i=s(t.components||t.parent.type.components)||s(t.appContext.components)}return i?rd(i):n?"App":"Anonymous"}function ql(t){return Pe(t)&&"__vccOpts"in t}function js(t){return!(!t||!t.__v_isShallow)}function ea(t,e,n){if(arguments.length===2)for(var i,s=0,l=e.length;s<l;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}function ta(t,e){if(t===e)return!0;if(typeof t=="object"){for(var n in t)if(!ta(t[n],e[n]))return!1;return!0}return!1}process.env.NODE_ENV!=="production"&&function(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#0b1bc9"},n={style:"color:#b62e24"},i={style:"color:#9d288c"},s={header:u=>Ae(u)?u.__isVue?["div",t,"VueInstance"]:_e(u)?["div",{},["span",t,h(u)],"<",r(u.value),">"]:Kt(u)?["div",{},["span",t,js(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+(_t(u)?" (readonly)":"")]:_t(u)?["div",{},["span",t,js(u)?"ShallowReadonly":"Readonly"],"<",r(u),">"]:null:null,hasBody:u=>u&&u.__isVue,body(u){if(u&&u.__isVue)return["div",{},...l(u.$)]}};function l(u){const f=[];u.type.props&&u.props&&f.push(a("props",ge(u.props))),u.setupState!==Ls&&f.push(a("setup",u.setupState)),u.data!==Ls&&f.push(a("data",ge(u.data)));const m=c(u,"computed");m&&f.push(a("computed",m));const g=c(u,"inject");return g&&f.push(a("injected",g)),f.push(["div",{},["span",{style:i.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function a(u,f){return f=lt({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",i,m+": "],r(f[m],!1)])]]:["span",{}]}function r(u,f=!0){return typeof u=="number"?["span",e,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",i,u]:Ae(u)?["object",{object:f?ge(u):u}]:["span",n,String(u)]}function c(u,f){const m=u.type;if(Pe(m))return;const g={};for(const p in u.ctx)d(m,p,f)&&(g[p]=u.ctx[p]);return g}function d(u,f,m){const g=u[m];return!!(Se(g)&&g.includes(f)||Ae(g)&&f in g)||!(!u.extends||!d(u.extends,f,m))||!(!u.mixins||!u.mixins.some(p=>d(p,f,m)))||void 0}function h(u){return js(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var cd=function(){function t(e,n){this.el=e,this.observer=null,this.frozen=!1,this.createObserver(n)}return Object.defineProperty(t.prototype,"threshold",{get:function(){return this.options.intersection&&this.options.intersection.threshold||0},enumerable:!1,configurable:!0}),t.prototype.createObserver=function(e){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){var i;if(this.options=typeof(i=e)=="function"?{callback:i}:i,this.callback=function(l,a){n.options.callback(l,a),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var s=(this.options.throttleOptions||{}).leading;this.callback=function(l,a,r){var c,d,h;r===void 0&&(r={});var u=function(f){for(var m=[],g=1;g<arguments.length;g++)m[g-1]=arguments[g];if(h=m,!c||f!==d){var p=r.leading;typeof p=="function"&&(p=p(f,d)),c&&f===d||!p||l.apply(void 0,ea([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,ea([f],h,!1)),c=0},a)}};return u._clear=function(){clearTimeout(c),c=null},u}(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var a=l[0];if(l.length>1){var r=l.find(function(d){return d.isIntersecting});r&&(a=r)}if(n.callback){var c=a.isIntersecting&&a.intersectionRatio>=n.threshold;if(c===n.oldResult)return;n.oldResult=c,n.callback(c,a)}},this.options.intersection),Wl(function(){n.observer&&n.observer.observe(n.el)})}},t.prototype.destroyObserver=function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)},t}(),Qs={beforeMount:function(t,e){var n=e.value;n&&(typeof IntersectionObserver>"u"?console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill"):t._vue_visibilityState=new cd(t,n))},updated:function(t,e){var n=e.value;if(!ta(n,e.oldValue)){var i=t._vue_visibilityState;n&&i&&i.createObserver(n)}},unmounted:function(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}};const Gn={mounted(t,e){if(typeof ResizeObserver>"u")return;const n=e.value;if(typeof n!="function")return;getComputedStyle(t).position==="static"&&t.style.setProperty("position","relative","important");const i=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});i.observe(t),t.__resizeObserver__=i},unmounted(t){const e=t.__resizeObserver__;e&&(e.disconnect(),t.__resizeObserver__=null)}},ce=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},dd={name:"EvTabs",directives:{observeVisibility:Qs,resize:Gn},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:t=>{const e=t.map(i=>i.value),n=[...new Set(e)];return t.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):t.every(i=>Object.hasOwnProperty.call(i,"value"))?!0:(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is essential."),!1)}},closable:{type:Boolean,default:!1},stretch:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:{"update:modelValue":[String,Number],"update:panels":[Array],change:[String,Number]},setup(t,{emit:e}){const n=o.ref(!1),i=o.ref([]),s=o.computed({get:()=>t.modelValue,set:x=>{e("update:modelValue",x),e("change",x)}});o.provide("evTabs",s);const l=o.computed({get:()=>t.panels,set:x=>e("update:panels",x)}),a=o.computed(()=>!t.draggable||!n.value?l.value:i.value),r=l.value.map(x=>x.value),c=o.ref(null),d=o.ref(null),h=o.ref(!1),u=o.reactive({x:0}),f=o.computed(()=>({transform:`translateX(${u.x}px)`})),m=()=>{const x=c.value.offsetWidth,S=d.value.offsetWidth;if(h.value=x<S,h.value){const L=x-S;L>u.x&&(u.x=L)}else u.x=0};o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let x,S;r.length>l.value.length?(x=r,S=l.value.map(I=>I.value)):(x=l.value.map(I=>I.value),S=r);const L=x.filter(I=>!S.includes(I))[0];if(s.value===L){const I=r.findIndex(R=>R===L);I===0?s.value=l.value[0].value:s.value=l.value[I-1].value}}});const g=x=>{s.value=x},p=x=>{if(l.value.length<2)return;const S=l.value.findIndex(L=>L.value===x);if(S<0){s.value=l.value[0].value;return}x===s.value&&(S===0?s.value=l.value[1].value:s.value=l.value[S-1].value),l.value.splice(S,1),o.nextTick(()=>{r.splice(S,1)}),o.triggerRef(l)},y=(x,S=100)=>{const L=c.value.offsetWidth,I=d.value.offsetWidth,R=L-I;x==="next"&&u.x!==R?R>=u.x-S?u.x=R:u.x-=S:x==="prev"&&u.x!==0&&(S*-1<=u.x?u.x=0:u.x+=S)},C=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:g,removeTab:p,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:y,dragstartTab:(x,S)=>{t.draggable&&(i.value=[...l.value],C.item=x,C.idx=S,n.value=!0)},dragoverTab:x=>{var I;if(!t.draggable||((I=C.item)==null?void 0:I.value)===x)return;const S=i.value.findIndex(R=>{var v;return R.value===((v=C.item)==null?void 0:v.value)}),L=i.value.findIndex(R=>R.value===x);i.value.splice(S,1),i.value.splice(L,0,C.item)},dragendTab:()=>{t.draggable&&(l.value=[...i.value],C.item={},C.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:x=>{var S;return t.draggable&&((S=C.item)==null?void 0:S.value)===x},selectIdxCls:x=>t.draggable&&C.idx===x,onResize:()=>{m()}}}},hd={class:"ev-tabs-header"},ud={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},fd=["onClick","onDragstart","onDragover"],md=["title"],pd=["onClick"],gd={class:"ev-tabs-body"};function bd(t,e,n,i,s,l){const a=o.resolveDirective("resize"),r=o.resolveDirective("observe-visibility");return o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[o.createElementVNode("div",hd,[o.createElementVNode("div",{class:o.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":i.hasScroll}])},[i.hasScroll?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:e[0]||(e[0]=c=>i.scrollTab("prev"))},[...e[3]||(e[3]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),o.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:e[1]||(e[1]=c=>i.scrollTab("next"))},[...e[4]||(e[4]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",ud,[o.createElementVNode("ul",{ref:"listRef",class:"ev-tabs-list",style:o.normalizeStyle(i.listRefStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.computedTabList,(c,d)=>(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===i.mv,"has-icon":c.iconClass,"drag-select":i.dragSelectCls(c.value),"select-idx":i.selectIdxCls(d)},onClick:h=>i.clickTab(c.value),onDragstart:o.withModifiers(h=>i.dragstartTab(c,d),["stop"]),onDragover:o.withModifiers(h=>i.dragoverTab(c.value),["prevent"]),onDragend:e[2]||(e[2]=o.withModifiers((...h)=>i.dragendTab&&i.dragendTab(...h),["prevent"]))}),[c.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"text",title:c.text},o.toDisplayString(c.text),9,md),n.closable?(o.openBlock(),o.createElementBlock("span",{key:1,class:"close-icon",onClick:o.withModifiers(h=>i.removeTab(c.value),["stop"])},[...e[5]||(e[5]=[o.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,pd)):o.createCommentVNode("",!0)],16,fd))),128))],4)],512)],2)]),o.createElementVNode("div",gd,[o.renderSlot(t.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Wn=ce(dd,[["render",bd]]);Wn.install=t=>{t.component(Wn.name,Wn)};const yd={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},emits:{},setup(t){const e=o.inject("evTabs",null),n=o.computed(()=>t.value===e.value),i=o.ref(n.value);return o.watch(n,s=>{s&&(i.value=!0)}),{isSelected:n,hasBeenSelected:i}}},xd={key:0,class:"ev-tab-panel"};function Sd(t,e,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",xd,[o.renderSlot(t.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const Zn=ce(yd,[["render",Sd]]);Zn.install=t=>{t.component(Zn.name,Zn)};const Cd={name:"EvButton",props:{disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},type:{type:String,default:"default"},htmlType:{type:String,default:"button",validator:t=>["button","submit","reset"].includes(t)},shape:{type:String,default:"square"},size:{type:String,default:"medium"}},emits:{click:null},setup(t){const e=o.ref(null);return o.onMounted(()=>{t.autoFocus&&e.value.focus()}),{buttonRef:e}}},kd=["type","disabled","autofocus"];function wd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("button",{ref:"buttonRef",class:o.normalizeClass(["ev-button",{disabled:n.disabled,[`type-${n.type}`]:!!n.type,[`shape-${n.shape}`]:n.shape!=="square",[`size-${n.size}`]:n.size!=="medium"}]),type:n.htmlType,disabled:n.disabled,autofocus:n.autoFocus,onClick:e[0]||(e[0]=a=>t.$emit("click",a))},[o.renderSlot(t.$slots,"default")],10,kd)}const fn=ce(Cd,[["render",wd]]);fn.install=t=>{t.component(fn.name,fn)};const Id={name:"EvButtonGroup"},Ld={class:"ev-button-group"};function Td(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Ld,[o.renderSlot(t.$slots,"default")])}const Xn=ce(Id,[["render",Td]]);Xn.install=t=>{t.component(Xn.name,Xn)};const Md={name:"EvCheckbox",props:{modelValue:{type:[String,Number,Boolean,Symbol,Array],default:!1},label:{type:[String,Number,Boolean,Symbol,Object],default:null},tooltipTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:{"update:modelValue":null,"update:indeterminate":[Boolean],change:null},setup(t,{emit:e}){const n=o.ref();o.onMounted(()=>{n.value&&t.tooltipTitle&&(n.value.title=t.tooltipTitle)});const i=o.ref(null),s=o.inject("EvCheckboxGroupMv",o.computed({get:()=>t.modelValue,set:c=>{c&&!i.value.indeterminate&&e("update:indeterminate",!1),e("update:modelValue",c)}})),l=o.computed(()=>t.label),a=o.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=o.inject("EvCheckboxGroupChange",async c=>{await o.nextTick(),e("change",s.value,c)});return o.watch(()=>t.indeterminate,c=>{o.nextTick(()=>{i.value&&(i.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:i,checked:a,changeMv:r}}},vd=["disabled","value","readonly"],Rd={ref:"checkboxLabel",class:"ev-checkbox-label"};function Vd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:i.checked}]])},[o.withDirectives(o.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":e[0]||(e[0]=a=>i.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:e[1]||(e[1]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,vd),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",Rd,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))],512)],2)}const mn=ce(Md,[["render",Vd]]);mn.install=t=>{t.component(mn.name,mn)};const Ed={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:s=>e("update:modelValue",s)});o.provide("EvCheckboxGroupMv",n);const i=async s=>{await o.nextTick(),e("change",n.value,s)};o.provide("EvCheckboxGroupChange",i)}};function Gd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(t.$slots,"default")],2)}const pn=ce(Ed,[["render",Gd]]);pn.install=t=>{t.component(pn.name,pn)};const Wd={name:"EvRadio",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},label:{type:[String,Number,Symbol,Boolean],default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:""}},emits:{"update:modelValue":null,change:null},setup(t,{emit:e}){const n=o.inject("EvRadioGroupMv",o.computed({get:()=>t.modelValue,set:l=>e("update:modelValue",l)})),i=o.inject("EvRadioGroupChange",async l=>{await o.nextTick(),e("change",n.value,l)}),s=o.computed(()=>n.value===t.label);return{mv:n,checked:s,changeMv:i}}},Zd=["value","disabled"],Xd={class:"ev-radio-label"};function Nd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:i.checked},n.size]])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:e[1]||(e[1]=o.withModifiers((...a)=>i.changeMv&&i.changeMv(...a),["stop"]))},null,40,Zd),[[o.vModelRadio,i.mv]]),o.createElementVNode("span",Xd,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))])],2)}const Nn=ce(Wd,[["render",Nd]]);Nn.install=t=>{t.component(Nn.name,Nn)};const Pd={name:"EvRadioGroup",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},type:{type:String,default:"radio"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:s=>e("update:modelValue",s)});o.provide("EvRadioGroupMv",n);const i=async s=>{await o.nextTick(),e("change",n.value,s)};o.provide("EvRadioGroupChange",i)}};function Dd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(t.$slots,"default")],2)}const Pn=ce(Pd,[["render",Dd]]);Pn.install=t=>{t.component(Pn.name,Pn)};const Yi={mounted(t,e){const n=t,i=e.modifiers.bubbles,s=l=>{(i||n!==l.target&&!n.contains(l.target))&&e.value(l)};n.vueClickOutside=s,document.addEventListener("mousedown",s)},unmounted(t){const e=t;document.removeEventListener("mousedown",e.vueClickOutside),e.vueClickOutside=null}},Bd={mounted(t,e){const n=t;let i=null;const s=e.modifiers.bubble,l=document.body.getElementsByClassName("ev-select-dropbox"),a="ev-tag-name",r="ev-tag-suffix-close",c=d=>{if(!(d.target.classList.contains(a)||d.target.classList.contains(r))&&l&&l.length&&(s||n!==d.target&&!n.contains(d.target))){for(let h=0;h<l.length;h++)if(i=l[h],i!==d.target&&!i.contains(d.target)){e.value(d);break}}};n.vueClickOutside=c,document.addEventListener("mousedown",c)},unmounted(t){const e=t;document.removeEventListener("mousedown",e.vueClickOutside),e.vueClickOutside=null}},Yd={mounted(t,e){const n=t,i=e.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(i||n!==a.target&&!n.contains(a.target))||s&&s[0]&&s[0]!==a.target&&!s[0].contains(a.target)&&n!==a.target&&!n.contains(a.target))&&e.value(a)};n.vueClickOutside=l,document.addEventListener("mousedown",l)},unmounted(t){const e=t;document.removeEventListener("mousedown",e.vueClickOutside),e.vueClickOutside=null}};var Pt=function(){return Pt=Object.assign||function(e){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},Pt.apply(this,arguments)};function gn(t,e,n){if(n||arguments.length===2)for(var i=0,s=e.length,l;i<s;i++)(l||!(i in e))&&(l||(l=Array.prototype.slice.call(e,0,i)),l[i]=e[i]);return t.concat(l||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Oi=44032,Dn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ye=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ee=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Dt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},$s={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},na=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],ia=[["ㄱ","r"],["ㄲ","R"],["ㄴ","s"],["ㄷ","e"],["ㄸ","E"],["ㄹ","f"],["ㅁ","a"],["ㅂ","q"],["ㅃ","Q"],["ㅅ","t"],["ㅆ","T"],["ㅇ","d"],["ㅈ","w"],["ㅉ","W"],["ㅊ","c"],["ㅋ","z"],["ㅌ","x"],["ㅍ","v"],["ㅎ","g"],["ㅏ","k"],["ㅐ","o"],["ㅑ","i"],["ㅒ","O"],["ㅓ","j"],["ㅔ","p"],["ㅕ","u"],["ㅖ","P"],["ㅗ","h"],["ㅛ","y"],["ㅜ","n"],["ㅠ","b"],["ㅡ","m"],["ㅣ","l"]];function sa(t){var e="",n="",i="",s=-1,l=-1,a=-1;if(t.match(/[ㄱ-ㅎ]/))e=t,s=Dn.join("").search(t);else if(t.match(/[가-힣]/)){var r=t.charCodeAt(0)-Oi;a=r%Ee.length,l=(r-a)/Ee.length%Ye.length,s=((r-a)/Ee.length-l)/Ye.length,e=Dn[s],n=Ye[l],i=Ee[a]}return{initial:e,medial:n,finale:i,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(t,e){var n=e[0],i=e[1];return gn(gn([],t,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(i,"\\)(\\s+)"),"g"),n,i],[RegExp(`([가-힣]['" ]{0,1})`.concat(i,"\\(").concat(n,"\\)(\\s+)"),"g"),n,i]],!1)},[]);function Od(t,e){var n=e===void 0?{}:e,i=n.grouped,s=i===void 0?!1:i,l=[];return t.split("").forEach(function(a){var r=sa(a),c=r.initial,d=r.medial,h=r.finale,u=r.initialOffset,f=r.medialOffset,m=r.finaleOffset;l.push((u!==-1||f!==-1||m!==-1?[c,Dt[d]&&na.indexOf(d)===-1?Dt[d]:d,Dt[h]&&na.indexOf(h)===-1?Dt[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var jt=Object.entries(Dt).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[s.join("")]=i,n))},{}),oa=function(t){return typeof t<"u"};function Hd(t){var e=t.findIndex(function(d){return Ye.indexOf(d)!==-1}),n=e!==-1&&Ye.indexOf(t[e+1])!==-1?e+1:e,i=t.slice(0,e).join(""),s=t.slice(e,n+1).join(""),l=t.slice(n+1).join(""),a=Dn.indexOf(jt[i]||i),r=Ye.indexOf(jt[s]||s),c=Ee.indexOf(jt[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Oi+a*(Ye.length*Ee.length)+r*Ee.length+c):t.join("")}function Fd(t){var e=[];(typeof t=="string"?t.split(""):t).forEach(function(l,a,r){typeof l=="string"&&e.length>0&&Ye.indexOf(r[a-1])!==-1&&Ye.indexOf(l)!==-1&&jt["".concat(r[a-1]).concat(l)]?e[e.length-1]=jt["".concat(r[a-1]).concat(l)]:e.push(l)});var n={medial:null,finales:[]},i=[n];e.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},i.push({grouped:l,finales:[]}),i.push(n)):Ye.indexOf(l)!==-1?(n={medial:l,finales:[]},i.push(n)):n.finales.push(l)}),i.forEach(function(l,a,r){if(a>0){var c=r[a-1];if(!c.medial||c.finales.length===1)l.initials=c.finales,c.finales=[];else{var d=c.finales,h=d[0],u=d.slice(1);l.initials=u,c.finales=h?[h]:[]}if(l.finales.length>2||a===i.length-1&&l.finales.length>1){var f=l.finales,m=f[0],g=f[1],p=f.slice(2);jt["".concat(m).concat(g)]&&(l.finales=gn([jt["".concat(m).concat(g)]],p,!0))}}});var s=[];return i.forEach(function(l){var a=l.initials,r=a===void 0?[]:a,c=l.medial,d=l.finales,h=l.grouped;if(h)s.push(h);else{var u=r.slice(),f=u.pop(),m=d[0],g=d.slice(1);Ee.indexOf(m)===-1&&(g=gn([m],g,!0),m=""),u.filter(oa).forEach(function(p){return s.push([p])}),s.push([f,c,m].filter(Boolean)),g.filter(oa).forEach(function(p){return s.push([p])})}}),s.map(Hd).join("")}var zd=Object.values(ia).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[s]=i,n))},{});function la(t){return Fd(t.split("").map(function(e){return zd[e]||e}).join(""))}var aa=/[\\^$.*+?()[\]{}|]/g,Ad=RegExp(aa.source);function qs(t){return t&&Ad.test(t)?t.replace(aa,"\\$&"):t||""}var Hi=function(t,e){e===void 0&&(e=!1);var n=Dn.indexOf(t);if(n!==-1){var i=n*Ye.length*Ee.length+Oi;return"[".concat(e?t:"").concat(String.fromCharCode(i),"-").concat(String.fromCharCode(i+Ye.length*Ee.length-1),"]")}return t},ra="__".concat(parseInt("fuzzy",36),"__"),ca="__".concat(parseInt("ignorespace",36),"__"),eo=function(){var t,e;return function(n,i){var s=i===void 0?{}:i,l=s.initialSearch,a=l===void 0?!1:l,r=s.startsWith,c=r===void 0?!1:r,d=s.endsWith,h=d===void 0?!1:d,u=s.ignoreSpace,f=u===void 0?!1:u,m=s.ignoreCase,g=m===void 0?!0:m,p=s.global,y=p===void 0?!1:p,C=s.fuzzy,b=C===void 0?!1:C,w=s.nonCaptureGroup,T=w===void 0?!1:w,k=s.engToKor,M=k===void 0?!1:k;if(t===n)return e;var V=n,x=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var S=la(n.trim());S.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=S,x.push(qs(n.trim())))}var L=V.split(""),I=L.slice(-1)[0],R="",v=sa(I||"");if(v.initialOffset!==-1){L=L.slice(0,-1);var G=v.initial,W=v.medial,E=v.finale,X=v.initialOffset,Z=v.medialOffset,N=X*Ye.length*Ee.length+Oi,P=[];switch(!0){case E!=="":{P.push(I),Dn.includes(E)&&P.push("".concat(String.fromCharCode(N+Z*Ee.length)).concat(Hi(E))),Dt[E]&&P.push("".concat(String.fromCharCode(N+Z*Ee.length+Ee.join("").search(Dt[E][0])+1)).concat(Hi(Dt[E][1])));break}case W!=="":{var B=void 0,Y=void 0;$s[W]?(B=N+Ye.join("").search($s[W][0])*Ee.length,Y=N+Ye.join("").search($s[W][1])*Ee.length+Ee.length-1):(B=N+Z*Ee.length,Y=B+Ee.length-1),P.push("[".concat(String.fromCharCode(B),"-").concat(String.fromCharCode(Y),"]"));break}case G!=="":{P.push(Hi(G,!0));break}}R=P.length>1?T?"(?:".concat(P.join("|"),")"):"(".concat(P.join("|"),")"):P[0]}var H=b?ra:f?ca:"",_=a?L.map(function(j){return j.search(/[ㄱ-ㅎ]/)!==-1?Hi(j,!0):qs(j)}).join(H):qs(L.join(H)),D=_.trim()!==""&&R.trim()!=="",z=D?"".concat(_).concat(H).concat(R):"".concat(_).concat(R),A=(c?"^":"")+z+(h?"$":"");return H&&(A=A.replace(RegExp(ra,"g"),".*").replace(RegExp(ca,"g"),"\\s*")),x.length>0&&(A=gn(gn([],x,!0),[A],!1).map(function(j){return"(".concat(j,")")}).join("|")),e=RegExp(A,(y?"g":"")+(g?"i":"")),e}}(),Kd=Object.values(ia).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[i]=s,n))},{});function _d(t){return t.split("").map(function(e){return Od(e,{grouped:!1}).map(function(n){return Kd[n]||n})}).flat().join("")}const Ud=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n={get:()=>t.items.some(p=>p.value===t.modelValue)?t.modelValue:null,set:p=>e("update:modelValue",p)},i={get:()=>Array.isArray(t.modelValue)?t.modelValue:[],set:p=>e("update:modelValue",p)},s=o.computed(t.multiple?i:n),l=()=>{var p;return(p=t.items.find(y=>y.value===s.value))==null?void 0:p.name},a=()=>t.items.filter(p=>t.modelValue.includes(p.value)),r=o.computed(t.multiple?a:l),c=o.computed(()=>t.multiple&&s.value.length?null:t.placeholder),d=()=>s.value,h=()=>s.value.length,u=o.computed(t.multiple?h:d),f=()=>{t.disabled||(t.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},m=async()=>{await o.nextTick(),e("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:u,removeAllMv:f,removeMv:async p=>{if(!t.disabled){const y=s.value.indexOf(p);s.value.splice(y,1),s.value=[...s.value],await m()}},changeMv:m}},Jd=t=>{const{props:e}=o.getCurrentInstance(),{mv:n,changeMv:i}=t,s=o.ref(!1),l=o.ref(e.filterText),a=o.ref(null),r=o.ref(null),c=o.ref(null),d=o.ref(null),h=o.ref("100%"),u=o.ref(null),f=o.reactive({top:0}),m=o.computed(()=>{var E;if(!l.value||!e.filterable)return e.items;const v=(E=l.value)==null?void 0:E.trim(),G=la(v),W=_d(v);return e.items.filter(({name:X})=>X.search(eo(v))>-1||X.search(eo(G))>-1||X.search(eo(W))>-1)}),g=v=>{var G;l.value=(G=v==null?void 0:v.target)==null?void 0:G.value},p=async()=>{var X,Z,N;await o.nextTick();const v=(X=r.value)==null?void 0:X.getBoundingClientRect().height,G=(Z=r.value)==null?void 0:Z.getBoundingClientRect().y,W=(N=c.value)==null?void 0:N.getBoundingClientRect().height;document.documentElement.clientHeight<G+v+W?f.top=`-${W}px`:f.top=`${v}px`},y=()=>{var X,Z,N;if(!((N=(Z=(X=d.value)==null?void 0:X.children[0])==null?void 0:Z.children)!=null&&N.length))return;const v="selected",G=d.value.children[0].children,W=d.value.offsetTop;let E=null;for(let P=0;P<G.length;P++)if(E=G[P],E.classList.contains(v)){if(!E.offsetTop)return;d.value.scrollTop=E.offsetTop-W;break}},C=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth);const v=d.value.querySelectorAll(".ev-select-dropbox-item");let G=0;v.forEach(_=>{const D=_.scrollWidth;D>G&&(G=D)});const{borderLeftWidth:W,borderRightWidth:E}=window.getComputedStyle(c.value),X=parseInt(W)+parseInt(E),Z=d.value.offsetWidth-d.value.clientWidth;G+=Z+X;const N=window.innerWidth,B=c.value.getBoundingClientRect().left,Y=N-B-20,H=Math.max(Math.min(G,Y),u.value);h.value=`${H}px`}else h.value="100%"};o.watch(()=>s.value,async v=>{v&&(await y(),await C())}),o.watch(()=>m.value,async()=>{await p()}),e.filterable&&o.watch(()=>m.value,()=>p());const b=async()=>{e.items.length&&!e.disabled&&(s.value=!s.value,s.value&&await p())},w=()=>{e.filterable&&(l.value=""),s.value=!1},T=o.ref(!1),k=v=>{v||(T.value=!T.value),T.value?n.value=m.value.filter(G=>!G.disabled).map(G=>G.value):n.value=[]},M=v=>{e.filterable&&(l.value=""),s.value=!1,n.value!==v&&(n.value=v,i())},V=v=>{if(e.filterable&&(l.value=""),!n.value.includes(v))n.value.push(v);else{const G=n.value.indexOf(v);n.value.splice(G,1)}T.value=n.value.length===m.value.filter(G=>!G.disabled).length,n.value=[...n.value],i()},x=e.multiple?V:M,S=v=>v===n.value,L=v=>n.value.includes(v),I=e.multiple?L:S;o.watch(()=>n.value,v=>{e.multiple&&e.checkable&&(v.length===0?T.value=!1:T.value=v.length===m.value.filter(G=>!G.disabled).length,p())});const R=()=>{s.value&&(C(),p())};return o.onMounted(()=>{window.addEventListener("resize",R)}),o.onUnmounted(()=>{window.removeEventListener("resize",R)}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:m,clickSelectInput:b,clickOutsideDropbox:w,changeFilterText:g,changeDropboxPosition:p,clickItem:x,selectedItemClass:I,allCheck:T,changeAllCheck:k,dropboxWidth:h}},jd={name:"EvSelect",components:{EvCheckbox:mn,EvCheckboxGroup:pn},directives:{clickoutside:Bd},props:{modelValue:{type:[Boolean,String,Number,Array,Object],default:null},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:"Please Enter a Search Words."},noMatchingText:{type:String,default:"NO MATCHING DATA"},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterText:{type:String,default:""},allCheckLabel:{type:String,default:"Select All"}},emits:{"update:modelValue":null,change:null},setup(){const{mv:t,selectedModel:e,computedPlaceholder:n,isClearableIcon:i,changeMv:s,removeMv:l,removeAllMv:a}=Ud(),{select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:m,filteredItems:g,clickSelectInput:p,clickOutsideDropbox:y,changeFilterText:C,changeDropboxPosition:b,clickItem:w,selectedItemClass:T,allCheck:k,changeAllCheck:M,dropboxWidth:V}=Jd({mv:t,changeMv:s});return{mv:t,selectedModel:e,computedPlaceholder:n,isClearableIcon:i,changeMv:s,removeMv:l,removeAllMv:a,select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:m,filteredItems:g,clickSelectInput:p,clickOutsideDropbox:y,changeFilterText:C,changeDropboxPosition:b,clickItem:w,selectedItemClass:T,allCheck:k,changeAllCheck:M,dropboxWidth:V}}},Qd={ref:"selectWrapper",class:"ev-select__wrapper"},$d=["placeholder","disabled"],qd={key:1,class:"ev-select-tag-wrapper"},eh=["placeholder","disabled"],th={class:"ev-tag-name"},nh=["onClick"],ih={key:0,class:"ev-select-tag"},sh={class:"ev-tag-name"},oh={key:1,class:"ev-select-tag num"},lh={class:"ev-tag-name"},ah={class:"ev-select-dropbox-wrapper"},rh=["placeholder","value"],ch={ref:"itemWrapper",class:"ev-select-dropbox-list"},dh={key:0,class:"ev-select-dropbox-ul"},hh=["title","onClick"],uh={key:1},fh={class:"ev-select-dropbox-item disabled"},mh={key:0,class:"ev-select-dropbox-ul"},ph=["title","onClick"],gh={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},bh={key:0,class:"ev-select-dropbox-ul"},yh=["title","onClick"],xh={key:1},Sh={class:"ev-select-dropbox-item disabled"};function Ch(t,e,n,i,s,l){const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-checkbox-group"),c=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"select",class:o.normalizeClass(["ev-select",{selected:i.isDropbox,disabled:n.disabled}])},[o.createElementVNode("div",Qd,[n.multiple?(o.openBlock(),o.createElementBlock("div",qd,[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:e[3]||(e[3]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:e[4]||(e[4]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,eh),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",ih,[o.createElementVNode("span",sh,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:e[5]||(e[5]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...e[13]||(e[13]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):o.createCommentVNode("",!0),i.selectedModel.length>1?(o.openBlock(),o.createElementBlock("div",oh,[o.createElementVNode("span",lh," + "+o.toDisplayString(i.selectedModel.length-1),1)])):o.createCommentVNode("",!0)],64)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.selectedModel,d=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"ev-select-tag"},[o.createElementVNode("span",th,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...e[12]||(e[12]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,nh)]))),128))])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:e[0]||(e[0]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=d=>i.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:e[2]||(e[2]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,$d),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:e[6]||(e[6]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...e[14]||(e[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",ah,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:"ev-select-dropbox",style:o.normalizeStyle([i.dropboxPosition,{width:i.dropboxWidth}])},[n.filterable?o.renderSlot(t.$slots,"search-filter",{key:0,item:{value:i.filterTextRef,onInput:i.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[o.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:i.filterTextRef,onInput:e[7]||(e[7]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,rh)]):o.createCommentVNode("",!0),n.checkable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-select-dropbox-item all-check",{selected:i.allCheck}]),onClick:e[10]||(e[10]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":e[8]||(e[8]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:e[9]||(e[9]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",ch,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":e[11]||(e[11]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",dh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["self","prevent"])},[o.createVNode(a,{label:d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)]),_:2},1032,["label","disabled"])],10,hh))),128))])):(o.openBlock(),o.createElementBlock("ul",uh,[o.createElementVNode("li",fh,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",mh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[o.createVNode(a,{"model-value":i.mv===d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)]),_:2},1032,["model-value","disabled"])],10,ph))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",gh,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",bh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)],10,yh))),128))])):(o.openBlock(),o.createElementBlock("ul",xh,[o.createElementVNode("li",Sh,o.toDisplayString(n.noMatchingText),1)]))],512))],4)):o.createCommentVNode("",!0)])],512)],2)),[[c,i.clickOutsideDropbox]])}const Bn=ce(jd,[["render",Ch]]);Bn.install=t=>{t.component(Bn.name,Bn)};const kh={name:"EvToggle",props:{modelValue:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeColor:{type:String,default:"#409EFF"},inactiveColor:{type:String,default:"#DCDFE6"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:s=>{e("update:modelValue",s),e("change",s)}});return{mv:n,clickMv:()=>{!t.disabled&&!t.readonly&&(n.value=!n.value)}}}};function wh(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:o.normalizeStyle({width:`${n.width}px`,border:`1px solid ${n.modelValue?n.activeColor:n.inactiveColor}`,"background-color":`${n.modelValue?n.activeColor:n.inactiveColor}`}),onClick:e[0]||(e[0]=(...a)=>i.clickMv&&i.clickMv(...a))},null,6)}const Yn=ce(kh,[["render",wh]]);Yn.install=t=>{t.component(Yn.name,Yn)};const Ih={name:"EvTextField",props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:"text"},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{type:Number,default:null},maxUnit:{type:String,default:"count"},showMaxLength:{type:Boolean,default:!1},errorMsg:{type:String,default:""},autocomplete:{type:String,default:"off"},modelModifiers:{type:Object,default:()=>({})}},emits:["update:modelValue","focus","blur","input","change","search"],setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:p=>e("update:modelValue",p)}),i=o.ref(!1),s=()=>{t.type==="password"&&(i.value=!i.value)},l=o.computed(()=>t.type==="password"?i.value?"text":"password":t.type==="search"?"text":t.type);o.watch(()=>t.type,p=>{p!=="password"&&(i.value=!1)});const a=()=>{n.value=""},r=()=>{e("search",n.value)},c=p=>{t.type==="search"&&(p.key==="Enter"||p.keyCode===13)&&r()},d=p=>{e("focus",p)},h=p=>{if(t.modelModifiers.trim&&typeof p.target.value=="string"){const y=p.target.value.trim();y!==p.target.value&&(n.value=y,p.target.value=y)}e("blur",p)},u=p=>new TextEncoder().encode(p).length,f=o.computed(()=>t.maxUnit==="byte"?u(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:i,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:p=>{let y=p.target.value;if(t.maxLength&&t.maxUnit==="byte"){for(;u(y)>t.maxLength;)y=y.slice(0,-1);p.target.value=y}n.value=y,e("input",y,p)},changeMv:p=>e("change",n.value,p),currentLength:f}}},Lh={class:"ev-text-field-wrapper"},Th=["placeholder","disabled","readonly","autocomplete","maxlength"],Mh=["type","placeholder","disabled","readonly","autocomplete","maxlength"],vh={key:3,class:"ev-text-field-icon icon-suffix"},Rh={key:4,class:"ev-text-field-icon icon-prefix"},Vh={key:0,class:"ev-text-field-error"},Eh={class:"curr-length"};function Gh(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-text-field",{disabled:n.disabled,clearable:n.clearable,readonly:n.readonly,error:!!n.errorMsg,"show-password":n.showPassword,"show-maxlength":n.showMaxLength,[`type-${n.type}`]:!!n.type,"ev-text-field-prefix":t.$slots["icon-prefix"],"ev-text-field-suffix":t.$slots["icon-suffix"],"ev-text-field-prefix-suffix":t.$slots["icon-prefix"]&&t.$slots["icon-suffix"]}])},[o.createElementVNode("div",Lh,[n.type==="textarea"?o.withDirectives((o.openBlock(),o.createElementBlock("textarea",{key:0,"onUpdate:modelValue":e[0]||(e[0]=a=>i.mv=a),class:"ev-textarea",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:e[1]||(e[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:e[2]||(e[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:e[3]||(e[3]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:e[4]||(e[4]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,Th)),[[o.vModelText,i.mv]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[5]||(e[5]=a=>i.mv=a),class:"ev-input",type:i.inputType,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:e[6]||(e[6]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:e[7]||(e[7]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:e[8]||(e[8]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:e[9]||(e[9]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeyup:e[10]||(e[10]=(...a)=>i.keyupInput&&i.keyupInput(...a))},null,40,Mh),[[o.vModelDynamic,i.mv]]),n.type==="text"&&n.clearable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:e[11]||(e[11]=(...a)=>i.clearValue&&i.clearValue(...a))},[...e[14]||(e[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):o.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["ev-text-field-icon icon-password",{on:i.isPasswordVisible}]),onClick:e[12]||(e[12]=(...a)=>i.changePasswordVisible&&i.changePasswordVisible(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):o.createCommentVNode("",!0),n.type==="search"?(o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:e[13]||(e[13]=(...a)=>i.searchValue&&i.searchValue(...a))},[...e[15]||(e[15]=[o.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):o.createCommentVNode("",!0),t.$slots["icon-suffix"]?(o.openBlock(),o.createElementBlock("span",vh,[o.renderSlot(t.$slots,"icon-suffix")])):o.createCommentVNode("",!0),t.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",Rh,[o.renderSlot(t.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",Vh,o.toDisplayString(n.errorMsg),1)):o.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-text-field-maxlength",{max:i.currentLength>n.maxLength}])},[o.createElementVNode("span",Eh,o.toDisplayString(i.currentLength),1),o.createTextVNode(" / "+o.toDisplayString(n.maxLength)+o.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):o.createCommentVNode("",!0)],2)}const On=ce(Ih,[["render",Gh]]);On.install=t=>{t.component(On.name,On)};const bn=globalThis.console,to={log(...t){bn.log(...t)},warn(...t){bn.warn(...t)},info(...t){bn.info(...t)},error(...t){bn.error(...t)},debug(...t){bn.debug(...t)},dir(t,e){bn.dir(t,e)}};function da(t){let e=null;if(typeof t=="string"||typeof t=="number"){const n=/^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(t);e=n?{value:+n[2],unit:n[3]||void 0}:null}return e}function ve(t){return typeof t=="number"&&!Number.isNaN(t)}function yt(...t){return t.every(ve)}function Je(t,e){const n=t/e*100;return!yt(t,e,n)||t===0||e===0?0:n.toFixed(2)}function Wh(t){return yt(t)?1e6*t:0}function Zh(t){return yt(t)?1e9*t:0}function Xh(t){return yt(t)?1e12*t:0}function Nh(t){return yt(t)?1e15*t:0}function Qt(t){const e=/\B(?=(\d{3})+(?!\d))/g;if(yt(t)){if(Number.isInteger(t))return t.toString().replace(e,",");const n=t.toString().split(".");return n[0].replace(e,",")+(n[1]?`.${n[1]}`:"")}return!1}function Hn(t){const e=(t==null?void 0:t.toString().split(".")[1])||0;return e?e.length:0}function no(t){return t==null}function Ph(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function $t(t,{min:e,max:n,step:i}){const s=Math.floor((t-e)/i),l=(t-e)%i,a=Math.floor((n-e)/i),r=Math.max(Hn(i),Hn(e));let c=!1,d;if(r){let h=+parseFloat(i*s).toFixed(r);d=+(h+e).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==i,l>i/2&&!c&&(d=+(d+i).toFixed(r)),d>n?(h=+parseFloat(i*a).toFixed(r),d=+(h+e).toFixed(r)):d<e&&(d=e)}else d=i*s+e,c=s===a&&n-d!==i,l>i/2&&!c&&(d+=i),d>n?d=i*a+e:d<e&&(d=e);return d}function Dh(){const{props:t,emit:e}=o.getCurrentInstance(),n=o.ref(t.modelValue),i=o.ref(t.modelValue),s=d=>{if(t.precision&&(d||d===0)){const h=Number(d).toFixed(t.precision);return t.trimTrailingZero?String(parseFloat(h)):h}return d},l=d=>{let h=d;!d&&d!==0?t.disableEmpty?(h=0,t.stepStrictly?h=$t(h,{min:t.min===-1/0?0:t.min,max:t.max,step:t.step}):(t.min||t.min===0)&&h<t.min?h=t.min:(t.max||t.max===0)&&h>t.max&&(h=t.max)):h=t.stepStrictly?i.value:null:isNaN(d)?h=i.value:t.stepStrictly?(t.min===-1/0&&(t.min=0),h=$t(d,{min:t.min,max:t.max,step:t.step})):(t.min||t.min===0)&&h<t.min?h=t.min:(t.max||t.max===0)&&h>t.max?h=t.max:h=+h,n.value=s(h),i.value=s(h),e("update:modelValue",h),e("change",h)},a=d=>{e("focus",d)},r=d=>{e("blur",d)},c=d=>{l(d.target.value)};return o.watch(()=>t.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function Bh(t){const{props:e}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=t;return{stepValue:l=>{if(e.readonly||e.disabled)return;const a=!n.value&&n.value!==0;let r;if(a)r=e.min===-1/0?0:e.min;else{const c=+n.value,d=l==="up"?e.step:e.step*-1,u=10**Math.max(Hn(c),Hn(e.step));r=(Math.round(c*u)+Math.round(d*u))/u}if(e.clampOnStep){r<e.min?r=e.min:r>e.max&&(r=e.max);const c=e.stepStrictly?$t(r,{min:e.min===-1/0?0:e.min,max:e.max,step:e.step}):r;(a||c!==+n.value)&&i(r)}else r>=e.min&&r<=e.max&&i(r)}}}function Yh(t){const{props:e}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=t,s=e.max||e.max===0,l=e.min||e.min===0,a=()=>{s&&l&&e.max<=e.min&&console.warn("[EVUI][InputNumber] Max value must be greater than min value."),e.step&&(e.precision||e.precision===0)&&Hn(e.step)>e.precision&&console.warn("[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.")},r=()=>{let c=n.value;isNaN(n.value)&&(c=0),(c||c===0)&&(s&&c>e.max?c=e.max:l&&c<e.min&&(c=e.min)),i(c)};o.onBeforeMount(()=>{a(),r()})}const Oh={name:"EvInputNumber",props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},step:{type:Number,default:1,validator:t=>t>0},stepStrictly:{type:Boolean,default:!1},precision:{type:Number,default:0,validator:t=>t>=0&&t<=100&&t===parseInt(t,10)},trimTrailingZero:{type:Boolean,default:!1},disableEmpty:{type:Boolean,default:!1},clampOnStep:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:t,validateValue:e,focusInput:n,blurInput:i,changeMv:s}=Dh(),{stepValue:l}=Bh({currentValue:t,validateValue:e});return Yh({currentValue:t,validateValue:e}),{currentValue:t,validateValue:e,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},Hh={class:"ev-input-number__wrapper"},Fh=["onClick"],zh=["placeholder","disabled","readonly"];function Ah(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[o.createElementVNode("div",Hh,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],a=>o.createElementVNode("span",{key:`step-arrow-${a}`,class:o.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>i.stepValue(a)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,Fh)),64)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:e[1]||(e[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:e[2]||(e[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onChange:e[3]||(e[3]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeydown:[e[4]||(e[4]=o.withKeys(o.withModifiers(a=>i.stepValue("up"),["prevent"]),["up"])),e[5]||(e[5]=o.withKeys(o.withModifiers(a=>i.stepValue("down"),["prevent"]),["down"])),e[6]||(e[6]=o.withKeys(o.withModifiers(a=>i.validateValue(i.currentValue),["prevent"]),["enter"]))]},null,40,zh),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])])],2)}const Fn=ce(Oh,[["render",Ah]]);Fn.install=t=>{t.component(Fn.name,Fn)};var ha=typeof global=="object"&&global&&global.Object===Object&&global,Kh=typeof self=="object"&&self&&self.Object===Object&&self,rt=ha||Kh||Function("return this")(),xt=rt.Symbol,ua=Object.prototype,_h=ua.hasOwnProperty,Uh=ua.toString,zn=xt?xt.toStringTag:void 0;function Jh(t){var e=_h.call(t,zn),n=t[zn];try{t[zn]=void 0;var i=!0}catch{}var s=Uh.call(t);return i&&(e?t[zn]=n:delete t[zn]),s}var jh=Object.prototype,Qh=jh.toString;function $h(t){return Qh.call(t)}var qh="[object Null]",eu="[object Undefined]",fa=xt?xt.toStringTag:void 0;function Bt(t){return t==null?t===void 0?eu:qh:fa&&fa in Object(t)?Jh(t):$h(t)}function ct(t){return t!=null&&typeof t=="object"}var tu="[object Symbol]";function Fi(t){return typeof t=="symbol"||ct(t)&&Bt(t)==tu}function nu(t,e){for(var n=-1,i=t==null?0:t.length,s=Array(i);++n<i;)s[n]=e(t[n],n,t);return s}var qe=Array.isArray,ma=xt?xt.prototype:void 0,pa=ma?ma.toString:void 0;function ga(t){if(typeof t=="string")return t;if(qe(t))return nu(t,ga)+"";if(Fi(t))return pa?pa.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var iu=/\s/;function su(t){for(var e=t.length;e--&&iu.test(t.charAt(e)););return e}var ou=/^\s+/;function lu(t){return t&&t.slice(0,su(t)+1).replace(ou,"")}function Oe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ba=NaN,au=/^[-+]0x[0-9a-f]+$/i,ru=/^0b[01]+$/i,cu=/^0o[0-7]+$/i,du=parseInt;function zi(t){if(typeof t=="number")return t;if(Fi(t))return ba;if(Oe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Oe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=lu(t);var n=ru.test(t);return n||cu.test(t)?du(t.slice(2),n?2:8):au.test(t)?ba:+t}var ya=1/0,hu=17976931348623157e292;function xa(t){if(!t)return t===0?t:0;if(t=zi(t),t===ya||t===-ya){var e=t<0?-1:1;return e*hu}return t===t?t:0}function io(t){return t}var uu="[object AsyncFunction]",fu="[object Function]",mu="[object GeneratorFunction]",pu="[object Proxy]";function so(t){if(!Oe(t))return!1;var e=Bt(t);return e==fu||e==mu||e==uu||e==pu}var oo=rt["__core-js_shared__"],Sa=function(){var t=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function gu(t){return!!Sa&&Sa in t}var bu=Function.prototype,yu=bu.toString;function qt(t){if(t!=null){try{return yu.call(t)}catch{}try{return t+""}catch{}}return""}var xu=/[\\^$.*+?()[\]{}|]/g,Su=/^\[object .+?Constructor\]$/,Cu=Function.prototype,ku=Object.prototype,wu=Cu.toString,Iu=ku.hasOwnProperty,Lu=RegExp("^"+wu.call(Iu).replace(xu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Tu(t){if(!Oe(t)||gu(t))return!1;var e=so(t)?Lu:Su;return e.test(qt(t))}function Mu(t,e){return t==null?void 0:t[e]}function en(t,e){var n=Mu(t,e);return Tu(n)?n:void 0}var lo=en(rt,"WeakMap"),Ca=Object.create,vu=function(){function t(){}return function(e){if(!Oe(e))return{};if(Ca)return Ca(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ka(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ru(){}function Vu(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var Eu=800,Gu=16,Wu=Date.now;function Zu(t){var e=0,n=0;return function(){var i=Wu(),s=Gu-(i-n);if(n=i,s>0){if(++e>=Eu)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Xu(t){return function(){return t}}var Ai=function(){try{var t=en(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Nu=Ai?function(t,e){return Ai(t,"toString",{configurable:!0,enumerable:!1,value:Xu(e),writable:!0})}:io,Pu=Zu(Nu);function Du(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}function Bu(t,e,n,i){for(var s=t.length,l=n+-1;++l<s;)if(e(t[l],l,t))return l;return-1}function Yu(t){return t!==t}function Ou(t,e,n){for(var i=n-1,s=t.length;++i<s;)if(t[i]===e)return i;return-1}function Hu(t,e,n){return e===e?Ou(t,e,n):Bu(t,Yu,n)}function Fu(t,e){var n=t==null?0:t.length;return!!n&&Hu(t,e,0)>-1}var zu=9007199254740991,Au=/^(?:0|[1-9]\d*)$/;function ao(t,e){var n=typeof t;return e=e??zu,!!e&&(n=="number"||n!="symbol"&&Au.test(t))&&t>-1&&t%1==0&&t<e}function ro(t,e,n){e=="__proto__"&&Ai?Ai(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function yn(t,e){return t===e||t!==t&&e!==e}var Ku=Object.prototype,_u=Ku.hasOwnProperty;function wa(t,e,n){var i=t[e];(!(_u.call(t,e)&&yn(i,n))||n===void 0&&!(e in t))&&ro(t,e,n)}function Uu(t,e,n,i){var s=!n;n||(n={});for(var l=-1,a=e.length;++l<a;){var r=e[l],c=void 0;c===void 0&&(c=t[r]),s?ro(n,r,c):wa(n,r,c)}return n}var Ia=Math.max;function Ju(t,e,n){return e=Ia(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,l=Ia(i.length-e,0),a=Array(l);++s<l;)a[s]=i[e+s];s=-1;for(var r=Array(e+1);++s<e;)r[s]=i[s];return r[e]=n(a),ka(t,this,r)}}function co(t,e){return Pu(Ju(t,e,io),t+"")}var ju=9007199254740991;function ho(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ju}function Ki(t){return t!=null&&ho(t.length)&&!so(t)}function La(t,e,n){if(!Oe(n))return!1;var i=typeof e;return(i=="number"?Ki(n)&&ao(e,n.length):i=="string"&&e in n)?yn(n[e],t):!1}function Ta(t){return co(function(e,n){var i=-1,s=n.length,l=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(l=t.length>3&&typeof l=="function"?(s--,l):void 0,a&&La(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),e=Object(e);++i<s;){var r=n[i];r&&t(e,r,i,l)}return e})}var Qu=Object.prototype;function uo(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Qu;return t===n}function $u(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}var qu="[object Arguments]";function Ma(t){return ct(t)&&Bt(t)==qu}var va=Object.prototype,ef=va.hasOwnProperty,tf=va.propertyIsEnumerable,_i=Ma(function(){return arguments}())?Ma:function(t){return ct(t)&&ef.call(t,"callee")&&!tf.call(t,"callee")};function nf(){return!1}var Ra=typeof le=="object"&&le&&!le.nodeType&&le,Va=Ra&&typeof module=="object"&&module&&!module.nodeType&&module,sf=Va&&Va.exports===Ra,Ea=sf?rt.Buffer:void 0,of=Ea?Ea.isBuffer:void 0,An=of||nf,lf="[object Arguments]",af="[object Array]",rf="[object Boolean]",cf="[object Date]",df="[object Error]",hf="[object Function]",uf="[object Map]",ff="[object Number]",mf="[object Object]",pf="[object RegExp]",gf="[object Set]",bf="[object String]",yf="[object WeakMap]",xf="[object ArrayBuffer]",Sf="[object DataView]",Cf="[object Float32Array]",kf="[object Float64Array]",wf="[object Int8Array]",If="[object Int16Array]",Lf="[object Int32Array]",Tf="[object Uint8Array]",Mf="[object Uint8ClampedArray]",vf="[object Uint16Array]",Rf="[object Uint32Array]",Ce={};Ce[Cf]=Ce[kf]=Ce[wf]=Ce[If]=Ce[Lf]=Ce[Tf]=Ce[Mf]=Ce[vf]=Ce[Rf]=!0,Ce[lf]=Ce[af]=Ce[xf]=Ce[rf]=Ce[Sf]=Ce[cf]=Ce[df]=Ce[hf]=Ce[uf]=Ce[ff]=Ce[mf]=Ce[pf]=Ce[gf]=Ce[bf]=Ce[yf]=!1;function Vf(t){return ct(t)&&ho(t.length)&&!!Ce[Bt(t)]}function fo(t){return function(e){return t(e)}}var Ga=typeof le=="object"&&le&&!le.nodeType&&le,Kn=Ga&&typeof module=="object"&&module&&!module.nodeType&&module,Ef=Kn&&Kn.exports===Ga,mo=Ef&&ha.process,xn=function(){try{var t=Kn&&Kn.require&&Kn.require("util").types;return t||mo&&mo.binding&&mo.binding("util")}catch{}}(),Wa=xn&&xn.isTypedArray,po=Wa?fo(Wa):Vf,Gf=Object.prototype,Wf=Gf.hasOwnProperty;function Za(t,e){var n=qe(t),i=!n&&_i(t),s=!n&&!i&&An(t),l=!n&&!i&&!s&&po(t),a=n||i||s||l,r=a?$u(t.length,String):[],c=r.length;for(var d in t)(e||Wf.call(t,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ao(d,c)))&&r.push(d);return r}function Xa(t,e){return function(n){return t(e(n))}}var Zf=Xa(Object.keys,Object),Xf=Object.prototype,Nf=Xf.hasOwnProperty;function Pf(t){if(!uo(t))return Zf(t);var e=[];for(var n in Object(t))Nf.call(t,n)&&n!="constructor"&&e.push(n);return e}function Na(t){return Ki(t)?Za(t):Pf(t)}function Df(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var Bf=Object.prototype,Yf=Bf.hasOwnProperty;function Of(t){if(!Oe(t))return Df(t);var e=uo(t),n=[];for(var i in t)i=="constructor"&&(e||!Yf.call(t,i))||n.push(i);return n}function go(t){return Ki(t)?Za(t,!0):Of(t)}var Hf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ff=/^\w*$/;function bo(t,e){if(qe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Fi(t)?!0:Ff.test(t)||!Hf.test(t)||e!=null&&t in Object(e)}var _n=en(Object,"create");function zf(){this.__data__=_n?_n(null):{},this.size=0}function Af(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Kf="__lodash_hash_undefined__",_f=Object.prototype,Uf=_f.hasOwnProperty;function Jf(t){var e=this.__data__;if(_n){var n=e[t];return n===Kf?void 0:n}return Uf.call(e,t)?e[t]:void 0}var jf=Object.prototype,Qf=jf.hasOwnProperty;function $f(t){var e=this.__data__;return _n?e[t]!==void 0:Qf.call(e,t)}var qf="__lodash_hash_undefined__";function em(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=_n&&e===void 0?qf:e,this}function tn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}tn.prototype.clear=zf,tn.prototype.delete=Af,tn.prototype.get=Jf,tn.prototype.has=$f,tn.prototype.set=em;function tm(){this.__data__=[],this.size=0}function Ui(t,e){for(var n=t.length;n--;)if(yn(t[n][0],e))return n;return-1}var nm=Array.prototype,im=nm.splice;function sm(t){var e=this.__data__,n=Ui(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():im.call(e,n,1),--this.size,!0}function om(t){var e=this.__data__,n=Ui(e,t);return n<0?void 0:e[n][1]}function lm(t){return Ui(this.__data__,t)>-1}function am(t,e){var n=this.__data__,i=Ui(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function It(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}It.prototype.clear=tm,It.prototype.delete=sm,It.prototype.get=om,It.prototype.has=lm,It.prototype.set=am;var Un=en(rt,"Map");function rm(){this.size=0,this.__data__={hash:new tn,map:new(Un||It),string:new tn}}function cm(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ji(t,e){var n=t.__data__;return cm(e)?n[typeof e=="string"?"string":"hash"]:n.map}function dm(t){var e=Ji(this,t).delete(t);return this.size-=e?1:0,e}function hm(t){return Ji(this,t).get(t)}function um(t){return Ji(this,t).has(t)}function fm(t,e){var n=Ji(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}function Lt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Lt.prototype.clear=rm,Lt.prototype.delete=dm,Lt.prototype.get=hm,Lt.prototype.has=um,Lt.prototype.set=fm;var mm="Expected a function";function yo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(mm);var n=function(){var i=arguments,s=e?e.apply(this,i):i[0],l=n.cache;if(l.has(s))return l.get(s);var a=t.apply(this,i);return n.cache=l.set(s,a)||l,a};return n.cache=new(yo.Cache||Lt),n}yo.Cache=Lt;var pm=500;function gm(t){var e=yo(t,function(i){return n.size===pm&&n.clear(),i}),n=e.cache;return e}var bm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ym=/\\(\\)?/g,xm=gm(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(bm,function(n,i,s,l){e.push(s?l.replace(ym,"$1"):i||n)}),e});function Sm(t){return t==null?"":ga(t)}function Pa(t,e){return qe(t)?t:bo(t,e)?[t]:xm(Sm(t))}function ji(t){if(typeof t=="string"||Fi(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Da(t,e){e=Pa(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[ji(e[n++])];return n&&n==i?t:void 0}function Cm(t,e,n){var i=t==null?void 0:Da(t,e);return i===void 0?n:i}function km(t,e){for(var n=-1,i=e.length,s=t.length;++n<i;)t[s+n]=e[n];return t}var Ba=Xa(Object.getPrototypeOf,Object),wm="[object Object]",Im=Function.prototype,Lm=Object.prototype,Ya=Im.toString,Tm=Lm.hasOwnProperty,Mm=Ya.call(Object);function vm(t){if(!ct(t)||Bt(t)!=wm)return!1;var e=Ba(t);if(e===null)return!0;var n=Tm.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Ya.call(n)==Mm}function Rm(){this.__data__=new It,this.size=0}function Vm(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Em(t){return this.__data__.get(t)}function Gm(t){return this.__data__.has(t)}var Wm=200;function Zm(t,e){var n=this.__data__;if(n instanceof It){var i=n.__data__;if(!Un||i.length<Wm-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Lt(i)}return n.set(t,e),this.size=n.size,this}function dt(t){var e=this.__data__=new It(t);this.size=e.size}dt.prototype.clear=Rm,dt.prototype.delete=Vm,dt.prototype.get=Em,dt.prototype.has=Gm,dt.prototype.set=Zm;var Oa=typeof le=="object"&&le&&!le.nodeType&&le,Ha=Oa&&typeof module=="object"&&module&&!module.nodeType&&module,Xm=Ha&&Ha.exports===Oa,Fa=Xm?rt.Buffer:void 0,za=Fa?Fa.allocUnsafe:void 0;function Aa(t,e){if(e)return t.slice();var n=t.length,i=za?za(n):new t.constructor(n);return t.copy(i),i}function Nm(t,e){for(var n=-1,i=t==null?0:t.length,s=0,l=[];++n<i;){var a=t[n];e(a,n,t)&&(l[s++]=a)}return l}function Pm(){return[]}var Dm=Object.prototype,Bm=Dm.propertyIsEnumerable,Ka=Object.getOwnPropertySymbols,Ym=Ka?function(t){return t==null?[]:(t=Object(t),Nm(Ka(t),function(e){return Bm.call(t,e)}))}:Pm;function Om(t,e,n){var i=e(t);return qe(t)?i:km(i,n(t))}function xo(t){return Om(t,Na,Ym)}var So=en(rt,"DataView"),Co=en(rt,"Promise"),Sn=en(rt,"Set"),_a="[object Map]",Hm="[object Object]",Ua="[object Promise]",Ja="[object Set]",ja="[object WeakMap]",Qa="[object DataView]",Fm=qt(So),zm=qt(Un),Am=qt(Co),Km=qt(Sn),_m=qt(lo),ht=Bt;(So&&ht(new So(new ArrayBuffer(1)))!=Qa||Un&&ht(new Un)!=_a||Co&&ht(Co.resolve())!=Ua||Sn&&ht(new Sn)!=Ja||lo&&ht(new lo)!=ja)&&(ht=function(t){var e=Bt(t),n=e==Hm?t.constructor:void 0,i=n?qt(n):"";if(i)switch(i){case Fm:return Qa;case zm:return _a;case Am:return Ua;case Km:return Ja;case _m:return ja}return e});var Um=Object.prototype,Jm=Um.hasOwnProperty;function jm(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&Jm.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Qi=rt.Uint8Array;function ko(t){var e=new t.constructor(t.byteLength);return new Qi(e).set(new Qi(t)),e}function Qm(t,e){var n=ko(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var $m=/\w*$/;function qm(t){var e=new t.constructor(t.source,$m.exec(t));return e.lastIndex=t.lastIndex,e}var $a=xt?xt.prototype:void 0,qa=$a?$a.valueOf:void 0;function ep(t){return qa?Object(qa.call(t)):{}}function er(t,e){var n=e?ko(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var tp="[object Boolean]",np="[object Date]",ip="[object Map]",sp="[object Number]",op="[object RegExp]",lp="[object Set]",ap="[object String]",rp="[object Symbol]",cp="[object ArrayBuffer]",dp="[object DataView]",hp="[object Float32Array]",up="[object Float64Array]",fp="[object Int8Array]",mp="[object Int16Array]",pp="[object Int32Array]",gp="[object Uint8Array]",bp="[object Uint8ClampedArray]",yp="[object Uint16Array]",xp="[object Uint32Array]";function Sp(t,e,n){var i=t.constructor;switch(e){case cp:return ko(t);case tp:case np:return new i(+t);case dp:return Qm(t);case hp:case up:case fp:case mp:case pp:case gp:case bp:case yp:case xp:return er(t,n);case ip:return new i;case sp:case ap:return new i(t);case op:return qm(t);case lp:return new i;case rp:return ep(t)}}function tr(t){return typeof t.constructor=="function"&&!uo(t)?vu(Ba(t)):{}}var Cp="[object Map]";function kp(t){return ct(t)&&ht(t)==Cp}var nr=xn&&xn.isMap,wp=nr?fo(nr):kp,Ip="[object Set]";function Lp(t){return ct(t)&&ht(t)==Ip}var ir=xn&&xn.isSet,Tp=ir?fo(ir):Lp,Mp=1,sr="[object Arguments]",vp="[object Array]",Rp="[object Boolean]",Vp="[object Date]",Ep="[object Error]",or="[object Function]",Gp="[object GeneratorFunction]",Wp="[object Map]",Zp="[object Number]",lr="[object Object]",Xp="[object RegExp]",Np="[object Set]",Pp="[object String]",Dp="[object Symbol]",Bp="[object WeakMap]",Yp="[object ArrayBuffer]",Op="[object DataView]",Hp="[object Float32Array]",Fp="[object Float64Array]",zp="[object Int8Array]",Ap="[object Int16Array]",Kp="[object Int32Array]",_p="[object Uint8Array]",Up="[object Uint8ClampedArray]",Jp="[object Uint16Array]",jp="[object Uint32Array]",ye={};ye[sr]=ye[vp]=ye[Yp]=ye[Op]=ye[Rp]=ye[Vp]=ye[Hp]=ye[Fp]=ye[zp]=ye[Ap]=ye[Kp]=ye[Wp]=ye[Zp]=ye[lr]=ye[Xp]=ye[Np]=ye[Pp]=ye[Dp]=ye[_p]=ye[Up]=ye[Jp]=ye[jp]=!0,ye[Ep]=ye[or]=ye[Bp]=!1;function Jn(t,e,n,i,s,l){var a,r=e&Mp;if(n&&(a=s?n(t,i,s,l):n(t)),a!==void 0)return a;if(!Oe(t))return t;var c=qe(t);if(c)a=jm(t);else{var d=ht(t),h=d==or||d==Gp;if(An(t))return Aa(t,r);if(d==lr||d==sr||h&&!s)a=h?{}:tr(t);else{if(!ye[d])return s?t:{};a=Sp(t,d,r)}}l||(l=new dt);var u=l.get(t);if(u)return u;l.set(t,a),Tp(t)?t.forEach(function(g){a.add(Jn(g,e,n,g,t,l))}):wp(t)&&t.forEach(function(g,p){a.set(p,Jn(g,e,n,p,t,l))});var f=xo,m=c?void 0:f(t);return Du(m||t,function(g,p){m&&(p=g,g=t[p]),wa(a,p,Jn(g,e,n,p,t,l))}),a}var Qp=1,$p=4;function Ze(t){return Jn(t,Qp|$p)}var qp=1,eg=4;function ar(t,e){return e=typeof e=="function"?e:void 0,Jn(t,qp|eg,e)}var tg="__lodash_hash_undefined__";function ng(t){return this.__data__.set(t,tg),this}function ig(t){return this.__data__.has(t)}function jn(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Lt;++e<n;)this.add(t[e])}jn.prototype.add=jn.prototype.push=ng,jn.prototype.has=ig;function sg(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}function rr(t,e){return t.has(e)}var og=1,lg=2;function cr(t,e,n,i,s,l){var a=n&og,r=t.length,c=e.length;if(r!=c&&!(a&&c>r))return!1;var d=l.get(t),h=l.get(e);if(d&&h)return d==e&&h==t;var u=-1,f=!0,m=n&lg?new jn:void 0;for(l.set(t,e),l.set(e,t);++u<r;){var g=t[u],p=e[u];if(i)var y=a?i(p,g,u,e,t,l):i(g,p,u,t,e,l);if(y!==void 0){if(y)continue;f=!1;break}if(m){if(!sg(e,function(C,b){if(!rr(m,b)&&(g===C||s(g,C,n,i,l)))return m.push(b)})){f=!1;break}}else if(!(g===p||s(g,p,n,i,l))){f=!1;break}}return l.delete(t),l.delete(e),f}function ag(t){var e=-1,n=Array(t.size);return t.forEach(function(i,s){n[++e]=[s,i]}),n}function wo(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}var rg=1,cg=2,dg="[object Boolean]",hg="[object Date]",ug="[object Error]",fg="[object Map]",mg="[object Number]",pg="[object RegExp]",gg="[object Set]",bg="[object String]",yg="[object Symbol]",xg="[object ArrayBuffer]",Sg="[object DataView]",dr=xt?xt.prototype:void 0,Io=dr?dr.valueOf:void 0;function Cg(t,e,n,i,s,l,a){switch(n){case Sg:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case xg:return!(t.byteLength!=e.byteLength||!l(new Qi(t),new Qi(e)));case dg:case hg:case mg:return yn(+t,+e);case ug:return t.name==e.name&&t.message==e.message;case pg:case bg:return t==e+"";case fg:var r=ag;case gg:var c=i&rg;if(r||(r=wo),t.size!=e.size&&!c)return!1;var d=a.get(t);if(d)return d==e;i|=cg,a.set(t,e);var h=cr(r(t),r(e),i,s,l,a);return a.delete(t),h;case yg:if(Io)return Io.call(t)==Io.call(e)}return!1}var kg=1,wg=Object.prototype,Ig=wg.hasOwnProperty;function Lg(t,e,n,i,s,l){var a=n&kg,r=xo(t),c=r.length,d=xo(e),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in e:Ig.call(e,f)))return!1}var m=l.get(t),g=l.get(e);if(m&&g)return m==e&&g==t;var p=!0;l.set(t,e),l.set(e,t);for(var y=a;++u<c;){f=r[u];var C=t[f],b=e[f];if(i)var w=a?i(b,C,f,e,t,l):i(C,b,f,t,e,l);if(!(w===void 0?C===b||s(C,b,n,i,l):w)){p=!1;break}y||(y=f=="constructor")}if(p&&!y){var T=t.constructor,k=e.constructor;T!=k&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof k=="function"&&k instanceof k)&&(p=!1)}return l.delete(t),l.delete(e),p}var Tg=1,hr="[object Arguments]",ur="[object Array]",$i="[object Object]",Mg=Object.prototype,fr=Mg.hasOwnProperty;function vg(t,e,n,i,s,l){var a=qe(t),r=qe(e),c=a?ur:ht(t),d=r?ur:ht(e);c=c==hr?$i:c,d=d==hr?$i:d;var h=c==$i,u=d==$i,f=c==d;if(f&&An(t)){if(!An(e))return!1;a=!0,h=!1}if(f&&!h)return l||(l=new dt),a||po(t)?cr(t,e,n,i,s,l):Cg(t,e,c,n,i,s,l);if(!(n&Tg)){var m=h&&fr.call(t,"__wrapped__"),g=u&&fr.call(e,"__wrapped__");if(m||g){var p=m?t.value():t,y=g?e.value():e;return l||(l=new dt),s(p,y,n,i,l)}}return f?(l||(l=new dt),Lg(t,e,n,i,s,l)):!1}function qi(t,e,n,i,s){return t===e?!0:t==null||e==null||!ct(t)&&!ct(e)?t!==t&&e!==e:vg(t,e,n,i,qi,s)}var Rg=1,Vg=2;function Eg(t,e,n,i){var s=n.length,l=s;if(t==null)return!l;for(t=Object(t);s--;){var a=n[s];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++s<l;){a=n[s];var r=a[0],c=t[r],d=a[1];if(a[2]){if(c===void 0&&!(r in t))return!1}else{var h=new dt,u;if(!(u===void 0?qi(d,c,Rg|Vg,i,h):u))return!1}}return!0}function mr(t){return t===t&&!Oe(t)}function Gg(t){for(var e=Na(t),n=e.length;n--;){var i=e[n],s=t[i];e[n]=[i,s,mr(s)]}return e}function pr(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Wg(t){var e=Gg(t);return e.length==1&&e[0][2]?pr(e[0][0],e[0][1]):function(n){return n===t||Eg(n,t,e)}}function Zg(t,e){return t!=null&&e in Object(t)}function Xg(t,e,n){e=Pa(e,t);for(var i=-1,s=e.length,l=!1;++i<s;){var a=ji(e[i]);if(!(l=t!=null&&n(t,a)))break;t=t[a]}return l||++i!=s?l:(s=t==null?0:t.length,!!s&&ho(s)&&ao(a,s)&&(qe(t)||_i(t)))}function Ng(t,e){return t!=null&&Xg(t,e,Zg)}var Pg=1,Dg=2;function Bg(t,e){return bo(t)&&mr(e)?pr(ji(t),e):function(n){var i=Cm(n,t);return i===void 0&&i===e?Ng(n,t):qi(e,i,Pg|Dg)}}function Yg(t){return function(e){return e==null?void 0:e[t]}}function Og(t){return function(e){return Da(e,t)}}function Hg(t){return bo(t)?Yg(ji(t)):Og(t)}function Fg(t){return typeof t=="function"?t:t==null?io:typeof t=="object"?qe(t)?Bg(t[0],t[1]):Wg(t):Hg(t)}function zg(t){return function(e,n,i){for(var s=-1,l=Object(e),a=i(e),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return e}}var Ag=zg(),Lo=function(){return rt.Date.now()},Kg="Expected a function",_g=Math.max,Ug=Math.min;function es(t,e,n){var i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;if(typeof t!="function")throw new TypeError(Kg);e=zi(e)||0,Oe(n)&&(h=!!n.leading,u="maxWait"in n,l=u?_g(zi(n.maxWait)||0,e):l,f="trailing"in n?!!n.trailing:f);function m(M){var V=i,x=s;return i=s=void 0,d=M,a=t.apply(x,V),a}function g(M){return d=M,r=setTimeout(C,e),h?m(M):a}function p(M){var V=M-c,x=M-d,S=e-V;return u?Ug(S,l-x):S}function y(M){var V=M-c,x=M-d;return c===void 0||V>=e||V<0||u&&x>=l}function C(){var M=Lo();if(y(M))return b(M);r=setTimeout(C,p(M))}function b(M){return r=void 0,f&&i?m(M):(i=s=void 0,a)}function w(){r!==void 0&&clearTimeout(r),d=0,i=c=s=r=void 0}function T(){return r===void 0?a:b(Lo())}function k(){var M=Lo(),V=y(M);if(i=arguments,s=this,c=M,V){if(r===void 0)return g(c);if(u)return clearTimeout(r),r=setTimeout(C,e),m(c)}return r===void 0&&(r=setTimeout(C,e)),a}return k.cancel=w,k.flush=T,k}var gr=Object.prototype,Jg=gr.hasOwnProperty,jg=co(function(t,e){t=Object(t);var n=-1,i=e.length,s=i>2?e[2]:void 0;for(s&&La(e[0],e[1],s)&&(i=1);++n<i;)for(var l=e[n],a=go(l),r=-1,c=a.length;++r<c;){var d=a[r],h=t[d];(h===void 0||yn(h,gr[d])&&!Jg.call(t,d))&&(t[d]=l[d])}return t});function To(t,e,n){(n!==void 0&&!yn(t[e],n)||n===void 0&&!(e in t))&&ro(t,e,n)}function Qg(t){return ct(t)&&Ki(t)}function Mo(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function $g(t){return Uu(t,go(t))}function qg(t,e,n,i,s,l,a){var r=Mo(t,n),c=Mo(e,n),d=a.get(c);if(d){To(t,n,d);return}var h=l?l(r,c,n+"",t,e,a):void 0,u=h===void 0;if(u){var f=qe(c),m=!f&&An(c),g=!f&&!m&&po(c);h=c,f||m||g?qe(r)?h=r:Qg(r)?h=Vu(r):m?(u=!1,h=Aa(c,!0)):g?(u=!1,h=er(c,!0)):h=[]:vm(c)||_i(c)?(h=r,_i(r)?h=$g(r):(!Oe(r)||so(r))&&(h=tr(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),To(t,n,h)}function ts(t,e,n,i,s){t!==e&&Ag(e,function(l,a){if(s||(s=new dt),Oe(l))qg(t,e,a,n,ts,i,s);else{var r=i?i(Mo(t,a),l,a+"",t,e,s):void 0;r===void 0&&(r=l),To(t,a,r)}},go)}function br(t,e,n,i,s,l){return Oe(t)&&Oe(e)&&(l.set(e,t),ts(t,e,void 0,br,l),l.delete(e)),t}var eb=Ta(function(t,e,n,i){ts(t,e,n,i)}),He=co(function(t){return t.push(void 0,br),ka(eb,void 0,t)}),tb=Math.max,nb=Math.min;function ib(t,e,n){return t>=nb(e,n)&&t<tb(e,n)}function St(t,e,n){return e=xa(e),n===void 0?(n=e,e=0):n=xa(n),t=zi(t),ib(t,e,n)}function Fe(t,e){return qi(t,e)}var sb="[object Number]";function ob(t){return typeof t=="number"||ct(t)&&Bt(t)==sb}function Yt(t){return t==null}function lb(t){return t===void 0}var vo=Ta(function(t,e,n){ts(t,e,n)}),ab=Array.prototype,rb=ab.reverse;function cb(t){return t==null?t:rb.call(t)}var db="Expected a function";function ns(t,e,n){var i=!0,s=!0;if(typeof t!="function")throw new TypeError(db);return Oe(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),es(t,e,{leading:i,maxWait:e,trailing:s})}var hb=1/0,ub=Sn&&1/wo(new Sn([,-0]))[1]==hb?function(t){return new Sn(t)}:Ru,fb=200;function mb(t,e,n){var i=-1,s=Fu,l=t.length,a=!0,r=[],c=r;if(l>=fb){var d=e?null:ub(t);if(d)return wo(d);a=!1,s=rr,c=new jn}else c=e?[]:r;e:for(;++i<l;){var h=t[i],u=e?e(h):h;if(h=h!==0?h:0,a&&u===u){for(var f=c.length;f--;)if(c[f]===u)continue e;e&&c.push(u),r.push(h)}else s(c,u,n)||(c!==r&&c.push(u),r.push(h))}return r}function pb(t,e){return t&&t.length?mb(t,Fg(e)):[]}const gb=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.ref(t.modelValue),i=()=>{if(!t.showStep)return[];const f=t.max-t.min,m=f/t.step,g=Je(t.step,f),p=[];for(let y=1;y<m;y++)p.push(y*g);return p},s=()=>{if(!t.mark||!Object.keys(t.mark).length)return[];const f=(g,p="value")=>{if(!g)return[];const y=t.mark.style&&typeof t.mark.style=="object"?t.mark.style:{},C=Object.keys(g),b=[];let w;for(let T=0;T<C.length;T++)w=+C[T],isNaN(w)||b.push({posX:p==="value"?Je(w,t.max-t.min):w,label:g[w],style:y});return b};return t.mark.value||t.mark.percent?[...f(t.mark.value),...f(t.mark.percent,"percent")]:[...f(t.mark)]},l=o.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=o.reactive({valueRange:0,stepList:o.computed(i),markList:o.computed(s),offset:{left:0,width:0}}),r=o.ref(),c=o.computed(()=>{const f=t.tooltipFormat,m=f instanceof Function;return{left:m?f(l.leftValue):l.leftValue,right:m?f(l.rightValue):l.rightValue}}),d=f=>{const m={min:t.min,max:t.max,step:t.step};let g,p;t.range&&Array.isArray(f)?(g=typeof f[0]=="number"&&!isNaN(f[0])?f[0]:t.min,p=typeof f[1]=="number"&&!isNaN(f[1])?f[1]:t.min,l.leftValue=$t(g,m),l.rightValue=$t(p,m)):(g=t.min,p=typeof f=="number"&&!isNaN(f)?f:t.min,l.leftValue=$t(g,m),l.rightValue=$t(p,m))},h=f=>{if(a.valueRange<=0)return;d(f);let m;if(t.range&&Array.isArray(f)){const g=Math.min(l.leftValue,l.rightValue),p=Math.max(l.leftValue,l.rightValue);m=[g,p]}else m=l.rightValue;n.value=m,e("update:modelValue",m),e("change",m)},u=()=>{const f=r.value.getBoundingClientRect();a.offset.left=f.left,a.offset.width=f.width,a.valueRange=t.max-t.min};return o.watch(()=>t.modelValue,(f,m)=>{ob(f)&&f>=0&&!Fe(f,m)&&!l.dragging&&(d(f),n.value=f)}),o.watch(()=>t.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:u,setSliderValue:h}},bb=t=>{const{props:e}=o.getCurrentInstance(),{state:n,slider:i}=t,s="transparent",l=o.computed(()=>({left:i.valueRange>0?`${Je(n.leftValue-e.min,i.valueRange)}%`:0})),a=o.computed(()=>({left:i.valueRange>0?`${Je(n.rightValue-e.min,i.valueRange)}%`:0})),r=o.computed(()=>!e.color||Array.isArray(e.color)&&e.color.length!==1?{}:{borderColor:(typeof e.color=="string"?e.color:e.color[0])||s}),c=o.computed(()=>e.color&&Array.isArray(e.color)),d=o.computed(()=>{const f=Math.min(n.leftValue,n.rightValue),g=+(Math.max(n.leftValue,n.rightValue)-f).toFixed(2),p=i.valueRange>0&&e.range?Je(+(f-e.min).toFixed(2),i.valueRange):0,y=g>0?Je(g,i.valueRange):0,C={};return e.color&&(typeof e.color=="string"||Array.isArray(e.color)&&e.color.length===1?C.backgroundColor=(typeof e.color=="string"?e.color:e.color[0])||s:Array.isArray(e.color)&&e.color.length>1&&(C.backgroundColor=(e.range?e.color[1]:e.color[0])||s)),{left:`${p}%`,width:`${y}%`,...C}}),h=o.computed(()=>{if(!c.value||e.color.length<2||!e.range)return{};const f=Math.min(n.leftValue,n.rightValue);return{width:`${Je(Math.abs(f-e.min),i.valueRange)}%`,backgroundColor:e.color[0]||s}}),u=o.computed(()=>{if(!c.value||e.color.length<2)return{};const f=Math.max(n.leftValue,n.rightValue),m=Je(+(f-e.min).toFixed(2),i.valueRange),g=Je(+(e.max-f).toFixed(2),i.valueRange),p=e.range?2:e.color.length-1;return{left:`${m}%`,width:`${g}%`,backgroundColor:e.color[p]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:u}},yb=t=>{const{props:e}=o.getCurrentInstance(),{currentValue:n,state:i,slider:s,updateSliderInfo:l,setSliderValue:a}=t,r=m=>{i.dragging||l();const g=m.type.indexOf("touch")!==-1?m.touches[0].clientX:m.clientX,{valueRange:p,offset:y}=s;let C=e.min+(g-y.left)*p/y.width;return C<e.min?C=e.min:C>e.max&&(C=e.max),C},c=m=>{if(e.readonly||e.disabled||i.dragging)return;const g=r(m);let p;if(e.range){const C=Math.min(i.leftValue,i.rightValue)+Math.abs((i.rightValue-i.leftValue)/2),b=i.leftValue>i.rightValue;g<C?i.handleType=b?"right":"left":i.handleType=b?"left":"right",p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]}else i.handleType="right",p=g;a(p)},d=m=>{const g=r(m);i.dragging=!0;let p;e.range?p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]:p=g,a(p)},h=()=>{i.handleType=null,i.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:m=>{e.readonly||e.disabled||(i.handleType=m,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(m,g)=>{if(e.showInput&&!i.dragging&&i.isInit)if(e.range&&Array.isArray(n.value)){const p=g==="left"?[m,n.value[1]]:[n.value[0],m];a(p)}else e.range||a(m)}}},xb=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{currentValue:i,state:s,slider:l,updateSliderInfo:a,setSliderValue:r}=t,c=()=>{const h=e.max||e.max===0,u=e.min||e.min===0;h&&u&&e.max<=e.min&&console.warn("[EVUI][Slider] Max value must be greater than min value.")},d=()=>{a(),l.valueRange<=0&&(i.value=e.range?[e.min,e.min]:e.min,n("update:modelValue",i.value)),r(i.value),s.isInit=!0};o.onMounted(()=>{c(),d()})},Sb={name:"EvSlider",components:{},props:{modelValue:{type:[Number,Array],default:null},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1,validator:t=>t>0},mark:{type:Object,default:()=>{}},showStep:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},color:{type:[String,Array],default:null},tooltipFormat:{type:Function,default:null}},emits:["update:modelValue","change"],setup(){const{currentValue:t,state:e,slider:n,formatValue:i,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=gb(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m}=bb({state:e,slider:n}),{startDrag:g,clickSlider:p,changeInput:y}=yb({currentValue:t,state:e,slider:n,updateSliderInfo:l,setSliderValue:a});return xb({currentValue:t,state:e,slider:n,updateSliderInfo:l,setSliderValue:a}),{currentValue:t,isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m,sliderLine:s,...o.toRefs(e),...o.toRefs(n),formatValue:i,startDrag:g,clickSlider:p,changeInput:y}}},Cb={class:"ev-slider-wrapper"},kb={ref:"sliderLine",class:"ev-slider-line"},wb={key:0,class:"ev-slider-step-wrapper"},Ib={key:2,class:"ev-slider-mark-wrapper"},Lb={class:"ev-slider-mark-label"},Tb=["innerHTML"],Mb=["innerHTML"];function vb(t,e,n,i,s,l){const a=o.resolveComponent("ev-input-number");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":i.isColorArray,"show-mark":t.markList.length}])},[o.createElementVNode("div",Cb,[o.createElementVNode("div",kb,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",wb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.stepList,(r,c)=>(o.openBlock(),o.createElementBlock("span",{key:`slider-step-${c}`,style:o.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):o.createCommentVNode("",!0),i.isColorArray&&n.color.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.range?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle(i.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle(i.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"ev-slider-thumb",style:o.normalizeStyle(i.rangeThumbStyle)},null,4),t.markList.length>0?(o.openBlock(),o.createElementBlock("div",Ib,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.markList,(r,c)=>(o.openBlock(),o.createElementBlock("div",{key:`slider-step-${c}`,style:o.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[o.createElementVNode("span",Lb,o.toDisplayString(r.label),1)],4))),128))])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-slider-line-layer",onClick:e[0]||(e[0]=(...r)=>i.clickSlider&&i.clickSlider(...r))})],512),n.range?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-slider-handle",{dragging:t.dragging&&t.handleType==="left"}]),style:o.normalizeStyle(i.leftHandleStyle),onMousedown:e[1]||(e[1]=o.withModifiers(r=>i.startDrag("left"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.left},null,8,Tb)],38)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ev-slider-handle",{dragging:t.dragging&&t.handleType==="right"}]),style:o.normalizeStyle(i.rightHandleStyle),onMousedown:e[2]||(e[2]=o.withModifiers(r=>i.startDrag("right"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.right},null,8,Mb)],38)]),n.showInput&&!n.range?(o.openBlock(),o.createBlock(a,{key:0,modelValue:i.currentValue,"onUpdate:modelValue":e[3]||(e[3]=r=>i.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:i.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(a,{modelValue:i.currentValue[0],"onUpdate:modelValue":e[4]||(e[4]=r=>i.currentValue[0]=r),step:n.step,min:n.min,max:i.currentValue[1],"step-strictly":"",onChange:e[5]||(e[5]=r=>i.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),o.createVNode(a,{modelValue:i.currentValue[1],"onUpdate:modelValue":e[6]||(e[6]=r=>i.currentValue[1]=r),step:n.step,min:i.currentValue[0],max:n.max,"step-strictly":"",onChange:e[7]||(e[7]=r=>i.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):o.createCommentVNode("",!0)],2)}const Qn=ce(Sb,[["render",vb]]);Qn.install=t=>{t.component(Qn.name,Qn)};const Rb={name:"EvIcon",props:{icon:{type:String,default:""},size:{type:String,default:""},color:{type:String,default:""}},emits:{click:null,"dbl-click":null,"context-menu":null},setup(t,{emit:e}){return{onClick:l=>{e("click",l)},onDblClick:l=>{e("dbl-click",l)},onContextMenu:l=>{e("context-menu",l)}}}};function Vb(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("i",{class:o.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:o.normalizeStyle({color:n.color}),onClick:e[0]||(e[0]=(...a)=>i.onClick&&i.onClick(...a)),"on:dblClick":e[1]||(e[1]=(...a)=>i.onDblClick&&i.onDblClick(...a)),onContextmenu:e[2]||(e[2]=(...a)=>i.onContextMenu&&i.onContextMenu(...a))},null,38)}const Cn=ce(Rb,[["render",Vb]]);Cn.install=t=>{t.component(Cn.name,Cn)};const Ro=6,Vo=7,Eo=4,Go=3,Wo=5,Zo=4,je=12,Eb=24,Gb=60,Wb=60,ut=12,yr=4,Xo=20,No={fullName:["January","February","March","April","May","June","July","August","September","October","November","December"],numberName:["1","2","3","4","5","6","7","8","9","10","11","12"],abbrName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],korName:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},Zb={abbrUpperName:["SUN","MON","TUE","WED","THU","FRI","SAT"],abbrLowerName:["sun","mon","tue","wed","thu","fri","sat"],abbrPascalName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbrKorName:["일","월","화","수","목","금","토"]},et={DATE:"date",MONTH:"month",YEAR:"year"},is=864e5,ss=+new Date("1970-01-01 00:00:00"),xr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Sr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),Xb=(t,e)=>t.length?t.reduce((n,i)=>new Date(n).getTime()>new Date(i).getTime()?n:i):"",Ge=t=>t===null?"00":+t<10?`0${t}`:t,kn=(t,e)=>Array.from(Array(t),()=>Array(e).fill(!1)),Nb=(t,e)=>new Date(`${t}-${e}-1`).getDay(),Po=(t,e)=>{let n;switch(e){case 4:case 6:case 9:case 11:n=30;break;case 2:t%4===0&&t%100!==0||t%400===0?n=29:n=28;break;default:n=31;break}return n},$n=({year:t,month:e,date:n,hour:i,min:s,sec:l})=>i!==void 0&&s!==void 0&&l!==void 0?`${t}-${Ge(e)}-${Ge(n)} ${Ge(i)}:${Ge(s)}:${Ge(l)}`:`${t}-${Ge(e)}-${Ge(n)}`,We=(t,e)=>{var s,l,a,r,c,d;let n=o.unref(t);Array.isArray(n)&&(n=Xb(t));const i={year:+((s=n==null?void 0:n.split(" ")[0])==null?void 0:s.split("-")[0])||null,month:+((l=n==null?void 0:n.split(" ")[0])==null?void 0:l.split("-")[1])||null,date:+((a=n==null?void 0:n.split(" ")[0])==null?void 0:a.split("-")[2])||null,hour:+((r=n==null?void 0:n.split(" ")[1])==null?void 0:r.split(":")[0])||0,min:+((c=n==null?void 0:n.split(" ")[1])==null?void 0:c.split(":")[1])||0,sec:+((d=n==null?void 0:n.split(" ")[1])==null?void 0:d.split(":")[2])||0};return e==="year"?i.year:e==="month"?i.month:e==="date"?i.date:e==="hour"?i.hour:e==="min"?i.min:e==="sec"?i.sec:i},Cr=(t,e,n)=>t==="next"?{year:n===12?e+1:e,month:(n+1)%12||12}:{year:n===1?e-1:e,month:(n-1)%12||12},qn=(t,e,n)=>{const i=We(e,n);if(t){const s=t==null?void 0:t.split(":")[0],l=t==null?void 0:t.split(":")[1],a=t==null?void 0:t.split(":")[2];if(n==="hour")return s==="HH"?i:+s;if(n==="min")return l==="mm"?i:+l;if(n==="sec")return a==="ss"?i:+a}return i},Te=(t,e)=>{if(!e)return"";const n=Ge(qn(t,e,"hour")),i=Ge(qn(t,e,"min")),s=Ge(qn(t,e,"sec"));return`${e.split(" ")[0]} ${n}:${i}:${s}`},os=(t,e,n,i)=>{if(!i.length)return!1;let s=e==="main"?n:i[0],l=e==="expanded"?n:i[1],a=s,r=l;if(!n.split(" ")[1])if(t==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=i[0].split(" ")[1],d=i[1].split(" ")[1];a=`${s} ${c}`,r=`${l} ${d}`}else a=`${s} 00:00:00`,r=`${l} 23:59:59`;return a&&r&&new Date(a).getTime()>+new Date(r).getTime()},wn=t=>new Date(`${t}`).getTime(),kr=t=>{const e=10**(t.toString().length-1),n=Math.floor(t/e),i=Math.floor(t%(e*n)),s=n*e+Math.floor(i/Xo)*Xo,l=s+Xo-1;return{start:s,end:l}},Pb=()=>{var p,y,C;const{props:t}=o.getCurrentInstance(),e=(p=t.options)==null?void 0:p.timeFormat,n=o.computed(()=>["dateRange","dateTimeRange"].includes(t.mode)?["main","expanded"]:["main"]);let i;if(t.mode!=="dateMulti"&&t.mode!=="dateRange"&&t.mode!=="dateTimeRange")if(t.modelValue&&(t.modelValue.length===10&&xr.exec((y=t.modelValue)==null?void 0:y.toString())||t.modelValue.length===19&&Sr.exec((C=t.modelValue)==null?void 0:C.toString())))if(t.mode==="dateTime"&&e){const b=Te(e,t.modelValue);i=o.ref(b)}else i=o.ref(t.modelValue);else i=o.ref("");else if(Array.isArray(t.modelValue)&&t.modelValue.every(b=>!b||b.length===10&&xr.exec(b)||b.length===19&&Sr.exec(b)))if(t.mode==="dateTimeRange"&&t.modelValue.length===2&&e){const b=[];b.push(Te(e[0],t.modelValue[0])),b.push(Te(e[1],t.modelValue[1])),i=o.ref([...b])}else i=o.ref([...t.modelValue]);else i=o.ref([]);const s=()=>{t.mode==="date"&&t.modelValue&&typeof t.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type."):t.mode==="dateTime"&&t.modelValue&&typeof t.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type."):t.mode==="dateMulti"&&t.modelValue&&!Array.isArray(t.modelValue)?console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type."):t.mode==="dateRange"&&t.modelValue?Array.isArray(t.modelValue)?wn(`${t.modelValue[0]} 00:00:00`)>wn(`${t.modelValue[1]} 00:00:00`)&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type."):t.mode==="dateTimeRange"&&t.modelValue&&(Array.isArray(t.modelValue)?wn(t.modelValue[0])>wn(t.modelValue[1])&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."))};let l;const a=["dateRange","dateTimeRange"].includes(t.mode)?i.value[0]:i.value;a!=null&&a.length?l={year:We(a,"year"),month:We(a,"month"),hour:Math.floor(We(a,"hour")/ut)+1||1,min:Math.floor(We(a,"min")/ut)+1||1,sec:Math.floor(We(a,"sec")/ut)+1||1}:l={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};let r;if(["dateRange","dateTimeRange"].includes(t.mode)&&Array.isArray(i.value)&&i.value[1]){const b=i.value[1];r={year:We(b,"year"),month:We(b,"month")},t.mode==="dateTimeRange"&&(r.hour=Math.floor(We(b,"hour")/ut)+1||1,r.min=Math.floor(We(b,"min")/ut)+1||1,r.sec=Math.floor(We(b,"sec")/ut)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=o.reactive({main:l,expanded:r}),d=o.reactive({main:o.computed(()=>kr(c.main.year)),expanded:o.computed(()=>kr(c.expanded.year))}),h=o.computed(()=>No[t.monthNotation][c.main.month-1]),u=o.computed(()=>No[t.monthNotation][c.expanded.month-1]),f=o.reactive({main:h,expanded:u}),m=o.computed(()=>Zb[t.dayOfTheWeekNotation]),g=o.reactive({main:et.DATE,expanded:et.DATE});return o.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:i,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:f,dayOfTheWeekList:m,selectedListType:g}},Db=t=>{const{props:e}=o.getCurrentInstance(),{selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:s}=t,l=o.reactive({main:kn(Wo,Zo),expanded:kn(Wo,Zo)}),a=o.reactive({main:kn(Eo,Go),expanded:kn(Eo,Go)}),r=o.reactive({main:kn(Ro,Vo),expanded:kn(Ro,Vo)}),c=o.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:g=>{const p=i[g];let y=e.options.disabledDate;y&&Array.isArray(y)&&(y=g==="main"?y[0]:y[1]);const C=["dateRange","dateTimeRange"].includes(e.mode),b=$n({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),w=(je+p.month-1)%je||je,T=(p.month+1)%je||je,k=p.month===1?p.year-1:p.year,M=p.month===12?p.year+1:p.year,V=Nb(p.year,p.month),x=Po(p.month===1?p.year-1:p.year,(je+p.month-1)%je||je),S=Po(p.year,p.month);let L="";e.mode.includes("Time")&&(e.mode==="dateTime"?L=n.value:L=g==="main"?n.value[0]:n.value[1]);let I=0,R=0,v=0,G=0,W="";const E=(X,Z,N)=>{var z,A,j;W=$n({year:R,month:v,date:G});const P=(L==null?void 0:L.split(" ")[1])??"",B=C&&!y&&os(e.mode,g,W,n.value)||+new Date(`${W} ${P}`)<ss,Y=y&&y(new Date(`${W} ${P}`))||B,H=+(g!=="main"),_=C&&n.value.length>H&&((A=(z=n.value)==null?void 0:z[H])==null?void 0:A.includes(W)),D=!Y&&(C?_:(j=n.value)==null?void 0:j.includes(W));r[g][Z][N]={monthType:`${X}${Y?" disabled":""}`,isToday:b===W,isSelected:D,year:R,month:v,date:G}};for(let X=0;X<Ro;X++)for(let Z=0;Z<Vo;Z++)X===0?V!==0?Z<V?(R=k,v=w,G=x-V+1+Z,E("prev",X,Z)):(I++,R=p.year,v=p.month,G=I,E("",X,Z)):(R=k,v=w,G=x-6+Z,E("prev",X,Z)):S<=I?(I++,R=M,v=T,G=I-S,E("next",X,Z)):(I++,R=p.year,v=p.month,G=I,E("",X,Z))},setCalendarMonth:g=>{let p=0;const y=new Date().getFullYear(),C=new Date().getMonth()+1,{year:b,month:w}=i[g];for(let T=0;T<Eo;T++)for(let k=0;k<Go;k++)a[g][T][k]={label:No.abbrName[p++],value:p,today:b===y&&p===C,isSelected:p===w}},setCalendarYear:g=>{let p=s[g].start;const y=new Date().getFullYear(),C=new Date(ss).getFullYear();for(let b=0;b<Wo;b++)for(let w=0;w<Zo;w++)l[g][b][w]={label:p,value:p,today:p===y,isSelected:p===i[g].year,disabled:p<C},p++},setHmsTime:()=>{var V,x;const g=(V=e.options)==null?void 0:V.timeFormat,p=(x=e.options)==null?void 0:x.disabledDate,y=Array.isArray(g)?g[0]:g,C=Array.isArray(g)?g[1]:"",b=e.mode==="dateTimeRange"?n.value[0]:n.value,w=e.mode==="dateTimeRange"?n.value[1]:"",T=Array.isArray(p)?p[0]:p,k=Array.isArray(p)?p[1]:p,M=(S,L,I)=>{const R=S==="main"?b:w,v=S==="main"?T:k;if(!R)return!1;const G=R.split(" ")[0];let W=We(R,"hour"),E=We(R,"min"),X=We(R,"sec");L==="hour"?W=I:L==="min"?E=I:L==="sec"&&(X=I);const Z=`${G} ${Ge(W)}:${Ge(E)}:${Ge(X)}`;return v&&v(new Date(Z))?!0:!v&&os(e.mode,S,Z,n.value)};["hour","min","sec"].forEach(S=>{let L=Wb;S==="hour"?L=Eb:S==="min"&&(L=Gb);const I=b&&b.length>0?qn(y,b,S):-1,R=w&&w.length>0?qn(C,w,S):-1;for(let v=0;v<L;v++){let G=e.mode==="dateTimeRange"&&M("main",S,v);c.main[S][v]={timeType:S,num:v,isSelected:!G&&I===v,isDisabled:G},e.mode==="dateTimeRange"&&(G=M("expanded",S,v),c.expanded[S][v]={timeType:S,num:v,isSelected:!G&&R===v,isDisabled:G})}})},getTimeInfo:(g,p,y,C)=>{const b=i[C],w=c[C],T=b[g]-1,k=p-1,M=y-1,V=T*ut+k*yr+M;return w[g][V]}}},Bb=t=>{var W;const{props:e,emit:n}=o.getCurrentInstance(),i=(W=e.options)==null?void 0:W.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:u}=t,f=o.ref(""),m=o.ref(null),g=Array.isArray(i)?i[0]:i,p=Array.isArray(i)?i[1]:"",y={main:{hour:g&&g.split(":")[0]!=="HH",min:g&&g.split(":")[1]!=="mm",sec:g&&g.split(":")[2]!=="ss"},expanded:{hour:p&&p.split(":")[0]!=="HH",min:p&&p.split(":")[1]!=="mm",sec:p&&p.split(":")[2]!=="ss"}},C=(E,X)=>{const Z=l[E],{year:N,month:P,hour:B,min:Y,sec:H}=X;N&&(Z.year=N),P&&(Z.month=P),B&&(Z.hour=B),Y&&(Z.min=Y),H&&(Z.sec=H)},b=E=>{E==null||E.forEach((X,Z)=>{const N=Z===0?"main":"expanded";C(N,{year:We(X,"year"),month:We(X,"month"),hour:Math.floor(We(X,"hour")/ut)+1,min:Math.floor(We(X,"min")/ut)+1,sec:Math.floor(We(X,"sec")/ut)+1}),r(N)})},w=(E,X)=>{const Z=u[E]===et.MONTH?1:20,N=X==="prev"?-Z:Z,P=new Date(ss).getFullYear(),B=l[E].year+N;l[E].year=B<P?P:B},T=(E,X)=>{const Z=l[E];if(X==="prev"){const N=new Date(ss).getFullYear();if(Z.year===N&&Z.month===1)return;Z.month===1?(Z.year-=1,Z.month=12):Z.month-=1}else Z.month===12?(Z.year+=1,Z.month=1):Z.month+=1},k=(E,X)=>{switch(u[E]){case et.DATE:{T(E,X),r(E);break}case et.MONTH:w(E,X),c(E);break;case et.YEAR:w(E,X),d(E);break}},M=(E,X)=>{X===et.DATE?r(E):X===et.MONTH?c(E):X===et.YEAR&&d(E),u[E]=X},V=(E,X)=>{const{value:Z}=X;X.disabled||(u[E]===et.YEAR?(l[E].year=Z,u[E]=et.MONTH,c(E)):(l[E].month=Z,u[E]=et.DATE,r(E)))},x=(E,X)=>{var U,ne,$,ee;const{year:Z,month:N,date:P,monthType:B}=X,Y=$n({year:Z,month:N,date:P}),H=e.modelValue?(Array.isArray(e.modelValue)?((U=e.modelValue)==null?void 0:U.map(Q=>Q==null?void 0:Q.split(" ")[0]))??[]:e.modelValue.split(" ")[0]).includes(Y):!1;let _=e.options.disabledDate;if(_&&Array.isArray(_)&&(_=E==="main"?_[0]:_[1]),_&&_(new Date(Y))&&!H)return;if(!_&&["dateRange","dateTimeRange"].includes(e.mode)&&os(e.mode,E,Y,s.value))return;const D=l[E],z=(je+D.month-1)%je||je,A=D.month===1?D.year-1:D.year,j=(D.month+1)%je||je,J=D.month===12?D.year+1:D.year,q=()=>{B.includes("prev")?(D.year=A,D.month=z):B.includes("next")&&(D.year=J,D.month=j)};switch(e.mode){case"date":n("update:modelValue",Y);break;case"dateTime":{const he=!!((ne=s.value)!=null&&ne.split(" ")[1])?($=s.value)==null?void 0:$.split(" ")[1]:"00:00:00",me=Te(i,`${Y} ${he}`);n("update:modelValue",me);break}case"dateMulti":{const Q=e.options.multiType,he=e.options.multiDayLimit;if(Q==="date"){const me=s.value.indexOf(Y);me>-1?(s.value.splice(me,1),n("update:modelValue",[...s.value])):s.value.length<he&&(s.value.push(Y),q(),n("update:modelValue",[...s.value]))}else if(Q==="week"||Q==="weekday"){const me=Q==="week"?7:5,ae=Q==="week"?6:5,xe=new Date(`${Y} 00:00:00`),be=xe.getDay(),oe=ae-be,re=xe.getTime()+is*oe;for(let pe=0;pe<me;pe++){const Ie=new Date(re-pe*is).getFullYear(),Ve=new Date(re-pe*is).getMonth()+1,kt=new Date(re-pe*is).getDate(),Vt=`${Ie}-${Ge(Ve)}-${Ge(kt)}`;if(pe===0)if(s.value.includes(Vt)){s.value.splice(0);break}else s.value.splice(0),q();(!_||!_(new Date(Vt)))&&s.value.unshift(Vt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let Q=[...s.value];if(!s.value.length)Q=[Y,Y];else{const he=+(E==="expanded");Q[he]=Y}n("update:modelValue",Q);break}case"dateTimeRange":{let Q=[...s.value];if(Q.length){const he=+(E==="expanded"),me=((ee=Q[he])==null?void 0:ee.split(" ")[1])||"00:00:00";let ae=`${Y} ${me}`;i&&i.length&&(ae=Te(i[he],ae)),Q[he]=ae}else{let he=`${Y} 00:00:00`,me=`${Y} 00:00:00`;i&&i.length&&(he=Te(i[0],he),me=Te(i[1],me)),Q=[he,me]}n("update:modelValue",Q);break}}},S=(E,X,Z)=>{if(y[E][X])return;const N=l[E],P=1;X==="hour"?Z==="down"&&N.hour<2?N.hour++:Z==="up"&&N.hour>P&&N.hour--:X==="min"?Z==="down"&&N.min<5?N.min++:Z==="up"&&N.min>P&&N.min--:X==="sec"&&(Z==="down"&&N.sec<5?N.sec++:Z==="up"&&N.sec>P&&N.sec--)},L=(E,X,Z,N)=>{var ne;if(y[E][X])return;const P=l[E],B=a[E],Y=P[X]-1,H=Z-1,_=N-1,D=Y*ut+H*yr+_;if((ne=B[X][D])!=null&&ne.isDisabled)return;const z=new Date,A={year:z.getFullYear(),month:z.getMonth()+1,date:z.getDate()};let j=!0,J=[];const q=()=>{let $;return X==="hour"?$=`${Ge(D)}:00:00'`:X==="min"?$=`00:${Ge(D)}:00`:X==="sec"&&($=`00:00:${Ge(D)}`),`${$n(A)} ${$}`},U=$=>{let ae=11;return X==="min"?ae=14:X==="sec"&&(ae=17),`${$==null?void 0:$.substr(0,ae)}${Ge(D)}${$==null?void 0:$.substr(ae+2)}`};if(e.mode==="dateTime"){let $;e.modelValue?$=Te(i,U(e.modelValue)):(j=!1,$=Te(i,q())),n("update:modelValue",$),J.push($)}else{const $=E!=="main"|0;let ee=[...s.value];if(e.modelValue.length){let Q=U(e.modelValue[$]);i&&i.length&&(Q=Te(i[$],Q)),ee[$]=Q}else{const Q=q();ee=[Q,Q],i&&i.length&&(ee=[...ee.map((he,me)=>Te(i[me],he))]),j=!1,J=ee}n("update:modelValue",ee)}h(),j||b(J)},I=(E,X)=>{k(E,X.deltaY>0?"next":"prev")},R=(E,X,Z)=>{y[E][X]||S(E,X,Z.deltaY>0?"down":"up")},v=ns((E,X)=>{const Z=X.target.tagName==="TD"?X.target:X.target.parentElement,N=Z.classList.contains("disabled"),P=Z.classList.contains("prev"),B=Z.classList.contains("next");if(Z.classList.length>0&&!N){const Y=l[E];let H={year:+Y.year,month:+Y.month,date:X.target.innerText};P?H={...H,...Cr("prev",H.year,H.month)}:B&&(H={...H,...Cr("next",H.year,H.month)});const _=f.value,D=$n({year:H.year,month:H.month,date:H.date});wn(D)<wn(_)?(s.value[0]=D,s.value[1]=_):(s.value[0]=_,s.value[1]=D),r("main"),r("expanded")}},10),G=E=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode),Z=e.options.disabledDate;if(X){const[N,P]=s.value;let[B,Y]=[Z,Z];if(Z&&Array.isArray(Z)&&([B,Y]=Z),E[0]&&E[0]!==N&&B&&B(new Date(E[0])))return!0;if(E[1]&&E[1]!==P&&Y&&Y(new Date(E[1])))return!0;if(!Z&&os(e.mode,"main",E[0],E))return!0}else{if(e.mode==="dateMulti")return E.some(N=>Z&&Z(new Date(N)));if(Z&&Z(new Date(E)))return!0}return!1};return o.watch(()=>e.modelValue,E=>{if(G(E)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode);if(s.value=X?[...E]:E,e.mode==="dateRange")b(E);else if(e.mode.includes("Time")){let Z=[];e.mode==="dateTime"?Z=[E]:e.mode==="dateTimeRange"&&(Z=E),b(Z),h()}else e.mode==="date"&&b([E])}),{clickYearMonthBtn:M,clickPrevNextBtn:k,clickDate:x,clickYearMonth:V,clickHmsBtn:S,clickTime:L,wheelMonth:I,wheelTime:R,calendarEventName:m,onMousemoveDate:v,preventTimeEventType:y}},Yb={name:"EvCalendar",props:{modelValue:{type:[String,Array],default:"",validator:t=>{const e=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(t)?t.every(i=>!!(!i||i.length===10&&e.exec(i))||i.length===19&&n.exec(i)):!!(!t||t.length===10&&e.exec(t)||t.length===19&&n.exec(t))}},mode:{type:String,default:"date",validator:t=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(t)!==-1},monthNotation:{type:String,default:"fullName",validator:t=>["fullName","abbrName","numberName","korName"].indexOf(t)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:t=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(t)!==-1},options:{type:Object,default:()=>({multiType:"date",limit:1}),validator:({multiType:t,multiDayLimit:e,disabledDate:n,timeFormat:i})=>{const s=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!t||["weekday","week","date"].indexOf(t)!==-1)&&(!e||typeof e=="number"&&e>0)&&(!n||typeof n=="function"||Array.isArray(n))&&Array.isArray(i)?i.every(l=>!!(!l||s.exec(l))):!!(!i||s.exec(i))}}},emits:{"update:modelValue":[Array,String]},setup(t){const{calendarList:e,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=Pb(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p,getTimeInfo:y}=Db({selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:a}),{clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:w,clickYearMonth:T,clickHmsBtn:k,clickTime:M,wheelMonth:V,wheelTime:x,calendarEventName:S,onMousemoveDate:L,preventTimeEventType:I}=Bb({selectedValue:n,calendarPageInfo:i,calendarTimeTableInfo:u,selectedListType:r,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p});return f("main"),["dateRange","dateTimeRange"].includes(t.mode)&&f("expanded"),["dateTime","dateTimeRange"].includes(t.mode)&&p(),{calendarList:e,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,getTimeInfo:y,clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:w,clickYearMonth:T,clickHmsBtn:k,clickTime:M,wheelMonth:V,wheelTime:x,calendarEventName:S,onMousemoveDate:L,preventTimeEventType:I}}},Ob={class:"ev-calendar-wrapper"},Hb={class:"ev-calendar-date-area"},Fb={class:"ev-calendar-header"},zb=["onClick"],Ab={class:"ev-calendar-year-month-wrapper"},Kb={key:0,class:"ev-calendar-year-range"},_b=["onClick"],Ub=["onClick"],Jb=["onClick"],jb={class:"ev-calendar-body"},Qb=["onWheel"],$b=["onClick"],qb=["onWheel"],ey=["onClick"],ty={key:2,class:"ev-calendar-selector-btn-wrapper"},ny={key:0,class:"ev-calendar-time-area"},iy={key:0,class:"ev-calendar-time-area-disabled"},sy={class:"ev-calendar-time-side"},oy={class:"ev-calendar-time-center"},ly=["onWheel"],ay=["onClick"],ry={class:"ev-calendar-time-side"},cy=["onClick"];function dy(t,e,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",Ob,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",Hb,[o.createElementVNode("div",Fb,[o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"prev")},[...e[0]||(e[0]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,zb),o.createElementVNode("div",Ab,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",Kb,o.toDisplayString(i.calendarYearRangeInfo[r].start+" - "+i.calendarYearRangeInfo[r].end),1)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>i.clickYearMonthBtn(r,"year")},o.toDisplayString(i.calendarPageInfo[r].year),9,_b),i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>i.clickYearMonthBtn(r,"month")},o.toDisplayString(i.calendarMonth[r]),9,Ub)):o.createCommentVNode("",!0)],64))]),o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"next")},[...e[1]||(e[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,Jb)]),o.createElementVNode("div",jb,[i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[o.createElementVNode("thead",null,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.dayOfTheWeekList,c=>(o.openBlock(),o.createElementBlock("th",{key:c},o.toDisplayString(c),1))),128))])]),o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>i.clickDate(r,d)},{[o.toHandlerKey(`${i.calendarEventName}`)]:h=>i.onMousemoveDate(r,h)}),[o.createElementVNode("div",null,[o.createElementVNode("span",null,o.toDisplayString(d.date),1)])],16,$b))),128))]))),128))],40,Qb)])):(o.openBlock(),o.createElementBlock("table",{key:1,class:o.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${i.selectedListType[r]}`])},[o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.selectedListType[r]==="month"?i.calendarMonthTableInfo[r]:i.calendarYearTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",{key:d.value,onClick:h=>i.clickYearMonth(r,d)},[o.createElementVNode("div",{class:o.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},o.toDisplayString(d.label),3)],8,ey))),128))]))),128))],40,qb)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",ty,[o.createVNode(a,{onClick:c=>i.clickYearMonthBtn(r,"date")},{default:o.withCtx(()=>[...e[2]||(e[2]=[o.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(o.openBlock(),o.createElementBlock("div",ny,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",iy)):o.createCommentVNode("",!0),o.createElementVNode("div",sy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["HOUR","MIN","SEC"],c=>o.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},o.toDisplayString(c),1)),64))]),o.createElementVNode("div",oy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>o.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[o.createElementVNode("tbody",{onWheel:o.withModifiers(d=>i.wheelTime(r,c,d),["prevent"])},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,d=>o.createElementVNode("tr",{key:`${c}_${d}_tr`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(4,h=>o.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:o.normalizeClass(["ev-calendar-time-td",{selected:i.getTimeInfo(c,d,h,r).isSelected},{disabled:i.preventTimeEventType[r][c]||i.getTimeInfo(c,d,h,r).isDisabled}]),onClick:u=>i.clickTime(r,c,d,h)},[o.createElementVNode("div",null,o.toDisplayString(i.getTimeInfo(c,d,h,r).num),1)],10,ay)),64))])),64))],40,ly)])),64))]),o.createElementVNode("div",ry,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${c}_btn_area`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],d=>o.createElementVNode("div",{key:`${c}_${d}_btn`,class:o.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:i.preventTimeEventType[r][c]}]),onClick:h=>i.clickHmsBtn(r,c,d)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,cy)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const ei=ce(Yb,[["render",dy]]);ei.install=t=>{t.component(ei.name,ei)};const hy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),uy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),fy=()=>{var f;const{props:t,emit:e}=o.getCurrentInstance(),n=(f=t.options)==null?void 0:f.timeFormat,i=["dateTimeRange","dateRange","dateMulti"].includes(t.mode),s=m=>{let g;if(t.mode==="dateTime")g=Te(n,m);else if(t.modelValue.length){const[p,y]=n;g=[Te(p,m[0]),Te(y,m[1])]}return g},l=o.computed({get:()=>t.modelValue?["dateTime","dateTimeRange"].includes(t.mode)&&n?s(t.modelValue):i?[...t.modelValue]:t.modelValue:t.mode==="date"||t.mode==="dateTime"?"":[],set:m=>{if(["dateTime","dateTimeRange"].includes(t.mode)&&n){e("update:modelValue",s(m));return}e("update:modelValue",m)}});let a;if(["dateTimeRange","dateTime"].includes(t.mode)&&n)if(t.mode==="dateTimeRange"&&Array.isArray(t.modelValue)&&t.modelValue.length===2){const[m,g]=t.modelValue,[p,y]=n;t.modelValue=[Te(p,m),Te(y,g)],a=o.ref([...t.modelValue])}else t.mode==="dateTime"&&t.modelValue?a=o.ref(Te(n,t.modelValue)):a=o.ref(t.modelValue);else a=o.ref(i?[...t.modelValue]:t.modelValue);const r=m=>{const g=b=>!!(b.length===10&&hy.exec(b)),p=b=>!!(b.length===19&&uy.exec(b)),y=b=>{const w=b.split(" ")[0],T=+w.split("-")[0],k=+w.split("-")[1],M=+w.split("-")[2],V=Po(T,k);return+M<=V&&T>=new Date(0).getFullYear()};let C=!0;t.mode==="date"?C=g(m)&&y(m):t.mode==="dateTime"?C=p(m)&&y(m):t.mode==="dateRange"?C=m.every(b=>g(b)&&y(b)):t.mode==="dateTimeRange"&&(C=m.every(b=>p(b)&&y(b))),C&&(l.value=i?[...m]:m),a.value=i?[...l.value]:l.value},c=o.computed(()=>t.mode==="date"||t.mode==="dateTime"?l.value:l.value.length);return{mv:l,currentValue:a,isClearableIcon:c,validateValue:r,removeAllMv:()=>{t.mode==="date"||t.mode==="dateTime"?l.value=null:(l.value.splice(0),l.value=[...l.value])},changeMv:async m=>{await o.nextTick(),e("change",l.value,m)},removeMv:m=>{if(!t.disabled){const g=l.value.indexOf(m);l.value.splice(g,1),l.value=[...l.value]}}}},my=()=>{const{props:t}=o.getCurrentInstance(),e=o.ref(!1),n=o.ref(null),i=o.ref(null),s=o.ref(null),l=o.ref(null),a=o.reactive({top:null,right:null,left:null}),r=async()=>{var w,T;await o.nextTick();const h=(w=i.value)==null?void 0:w.getBoundingClientRect(),u=(T=s.value)==null?void 0:T.getBoundingClientRect(),f=h.height,m=h.y,g=h.x,p=u.height,y=u.width,C=document.documentElement.clientHeight,b=document.documentElement.clientWidth;C<m+f+p?(a.top=`-${p}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${f}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:e,datePicker:n,datePickerWrapper:i,dropbox:s,itemWrapper:l,dropboxPosition:a,clickSelectInput:async()=>{t.disabled||(e.value=t.enableTextInput?!0:!e.value,e.value&&await r())},clickOutsideDropbox:()=>{e.value=!1},changeDropboxPosition:r}},py=t=>{var m;const{props:e}=o.getCurrentInstance(),{mv:n,currentValue:i,clickOutsideDropbox:s}=t,l=o.reactive([]);(m=e.shortcuts)==null||m.forEach(({value:g,label:p,shortcutDate:y})=>{l.push({key:g,label:p,shortcutDate:y,isActive:!1})});const a=()=>{const g=l.find(p=>p.isActive);g&&(g.isActive=!1)},r=g=>{const p=l.find(y=>y.key===g);p&&(p.isActive=!0)},c=g=>g===null?"00":+g<10?`0${g}`:g,d=g=>{const p=g?new Date(g):new Date,y=p.getFullYear(),C=p.getMonth()+1,b=p.getDate();return`${y}-${c(C)}-${c(b)}`},h=g=>{const p=g?new Date(g):new Date,y=p.getHours(),C=p.getMinutes(),b=p.getSeconds();return`${d(p)} ${c(y)}:${c(C)}:${c(b)}`},u=()=>{var y,C;a();const g=["dateRange","dateTimeRange"].includes(e.mode);if(!l.length||e.mode==="dateMulti"&&((y=e.options)==null?void 0:y.multiType)!=="date"||g&&!n.value.length||!g&&!n.value)return;let p;if(g){const b=(C=e.options)==null?void 0:C.timeFormat,[w,T]=n.value;let k;e.mode==="dateTimeRange"&&(b!=null&&b.length)?k=l.find(({shortcutDate:M})=>{const[V,x]=M(),[S,L]=b,I=Te(S,h(V)),R=Te(L,h(x)),v=I===h(w),G=R===h(T);return v&&G}):k=l.find(({shortcutDate:M})=>{const[V,x]=M(),S=e.mode==="dateTimeRange"?h:d,L=S(V)===S(w),I=S(x)===S(T);return L&&I}),p=k==null?void 0:k.key}else{const b=e.mode==="dateTime"?h:d,w=b(n.value),T=l.find(({shortcutDate:k})=>b(k())===w);p=T==null?void 0:T.key}p&&r(p)},f=g=>{var w;const p=["dateRange","dateTimeRange"].includes(e.mode),y=l.find(({key:T})=>T===g);if(!y)return;const C=y.shortcutDate,b=(w=e.options)==null?void 0:w.timeFormat;if(p){const[T,k]=C();if(e.mode==="dateTimeRange")if(b!=null&&b.length){const[M,V]=b;n.value=[Te(M,h(T)),Te(V,h(k))]}else n.value=[h(T),h(k)];else n.value=[d(T),d(k)]}else{const T=C();n.value=e.mode==="dateTime"?Te(b,h(T)):d(T)}a(),r(g)};return o.watch(()=>e.modelValue,g=>{var p,y;if(u(),!(e.mode==="dateMulti"&&((p=e==null?void 0:e.options)==null?void 0:p.multiType)==="date"&&((y=e==null?void 0:e.options)==null?void 0:y.multiDayLimit)>g.length)){if(e.mode==="dateRange"||e.mode==="dateTimeRange"){i.value=[...g];return}else if(e.mode==="dateTime"){i.value=g;return}i.value=g,s()}}),{usedShortcuts:l,clickShortcut:f,setActiveShortcut:u}},gy={name:"EvDatePicker",directives:{clickoutside:Yd},props:{modelValue:{type:[String,Array],default:"",validator:t=>{const e=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(t)?t.every(i=>!!(!i||i.length===10&&e.exec(i))||i.length===19&&n.exec(i)):!!(!t||t.length===10&&e.exec(t)||t.length===19&&n.exec(t))}},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},enableTextInput:{type:Boolean,default:!1},mode:{type:String,default:"date",validator:t=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(t)!==-1},monthNotation:{type:String,default:"fullName",validator:t=>["fullName","abbrName","numberName","korName"].indexOf(t)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:t=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(t)!==-1},options:{type:Object,default:()=>({type:"date",limit:1,tagShorten:!1}),validator:({multiType:t,multiDayLimit:e,disabledDate:n,tagShorten:i,timeFormat:s})=>{const l=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!t||["weekday","week","date"].indexOf(t)!==-1)&&(!e||typeof e=="number"&&e>0)&&(!n||typeof n=="function"||Array.isArray(n))&&(i===void 0||typeof i=="boolean")&&Array.isArray(s)?s.every(a=>!!(!a||l.exec(a))):!!(!s||l.exec(s))}},shortcuts:{type:Array,default:()=>[],validator:t=>t.length?t.every(({shortcutDate:e})=>{if(typeof e!="function")return!1;const n=e();return Array.isArray(n)&&n.every(i=>i instanceof Date)&&n[0]<=n[1]||typeof n=="object"&&n instanceof Date}):!0}},emits:{"update:modelValue":[Array,String]},setup(){const{mv:t,currentValue:e,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a}=fy(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p}=my(),{usedShortcuts:y,clickShortcut:C,setActiveShortcut:b}=py({mv:t,currentValue:e,clickOutsideDropbox:g});return b(),{mv:t,currentValue:e,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p,usedShortcuts:y,clickShortcut:C}}},by={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},yy=["placeholder","readonly","disabled"],xy=["placeholder","disabled"],Sy={class:"ev-tag-name"},Cy=["onClick"],ky={key:0,class:"ev-select-tag num"},wy={class:"ev-tag-name"},Iy={class:"ev-select-tag num"},Ly={class:"ev-tag-name"},Ty={class:"ev-date-picker-dropbox-wrapper"},My={key:0,class:"ev-date-picker-dropbox__button-layout"},vy={key:1,class:"ev-date-picker-dropbox__divider"};function Ry(t,e,n,i,s,l){const a=o.resolveComponent("ev-button"),r=o.resolveComponent("ev-button-group"),c=o.resolveComponent("ev-calendar"),d=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"datePicker",class:o.normalizeClass(["ev-date-picker",{disabled:t.$props.disabled}])},[o.createElementVNode("div",by,[t.$props.mode==="date"||t.$props.mode==="dateTime"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e[15]||(e[15]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=h=>i.currentValue=h),type:"text",class:o.normalizeClass(["ev-input",{readonly:!t.$props.enableTextInput}]),placeholder:t.$props.placeholder,readonly:!t.$props.enableTextInput,disabled:t.$props.disabled,onClick:e[1]||(e[1]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h)),onKeydown:e[2]||(e[2]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:e[3]||(e[3]=h=>i.validateValue(i.currentValue))},null,42,yy),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])],64)):t.$props.mode==="dateMulti"||!t.$props.enableTextInput?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:e[4]||(e[4]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[e[18]||(e[18]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:t.$props.placeholder,disabled:t.$props.disabled},null,8,xy),t.$props.mode==="dateMulti"&&(t.$props.options.multiType==="date"||!t.$props.options.tagShorten)?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.mv,(h,u)=>(o.openBlock(),o.createElementBlock("div",{key:`${h}_${u}`,class:o.normalizeClass(["ev-select-tag",{num:t.$props.options.multiType!=="date"}])},[o.createElementVNode("span",Sy,o.toDisplayString(h),1),t.$props.options.multiType==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:o.withModifiers(f=>[i.removeMv(h),i.changeDropboxPosition()],["stop"])},[...e[16]||(e[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Cy)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",ky,[o.createElementVNode("span",wy,o.toDisplayString(i.mv[0]),1)])):o.createCommentVNode("",!0),i.mv[i.mv.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e[17]||(e[17]=o.createElementVNode("div",{class:"ev-select-tag num"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.createElementVNode("div",Iy,[o.createElementVNode("span",Ly,o.toDisplayString(i.mv[i.mv.length-1]),1)])],64)):o.createCommentVNode("",!0)],64))])):(o.openBlock(),o.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:e[11]||(e[11]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[e[20]||(e[20]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[5]||(e[5]=h=>i.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:e[6]||(e[6]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:e[7]||(e[7]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[0],void 0,{trim:!0}]]),i.currentValue[i.currentValue.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e[19]||(e[19]=o.createElementVNode("div",{class:"ev-date-picker-range-separator"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[8]||(e[8]=h=>i.currentValue[i.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:e[9]||(e[9]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:e[10]||(e[10]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[i.currentValue.length-1],void 0,{trim:!0}]])],64)):o.createCommentVNode("",!0)])),t.$props.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:e[12]||(e[12]=o.withModifiers(h=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...e[21]||(e[21]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",Ty,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-date-picker-dropdown",t.$props.mode]),style:o.normalizeStyle(i.dropboxPosition)},[i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",My,[i.usedShortcuts.length===1?(o.openBlock(),o.createBlock(a,{key:0,type:i.usedShortcuts[0].isActive?"primary":"default",onClick:e[13]||(e[13]=h=>i.clickShortcut(i.usedShortcuts[0].key))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.usedShortcuts[0].label),1)]),_:1},8,["type"])):(o.openBlock(),o.createBlock(r,{key:1},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.usedShortcuts,h=>(o.openBlock(),o.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:u=>i.clickShortcut(h.key)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):o.createCommentVNode("",!0),i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",vy)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass({"ev-date-picker-dropbox__calendar":i.usedShortcuts.length})},[o.createVNode(c,{key:"fromCalendar",modelValue:i.mv,"onUpdate:modelValue":e[14]||(e[14]=h=>i.mv=h),mode:t.$props.mode,"month-notation":t.$props.monthNotation,"day-of-the-week-notation":t.$props.dayOfTheWeekNotation,options:t.$props.options},null,8,["modelValue","mode","month-notation","day-of-the-week-notation","options"])],2)],6)):o.createCommentVNode("",!0)])],512)],2)),[[d,i.clickOutsideDropbox]])}const ti=ce(gy,[["render",Ry]]);ti.install=t=>{t.component(ti.name,ti)};const Vy={name:"EvMessage",props:{type:{type:String,default:"info",validator:t=>["info","success","warning","error"].includes(t)},message:{type:String,default:""},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!1},iconClass:{type:String,default:""},onClose:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(t,e){const n=o.reactive({timer:null,isShow:!0}),i=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,t.onClose&&t.onClose(),i(),t.unmount&&setTimeout(t.unmount,1e3)},l=()=>{t.duration>0&&(n.timer=setTimeout(()=>{n.isShow&&s()},t.duration))},a=c=>{c.keyCode===27&&n.isShow&&s()},r=()=>{s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),i()}),e.expose({hide:r}),{startTimer:l,clearTimer:i,closeMsg:s,...o.toRefs(n),hide:r}}},Ey={key:0,class:"ev-message-icon"},Gy=["innerHTML"],Wy={key:2,class:"ev-message-content"};function Zy(t,e,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-message-modal"},[o.createVNode(o.Transition,{name:"ev-message-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:e[1]||(e[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:e[2]||(e[2]=(...a)=>i.startTimer&&i.startTimer(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Ey,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,Gy)):(o.openBlock(),o.createElementBlock("div",Wy,o.toDisplayString(n.message),1)),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-message-close",onClick:e[0]||(e[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...e[3]||(e[3]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,t.isShow]])]),_:1})])}const Xy=ce(Vy,[["render",Zy]]),Ny=o.defineComponent(Xy),wr="ev-message-modal",Ir=document.createElement("div");Ir.id=wr;const ls=(t={})=>{document.getElementById(wr)||document.body.appendChild(Ir);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof t=="string"?{message:t,unmount:i}:{...t,unmount:i},l=o.h(Ny,s);return o.render(l,n),l.component.exposed};ls.install=t=>{const e=t.config.globalProperties;e.$message=ls};const Py={name:"EvNotification",props:{type:{type:String,default:"info",validator:t=>["info","success","warning","error"].includes(t)},title:{type:String,default:""},message:{type:String,default:""},position:{type:String,default:"top-right",validator:t=>["top-left","top-right","bottom-left","bottom-right"].includes(t)},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},iconClass:{type:String,default:""},onClose:{type:Function,default:null},onClick:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(t){const e=o.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(e.timer),e.timer=null},i=r=>{r.target.className!=="ev-notification-close"&&t.onClick&&t.onClick()},s=()=>{e.isShow=!1,t.onClose&&t.onClose(),n(),t.unmount&&setTimeout(t.unmount,1e3)},l=()=>{t.duration>0&&(e.timer=setTimeout(()=>{e.isShow&&s()},t.duration))},a=r=>{r.keyCode===27&&e.isShow&&s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:i,closeMsg:s,...o.toRefs(e)}}},Dy={key:0,class:"ev-notification-icon"},By={class:"ev-notification-content"},Yy={key:0,class:"title"},Oy=["innerHTML"],Hy={key:2,class:"message"};function Fy(t,e,n,i,s,l){return o.openBlock(),o.createBlock(o.Transition,{name:"ev-notification-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["ev-notification",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-click":!!n.onClick}]),onMouseenter:e[1]||(e[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:e[2]||(e[2]=(...a)=>i.startTimer&&i.startTimer(...a)),onClick:e[3]||(e[3]=(...a)=>i.clickMsg&&i.clickMsg(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Dy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",By,[n.title?(o.openBlock(),o.createElementBlock("p",Yy,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,Oy)):(o.openBlock(),o.createElementBlock("p",Hy,o.toDisplayString(n.message),1))]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:e[0]||(e[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...e[4]||(e[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,t.isShow]])]),_:1})}const zy=ce(Py,[["render",Fy]]),Ay=o.defineComponent(zy),Lr="ev-notification-modal",as=document.createElement("div");as.id=Lr;const Ky=["top-left","top-right","bottom-left","bottom-right"],rs=(t={})=>{const e=t.position||"top-right";if(!Ky.includes(e)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(Lr)||document.body.appendChild(as);let i=as.getElementsByClassName(`modal-${e}`);i.length?i=i[0]:(i=document.createElement("div"),i.classList.add(`modal-${e}`),as.appendChild(i));const l=document.createElement("div"),a=()=>o.render(null,l),r=typeof t=="string"?{message:t,unmount:a}:{...t,unmount:a},c=o.h(Ay,r);o.render(c,l),i.appendChild(c.el)};rs.install=t=>{const e=t.config.globalProperties;e.$notify=rs};const _y={name:"EvMessageBox",components:{EvButton:fn},props:{type:{type:String,default:"",validator:t=>["","info","success","warning","error"].includes(t)},title:{type:String,default:""},message:{type:[String,Array],default:""},iconClass:{type:String,default:""},onClose:{type:Function,default:null},showClose:{type:Boolean,default:!0},showConfirmBtn:{type:Boolean,default:!0},showCancelBtn:{type:Boolean,default:!0},confirmBtnText:{type:String,default:"OK"},cancelBtnText:{type:String,default:"Cancel"},closeOnClickModal:{type:Boolean,default:!0},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null},focusable:{type:Boolean,default:!1}},setup(t){const e=o.ref(null),n=o.reactive({isShow:!0,iconClass:""}),i=c=>{if(!t.closeOnClickModal&&c==="modal")return;const d=c==="modal"?"cancel":c;n.isShow=!1,t.onClose&&t.onClose(d),t.unmount&&setTimeout(t.unmount,1e3)},s=c=>{c.keyCode===27&&n.isShow&&i()},l=c=>{switch(c){case"success":return"ev-icon-arrow-check";case"warning":return"ev-icon-warning2";case"error":return"ev-icon-warning3";case"info":default:return"ev-icon-info2"}},a=()=>{t.iconClass?n.iconClass=t.iconClass:t.type&&(n.iconClass=l(t.type))},r=c=>{if(!t.focusable)return!1;switch(c){case"confirmBtn":return t.showConfirmBtn;case"cancelBtn":return!t.showConfirmBtn&&t.showCancelBtn;case"messagebox":return!t.showConfirmBtn&&!t.showCancelBtn;default:return!1}};return o.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&e.value.focus()}),o.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:i,...o.toRefs(n),msgRef:e,hasFocus:r}}},Uy={key:0,class:"ev-message-box-icon"},Jy={class:"ev-message-box-content"},jy={key:0,class:"ev-message-box-title"},Qy=["innerHTML"],$y={key:2,class:"ev-message-box-message"},qy={class:"ev-message-box-btn"};function ex(t,e,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"ev-message-box-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{id:"ev-message-box-modal",onClick:e[3]||(e[3]=o.withModifiers(r=>i.closeMsg("modal"),["self"])),onWheel:o.withModifiers(()=>{},["stop","prevent"])},[o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message-box",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-title":!!n.title}]),tabindex:"-1"},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Uy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Jy,[n.title?(o.openBlock(),o.createElementBlock("p",jy,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,Qy)):(o.openBlock(),o.createElementBlock("p",$y,o.toDisplayString(n.message),1))]),o.createElementVNode("div",qy,[n.showCancelBtn?(o.openBlock(),o.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":i.hasFocus("cancelBtn"),onClick:e[0]||(e[0]=r=>i.closeMsg("cancel"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0),n.showConfirmBtn?(o.openBlock(),o.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":i.hasFocus("confirmBtn"),onClick:e[1]||(e[1]=r=>i.closeMsg("ok"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0)]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:e[2]||(e[2]=r=>i.closeMsg("cancel"))},[...e[4]||(e[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],2)],544),[[o.vShow,t.isShow]])]),_:1})])}const tx=ce(_y,[["render",ex]]),nx=o.defineComponent(tx),cs=(t={})=>{const e=document.createElement("div"),n=()=>o.render(null,e),i=typeof t=="string"?{message:t,unmount:n}:{...t,unmount:n},s=o.h(nx,i);o.render(s,e)};cs.install=t=>{const e=t.config.globalProperties;e.$messagebox=cs};const Tr=(t,e)=>Array.from(Array(t),()=>Array(e).fill(!1)),ix=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.computed({get:()=>t.modelValue.length!==t.rowLabels.length||!t.modelValue[0]||t.modelValue[0].length!==t.colLabels.length?Tr(t.rowLabels.length,t.colLabels.length):t.modelValue,set:s=>{e("update:modelValue",s),e("change",s)}});return{mv:n,validateValue:()=>{(t.modelValue.length!==t.rowLabels.length||!t.modelValue[0]||t.modelValue[0].length!==t.colLabels.length)&&(n.value=[...Tr(t.rowLabels.length,t.colLabels.length)])}}},sx=t=>{const{mv:e}=t,n=o.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),i=(h,u)=>{if(n.dragCol===null||n.dragRow===null)return{};const f=n.startRow<n.dragRow?n.startRow:n.dragRow,m=n.startRow>n.dragRow?n.startRow:n.dragRow,g=n.startCol<n.dragCol?n.startCol:n.dragCol,p=n.startCol>n.dragCol?n.startCol:n.dragCol;if(f>h||m<h||g>u||p<u)return{};const y="2px solid #5292F7";let C={};return h===f&&(C={...C,"border-top":y}),h===m&&(C={...C,"border-bottom":y}),u===g&&(C={...C,"border-left":y}),u===p&&(C={...C,"border-right":y}),C},s=(h,u)=>{n.startRow=h,n.startCol=u,n.dragRow=h,n.dragCol=u,n.dragEventName="mousemove"},l=(h,u)=>{if(!n.dragEventName)return;n.endRow=h,n.endCol=u,n.dragEventName=null;const f=[...e.value],m=n.startRow<n.endRow?n.startRow:n.endRow,g=n.startRow>n.endRow?n.startRow:n.endRow,p=n.startCol<n.endCol?n.startCol:n.endCol,y=n.startCol>n.endCol?n.startCol:n.endCol;for(let C=m;C<=g;C++)for(let b=p;b<=y;b++)f[C][b]=!f[C][b];e.value=[...f],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:(h,u)=>{n.dragRow=h,n.dragCol=u},mouseleaveBoxArea:()=>{l(n.dragRow,n.dragCol)},selectColumn:h=>{const u=[...e.value],f=u[0][h];for(let m=0;m<u.length;m++)u[m][h]=!f;e.value=[...u]},selectRow:h=>{const u=[...e.value],f=u[h][0];for(let m=0;m<u[0].length;m++)u[h][m]=!f;e.value=[...u]}}},ox={name:"EvScheduler",props:{modelValue:{type:Array,default:()=>[]},colLabels:{type:Array,default:()=>['<span style="color: #FF0000">SUN</span>',"MON","TUE","WED","THU","FRI",'<span style="color: #0006F9">SAT</span>']},rowLabels:{type:Array,default:()=>["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"]}},emits:{"update:modelValue":Array,change:Array},setup(){const{mv:t,validateValue:e}=ix();e();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=sx({mv:t});return{mv:t,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},lx={class:"ev-scheduler-header"},ax=["onClick","innerHTML"],rx=["onClick","innerHTML"],cx=["onMousedown","onMouseup"];function dx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("table",{class:o.normalizeClass(["ev-scheduler",{draggable:!!t.dragEventName}])},[o.createElementVNode("thead",null,[o.createElementVNode("tr",lx,[e[1]||(e[1]=o.createElementVNode("td",null,null,-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>i.selectColumn(r),innerHTML:n.colLabels[r]},null,8,ax))),128))])]),o.createElementVNode("tbody",{onMouseleave:e[0]||(e[0]=(...a)=>i.mouseleaveBoxArea&&i.mouseleaveBoxArea(...a))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.rowLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>i.selectRow(r),innerHTML:n.rowLabels[r]},null,8,rx)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(c,d)=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:i.mv[r][d]}],style:i.selectionStyle(r,d),onMousedown:o.withModifiers(h=>i.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:o.withModifiers(h=>i.mouseupBox(r,d),["stop","prevent"])},{[o.toHandlerKey(`${t.dragEventName}`)]:h=>i.mousemoveBox(r,d)}),null,16,cx))),128))]))),128))],32)],2)}const ni=ce(ox,[["render",dx]]);ni.install=t=>{t.component(ni.name,ni)};const hx=()=>{const t=o.defineComponent(Mr),e=o.ref([]);return{comp:t,childrenItems:e,initWrapperDiv:()=>{const i=document.createElement("div");i.id="ev-context-menu-modal",i.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(i)}}},ux=()=>{const{props:t}=o.getCurrentInstance(),e=o.computed(()=>t.isShowMenuOnClick),n=o.ref(!1),i=o.ref(null),s=o.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:i,menuStyle:s,show:async r=>{var d,h;n.value=!0,await o.nextTick();const c=(h=(d=i.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const u=c.height,f=c.width,m=document.documentElement.clientHeight,g=document.documentElement.clientWidth,p=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,m<r.clientY+u?s.top=`${r.pageY-u}px`:s.top=`${r.pageY}px`,g<r.clientX+f+p?s.left=`${r.pageX-f}px`:s.left=`${r.pageX}px`}},hide:async()=>{await o.nextTick(),!e.value&&(n.value=!1)}}},fx=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.computed({get:()=>t.isShow,set:f=>e("update:isShow",f)}),i=o.computed(()=>!!t.items.some(f=>f.children)),s=o.ref([]),l=o.ref(!1),a=o.ref(null),r=o.reactive({top:null,left:null,right:null}),c=f=>{f||(n.value=!1)},d=f=>{var I,R,v;const m=document.documentElement.clientWidth,g=document.documentElement.clientHeight,p=20,y=(I=f.target.parentElement)==null?void 0:I.getBoundingClientRect(),{x:C,y:b,width:w,height:T}=y,k=(v=(R=a.value)==null?void 0:R.$el)==null?void 0:v.children[0].getBoundingClientRect(),{width:M,height:V}=k,x=f.target.offsetTop,S=g<b+x+V,L=m<C+w+M+p;S?r.top=`${T-V}px`:r.top=`${x}px`,L?r.left=`${0-M}px`:r.left=`${w}px`};return{computedIsShow:n,isExistChild:i,isShowChild:l,childMenu:a,menuStyle:r,childrenItems:s,handleItemClick:f=>{f.click&&!f.disabled&&f.click(f),f.isShowMenu||c(f.children)},handleMouseEnter:async(f,m)=>{!m.children||!Array.isArray(m.children)||m.disabled?l.value=!1:(l.value=!0,s.value=m.children,await o.nextTick(),d(f))},hideAll:c}},mx={name:"EvMenuList",props:{isShow:{type:Boolean,default:!1},items:{type:Array,default:()=>[],validator:t=>t.some(e=>e.children!==void 0&&!Array.isArray(e.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):t.some(e=>e.click!==void 0&&typeof e.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},comp:{type:Object,default:()=>{}}},emits:{"update:isShow":[Boolean]},setup(){const{isExistChild:t,computedIsShow:e,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=fx();return{isExistChild:t,computedIsShow:e,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},px={class:"ev-menu-list"},gx={class:"ev-menu-ul"},bx=["onClick","onMouseenter"],yx={class:"ev-menu-li-text"},xx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function Sx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",px,[o.createElementVNode("ul",gx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(a,r)=>o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:`${a.value}_${r}`,class:o.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>i.handleItemClick(a),onMouseenter:c=>i.handleMouseEnter(c,a)},[a.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",yx,[a.slotKey?o.renderSlot(t.$slots,a.slotKey,{key:0,item:a},()=>[o.createTextVNode(o.toDisplayString(a.text),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(o.openBlock(),o.createElementBlock("i",xx)):o.createCommentVNode("",!0)],42,bx)),[[o.vShow,!a.hidden]])),128))]),i.isExistChild?o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:i.computedIsShow,"onUpdate:isShow":e[0]||(e[0]=a=>i.computedIsShow=a),comp:n.comp,items:i.childrenItems,style:o.normalizeStyle(i.menuStyle)},o.createSlots({_:2},[o.renderList(t.$slots,(a,r)=>({name:r,fn:o.withCtx(c=>[o.renderSlot(t.$slots,r,o.normalizeProps(o.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[o.vShow,i.childrenItems.length&&i.isShowChild]]):o.createCommentVNode("",!0)])}const Mr=ce(mx,[["render",Sx]]),Cx={name:"EvContextMenu",directives:{clickoutside:Yi},components:{MenuList:Mr},props:{items:{type:Array,default:()=>[],validator:t=>t.some(e=>e.children!==void 0&&!Array.isArray(e.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):t.some(e=>e.click!==void 0&&typeof e.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},customClass:{type:String,default:""},isShowMenuOnClick:{type:Boolean,default:!1}},setup(){const{comp:t,initWrapperDiv:e}=hx(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=ux();return o.onBeforeMount(()=>e()),{isShow:n,rootMenuList:i,menuStyle:s,comp:t,show:l,hide:a}}};function kx(t,e,n,i,s,l){const a=o.resolveComponent("menu-list"),r=o.resolveDirective("clickoutside");return i.isShow&&n.items.length?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-context-menu-modal"},[o.withDirectives((o.openBlock(),o.createBlock(a,{ref:"rootMenuList",isShow:i.isShow,"onUpdate:isShow":e[0]||(e[0]=c=>i.isShow=c),class:o.normalizeClass(n.customClass),items:n.items,style:o.normalizeStyle(i.menuStyle),comp:i.comp},o.createSlots({_:2},[o.renderList(t.$slots,(c,d)=>({name:d,fn:o.withCtx(h=>[o.renderSlot(t.$slots,d,o.normalizeProps(o.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,i.hide]])])):o.createCommentVNode("",!0)}const ii=ce(Cx,[["render",kx]]);ii.install=t=>{t.component(ii.name,ii)};const wx=()=>window.innerWidth-document.documentElement.clientWidth,Ix=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.ref(),i=o.ref(),s=o.ref(!1),l=o.computed(()=>s.value?"ev-icon-compress":"ev-icon-expand");let a=document.getElementById("ev-window-modal");(()=>{if(!a){const p=document.createElement("div");p.id="ev-window-modal",document.body.appendChild(p),a=document.getElementById("ev-window-modal")}})();const c=p=>{let y,C;if(typeof p=="string"||typeof p=="number"){const b=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);y=b?{value:+b[2],unit:b[3]||void 0}:void 0}else y=void 0;return y==null?C=void 0:y.unit?C=`${y.value}${y.unit}`:C=`${y.value}px`,C},d=(p,y="horizontal")=>{if(typeof p=="number")return p;if(!p)return 0;let C=0;const b=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);if(y&&["%","vw","vh"].includes(b[3])&&b[2]){const w=y==="horizontal"?window.innerWidth:window.innerHeight;C=Math.floor(w*+b[2]/100)}else b[2]&&(C=+b[2]);return C},h=o.reactive({}),u=o.computed(()=>({...t.style,...h})),f=()=>{if(h.position="fixed",t.fullscreen){h.width="100%",h.height="100%",h.top=0,h.left=0;return}const p=d(t.width,"horizontal"),y=d(t.minWidth,"horizontal");p<y?(console.warn("[EVUI][Window] Since width is less than min-width, it is replaced by min-width."),h.width=c(t.minWidth)):h.width=c(t.width);const C=d(t.height,"vertical"),b=d(t.minHeight,"vertical");C<b?(console.warn("[EVUI][Window] Since height is less than min-height, it is replaced by min-height."),h.height=c(t.minHeight)):h.height=c(t.height),h.top=`calc((100% - ${h.height}) / 2)`,h.left=`calc((100% - ${h.width}) / 2)`,d(t.width,"horizontal")>window.innerWidth&&(h.left=0),d(t.height,"vertical")>window.innerHeight&&(h.top=0)},m=p=>{p==="layer"&&!t.closeOnClickModal||e("update:visible",!1)},g=p=>{var b;const y=(b=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:b.length,C=document.body;if(p){if(t.hideScroll){if(!y){const w=wx();C.style.paddingRight=`${w}px`}C.classList.add("ev-window-scroll-lock")}}else t.hideScroll&&y===1&&(C.style.removeProperty("padding-right"),C.classList.remove("ev-window-scroll-lock"))};return f(),o.watch(()=>t.visible,async p=>{g(p),p&&await o.nextTick(()=>{f()})}),{windowRef:n,headerRef:i,isFullExpandWindow:s,maximizableIcon:l,baseStyle:u,closeWin:m,numberToUnit:c,removeUnit:d}},Lx=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{windowRef:i,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=t,c=50,d=5,h=o.reactive({}),u=o.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),f=o.reactive({top:0,left:0}),m=o.reactive({top:!1,right:!1,left:!1,bottom:!1}),g=o.reactive({width:null,height:null,top:null,left:null}),p=(I,R)=>{if(I==null||R==null)return!1;const v=i.value.getBoundingClientRect(),G=+I-v.left,W=+R-v.top,E=s.value.style,X={top:r(E.paddingTop,"vertical"),left:r(E.paddingLeft,"horizontal"),right:r(E.paddingRight,"horizontal")},Z=X.left,N=v.width-X.right,P=X.top,B=P+s.value.offsetHeight;return G>Z&&G<N&&W>P&&W<B},y=I=>{if(I===null||typeof I!="object")return;let R,v,G,W,E,X;const Z=i.value,N=Object.prototype.hasOwnProperty;N.call(I,"top")?R=I.top:R=u.top,N.call(I,"left")?v=I.left:v=u.left,N.call(I,"width")?G=I.width:G=Z.offsetWidth,N.call(I,"height")?W=I.height:W=Z.offsetHeight,N.call(I,"minWidth")?E=I.minWidth:E=e.minWidth,N.call(I,"minHeight")?X=I.minHeight:X=e.minHeight,G=r(G,"horizontal")>r(E,"horizontal")?G:E,W=r(W,"vertical")>r(X,"vertical")?W:X,h.top=a(R),h.left=a(v),h.width=a(G),h.height=a(W),h.minWidth=a(E),h.minHeight=a(X)},C=I=>{if(!(!i.value||u.pressedSpot))if(e.resizable){const R=i.value.getBoundingClientRect(),v=I.clientX-R.left,G=I.clientY-R.top,W=G<d,E=v<d,X=v>=R.width-d,Z=G>=R.height-d;W&&E||Z&&X?i.value.style.cursor="nwse-resize":W&&X||Z&&E?i.value.style.cursor="nesw-resize":X||E?i.value.style.cursor="ew-resize":Z||W?i.value.style.cursor="ns-resize":e.draggable&&p(I.clientX,I.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else e.draggable&&p(I.clientX,I.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},b=I=>{const R=window.innerWidth,v=window.innerHeight,G=m.top,W=m.left,E=m.right,X=m.bottom,Z=r(e.minWidth,"horizontal"),N=r(e.minHeight,"vertical"),P=I.clientX>=R?R:I.clientX;let B=I.clientY>=v?v:I.clientY;B=I.clientY>0?B:0;const Y=P-u.clientX,H=B-u.clientY;let _=u.top,D=u.left,z=u.width,A=u.height;const j=_+u.height-N,J=D+u.width-Z;G&&(_=u.top+H,A=u.height-H,_>j&&(_=j)),W&&(D=u.left+Y,z=u.width-Y,D>J&&(D=J)),E&&(z=u.width+Y),X&&(A=u.height+H),z=Math.min(Math.max(z,Z),R),A=Math.min(Math.max(A,N),v);const q={top:_,left:D,width:z,height:A};y(q),n("resize",I,{...q})},w=(I,R)=>{let v=R;return v<0?v=0:v>I-c&&(v=Math.floor(I-c)),v},T=(I,R)=>{let v=R;return v<-(u.width-c)?v=-Math.floor(u.width-c):v>I-c&&(v=Math.floor(I-c)),v},k=I=>{if(I.preventDefault(),u.state="mousedown-mousemove",e.draggable&&u.pressedSpot==="header"){const R=document.documentElement.clientWidth,v=document.documentElement.clientHeight,G=I.clientY-u.clientY,W=I.clientX-u.clientX;let E=u.top+G,X=u.left+W;E=w(v,E),X=T(R,X),y({top:`${E}px`,left:`${X}px`,width:h.width??e.width,height:h.height??e.height})}else e.resizable&&u.pressedSpot==="border"&&b(I);n("mousedown-mousemove",I)},M=I=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",I),window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",M)},V=I=>{if(!i.value||!e.resizable&&!e.draggable)return;let R="";if(e.resizable){const v=i.value.getBoundingClientRect(),G=I.clientX-v.left,W=I.clientY-v.top,E=W<d,X=G<d,Z=G>=v.width-d,N=W>=v.height-d;m.top=E,m.left=X,m.right=Z,m.bottom=N,(E||X||Z||N)&&(R="border")}if(R!=="border"&&p(I.clientX,I.clientY)&&(R="header"),!R||!e.draggable&&R==="header"||!e.resizable&&R==="border"){u.state="mousedown",u.pressedSpot="",u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=I.clientX,u.clientY=I.clientY,n("mousedown",{...u,ref:i.value});return}u.state="mousedown",u.pressedSpot=R,u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=I.clientX,u.clientY=I.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",k),window.addEventListener("mouseup",M)},x=I=>{!e.draggable&&!e.resizable||C(I)},S=()=>{l.value=!l.value,o.nextTick(()=>{l.value?(g.top=i.value.offsetTop,g.left=i.value.offsetLeft,g.width=i.value.offsetWidth,g.height=i.value.offsetHeight,y({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):y({top:g.top,left:g.left,width:g.width,height:g.height}),n("expand",{top:g.top,left:g.left,width:g.width,height:g.height})})},L=()=>{l.value=!1,u.state="",u.pressedSpot="",u.top=0,u.left=0,u.width=0,u.height=0,u.clientX=0,u.clientY=0,f.top=0,f.left=0,m.top=!1,m.left=!1,m.right=!1,m.bottom=!1,g.top=null,g.left=null,g.width=null,g.height=null,Object.keys(h).forEach(I=>{delete h[I]})};return o.watch(()=>e.visible,I=>{I||L()}),{dragStyle:h,startDrag:V,moveMouse:x,clickExpandBtn:S}},Tt=(()=>{let t=[],e=0;return{add(n){if(n!=null)return n.sequence=e++,t.push(n),n.sequence},remove(n){n!=null&&(t=t.filter(i=>i.sequence!==n.sequence))},get windows(){return t.slice()},getWindowBySequence(n){return t.find(i=>i.sequence===n)},isEmpty(){return t.length<=0},isFirstWindowOpen(){return e===1}}})(),Mt=(()=>{let l=700;return{getNext(){return l>=748?748:(l+=1,l)},getNextOverLimit(){return 749},getPrevFrom(a){const r=l-a*1;return r<=700?700:r},isUpperLimitClose(){return l>=748},resetToLower(){l=700},getAllocableCount(){return Math.floor(48/1)}}})(),Tx=t=>{const e=window.getComputedStyle(t).getPropertyValue("z-index").trim();return!e||isNaN(e)?700:parseInt(e)},Do=()=>{const t=(n,i)=>n.zIndex>i.zIndex?1:n.zIndex<i.zIndex?-1:n.sequence>i.sequence?1:-1;return Array.prototype.map.call(Tt.windows,n=>({...n,zIndex:Tx(n.elem)})).sort(t)},Mx=({closeWin:t,windowRef:e})=>{const{props:n}=o.getCurrentInstance();let i=null,s=null;const l=()=>Tt.add({sequence:i,closeWin:t,elem:e.value,escClose:n.escClose}),a=y=>{Tt.remove(y)},r=y=>{if(Tt.isEmpty())return;const{code:C}=y;if(C!=="Escape")return;const b=Do(),w=b[b.length-1];w.escClose&&w.closeWin()},c=()=>{i=l(),e.value.dataset.sequence=i,Tt.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const y=Tt.getWindowBySequence(i);a(y)},h=({elem:y,zIndex:C})=>{if(n.isModal){const b=y.parentElement.getElementsByClassName("ev-window-dim-layer")[0];b.style.zIndex=C}y.style.zIndex=C},u=()=>{Tt.windows.length===1&&Mt.resetToLower();const y=Mt.getNext();h({elem:e.value,zIndex:y})},f=y=>String(y.sequence)===e.value.dataset.sequence,m=()=>{const y=Do();if(Tt.windows.length>Mt.getAllocableCount()){const b=y.reverse();let w=0;b.forEach(k=>{if(f(k))return;const M=Mt.getPrevFrom(w++);h({elem:k.elem,zIndex:M})});const T=Mt.getNextOverLimit();h({elem:e.value,zIndex:T})}else{Mt.resetToLower(),y.forEach(w=>{if(f(w))return;const T=Mt.getNext();h({elem:w.elem,zIndex:T})});const b=Mt.getNext();h({elem:e.value,zIndex:b})}},g=()=>{Mt.isUpperLimitClose()?m():u()},p=()=>{if(!e.value||!n.focusable)return;const y=Do(),C=y[y.length-1];f(C)||g()};return o.onMounted(()=>{n.visible&&(c(),s=setTimeout(g,0))}),o.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),o.watch(()=>n.visible,y=>{o.nextTick(()=>{y?(c(),s=setTimeout(g,0)):(d(),clearTimeout(s))})}),o.watch(()=>n.escClose,y=>{if(!n.visible)return;const C=Tt.getWindowBySequence(i);C&&(C.escClose=y)}),{setFocus:p}},vx={name:"EvWindow",props:{style:{type:Object,default(){return{}}},visible:{type:Boolean,default:!1},title:{type:[String,Number],default:null},windowClass:{type:String,default:""},iconClass:{type:String,default:""},width:{type:[String,Number],default:"50vw"},height:{type:[String,Number],default:"50vh"},minWidth:{type:[String,Number],default:150},minHeight:{type:[String,Number],default:150},fullscreen:{type:Boolean,default:!1},isModal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},hideScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!1},escClose:{type:Boolean,default:!1},focusable:{type:Boolean,default:!1}},emits:["update:visible","mousedown","mousedown-mouseup","mousedown-mousemove","resize","expand"],setup(){const{windowRef:t,headerRef:e,isFullExpandWindow:n,maximizableIcon:i,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=Ix(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=Lx({windowRef:t,headerRef:e,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=Mx({closeWin:l,windowRef:t});return{windowRef:t,headerRef:e,baseStyle:s,dragStyle:c,maximizableIcon:i,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:u,setFocus:f}}},Rx={key:0,ref:"headerRef",class:"ev-window-header"},Vx={key:0,class:"ev-window-icon"},Ex={key:1,class:"ev-window-title"},Gx={class:"ev-window-content"},Wx={key:1,class:"ev-window-footer"},Zx={class:"ev-window-top-right-icon"};function Xx(t,e,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-window-modal"},[o.createVNode(o.Transition,{name:"ev-window-fade",appear:""},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:e[0]||(e[0]=a=>i.closeWin("layer")),onWheel:o.withModifiers(()=>{},["stop","prevent"])},null,32)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref:"windowRef",class:o.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:o.normalizeStyle({...i.baseStyle,...i.dragStyle}),onMousedown:e[3]||(e[3]=(...a)=>i.startDrag&&i.startDrag(...a)),onMousemove:e[4]||(e[4]=(...a)=>i.moveMouse&&i.moveMouse(...a)),onClick:e[5]||(e[5]=(...a)=>i.setFocus&&i.setFocus(...a))},[t.$slots.header||n.iconClass||n.title?(o.openBlock(),o.createElementBlock("div",Rx,[t.$slots.header?o.renderSlot(t.$slots,"header",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Vx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",Ex,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",Gx,[o.renderSlot(t.$slots,"default")]),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",Wx,[o.renderSlot(t.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",Zx,[n.maximizable&&!n.fullscreen?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:e[1]||(e[1]=(...a)=>i.clickExpandBtn&&i.clickExpandBtn(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.maximizableIcon)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-window-close",onClick:e[2]||(e[2]=(...a)=>i.closeWin&&i.closeWin(...a))},[...e[6]||(e[6]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):o.createCommentVNode("",!0)]),_:3})])}const si=ce(vx,[["render",Xx]]);si.install=t=>{t.component(si.name,si)};const Nx={name:"EvLoading",props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},clickOutside:{type:Boolean,default:!1},iconClass:{type:String,default:null},iconStyle:{type:Object,default:()=>{}}},emits:{"update:modelValue":[Boolean]},setup(t,{emit:e}){return{clickEventName:o.computed(()=>t.clickOutside?"click":null),closeLoading:()=>e("update:modelValue",!1)}}},Px={class:"ev-loading-spinner"},Dx={class:"ev-loading-spinner"};function Bx(t,e,n,i,s,l){return n.fullscreen?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"body"},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading full-screen"},{[o.toHandlerKey(`${i.clickEventName}`)]:e[0]||(e[0]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",Px,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading"},{[o.toHandlerKey(`${i.clickEventName}`)]:e[1]||(e[1]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",Dx,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)],64))}const oi=ce(Nx,[["render",Bx]]);oi.install=t=>{t.component(oi.name,oi)};const Yx={name:"EvProgress",props:{modelValue:{type:Number,default:0,validator:t=>t>=0&&t<=100},color:{type:[String,Array],default:"#409EFF"},strokeWidth:{type:Number,default:6},innerText:{type:String,default:""}},emits:{},setup(t){const e=o.computed(()=>({height:`${t.strokeWidth}px`})),n=o.computed(()=>{if(Array.isArray(t.color)){const i=[...t.color].sort((l,a)=>l.value-a.value);let s=i[0].color;if(!t.modelValue)return{width:`${t.modelValue}%`,"background-color":s};for(let l=0;l<i.length;l++){const a=l===0?0:i[l-1].value,r=i[l].value;if(t.modelValue>a&&t.modelValue<=r){s=i[l].color;break}}return{width:`${t.modelValue}%`,"background-color":s}}return{width:`${t.modelValue}%`,"background-color":t.color}});return{wrapperStyle:e,innerStyle:n}}},Ox={class:"ev-progress"},Hx={key:0,class:"ev-progress-inner-text"},Fx={key:0,class:"ev-progress-label"};function zx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Ox,[o.createElementVNode("div",{class:"ev-progress-wrapper",style:o.normalizeStyle(i.wrapperStyle)},[o.createElementVNode("div",{class:"ev-progress-inner",style:o.normalizeStyle(i.innerStyle)},[n.innerText?(o.openBlock(),o.createElementBlock("div",Hx,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),t.$slots.default?(o.openBlock(),o.createElementBlock("div",Fx,[o.renderSlot(t.$slots,"default")])):o.createCommentVNode("",!0)])}const li=ce(Yx,[["render",zx]]);li.install=t=>{t.component(li.name,li)};const Ax={name:"MenuItem",props:{selectedItem:{type:[String,Number],default:""},item:{type:Object,default:()=>{},validator:t=>{if(t.value){if(t.children!==void 0&&!Array.isArray(t.children))return console.warn("[EVUI][Menu] children attribute must be 'Array' type."),!1;if(t.expand!==void 0&&typeof t.expand!="boolean")return console.warn("[EVUI][Menu] expand attribute must be 'Boolean' type."),!1;if(t.hidden!==void 0&&typeof t.hidden!="boolean")return console.warn("[EVUI][Menu] hidden attribute must be 'Boolean' type."),!1;if(t.disabled!==void 0&&typeof t.disabled!="boolean")return console.warn("[EVUI][Menu] disabled attribute must be 'Boolean' type."),!1;if(t.slotKey!==void 0&&typeof t.slotKey!="string")return console.warn("[EVUI][Menu] slotKey attribute must be 'String' type."),!1}else return console.warn("[EVUI][Menu] value attribute is required."),!1;return!0}},depth:{type:Number,default:1},expandable:{type:Boolean,default:!0},comp:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=t.expandable&&t.item.expand!==void 0&&typeof t.item.expand=="boolean"?t.item.expand:!0,i=o.ref(n),s=o.computed(()=>!!t.item.children&&!!t.item.children.length);return{isExpand:i,hasChild:s,clickMenu:a=>{s.value&&a.depth===t.depth?t.expandable&&(i.value=!i.value):e("click",a)}}}},Kx={class:"text"};function _x(t,e,n,i,s,l){return n.item.hidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[o.createElementVNode("div",{class:o.normalizeClass(["ev-menu-title",{expandable:i.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:e[0]||(e[0]=a=>i.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["front-icon",n.item.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",Kx,[n.item.slotKey?o.renderSlot(t.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&i.hasChild?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["list-expend-icon",{expend:n.expandable&&i.isExpand}])},[...e[1]||(e[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):o.createCommentVNode("",!0)],2),i.hasChild?o.withDirectives((o.openBlock(),o.createElementBlock("ol",{key:0,class:o.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.item.children,(a,r)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${a.value}_${r}_${n.depth+1}`,depth:n.depth+1,item:a,"selected-item":n.selectedItem,expandable:n.expandable,disabled:n.disabled,comp:n.comp,onClick:i.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[o.vShow,i.isExpand]]):o.createCommentVNode("",!0)],2))}const vr=ce(Ax,[["render",_x]]),Ux={name:"EvMenu",components:{MenuItem:vr},props:{modelValue:{type:[String,Number],default:""},items:{type:Array,default:()=>[]},expandable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=o.ref(t.items.filter(l=>t.modelValue===l.value));return{clickMenu:l=>{if(!l.disabled){const a=l.item;e("update:modelValue",a.value),e("change",a,n.value),n.value=a}},component:vr}}},Jx={class:"ev-menu"};function jx(t,e,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",Jx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:i.component,onClick:i.clickMenu},o.createSlots({_:2},[o.renderList(t.$slots,(d,h)=>({name:h,fn:o.withCtx(u=>[o.renderSlot(t.$slots,h,o.mergeProps({ref_for:!0},u))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const ai=ce(Ux,[["render",jx]]);ai.install=t=>{t.component(ai.name,ai)};const Qx={name:"TreeNode",props:{data:{type:Object,require:!0,default:()=>({})},useCheckbox:{type:Boolean,default:!1},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},comp:{type:Object,default:()=>{}}},emits:{"update-checked-info":null,"click-node":null,"dblclick-node":null,"show-context-menu":null},setup(t,{emit:e}){const n=o.reactive(t.data),i=o.computed(()=>t.data.children&&t.data.children.length),s=o.computed(()=>{const p=t.expandIcon?t.expandIcon:"ev-icon-s-play",y=t.expandIcon?t.collapseIcon:"ev-icon-s-play";return t.data.expand?y:p}),l=o.computed(()=>t.data.children);function a(p,y){e("update-checked-info",{nodeKey:y,isChecked:p})}function r({nodeKey:p,isChecked:y}){e("update-checked-info",{nodeKey:p,isChecked:y})}function c(){n.expand=!n.expand}function d(){n.disabled||(n.selected=!n.selected,e("click-node",n.nodeKey))}function h(p){e("click-node",p)}function u(){n.disabled||e("dblclick-node",n.nodeKey)}function f(p){e("dblclick-node",p)}function m(p){e("show-context-menu",!0,p)}return{expandIconClasses:s,showExpandIcon:i,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:u,emitDblClickedContent:f,handleContextmenu:m,emitContextMenuFlag:(p,y)=>{e("show-context-menu",p,y)}}}},$x={class:"ev-tree-children"},qx={class:"ev-tree-node"};function e0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-checkbox");return o.withDirectives((o.openBlock(),o.createElementBlock("ul",$x,[o.createElementVNode("li",null,[o.createElementVNode("span",{class:o.normalizeClass([{expand:i.treeData.expand},"ev-tree-toggle"])},[i.showExpandIcon?(o.openBlock(),o.createBlock(a,{key:0,icon:i.expandIconClasses,onClick:i.handleExpand},null,8,["icon","onClick"])):o.createCommentVNode("",!0)],2),o.createElementVNode("div",qx,[n.useCheckbox?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.treeData.checked,"onUpdate:modelValue":e[0]||(e[0]=c=>i.treeData.checked=c),indeterminate:i.treeData.indeterminate,disabled:i.treeData.disabled,onChange:e[1]||(e[1]=c=>i.handleCheck(i.treeData.checked,i.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):o.createCommentVNode("",!0),i.treeData.iconClass?(o.openBlock(),o.createBlock(a,{key:1,icon:i.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass([{"ev-tree-title-selected":i.treeData.selected,"ev-tree-title-disabled":i.treeData.disabled},"ev-tree-title"]),onContextmenu:e[2]||(e[2]=(...c)=>i.handleContextmenu&&i.handleContextmenu(...c)),onClick:e[3]||(e[3]=(...c)=>i.clickTreeContent&&i.clickTreeContent(...c)),onDblclick:e[4]||(e[4]=(...c)=>i.dblClickTreeContent&&i.dblClickTreeContent(...c))},o.toDisplayString(i.treeData.title),35)]),o.createVNode(o.TransitionGroup,{name:"fade"},{default:o.withCtx(()=>[i.treeData.expand?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.childrenInfo,(c,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${c.value}-${d}`,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:n.comp,onUpdateCheckedInfo:i.emitCheckedInfo,onClickNode:i.emitClickedContent,onDblclickNode:i.emitDblClickedContent,onShowContextMenu:i.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):o.createCommentVNode("",!0)]),_:1})])],512)),[[o.vShow,i.treeData.visible]])}const Rr=ce(Qx,[["render",e0]]),t0={name:"EvTree",components:{TreeNode:Rr},props:{data:{type:Array,default:()=>[]},useCheckbox:{type:Boolean,default:!1},emptyText:{type:String,default:"No Data"},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},contextMenuItems:{type:Array,default:()=>[]},searchWord:{type:String,default:""},searchIncludeChildren:{type:Boolean,default:!1}},emits:{"click-node":null,"dblclick-node":null,check:Array},setup(t,{emit:e}){const n=o.ref(t.data);let i=[];const s=o.ref(null);let l=!1;const a=Rr;function r(x){const S=i[x].parent;if(typeof S>"u")return;const L=i[x].node,I=i[S].node;if(!(L.checked===I.checked&&L.indeterminate===I.indeterminate)){if(L.checked)I.checked=I.children.every(R=>R.checked),I.indeterminate=!I.checked;else{const R=v=>v.checked||L.indeterminate;I.checked=!1,I.indeterminate=I.children.some(R)}r(S)}}function c(x,S={}){const L=Object.keys(S);for(let I=0;I<L.length;I++)x[L[I]]=S[L[I]];x.children&&x.children.forEach(I=>{c(I,S)})}function d(){let x=0;const S=[],L=[];function I(R,v){const G=R;G.nodeKey=x++,Object.hasOwnProperty.call(G,"selected")||(G.selected=!1),Object.hasOwnProperty.call(G,"visible")||(G.visible=!0),"value"in G&&L.includes(G.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),G.value+=G.nodeKey):"value"in G||(G.value=G.title+G.nodeKey),L.push(G.value),S[G.nodeKey]={node:G,nodeKey:G.nodeKey},typeof v<"u"&&(S[G.nodeKey].parent=v.nodeKey,S[v.nodeKey].children.push(G.nodeKey)),G.children&&(S[G.nodeKey].children=[],G.children.forEach(W=>I(W,G)))}return n.value.length&&I(n.value[0]),S}i=d();function h(){return i.filter(x=>x.node.checked).map(x=>x.node)}function u(){h().forEach(S=>{c(S,{checked:!0});const L=i[S.nodeKey].parent;if(!L&&L!==0)return;const I=i[L].node;typeof S.checked<"u"&&S.checked&&I.checked!==S.checked&&r(S.nodeKey)})}function f({nodeKey:x,isChecked:S}){const L=i[x].node;L.checked=S,L.indeterminate=!1,r(x),c(L,{checked:S,indeterminate:!1});const I=h();e("check",I),u()}function m(x){const S=i[x].node;for(let L=0;L<i.length;L++)i[L].node.nodeKey!==x&&(i[L].node.selected=!1);e("click-node",{title:S.title,value:S.value})}function g(x){const S=i[x].node;e("dblclick-node",{title:S.title,value:S.value})}const p=x=>{t.contextMenuItems.length&&l&&(s.value.show(x),l=!1)},y=(x,S)=>{l=x,p(S)},C=(x,S)=>x.toLowerCase().includes(S.toLowerCase()),b=x=>{var S;if(x.children){const L=!!((S=x.children.filter(I=>C(I.title,t.searchWord)))!=null&&S.length);x.children.forEach(I=>{b(I),I.visible=L&&C(I.title,t.searchWord)||!L})}};function w(x){x.children&&x.children.forEach(S=>{S.visible=!1,w(S)})}function T(x){if(!x&&x!==0)return;const S=i[x];S.node.visible=!0,S.parent!==void 0&&T(S.parent)}function k(x){i.forEach(L=>{const I=L.node;I.visible=!1}),i.filter(L=>C(L.node.title,x)).forEach(L=>{const I=L.node;I.visible=!0,t.searchIncludeChildren?b(I):w(I);const R=i[I.nodeKey].parent;T(R)})}const M=o.computed(()=>!n.value.length||n.value.every(x=>!x.visible));o.watch(()=>t.data,x=>{n.value=x,i=d()},{deep:!0});let V;return o.watch(()=>t.searchWord,x=>{V&&clearTimeout(V),V=setTimeout(()=>{x?k(x):i.forEach(S=>{const L=S.node;L.visible=!0})},200)}),o.onMounted(()=>{u();const x=h();x.length&&e("check",x)}),o.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:f,clickContent:m,dblClickContent:g,showContextMenu:p,getContextMenuFlag:y}}},n0={class:"ev-tree-view"},i0={key:0};function s0(t,e,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",n0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.treeNodeData,(c,d)=>(o.openBlock(),o.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:i.component,onUpdateCheckedInfo:i.updateCheckedInfo,onClickNode:i.clickContent,onDblclickNode:i.dblClickContent,onShowContextMenu:i.getContextMenuFlag,onContextmenu:o.withModifiers(i.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),i.isShowEmptyText?(o.openBlock(),o.createElementBlock("div",i0,o.toDisplayString(n.emptyText),1)):o.createCommentVNode("",!0),n.contextMenuItems.length?(o.openBlock(),o.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):o.createCommentVNode("",!0)])}const ri=ce(t0,[["render",s0]]);ri.install=t=>{t.component(ri.name,ri)};const o0={name:"EvTimePicker",props:{modelValue:{type:[Array,String],default:"",validator:t=>{const e=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;return Array.isArray(t)&&(!e.test(t[0])||!e.test(t[1]))||!Array.isArray(t)&&!e.test(t)?(console.warn("[EVUI][TimePicker] Please check the time format in the Timepicker."),!1):!0}},type:{type:String,default:"range"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:[String,Array],required:!1,default:void 0}},emits:{"update:modelValue":null,focus:null,blur:null,change:null},setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:k=>{if(t.type==="range"){if(Array.isArray(k)){const M=k[0]>k[1]?"00:00":k[0],V=M.value>k[1]?"23:59":k[1];e("update:modelValue",[M,V])}}else e("update:modelValue",k)}}),i=o.computed(()=>{const k=["start time","end time"];return Array.isArray(t.placeholder)?[typeof t.placeholder[0]=="string"?t.placeholder[0]:k[0],typeof t.placeholder[1]=="string"?t.placeholder[1]:k[1]]:typeof t.placeholder=="string"?[t.placeholder,t.placeholder]:k}),s=o.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=o.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=k=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(k),r=()=>{Array.isArray(n.value)&&(a(n.value[0])||(n.value[0]=s.value[0]),n.value[1]&&n.value[0]>n.value[1]&&(n.value[0]=n.value[1]),s.value[0]=n.value[0])},c=()=>{Array.isArray(n.value)&&(a(n.value[1])||(n.value[1]=s.value[1]),n.value[0]&&n.value[0]>n.value[1]&&(n.value[1]=s.value[1],n.value[0]>s.value[1]&&(n.value[1]=n.value[0])),s.value[1]=n.value[1])};return{time:n,isWrongType:l,previousValue:s,clearContents:()=>{n.value="",l.single=!0},clearStartTime:()=>{n.value[0]="",l.rangeStart=!0},clearEndTime:()=>{n.value[1]="",l.rangeEnd=!0},focusInputTime:k=>{e("focus",k)},blurInputTime:k=>{e("blur",k)},changeTime:k=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),e("change",k,n.value)},focusInputStartTime:k=>{e("focus",k)},blurInputStartTime:k=>{e("blur",k)},changeStartTime:k=>{r(),l.rangeStart=!1,e("change",k,n.value)},focusInputEndTime:k=>{e("focus",k)},blurInputEndTime:k=>{e("blur",k)},changeEndTime:k=>{c(),l.rangeEnd=!1,e("change",k,n.value)},placeholders:i}}},l0={class:"ev-time-picker"},a0={key:0,class:"ev-time-picker-range"},r0=["disabled","readonly","placeholder"],c0=["disabled","readonly","placeholder"],d0={key:1,class:"ev-time-picker-single"},h0=["disabled","readonly","placeholder"];function u0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",l0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",a0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=r=>i.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[0],onFocus:e[1]||(e[1]=(...r)=>i.focusInputStartTime&&i.focusInputStartTime(...r)),onBlur:e[2]||(e[2]=(...r)=>i.blurInputStartTime&&i.blurInputStartTime(...r)),onChange:e[3]||(e[3]=(...r)=>i.changeStartTime&&i.changeStartTime(...r))},null,40,r0),[[o.vModelText,i.time[0]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearStartTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2),e[12]||(e[12]=o.createElementVNode("p",{class:"tilde"},"~",-1)),o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[4]||(e[4]=r=>i.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[1],onFocus:e[5]||(e[5]=(...r)=>i.focusInputEndTime&&i.focusInputEndTime(...r)),onBlur:e[6]||(e[6]=(...r)=>i.blurInputEndTime&&i.blurInputEndTime(...r)),onChange:e[7]||(e[7]=(...r)=>i.changeEndTime&&i.changeEndTime(...r))},null,40,c0),[[o.vModelText,i.time[1]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearEndTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2)])):(o.openBlock(),o.createElementBlock("div",d0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[8]||(e[8]=r=>i.time=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:typeof n.placeholder=="string"?n.placeholder:"Enter time",onFocus:e[9]||(e[9]=(...r)=>i.focusInputTime&&i.focusInputTime(...r)),onBlur:e[10]||(e[10]=(...r)=>i.blurInputTime&&i.blurInputTime(...r)),onChange:e[11]||(e[11]=(...r)=>i.changeTime&&i.changeTime(...r))},null,40,h0),[[o.vModelText,i.time]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearContents},null,8,["onClick"])):o.createCommentVNode("",!0)],2)]))])}const ci=ce(o0,[["render",u0]]);ci.install=t=>{t.component(ci.name,ci)};const f0={name:"EvGridToolbar"},m0={class:"gridToolbar"};function p0(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",m0,[o.renderSlot(t.$slots,"toolbarWrapper")])}const g0=ce(f0,[["render",p0]]),b0={name:"EvGridPagination",props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:t=>["left","right","center"].includes(t)}},emits:{"update:modelValue":null},setup(t,{emit:e}){const n=o.ref(t.modelValue),i=s=>{n.value=s>0?s:1,e("update:modelValue",n.value)};return o.watch(()=>t.modelValue,s=>{n.value=s}),{currentValue:n,changePage:i}}},y0={class:"grid-pagination"};function x0(t,e,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",y0,[o.createVNode(a,{modelValue:i.currentValue,"onUpdate:modelValue":e[0]||(e[0]=r=>i.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:i.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const Vr=ce(b0,[["render",x0],["__scopeId","data-v-2e265290"]]);var S0=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Bo=Math.ceil,tt=Math.floor,Ue="[BigNumber Error] ",Er=Ue+"Number primitive has more than 15 significant digits: ",ft=1e14,de=14,Yo=9007199254740991,Oo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ot=1e7,Xe=1e9;function Gr(t){var e,n,i,s=b.prototype={constructor:b,toString:null,valueOf:null},l=new b(1),a=20,r=4,c=-7,d=21,h=-1e7,u=1e7,f=!1,m=1,g=0,p={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},y="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function b(x,S){var L,I,R,v,G,W,E,X,Z=this;if(!(Z instanceof b))return new b(x,S);if(S==null){if(x&&x._isBigNumber===!0){Z.s=x.s,!x.c||x.e>u?Z.c=Z.e=null:x.e<h?Z.c=[Z.e=0]:(Z.e=x.e,Z.c=x.c.slice());return}if((W=typeof x=="number")&&x*0==0){if(Z.s=1/x<0?(x=-x,-1):1,x===~~x){for(v=0,G=x;G>=10;G/=10,v++);v>u?Z.c=Z.e=null:(Z.e=v,Z.c=[x]);return}X=String(x)}else{if(!S0.test(X=String(x)))return i(Z,X,W);Z.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(v=X.indexOf("."))>-1&&(X=X.replace(".","")),(G=X.search(/e/i))>0?(v<0&&(v=G),v+=+X.slice(G+1),X=X.substring(0,G)):v<0&&(v=X.length)}else{if(we(S,2,y.length,"Base"),S==10&&C)return Z=new b(x),M(Z,a+Z.e+1,r);if(X=String(x),W=typeof x=="number"){if(x*0!=0)return i(Z,X,W,S);if(Z.s=1/x<0?(X=X.slice(1),-1):1,b.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Er+x)}else Z.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(L=y.slice(0,S),v=G=0,E=X.length;G<E;G++)if(L.indexOf(I=X.charAt(G))<0){if(I=="."){if(G>v){v=E;continue}}else if(!R&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){R=!0,G=-1,v=0;continue}return i(Z,String(x),W,S)}W=!1,X=n(X,S,10,Z.s),(v=X.indexOf("."))>-1?X=X.replace(".",""):v=X.length}for(G=0;X.charCodeAt(G)===48;G++);for(E=X.length;X.charCodeAt(--E)===48;);if(X=X.slice(G,++E)){if(E-=G,W&&b.DEBUG&&E>15&&(x>Yo||x!==tt(x)))throw Error(Er+Z.s*x);if((v=v-G-1)>u)Z.c=Z.e=null;else if(v<h)Z.c=[Z.e=0];else{if(Z.e=v,Z.c=[],G=(v+1)%de,v<0&&(G+=de),G<E){for(G&&Z.c.push(+X.slice(0,G)),E-=de;G<E;)Z.c.push(+X.slice(G,G+=de));G=de-(X=X.slice(G)).length}else G-=E;for(;G--;X+="0");Z.c.push(+X)}}else Z.c=[Z.e=0]}b.clone=Gr,b.ROUND_UP=0,b.ROUND_DOWN=1,b.ROUND_CEIL=2,b.ROUND_FLOOR=3,b.ROUND_HALF_UP=4,b.ROUND_HALF_DOWN=5,b.ROUND_HALF_EVEN=6,b.ROUND_HALF_CEIL=7,b.ROUND_HALF_FLOOR=8,b.EUCLID=9,b.config=b.set=function(x){var S,L;if(x!=null)if(typeof x=="object"){if(x.hasOwnProperty(S="DECIMAL_PLACES")&&(L=x[S],we(L,0,Xe,S),a=L),x.hasOwnProperty(S="ROUNDING_MODE")&&(L=x[S],we(L,0,8,S),r=L),x.hasOwnProperty(S="EXPONENTIAL_AT")&&(L=x[S],L&&L.pop?(we(L[0],-Xe,0,S),we(L[1],0,Xe,S),c=L[0],d=L[1]):(we(L,-Xe,Xe,S),c=-(d=L<0?-L:L))),x.hasOwnProperty(S="RANGE"))if(L=x[S],L&&L.pop)we(L[0],-Xe,-1,S),we(L[1],1,Xe,S),h=L[0],u=L[1];else if(we(L,-Xe,Xe,S),L)h=-(u=L<0?-L:L);else throw Error(Ue+S+" cannot be zero: "+L);if(x.hasOwnProperty(S="CRYPTO"))if(L=x[S],L===!!L)if(L)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=L;else throw f=!L,Error(Ue+"crypto unavailable");else f=L;else throw Error(Ue+S+" not true or false: "+L);if(x.hasOwnProperty(S="MODULO_MODE")&&(L=x[S],we(L,0,9,S),m=L),x.hasOwnProperty(S="POW_PRECISION")&&(L=x[S],we(L,0,Xe,S),g=L),x.hasOwnProperty(S="FORMAT"))if(L=x[S],typeof L=="object")p=L;else throw Error(Ue+S+" not an object: "+L);if(x.hasOwnProperty(S="ALPHABET"))if(L=x[S],typeof L=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(L))C=L.slice(0,10)=="0123456789",y=L;else throw Error(Ue+S+" invalid: "+L)}else throw Error(Ue+"Object expected: "+x);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,u],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:g,FORMAT:p,ALPHABET:y}},b.isBigNumber=function(x){if(!x||x._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var S,L,I=x.c,R=x.e,v=x.s;e:if({}.toString.call(I)=="[object Array]"){if((v===1||v===-1)&&R>=-Xe&&R<=Xe&&R===tt(R)){if(I[0]===0){if(R===0&&I.length===1)return!0;break e}if(S=(R+1)%de,S<1&&(S+=de),String(I[0]).length==S){for(S=0;S<I.length;S++)if(L=I[S],L<0||L>=ft||L!==tt(L))break e;if(L!==0)return!0}}}else if(I===null&&R===null&&(v===null||v===1||v===-1))return!0;throw Error(Ue+"Invalid BigNumber: "+x)},b.maximum=b.max=function(){return T(arguments,-1)},b.minimum=b.min=function(){return T(arguments,1)},b.random=function(){var x=9007199254740992,S=Math.random()*x&2097151?function(){return tt(Math.random()*x)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(L){var I,R,v,G,W,E=0,X=[],Z=new b(l);if(L==null?L=a:we(L,0,Xe),G=Bo(L/de),f)if(crypto.getRandomValues){for(I=crypto.getRandomValues(new Uint32Array(G*=2));E<G;)W=I[E]*131072+(I[E+1]>>>11),W>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),I[E]=R[0],I[E+1]=R[1]):(X.push(W%1e14),E+=2);E=G/2}else if(crypto.randomBytes){for(I=crypto.randomBytes(G*=7);E<G;)W=(I[E]&31)*281474976710656+I[E+1]*1099511627776+I[E+2]*4294967296+I[E+3]*16777216+(I[E+4]<<16)+(I[E+5]<<8)+I[E+6],W>=9e15?crypto.randomBytes(7).copy(I,E):(X.push(W%1e14),E+=7);E=G/7}else throw f=!1,Error(Ue+"crypto unavailable");if(!f)for(;E<G;)W=S(),W<9e15&&(X[E++]=W%1e14);for(G=X[--E],L%=de,G&&L&&(W=Oo[de-L],X[E]=tt(G/W)*W);X[E]===0;X.pop(),E--);if(E<0)X=[v=0];else{for(v=-1;X[0]===0;X.splice(0,1),v-=de);for(E=1,W=X[0];W>=10;W/=10,E++);E<de&&(v-=de-E)}return Z.e=v,Z.c=X,Z}}(),b.sum=function(){for(var x=1,S=arguments,L=new b(S[0]);x<S.length;)L=L.plus(S[x++]);return L},n=function(){var x="0123456789";function S(L,I,R,v){for(var G,W=[0],E,X=0,Z=L.length;X<Z;){for(E=W.length;E--;W[E]*=I);for(W[0]+=v.indexOf(L.charAt(X++)),G=0;G<W.length;G++)W[G]>R-1&&(W[G+1]==null&&(W[G+1]=0),W[G+1]+=W[G]/R|0,W[G]%=R)}return W.reverse()}return function(L,I,R,v,G){var W,E,X,Z,N,P,B,Y,H=L.indexOf("."),_=a,D=r;for(H>=0&&(Z=g,g=0,L=L.replace(".",""),Y=new b(I),P=Y.pow(L.length-H),g=Z,Y.c=S(vt(it(P.c),P.e,"0"),10,R,x),Y.e=Y.c.length),B=S(L,I,R,G?(W=y,x):(W=x,y)),X=Z=B.length;B[--Z]==0;B.pop());if(!B[0])return W.charAt(0);if(H<0?--X:(P.c=B,P.e=X,P.s=v,P=e(P,Y,_,D,R),B=P.c,N=P.r,X=P.e),E=X+_+1,H=B[E],Z=R/2,N=N||E<0||B[E+1]!=null,N=D<4?(H!=null||N)&&(D==0||D==(P.s<0?3:2)):H>Z||H==Z&&(D==4||N||D==6&&B[E-1]&1||D==(P.s<0?8:7)),E<1||!B[0])L=N?vt(W.charAt(1),-_,W.charAt(0)):W.charAt(0);else{if(B.length=E,N)for(--R;++B[--E]>R;)B[E]=0,E||(++X,B=[1].concat(B));for(Z=B.length;!B[--Z];);for(H=0,L="";H<=Z;L+=W.charAt(B[H++]));L=vt(L,X,W.charAt(0))}return L}}(),e=function(){function x(I,R,v){var G,W,E,X,Z=0,N=I.length,P=R%Ot,B=R/Ot|0;for(I=I.slice();N--;)E=I[N]%Ot,X=I[N]/Ot|0,G=B*E+X*P,W=P*E+G%Ot*Ot+Z,Z=(W/v|0)+(G/Ot|0)+B*X,I[N]=W%v;return Z&&(I=[Z].concat(I)),I}function S(I,R,v,G){var W,E;if(v!=G)E=v>G?1:-1;else for(W=E=0;W<v;W++)if(I[W]!=R[W]){E=I[W]>R[W]?1:-1;break}return E}function L(I,R,v,G){for(var W=0;v--;)I[v]-=W,W=I[v]<R[v]?1:0,I[v]=W*G+I[v]-R[v];for(;!I[0]&&I.length>1;I.splice(0,1));}return function(I,R,v,G,W){var E,X,Z,N,P,B,Y,H,_,D,z,A,j,J,q,U,ne,$=I.s==R.s?1:-1,ee=I.c,Q=R.c;if(!ee||!ee[0]||!Q||!Q[0])return new b(!I.s||!R.s||(ee?Q&&ee[0]==Q[0]:!Q)?NaN:ee&&ee[0]==0||!Q?$*0:$/0);for(H=new b($),_=H.c=[],X=I.e-R.e,$=v+X+1,W||(W=ft,X=nt(I.e/de)-nt(R.e/de),$=$/de|0),Z=0;Q[Z]==(ee[Z]||0);Z++);if(Q[Z]>(ee[Z]||0)&&X--,$<0)_.push(1),N=!0;else{for(J=ee.length,U=Q.length,Z=0,$+=2,P=tt(W/(Q[0]+1)),P>1&&(Q=x(Q,P,W),ee=x(ee,P,W),U=Q.length,J=ee.length),j=U,D=ee.slice(0,U),z=D.length;z<U;D[z++]=0);ne=Q.slice(),ne=[0].concat(ne),q=Q[0],Q[1]>=W/2&&q++;do{if(P=0,E=S(Q,D,U,z),E<0){if(A=D[0],U!=z&&(A=A*W+(D[1]||0)),P=tt(A/q),P>1)for(P>=W&&(P=W-1),B=x(Q,P,W),Y=B.length,z=D.length;S(B,D,Y,z)==1;)P--,L(B,U<Y?ne:Q,Y,W),Y=B.length,E=1;else P==0&&(E=P=1),B=Q.slice(),Y=B.length;if(Y<z&&(B=[0].concat(B)),L(D,B,z,W),z=D.length,E==-1)for(;S(Q,D,U,z)<1;)P++,L(D,U<z?ne:Q,z,W),z=D.length}else E===0&&(P++,D=[0]);_[Z++]=P,D[0]?D[z++]=ee[j]||0:(D=[ee[j]],z=1)}while((j++<J||D[0]!=null)&&$--);N=D[0]!=null,_[0]||_.splice(0,1)}if(W==ft){for(Z=1,$=_[0];$>=10;$/=10,Z++);M(H,v+(H.e=Z+X*de-1)+1,G,N)}else H.e=X,H.r=+N;return H}}();function w(x,S,L,I){var R,v,G,W,E;if(L==null?L=r:we(L,0,8),!x.c)return x.toString();if(R=x.c[0],G=x.e,S==null)E=it(x.c),E=I==1||I==2&&(G<=c||G>=d)?hs(E,G):vt(E,G,"0");else if(x=M(new b(x),S,L),v=x.e,E=it(x.c),W=E.length,I==1||I==2&&(S<=v||v<=c)){for(;W<S;E+="0",W++);E=hs(E,v)}else if(S-=G+(I===2&&v>G),E=vt(E,v,"0"),v+1>W){if(--S>0)for(E+=".";S--;E+="0");}else if(S+=v-W,S>0)for(v+1==W&&(E+=".");S--;E+="0");return x.s<0&&R?"-"+E:E}function T(x,S){for(var L,I,R=1,v=new b(x[0]);R<x.length;R++)I=new b(x[R]),(!I.s||(L=nn(v,I))===S||L===0&&v.s===S)&&(v=I);return v}function k(x,S,L){for(var I=1,R=S.length;!S[--R];S.pop());for(R=S[0];R>=10;R/=10,I++);return(L=I+L*de-1)>u?x.c=x.e=null:L<h?x.c=[x.e=0]:(x.e=L,x.c=S),x}i=function(){var x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,L=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,G,W,E){var X,Z=W?G:G.replace(R,"");if(I.test(Z))v.s=isNaN(Z)?null:Z<0?-1:1;else{if(!W&&(Z=Z.replace(x,function(N,P,B){return X=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!E||E==X?P:N}),E&&(X=E,Z=Z.replace(S,"$1").replace(L,"0.$1")),G!=Z))return new b(Z,X);if(b.DEBUG)throw Error(Ue+"Not a"+(E?" base "+E:"")+" number: "+G);v.s=null}v.c=v.e=null}}();function M(x,S,L,I){var R,v,G,W,E,X,Z,N=x.c,P=Oo;if(N){e:{for(R=1,W=N[0];W>=10;W/=10,R++);if(v=S-R,v<0)v+=de,G=S,E=N[X=0],Z=tt(E/P[R-G-1]%10);else if(X=Bo((v+1)/de),X>=N.length)if(I){for(;N.length<=X;N.push(0));E=Z=0,R=1,v%=de,G=v-de+1}else break e;else{for(E=W=N[X],R=1;W>=10;W/=10,R++);v%=de,G=v-de+R,Z=G<0?0:tt(E/P[R-G-1]%10)}if(I=I||S<0||N[X+1]!=null||(G<0?E:E%P[R-G-1]),I=L<4?(Z||I)&&(L==0||L==(x.s<0?3:2)):Z>5||Z==5&&(L==4||I||L==6&&(v>0?G>0?E/P[R-G]:0:N[X-1])%10&1||L==(x.s<0?8:7)),S<1||!N[0])return N.length=0,I?(S-=x.e+1,N[0]=P[(de-S%de)%de],x.e=-S||0):N[0]=x.e=0,x;if(v==0?(N.length=X,W=1,X--):(N.length=X+1,W=P[de-v],N[X]=G>0?tt(E/P[R-G]%P[G])*W:0),I)for(;;)if(X==0){for(v=1,G=N[0];G>=10;G/=10,v++);for(G=N[0]+=W,W=1;G>=10;G/=10,W++);v!=W&&(x.e++,N[0]==ft&&(N[0]=1));break}else{if(N[X]+=W,N[X]!=ft)break;N[X--]=0,W=1}for(v=N.length;N[--v]===0;N.pop());}x.e>u?x.c=x.e=null:x.e<h&&(x.c=[x.e=0])}return x}function V(x){var S,L=x.e;return L===null?x.toString():(S=it(x.c),S=L<=c||L>=d?hs(S,L):vt(S,L,"0"),x.s<0?"-"+S:S)}return s.absoluteValue=s.abs=function(){var x=new b(this);return x.s<0&&(x.s=1),x},s.comparedTo=function(x,S){return nn(this,new b(x,S))},s.decimalPlaces=s.dp=function(x,S){var L,I,R,v=this;if(x!=null)return we(x,0,Xe),S==null?S=r:we(S,0,8),M(new b(v),x+v.e+1,S);if(!(L=v.c))return null;if(I=((R=L.length-1)-nt(this.e/de))*de,R=L[R])for(;R%10==0;R/=10,I--);return I<0&&(I=0),I},s.dividedBy=s.div=function(x,S){return e(this,new b(x,S),a,r)},s.dividedToIntegerBy=s.idiv=function(x,S){return e(this,new b(x,S),0,1)},s.exponentiatedBy=s.pow=function(x,S){var L,I,R,v,G,W,E,X,Z,N=this;if(x=new b(x),x.c&&!x.isInteger())throw Error(Ue+"Exponent not an integer: "+V(x));if(S!=null&&(S=new b(S)),W=x.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!x.c||!x.c[0])return Z=new b(Math.pow(+V(N),W?x.s*(2-ds(x)):+V(x))),S?Z.mod(S):Z;if(E=x.s<0,S){if(S.c?!S.c[0]:!S.s)return new b(NaN);I=!E&&N.isInteger()&&S.isInteger(),I&&(N=N.mod(S))}else{if(x.e>9&&(N.e>0||N.e<-1||(N.e==0?N.c[0]>1||W&&N.c[1]>=24e7:N.c[0]<8e13||W&&N.c[0]<=9999975e7)))return v=N.s<0&&ds(x)?-0:0,N.e>-1&&(v=1/v),new b(E?1/v:v);g&&(v=Bo(g/de+2))}for(W?(L=new b(.5),E&&(x.s=1),X=ds(x)):(R=Math.abs(+V(x)),X=R%2),Z=new b(l);;){if(X){if(Z=Z.times(N),!Z.c)break;v?Z.c.length>v&&(Z.c.length=v):I&&(Z=Z.mod(S))}if(R){if(R=tt(R/2),R===0)break;X=R%2}else if(x=x.times(L),M(x,x.e+1,1),x.e>14)X=ds(x);else{if(R=+V(x),R===0)break;X=R%2}N=N.times(N),v?N.c&&N.c.length>v&&(N.c.length=v):I&&(N=N.mod(S))}return I?Z:(E&&(Z=l.div(Z)),S?Z.mod(S):v?M(Z,g,r,G):Z)},s.integerValue=function(x){var S=new b(this);return x==null?x=r:we(x,0,8),M(S,S.e+1,x)},s.isEqualTo=s.eq=function(x,S){return nn(this,new b(x,S))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(x,S){return nn(this,new b(x,S))>0},s.isGreaterThanOrEqualTo=s.gte=function(x,S){return(S=nn(this,new b(x,S)))===1||S===0},s.isInteger=function(){return!!this.c&&nt(this.e/de)>this.c.length-2},s.isLessThan=s.lt=function(x,S){return nn(this,new b(x,S))<0},s.isLessThanOrEqualTo=s.lte=function(x,S){return(S=nn(this,new b(x,S)))===-1||S===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(x,S){var L,I,R,v,G=this,W=G.s;if(x=new b(x,S),S=x.s,!W||!S)return new b(NaN);if(W!=S)return x.s=-S,G.plus(x);var E=G.e/de,X=x.e/de,Z=G.c,N=x.c;if(!E||!X){if(!Z||!N)return Z?(x.s=-S,x):new b(N?G:NaN);if(!Z[0]||!N[0])return N[0]?(x.s=-S,x):new b(Z[0]?G:r==3?-0:0)}if(E=nt(E),X=nt(X),Z=Z.slice(),W=E-X){for((v=W<0)?(W=-W,R=Z):(X=E,R=N),R.reverse(),S=W;S--;R.push(0));R.reverse()}else for(I=(v=(W=Z.length)<(S=N.length))?W:S,W=S=0;S<I;S++)if(Z[S]!=N[S]){v=Z[S]<N[S];break}if(v&&(R=Z,Z=N,N=R,x.s=-x.s),S=(I=N.length)-(L=Z.length),S>0)for(;S--;Z[L++]=0);for(S=ft-1;I>W;){if(Z[--I]<N[I]){for(L=I;L&&!Z[--L];Z[L]=S);--Z[L],Z[I]+=ft}Z[I]-=N[I]}for(;Z[0]==0;Z.splice(0,1),--X);return Z[0]?k(x,Z,X):(x.s=r==3?-1:1,x.c=[x.e=0],x)},s.modulo=s.mod=function(x,S){var L,I,R=this;return x=new b(x,S),!R.c||!x.s||x.c&&!x.c[0]?new b(NaN):!x.c||R.c&&!R.c[0]?new b(R):(m==9?(I=x.s,x.s=1,L=e(R,x,0,3),x.s=I,L.s*=I):L=e(R,x,0,m),x=R.minus(L.times(x)),!x.c[0]&&m==1&&(x.s=R.s),x)},s.multipliedBy=s.times=function(x,S){var L,I,R,v,G,W,E,X,Z,N,P,B,Y,H,_,D=this,z=D.c,A=(x=new b(x,S)).c;if(!z||!A||!z[0]||!A[0])return!D.s||!x.s||z&&!z[0]&&!A||A&&!A[0]&&!z?x.c=x.e=x.s=null:(x.s*=D.s,!z||!A?x.c=x.e=null:(x.c=[0],x.e=0)),x;for(I=nt(D.e/de)+nt(x.e/de),x.s*=D.s,E=z.length,N=A.length,E<N&&(Y=z,z=A,A=Y,R=E,E=N,N=R),R=E+N,Y=[];R--;Y.push(0));for(H=ft,_=Ot,R=N;--R>=0;){for(L=0,P=A[R]%_,B=A[R]/_|0,G=E,v=R+G;v>R;)X=z[--G]%_,Z=z[G]/_|0,W=B*X+Z*P,X=P*X+W%_*_+Y[v]+L,L=(X/H|0)+(W/_|0)+B*Z,Y[v--]=X%H;Y[v]=L}return L?++I:Y.splice(0,1),k(x,Y,I)},s.negated=function(){var x=new b(this);return x.s=-x.s||null,x},s.plus=function(x,S){var L,I=this,R=I.s;if(x=new b(x,S),S=x.s,!R||!S)return new b(NaN);if(R!=S)return x.s=-S,I.minus(x);var v=I.e/de,G=x.e/de,W=I.c,E=x.c;if(!v||!G){if(!W||!E)return new b(R/0);if(!W[0]||!E[0])return E[0]?x:new b(W[0]?I:R*0)}if(v=nt(v),G=nt(G),W=W.slice(),R=v-G){for(R>0?(G=v,L=E):(R=-R,L=W),L.reverse();R--;L.push(0));L.reverse()}for(R=W.length,S=E.length,R-S<0&&(L=E,E=W,W=L,S=R),R=0;S;)R=(W[--S]=W[S]+E[S]+R)/ft|0,W[S]=ft===W[S]?0:W[S]%ft;return R&&(W=[R].concat(W),++G),k(x,W,G)},s.precision=s.sd=function(x,S){var L,I,R,v=this;if(x!=null&&x!==!!x)return we(x,1,Xe),S==null?S=r:we(S,0,8),M(new b(v),x,S);if(!(L=v.c))return null;if(R=L.length-1,I=R*de+1,R=L[R]){for(;R%10==0;R/=10,I--);for(R=L[0];R>=10;R/=10,I++);}return x&&v.e+1>I&&(I=v.e+1),I},s.shiftedBy=function(x){return we(x,-Yo,Yo),this.times("1e"+x)},s.squareRoot=s.sqrt=function(){var x,S,L,I,R,v=this,G=v.c,W=v.s,E=v.e,X=a+4,Z=new b("0.5");if(W!==1||!G||!G[0])return new b(!W||W<0&&(!G||G[0])?NaN:G?v:1/0);if(W=Math.sqrt(+V(v)),W==0||W==1/0?(S=it(G),(S.length+E)%2==0&&(S+="0"),W=Math.sqrt(+S),E=nt((E+1)/2)-(E<0||E%2),W==1/0?S="5e"+E:(S=W.toExponential(),S=S.slice(0,S.indexOf("e")+1)+E),L=new b(S)):L=new b(W+""),L.c[0]){for(E=L.e,W=E+X,W<3&&(W=0);;)if(R=L,L=Z.times(R.plus(e(v,R,X,1))),it(R.c).slice(0,W)===(S=it(L.c)).slice(0,W))if(L.e<E&&--W,S=S.slice(W-3,W+1),S=="9999"||!I&&S=="4999"){if(!I&&(M(R,R.e+a+2,0),R.times(R).eq(v))){L=R;break}X+=4,W+=4,I=1}else{(!+S||!+S.slice(1)&&S.charAt(0)=="5")&&(M(L,L.e+a+2,1),x=!L.times(L).eq(v));break}}return M(L,L.e+a+1,r,x)},s.toExponential=function(x,S){return x!=null&&(we(x,0,Xe),x++),w(this,x,S,1)},s.toFixed=function(x,S){return x!=null&&(we(x,0,Xe),x=x+this.e+1),w(this,x,S)},s.toFormat=function(x,S,L){var I,R=this;if(L==null)x!=null&&S&&typeof S=="object"?(L=S,S=null):x&&typeof x=="object"?(L=x,x=S=null):L=p;else if(typeof L!="object")throw Error(Ue+"Argument not an object: "+L);if(I=R.toFixed(x,S),R.c){var v,G=I.split("."),W=+L.groupSize,E=+L.secondaryGroupSize,X=L.groupSeparator||"",Z=G[0],N=G[1],P=R.s<0,B=P?Z.slice(1):Z,Y=B.length;if(E&&(v=W,W=E,E=v,Y-=v),W>0&&Y>0){for(v=Y%W||W,Z=B.substr(0,v);v<Y;v+=W)Z+=X+B.substr(v,W);E>0&&(Z+=X+B.slice(v)),P&&(Z="-"+Z)}I=N?Z+(L.decimalSeparator||"")+((E=+L.fractionGroupSize)?N.replace(new RegExp("\\d{"+E+"}\\B","g"),"$&"+(L.fractionGroupSeparator||"")):N):Z}return(L.prefix||"")+I+(L.suffix||"")},s.toFraction=function(x){var S,L,I,R,v,G,W,E,X,Z,N,P,B=this,Y=B.c;if(x!=null&&(W=new b(x),!W.isInteger()&&(W.c||W.s!==1)||W.lt(l)))throw Error(Ue+"Argument "+(W.isInteger()?"out of range: ":"not an integer: ")+V(W));if(!Y)return new b(B);for(S=new b(l),X=L=new b(l),I=E=new b(l),P=it(Y),v=S.e=P.length-B.e-1,S.c[0]=Oo[(G=v%de)<0?de+G:G],x=!x||W.comparedTo(S)>0?v>0?S:X:W,G=u,u=1/0,W=new b(P),E.c[0]=0;Z=e(W,S,0,1),R=L.plus(Z.times(I)),R.comparedTo(x)!=1;)L=I,I=R,X=E.plus(Z.times(R=X)),E=R,S=W.minus(Z.times(R=S)),W=R;return R=e(x.minus(L),I,0,1),E=E.plus(R.times(X)),L=L.plus(R.times(I)),E.s=X.s=B.s,v=v*2,N=e(X,I,v,r).minus(B).abs().comparedTo(e(E,L,v,r).minus(B).abs())<1?[X,I]:[E,L],u=G,N},s.toNumber=function(){return+V(this)},s.toPrecision=function(x,S){return x!=null&&we(x,1,Xe),w(this,x,S,2)},s.toString=function(x){var S,L=this,I=L.s,R=L.e;return R===null?I?(S="Infinity",I<0&&(S="-"+S)):S="NaN":(x==null?S=R<=c||R>=d?hs(it(L.c),R):vt(it(L.c),R,"0"):x===10&&C?(L=M(new b(L),a+R+1,r),S=vt(it(L.c),L.e,"0")):(we(x,2,y.length,"Base"),S=n(vt(it(L.c),R,"0"),10,x,I,!0)),I<0&&L.c[0]&&(S="-"+S)),S},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,t!=null&&b.set(t),b}function nt(t){var e=t|0;return t>0||t===e?e:e-1}function it(t){for(var e,n,i=1,s=t.length,l=t[0]+"";i<s;){for(e=t[i++]+"",n=de-e.length;n--;e="0"+e);l+=e}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function nn(t,e){var n,i,s=t.c,l=e.c,a=t.s,r=e.s,c=t.e,d=e.e;if(!a||!r)return null;if(n=s&&!s[0],i=l&&!l[0],n||i)return n?i?0:-r:a;if(a!=r)return a;if(n=a<0,i=c==d,!s||!l)return i?0:!s^n?1:-1;if(!i)return c>d^n?1:-1;for(r=(c=s.length)<(d=l.length)?c:d,a=0;a<r;a++)if(s[a]!=l[a])return s[a]>l[a]^n?1:-1;return c==d?0:c>d^n?1:-1}function we(t,e,n,i){if(t<e||t>n||t!==tt(t))throw Error(Ue+(i||"Argument")+(typeof t=="number"?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function ds(t){var e=t.c.length-1;return nt(t.e/de)==e&&t.c[e]%2!=0}function hs(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function vt(t,e,n){var i,s;if(e<0){for(s=n+".";++e;s+=n);t=s+t}else if(i=t.length,++e>i){for(s=n,e-=i;--e;s+=n);t+=s}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Wr=Gr();function sn(t){return new Wr(t)}function Ho(t,e){return sn(t).plus(sn(e)).toNumber()}function C0(t,e){return sn(t).minus(sn(e)).toNumber()}function k0(t,e){return sn(t).dividedBy(sn(e)).toNumber()}function Zr(t,e){return sn(t).decimalPlaces(e,Wr.ROUND_DOWN).toNumber()}const w0={name:"EvGridSummary",props:{stores:{type:Object,default:()=>({})},orderedColumns:{type:Object,default:()=>({})},useCheckbox:{type:Boolean,default:!1},styleOption:{type:Object,default:()=>({})},isTree:{type:Boolean,default:!1},scrollLeft:{type:Number,default:0}},setup(t){const e={max:20,default:3},n=o.ref(),i=2,s=o.computed(()=>t.stores),l=o.computed(()=>t.orderedColumns),a=o.computed(()=>t.useCheckbox),r=o.computed(()=>t.styleOption),c=m=>m==null||m<0?e.default:m>e.max?e.max:m,d=(m,g)=>{if(typeof g=="string"&&g.length===0)return g;const{type:p,decimal:y}=m;let C=g;return p==="number"?(C=Qt(g),C=C===!1?g:C):p==="float"&&(C=C.toFixed(c(y??e.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),C},h=m=>l.value.findIndex(g=>g.field===m),u=m=>{const{type:g,field:p,summaryType:y,summaryDecimal:C,summaryOnlyTopParent:b}=m;let w="";const T=h(p);if(T>=0){if(y==="count")return s.value.store.length;if(g==="number"||g==="float"){let k=[];switch(t.isTree?k=s.value.store.reduce((M,V)=>{var x,S;return b?V.parent||M.push((x=V.data)==null?void 0:x[p]):M.push((S=V.data)==null?void 0:S[p]),M},[]):k=s.value.store.map(M=>M[i][T]),y){case"sum":{const M=k.reduce((V,x)=>{const S=Number(x);return Number.isNaN(S)?V:Ho(V,S)},0);w=M&&Zr(M,c(C??e.default));break}case"average":{const M=k.reduce((V,x)=>{const S=Number(x);return Number.isNaN(S)?V:Ho(V,S)},0);w=M&&Zr(k0(M,k.length),c(C??e.default));break}case"max":{const M=k.filter(V=>V!=null);w=M.length?Math.max(...M):"";break}case"min":{const M=k.filter(V=>V!=null);w=M.length?Math.min(...M):"";break}}w=d(m,w)}}return w},f=m=>{const g=m.summaryRenderer,p=m.summaryData?m.summaryData:[],y=[m.field,...p];let C=g;return y.forEach((b,w)=>{const T=h(b);if(T>=0){const k=u(s.value.orderedColumns[T]);C=C.replace(`{${w}}`,k)}}),C};return o.watch(()=>t.scrollLeft,m=>{o.nextTick(()=>{n.value.scrollLeft=m})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:u,getSummaryRenderer:f}}},I0={class:"column-list"},L0=["title"],T0=["title"];function M0(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{ref:"summaryRef",class:o.normalizeClass({"grid-summary":!0,"non-border":i.styleInfo.borderStyle==="none"})},[o.createElementVNode("ul",I0,[i.showCheckbox?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle}),style:o.normalizeStyle({width:`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[o.createElementVNode("span",{style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columns,(a,r)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`summary_${r}`},[a.hide?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:o.normalizeStyle({width:`${a.width}px`,"min-width":`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle({width:"100%",height:`${i.styleInfo.rowHeight}px`})},[a.summaryRenderer?(o.openBlock(),o.createElementBlock("div",{key:0,title:i.getSummaryRenderer(a)},o.toDisplayString(i.getSummaryRenderer(a)),9,L0)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,T0))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const Xr=ce(w0,[["render",M0],["__scopeId","data-v-4b9bef37"]]),v0={name:"EVGridColumnSetting",directives:{clickoutside:Yi},props:{isShow:{type:Boolean,default:!1},columns:{type:[Array],default:()=>[]},hiddenColumn:{type:String,default:""},position:{type:Object,default:()=>({top:0,left:0,columnListMenuWidth:0})},isShowMenuOnClick:{type:Boolean,default:!1},textInfo:{type:Object,default:()=>({title:"Column List",search:"Search",empty:"No records",ok:"OK"})}},emits:{"update:isShow":[Boolean],"update:isShowMenuOnClick":[Boolean],"apply-column":null},setup(t,{emit:e}){const n=o.computed({get:()=>t.isShow,set:I=>e("update:isShow",I)}),i=o.ref(null),s=o.ref(""),l=o.ref(!1),a=o.ref([]),r=o.ref([]),c=o.ref([]),d=o.ref([]),h=o.computed(()=>l.value?c.value:r.value),u=o.computed(()=>!h.value.length);let f=null,m=null;const g=o.reactive({top:null,left:null}),p=o.computed({get:()=>t.isShowMenuOnClick,set:I=>e("update:isShowMenuOnClick",I)}),y=I=>{var R;(I==null?void 0:I.length)===1?m=I[0]:(I==null?void 0:I.length)<1&&(m==null&&(m=(R=r.value[0])==null?void 0:R.text),a.value.push(m))},C=I=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,I){const R=I.toString().toLowerCase();c.value=r.value.filter(v=>v.label.toString().toLowerCase().includes(R)),l.value=!0}},500)},b=()=>{s.value="",l.value=!1,c.value.length=0},w=()=>{const I=d.value.length?d.value:r.value;a.value=I.filter(R=>R.originChecked).map(R=>R.text),b()},T=()=>{d.value=r.value.filter(R=>a.value.includes(R.text));const I=d.value.map(R=>R.text);e("apply-column",I),n.value=!1,p.value=!1},k=o.ref(),M=o.ref(),V=()=>{M.value=Ze(a.value),r.value=t.columns.filter(I=>!I.hide&&I.caption).map(I=>{var G,W;const R=(G=k.value)==null?void 0:G.find(E=>E.field===I.field);let v=!1;return R?v=(R==null?void 0:R.hiddenDisplay)!==(I==null?void 0:I.hiddenDisplay)||!((W=M.value)!=null&&W.length)?!(I!=null&&I.hiddenDisplay):M.value.includes(I.field):v=!I.hiddenDisplay,{label:I.caption,text:I.field,originChecked:!I.hiddenDisplay,checked:v,fixed:I.fixed}}),a.value=r.value.filter(I=>I.checked).map(I=>I.text),d.value.length=0,k.value=Ze(t.columns)},x=()=>{n.value=!1,p.value=!1},S=()=>{const I=document.createElement("div");I.id="ev-grid-column-setting-modal",I.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(I)},L=async()=>{var B;await o.nextTick();const I=document.documentElement.clientWidth,R=document.documentElement.clientHeight,v=(B=i.value)==null?void 0:B.getBoundingClientRect(),G=v==null?void 0:v.width,W=v==null?void 0:v.height,{top:E,left:X,columnListMenuWidth:Z}=t.position;let N;Z?(N=X,I<X+G&&(N=X-G-Z)):N=X-G;const P=R-W;g.top=`${Math.min(E,P)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>S()),o.watch(()=>t.columns,()=>{V()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{w(),n.value&&await L()}),o.watch(()=>t.hiddenColumn,I=>{const R=d.value.length?d.value.filter(v=>v.text!==I):r.value.filter(v=>v.text!==I&&v.checked);d.value=R,a.value=R.map(v=>v.text)}),{columnSettingWrapper:i,columnSettingStyle:g,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:u,onSearchColumn:C,onApplyColumn:T,onCheckColumn:y,hideColumnSetting:x}}},R0={class:"ev-grid-column-setting__header"},V0={class:"header-title"},E0={class:"ev-grid-column-setting__content"},G0={key:1,class:"is-empty"},W0={class:"ev-grid-column-setting__footer"};function Z0(t,e,n,i,s,l){const a=o.resolveComponent("ev-text-field"),r=o.resolveComponent("ev-checkbox"),c=o.resolveComponent("ev-checkbox-group"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowColumnSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:o.normalizeStyle(i.columnSettingStyle)},[o.createElementVNode("div",R0,[o.createElementVNode("p",V0,o.toDisplayString(n.textInfo.title),1),o.createVNode(a,{modelValue:i.searchVm,"onUpdate:modelValue":e[0]||(e[0]=u=>i.searchVm=u),type:"search",placeholder:n.textInfo.search,onInput:i.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),o.createElementVNode("div",E0,[i.columnList.length?(o.openBlock(),o.createBlock(c,{key:0,modelValue:i.checkColumnGroup,"onUpdate:modelValue":e[1]||(e[1]=u=>i.checkColumnGroup=u),onChange:i.onCheckColumn},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columnList,(u,f)=>(o.openBlock(),o.createBlock(r,{key:`column_${f}`,label:u==null?void 0:u.text,disabled:!!(u!=null&&u.fixed),"tooltip-title":(u==null?void 0:u.label)??""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u==null?void 0:u.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(o.openBlock(),o.createElementBlock("p",G0,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",W0,[o.createVNode(d,{type:"primary",disabled:i.isDisabled,onClick:i.onApplyColumn},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,i.hideColumnSetting]])])):o.createCommentVNode("",!0)}const Nr=ce(v0,[["render",Z0]]),X0={name:"EVGridFilterSetting",directives:{clickoutside:Yi},props:{isShow:{type:Boolean,default:!1},position:{type:Object,default:()=>({top:0,left:0})},column:{type:Object,default:()=>({})},items:{type:Object,default:()=>({})}},emits:{"update:isShow":null,"apply-filtering":null},setup(t,{emit:e}){const n=o.ref([]),i=o.computed(()=>t.column),s=[{name:"AND",value:"and"},{name:"OR",value:"or"}],l=[{name:"true",value:"true"},{name:"false",value:"false"}],a=[{name:"=",value:"="},{name:"!=",value:"!="},{name:"<",value:"<"},{name:">",value:">"},{name:"<=",value:"<="},{name:">=",value:">="}],r=[{name:"s%",value:"s%"},{name:"%s",value:"%s"},{name:"%s%",value:"%s%"},{name:"Not Like",value:"notLike"},{name:"=",value:"="},{name:"!=",value:"!="}],c=[{name:"Is empty",value:"isEmpty"},{name:"Is not empty",value:"isNotEmpty"}],d=T=>T==="string"||T==="stringNumber"?[...r,...c]:T==="number"||T==="float"?[...a,...c]:T==="boolean"?[{name:"=",value:"="}]:[],h=o.computed(()=>d(t.column.type)),u=o.computed({get:()=>t.isShow,set:T=>e("update:isShow",T)}),f=()=>{const T=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:T,value:"",caption:i.value.caption})},m=T=>{n.value.length>1?n.value.splice(T,1):T===0&&(n.value[0].comparison="=",n.value[0].value="")},g=(T,k)=>{(T==="isEmpty"||T==="isNotEmpty")&&(n.value[k].value="")},p=T=>{n.value=n.value.map(k=>({...k,operator:T}))},y=()=>{e("apply-filtering",i.value.field,n.value.filter(T=>T.value||T.comparison==="isEmpty"||T.comparison==="isNotEmpty"))};o.watch(()=>t.isShow,T=>{var V;const k=[],M=Ze(t.items);T&&i.value.field&&((V=M[i.value.field])!=null&&V.length?M[i.value.field].forEach(x=>{k.push(x)}):k.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=k)});const C=(T,k)=>{var M;return((M=T.find(V=>V.value===k))==null?void 0:M.name)||""},b=()=>{const T=document.createElement("div");T.id="ev-grid-filter-setting-modal",T.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(T)};return o.onBeforeMount(()=>{b()}),{filteringItems:n,isShowFilterSetting:u,items1:s,items2:h,booleanItems:l,addRow:f,removeRow:m,changeOperator:p,applyFiltering:y,changeComparison:g,getSelectTitle:C,validateValue:(T,k)=>{(T==="number"||T==="float")&&(k.value=k.value.replace(/[^0-9.,]/g,""))}}}},N0={class:"ev-grid-filter-setting__header"},P0={class:"header-title"},D0={class:"ev-grid-filter-setting__content"},B0={class:"ev-grid-filter-setting__row--button"},Y0={class:"ev-grid-filter-setting__footer"};function O0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("ev-text-field"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowFilterSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:"ev-grid-filter-setting",style:o.normalizeStyle({top:t.$props.position.top,left:t.$props.position.left})},[o.createElementVNode("div",N0,[o.createVNode(a,{icon:"ev-icon-filter-list"}),o.createElementVNode("span",P0," Filter ("+o.toDisplayString(t.$props.column.caption)+") ",1)]),o.createElementVNode("div",D0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteringItems,(u,f)=>(o.openBlock(),o.createElementBlock("div",{key:f,class:"ev-grid-filter-setting__row"},[o.createVNode(r,{modelValue:u.operator,"onUpdate:modelValue":m=>u.operator=m,class:"ev-grid-filter-setting__row--operator",title:i.getSelectTitle(i.items1,u.operator),items:i.items1,disabled:f>1,style:o.normalizeStyle({visibility:f>0?"visible":"hidden"}),onChange:i.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),o.createVNode(r,{modelValue:u.comparison,"onUpdate:modelValue":m=>u.comparison=m,class:"ev-grid-filter-setting__row--comparison",title:i.getSelectTitle(i.items2,u.comparison),items:i.items2,onChange:m=>i.changeComparison(u.comparison,f)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),t.$props.column.type==="boolean"?(o.openBlock(),o.createBlock(r,{key:0,modelValue:u.value,"onUpdate:modelValue":m=>u.value=m,class:"ev-grid-filter-setting__row--comparison",items:i.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(o.openBlock(),o.createBlock(c,{key:1,modelValue:u.value,"onUpdate:modelValue":m=>u.value=m,class:"ev-grid-filter-setting__row--value",disabled:u.comparison==="isEmpty"||u.comparison==="isNotEmpty",onInput:m=>i.validateValue(t.$props.column.type,u)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),o.createElementVNode("div",B0,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:m=>i.removeRow(f)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",Y0,[o.createVNode(d,{type:"primary",onClick:i.applyFiltering},{default:o.withCtx(()=>[...e[0]||(e[0]=[o.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{i.isShowFilterSetting=!1}]])])):o.createCommentVNode("",!0)}const H0=ce(X0,[["render",O0]]),F0={name:"GridSortButton",props:{icon:{type:String,default:""}}},z0={key:0},A0={key:1},K0={key:2};function _0(t,e,n,i,s,l){return n.icon==="basic"?(o.openBlock(),o.createElementBlock("span",z0,[...e[0]||(e[0]=[o.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),o.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508 4.795L5.41508
|
|
4
|
+
`],...function({vnode:h,recurseCount:u}){const f=u>0?`... (${u} recursive calls)`:"",m=!!h.component&&h.component.parent==null,g=` at <${$l(h.component,h.type,m)}`,p=">"+f;return h.props?[g,...qc(h.props),p]:[g+p]}(c))}),r}(s)),console.warn(...l)}fl()}function qc(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(i=>{e.push(...Rl(i,t[i]))}),n.length>3&&e.push(" ..."),e}function Rl(t,e,n){return pt(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:_e(e)?(e=Rl(t,ge(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):Be(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=ge(e),n?e:[`${t}=`,e])}const Vl={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function Jt(t,e,n,i){let s;try{s=i?t(...i):t()}catch(l){El(l,e,n)}return s}function Fs(t,e,n,i){if(Be(t)){const l=Jt(t,e,n,i);return l&&Tc(l)&&l.catch(a=>{El(a,e,n)}),l}const s=[];for(let l=0;l<t.length;l++)s.push(Fs(t[l],e,n,i));return s}function El(t,e,n,i=!0){const s=e?e.vnode:null;if(e){let l=e.parent;const a=e.proxy,r=process.env.NODE_ENV!=="production"?Vl[n]:n;for(;l;){const d=l.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](t,a,r)===!1)return}l=l.parent}const c=e.appContext.config.errorHandler;if(c)return void Jt(c,null,10,[t,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=Vl[a];if(r&&(d=r,Ut.push(d)),gt("Unhandled error"+(h?` during execution of ${h}`:"")),r&&Ut.pop(),c)throw l;console.error(l)}else console.error(l);var d})(t,n,s,i)}let Ni=!1,zs=!1;const at=[];let Xt=0;const cn=[];let bt=null,Nt=0;const Wl=Promise.resolve();let As=null;const ed=100;function Gl(t){const e=As||Wl;return t?e.then(this?t.bind(this):t):e}function Ks(t){at.length&&at.includes(t,Ni&&t.allowRecurse?Xt+1:Xt)||(t.id==null?at.push(t):at.splice(function(e){let n=Xt+1,i=at.length;for(;n<i;){const s=n+i>>>1,l=at[s],a=Mn(l);a<e||a===e&&l.pre?n=s+1:i=s}return n}(t.id),0,t),Zl())}function Zl(){Ni||zs||(zs=!0,As=Wl.then(Nl))}function Xl(t){Se(t)?cn.push(...t):bt&&bt.includes(t,t.allowRecurse?Nt+1:Nt)||cn.push(t),Zl()}const Mn=t=>t.id==null?1/0:t.id,td=(t,e)=>{const n=Mn(t)-Mn(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function Nl(t){zs=!1,Ni=!0,process.env.NODE_ENV!=="production"&&(t=t||new Map),at.sort(td);const e=process.env.NODE_ENV!=="production"?n=>Pl(t,n):il;try{for(Xt=0;Xt<at.length;Xt++){const n=at[Xt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&e(n))continue;Jt(n,null,14)}}}finally{Xt=0,at.length=0,function(n){if(cn.length){const i=[...new Set(cn)];if(cn.length=0,bt)return void bt.push(...i);for(bt=i,process.env.NODE_ENV!=="production"&&(n=n||new Map),bt.sort((s,l)=>Mn(s)-Mn(l)),Nt=0;Nt<bt.length;Nt++)process.env.NODE_ENV!=="production"&&Pl(n,bt[Nt])||bt[Nt]();bt=null,Nt=0}}(t),Ni=!1,As=null,(at.length||cn.length)&&Nl(t)}}function Pl(t,e){if(t.has(e)){const n=t.get(e);if(n>ed){const i=e.ownerInstance,s=i&&Ql(i.type);return gt(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}t.set(e,n+1)}else t.set(e,1)}const vn=new Set;process.env.NODE_ENV!=="production"&&(Rs().__VUE_HMR_RUNTIME__={createRecord:_s(function(t,e){return Pi.has(t)?!1:(Pi.set(t,{initialDef:Rn(e),instances:new Set}),!0)}),rerender:_s(function(t,e){const n=Pi.get(t);n&&(n.initialDef.render=e,[...n.instances].forEach(i=>{e&&(i.render=e,Rn(i.type).render=e),i.renderCache=[],i.update()}))}),reload:_s(function(t,e){const n=Pi.get(t);if(!n)return;e=Rn(e),Bl(n.initialDef,e);const i=[...n.instances];for(const s of i){const l=Rn(s.type);vn.has(l)||(l!==n.initialDef&&Bl(l,e),vn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(vn.add(l),s.ceReload(e.styles),vn.delete(l)):s.parent?Ks(s.parent.update):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Xl(()=>{for(const s of i)vn.delete(Rn(s.type))})})});const Pi=new Map;function Rn(t){return ql(t)?t.__vccOpts:t}function Bl(t,e){lt(t,e);for(const n in t)n==="__file"||n in e||delete t[n]}function _s(t){return(e,n)=>{try{return t(e,n)}catch(i){console.error(i),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Vn=null,nd=null;const id=Symbol.for("v-ndc"),Bi={};function sd(t,e,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Ms){var r;process.env.NODE_ENV==="production"||e||(n!==void 0&>('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&>('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=k=>{gt("Invalid watch source: ",k,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=al===((r=un)==null?void 0:r.scope)?un:null;let h,u,f=!1,m=!1;if(_e(t)?(h=()=>t.value,f=Ds(t)):Kt(t)?(h=()=>t,i=!0):Se(t)?(m=!0,f=t.some(k=>Kt(k)||Ds(k)),h=()=>t.map(k=>_e(k)?k.value:Kt(k)?dn(k):Be(k)?Jt(k,d,2):void(process.env.NODE_ENV!=="production"&&c(k)))):Be(t)?h=e?()=>Jt(t,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),Fs(t,d,3,[g])}:(h=il,process.env.NODE_ENV!=="production"&&c(t)),e&&i){const k=h;h=()=>dn(k())}let g=k=>{u=b.onStop=()=>{Jt(k,d,4),u=b.onStop=void 0}},p=m?new Array(t.length).fill(Bi):Bi;const y=()=>{if(b.active)if(e){const k=b.run();(i||f||(m?k.some((T,w)=>rn(T,p[w])):rn(k,p)))&&(u&&u(),Fs(e,d,3,[k,p===Bi?void 0:m&&p[0]===Bi?[]:p,g]),p=k)}else b.run()};let C;y.allowRecurse=!!e,s==="sync"?C=y:s==="post"?C=()=>Fl(y,d&&d.suspense):(y.pre=!0,d&&(y.id=d.uid),C=()=>Ks(y));const b=new Xc(h,C);return process.env.NODE_ENV!=="production"&&(b.onTrack=l,b.onTrigger=a),e?n?y():p=b.run():s==="post"?Fl(b.run.bind(b),d&&d.suspense):b.run(),()=>{b.stop(),d&&d.scope&&wc(d.scope.effects,b)}}function od(t,e,n){const i=this.proxy,s=pt(t)?t.includes(".")?function(c,d){const h=d.split(".");return()=>{let u=c;for(let f=0;f<h.length&&u;f++)u=u[h[f]];return u}}(i,t):()=>i[t]:t.bind(i,i);let l;Be(e)?l=e:(l=e.handler,n=e);const a=un;jl(this);const r=sd(s,l.bind(i),n);return a?jl(a):hd(),r}function dn(t,e){if(!Ae(t)||t.__v_skip||(e=e||new Set).has(t))return t;if(e.add(t),_e(t))dn(t.value,e);else if(Se(t))for(let n=0;n<t.length;n++)dn(t[n],e);else if(Lc(t)||an(t))t.forEach(n=>{dn(n,e)});else if(vc(t))for(const n in t)dn(t[n],e);return t}const Us=t=>t?4&t.vnode.shapeFlag?function(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy((i=e.exposed,Vc(i,"__v_skip",!0),Kt(n=i)?n:new Proxy(n,$c)),{get:(s,l)=>l in s?s[l]:l in Js?Js[l](e):void 0,has:(s,l)=>l in s||l in Js}));var n,i}(t)||t.proxy:Us(t.parent):null,Js=lt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>process.env.NODE_ENV!=="production"?Xi(t.props):t.props,$attrs:t=>process.env.NODE_ENV!=="production"?Xi(t.attrs):t.attrs,$slots:t=>process.env.NODE_ENV!=="production"?Xi(t.slots):t.slots,$refs:t=>process.env.NODE_ENV!=="production"?Xi(t.refs):t.refs,$parent:t=>Us(t.parent),$root:t=>Us(t.root),$emit:t=>t.emit,$options:t=>function(e){const n=e.type,{mixins:i,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=e.appContext,c=a.get(n);let d;return c?d=c:l.length||i||s?(d={},l.length&&l.forEach(h=>Di(d,h,r,!0)),Di(d,n,r)):d=n,Ae(n)&&a.set(n,d),d}(t),$forceUpdate:t=>t.f||(t.f=()=>Ks(t.update)),$nextTick:t=>t.n||(t.n=Gl.bind(t.proxy)),$watch:t=>od.bind(t)});function Dl(t){return Se(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}process.env.NODE_ENV;function Di(t,e,n,i=!1){const{mixins:s,extends:l}=e;l&&Di(t,l,n,!0),s&&s.forEach(a=>Di(t,a,n,!0));for(const a in e)if(i&&a==="expose")process.env.NODE_ENV!=="production"&>('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=ld[a]||n&&n[a];t[a]=r?r(t[a],e[a]):e[a]}return t}const ld={data:Yl,props:Hl,emits:Hl,methods:En,computed:En,beforeCreate:Ye,created:Ye,beforeMount:Ye,mounted:Ye,beforeUpdate:Ye,updated:Ye,beforeDestroy:Ye,beforeUnmount:Ye,destroyed:Ye,unmounted:Ye,activated:Ye,deactivated:Ye,errorCaptured:Ye,serverPrefetch:Ye,components:En,directives:En,watch:function(t,e){if(!t)return e;if(!e)return t;const n=lt(Object.create(null),t);for(const i in e)n[i]=Ye(t[i],e[i]);return n},provide:Yl,inject:function(t,e){return En(Ol(t),Ol(e))}};function Yl(t,e){return e?t?function(){return lt(Be(t)?t.call(this,this):t,Be(e)?e.call(this,this):e)}:e:t}function Ol(t){if(Se(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Ye(t,e){return t?[...new Set([].concat(t,e))]:e}function En(t,e){return t?lt(Object.create(null),t,e):e}function Hl(t,e){return t?Se(t)&&Se(e)?[...new Set([...t,...e])]:lt(Object.create(null),Dl(t),Dl(e??{})):e}const Fl=function(t,e){e&&e.pendingBranch?Se(t)?e.effects.push(...t):e.effects.push(t):Xl(t)},zl=Symbol.for("v-fgt"),ad=Symbol.for("v-txt"),rd=Symbol.for("v-cmt"),Al="__vInternal",Kl=({key:t})=>t??null,Yi=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?pt(t)||_e(t)||Be(t)?{i:Vn,r:t,k:e,f:!!n}:t:null),cd=process.env.NODE_ENV!=="production"?(...t)=>_l(...t):_l;function _l(t,e=null,n=null,i=0,s=null,l=!1){if(t&&t!==id||(process.env.NODE_ENV==="production"||t||gt(`Invalid vnode type when creating vnode: ${t}.`),t=rd),(a=t)&&a.__v_isVNode===!0){const c=Oi(t,e,!0);return n&&js(c,n),c.patchFlag|=-2,c}var a;if(ql(t)&&(t=t.__vccOpts),e){e=function(h){return h?Ys(h)||Al in h?lt({},h):h:null}(e);let{class:c,style:d}=e;c&&!pt(c)&&(e.class=Es(c)),Ae(d)&&(Ys(d)&&!Se(d)&&(d=lt({},d)),e.style=Vs(d))}const r=pt(t)?1:(c=>c.__isSuspense)(t)?128:(c=>c.__isTeleport)(t)?64:Ae(t)?4:Be(t)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&Ys(t)&>("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
5
|
+
Component that was made reactive: `,t=ge(t)),function(c,d=null,h=null,u=0,f=null,m=c===zl?0:1,g=!1,p=!1){const y={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Kl(d),ref:d&&Yi(d),scopeId:nd,slotScopeIds:null,children:h,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:m,patchFlag:u,dynamicProps:f,dynamicChildren:null,appContext:null,ctx:Vn};return p?(js(y,h),128&m&&c.normalize(y)):h&&(y.shapeFlag|=pt(h)?8:16),process.env.NODE_ENV!=="production"&&y.key!=y.key&>("VNode created with invalid key (NaN). VNode type:",y.type),y}(t,e,n,i,s,r,l,!0)}function Oi(t,e,n=!1){const{props:i,ref:s,patchFlag:l,children:a}=t,r=e?function(...c){const d={};for(let h=0;h<c.length;h++){const u=c[h];for(const f in u)if(f==="class")d.class!==u.class&&(d.class=Es([d.class,u.class]));else if(f==="style")d.style=Vs([d.style,u.style]);else if(kc(f)){const m=d[f],g=u[f];!g||m===g||Se(m)&&m.includes(g)||(d[f]=m?[].concat(m,g):g)}else f!==""&&(d[f]=u[f])}return d}(i||{},e):i;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:r,key:r&&Kl(r),ref:e&&e.ref?n&&s?Se(s)?s.concat(Yi(e)):[s,Yi(e)]:Yi(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Se(a)?a.map(Ul):a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==zl?l===-1?16:16|l:l,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Oi(t.ssContent),ssFallback:t.ssFallback&&Oi(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Ul(t){const e=Oi(t);return Se(t.children)&&(e.children=t.children.map(Ul)),e}function dd(t=" ",e=0){return cd(ad,null,t,e)}function js(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(Se(e))n=16;else if(typeof e=="object"){if(65&i){const s=e.default;return void(s&&(s._c&&(s._d=!1),js(t,s()),s._c&&(s._d=!0)))}{n=32;const s=e._;s||Al in e||(e._ctx=Vn)}}else Be(e)?(e={default:e,_ctx:Vn},n=32):(e=String(e),64&i?(n=16,e=[dd(e)]):n=8);t.children=e,t.shapeFlag|=n}let Qs,hn,un=null,Jl="__VUE_INSTANCE_SETTERS__";(hn=Rs()[Jl])||(hn=Rs()[Jl]=[]),hn.push(t=>un=t),Qs=t=>{hn.length>1?hn.forEach(e=>e(t)):hn[0](t)};const jl=t=>{Qs(t),t.scope.on()},hd=()=>{un&&un.scope.off(),Qs(null)},ud=/(?:^|[-_])(\w)/g,fd=t=>t.replace(ud,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ql(t,e=!0){return Be(t)?t.displayName||t.name:t.name||e&&t.__name}function $l(t,e,n=!1){let i=Ql(e);if(!i&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&t&&t.parent){const s=l=>{for(const a in l)if(l[a]===e)return a};i=s(t.components||t.parent.type.components)||s(t.appContext.components)}return i?fd(i):n?"App":"Anonymous"}function ql(t){return Be(t)&&"__vccOpts"in t}function $s(t){return!(!t||!t.__v_isShallow)}function ea(t,e,n){if(arguments.length===2)for(var i,s=0,l=e.length;s<l;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}function ta(t,e){if(t===e)return!0;if(typeof t=="object"){for(var n in t)if(!ta(t[n],e[n]))return!1;return!0}return!1}process.env.NODE_ENV!=="production"&&function(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#0b1bc9"},n={style:"color:#b62e24"},i={style:"color:#9d288c"},s={header:u=>Ae(u)?u.__isVue?["div",t,"VueInstance"]:_e(u)?["div",{},["span",t,h(u)],"<",r(u.value),">"]:Kt(u)?["div",{},["span",t,$s(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+(_t(u)?" (readonly)":"")]:_t(u)?["div",{},["span",t,$s(u)?"ShallowReadonly":"Readonly"],"<",r(u),">"]:null:null,hasBody:u=>u&&u.__isVue,body(u){if(u&&u.__isVue)return["div",{},...l(u.$)]}};function l(u){const f=[];u.type.props&&u.props&&f.push(a("props",ge(u.props))),u.setupState!==Ms&&f.push(a("setup",u.setupState)),u.data!==Ms&&f.push(a("data",ge(u.data)));const m=c(u,"computed");m&&f.push(a("computed",m));const g=c(u,"inject");return g&&f.push(a("injected",g)),f.push(["div",{},["span",{style:i.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function a(u,f){return f=lt({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",i,m+": "],r(f[m],!1)])]]:["span",{}]}function r(u,f=!0){return typeof u=="number"?["span",e,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",i,u]:Ae(u)?["object",{object:f?ge(u):u}]:["span",n,String(u)]}function c(u,f){const m=u.type;if(Be(m))return;const g={};for(const p in u.ctx)d(m,p,f)&&(g[p]=u.ctx[p]);return g}function d(u,f,m){const g=u[m];return!!(Se(g)&&g.includes(f)||Ae(g)&&f in g)||!(!u.extends||!d(u.extends,f,m))||!(!u.mixins||!u.mixins.some(p=>d(p,f,m)))||void 0}function h(u){return $s(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var md=function(){function t(e,n){this.el=e,this.observer=null,this.frozen=!1,this.createObserver(n)}return Object.defineProperty(t.prototype,"threshold",{get:function(){return this.options.intersection&&this.options.intersection.threshold||0},enumerable:!1,configurable:!0}),t.prototype.createObserver=function(e){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){var i;if(this.options=typeof(i=e)=="function"?{callback:i}:i,this.callback=function(l,a){n.options.callback(l,a),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var s=(this.options.throttleOptions||{}).leading;this.callback=function(l,a,r){var c,d,h;r===void 0&&(r={});var u=function(f){for(var m=[],g=1;g<arguments.length;g++)m[g-1]=arguments[g];if(h=m,!c||f!==d){var p=r.leading;typeof p=="function"&&(p=p(f,d)),c&&f===d||!p||l.apply(void 0,ea([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,ea([f],h,!1)),c=0},a)}};return u._clear=function(){clearTimeout(c),c=null},u}(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var a=l[0];if(l.length>1){var r=l.find(function(d){return d.isIntersecting});r&&(a=r)}if(n.callback){var c=a.isIntersecting&&a.intersectionRatio>=n.threshold;if(c===n.oldResult)return;n.oldResult=c,n.callback(c,a)}},this.options.intersection),Gl(function(){n.observer&&n.observer.observe(n.el)})}},t.prototype.destroyObserver=function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)},t}(),qs={beforeMount:function(t,e){var n=e.value;n&&(typeof IntersectionObserver>"u"?console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill"):t._vue_visibilityState=new md(t,n))},updated:function(t,e){var n=e.value;if(!ta(n,e.oldValue)){var i=t._vue_visibilityState;n&&i&&i.createObserver(n)}},unmounted:function(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}};const Wn={mounted(t,e){if(typeof ResizeObserver>"u")return;const n=e.value;if(typeof n!="function")return;getComputedStyle(t).position==="static"&&t.style.setProperty("position","relative","important");const i=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});i.observe(t),t.__resizeObserver__=i},unmounted(t){const e=t.__resizeObserver__;e&&(e.disconnect(),t.__resizeObserver__=null)}},ce=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},pd={name:"EvTabs",directives:{observeVisibility:qs,resize:Wn},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:t=>{const e=t.map(i=>i.value),n=[...new Set(e)];return t.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):t.every(i=>Object.hasOwnProperty.call(i,"value"))?!0:(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is essential."),!1)}},closable:{type:Boolean,default:!1},stretch:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:{"update:modelValue":[String,Number],"update:panels":[Array],change:[String,Number]},setup(t,{emit:e}){const n=o.ref(!1),i=o.ref([]),s=o.computed({get:()=>t.modelValue,set:x=>{e("update:modelValue",x),e("change",x)}});o.provide("evTabs",s);const l=o.computed({get:()=>t.panels,set:x=>e("update:panels",x)}),a=o.computed(()=>!t.draggable||!n.value?l.value:i.value),r=l.value.map(x=>x.value),c=o.ref(null),d=o.ref(null),h=o.ref(!1),u=o.reactive({x:0}),f=o.computed(()=>({transform:`translateX(${u.x}px)`})),m=()=>{const x=c.value.offsetWidth,S=d.value.offsetWidth;if(h.value=x<S,h.value){const L=x-S;L>u.x&&(u.x=L)}else u.x=0};o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let x,S;r.length>l.value.length?(x=r,S=l.value.map(I=>I.value)):(x=l.value.map(I=>I.value),S=r);const L=x.filter(I=>!S.includes(I))[0];if(s.value===L){const I=r.findIndex(v=>v===L);I===0?s.value=l.value[0].value:s.value=l.value[I-1].value}}});const g=x=>{s.value=x},p=x=>{if(l.value.length<2)return;const S=l.value.findIndex(L=>L.value===x);if(S<0){s.value=l.value[0].value;return}x===s.value&&(S===0?s.value=l.value[1].value:s.value=l.value[S-1].value),l.value.splice(S,1),o.nextTick(()=>{r.splice(S,1)}),o.triggerRef(l)},y=(x,S=100)=>{const L=c.value.offsetWidth,I=d.value.offsetWidth,v=L-I;x==="next"&&u.x!==v?v>=u.x-S?u.x=v:u.x-=S:x==="prev"&&u.x!==0&&(S*-1<=u.x?u.x=0:u.x+=S)},C=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:g,removeTab:p,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:y,dragstartTab:(x,S)=>{t.draggable&&(i.value=[...l.value],C.item=x,C.idx=S,n.value=!0)},dragoverTab:x=>{var I;if(!t.draggable||((I=C.item)==null?void 0:I.value)===x)return;const S=i.value.findIndex(v=>{var W;return v.value===((W=C.item)==null?void 0:W.value)}),L=i.value.findIndex(v=>v.value===x);i.value.splice(S,1),i.value.splice(L,0,C.item)},dragendTab:()=>{t.draggable&&(l.value=[...i.value],C.item={},C.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:x=>{var S;return t.draggable&&((S=C.item)==null?void 0:S.value)===x},selectIdxCls:x=>t.draggable&&C.idx===x,onResize:()=>{m()}}}},gd={class:"ev-tabs-header"},bd={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},yd=["onClick","onDragstart","onDragover"],xd=["title"],Sd=["onClick"],Cd={class:"ev-tabs-body"};function kd(t,e,n,i,s,l){const a=o.resolveDirective("resize"),r=o.resolveDirective("observe-visibility");return o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[o.createElementVNode("div",gd,[o.createElementVNode("div",{class:o.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":i.hasScroll}])},[i.hasScroll?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:e[0]||(e[0]=c=>i.scrollTab("prev"))},[...e[3]||(e[3]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),o.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:e[1]||(e[1]=c=>i.scrollTab("next"))},[...e[4]||(e[4]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",bd,[o.createElementVNode("ul",{ref:"listRef",class:"ev-tabs-list",style:o.normalizeStyle(i.listRefStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.computedTabList,(c,d)=>(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===i.mv,"has-icon":c.iconClass,"drag-select":i.dragSelectCls(c.value),"select-idx":i.selectIdxCls(d)},onClick:h=>i.clickTab(c.value),onDragstart:o.withModifiers(h=>i.dragstartTab(c,d),["stop"]),onDragover:o.withModifiers(h=>i.dragoverTab(c.value),["prevent"]),onDragend:e[2]||(e[2]=o.withModifiers((...h)=>i.dragendTab&&i.dragendTab(...h),["prevent"]))}),[c.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"text",title:c.text},o.toDisplayString(c.text),9,xd),n.closable?(o.openBlock(),o.createElementBlock("span",{key:1,class:"close-icon",onClick:o.withModifiers(h=>i.removeTab(c.value),["stop"])},[...e[5]||(e[5]=[o.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,Sd)):o.createCommentVNode("",!0)],16,yd))),128))],4)],512)],2)]),o.createElementVNode("div",Cd,[o.renderSlot(t.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Gn=ce(pd,[["render",kd]]);Gn.install=t=>{t.component(Gn.name,Gn)};const wd={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},emits:{},setup(t){const e=o.inject("evTabs",null),n=o.computed(()=>t.value===e.value),i=o.ref(n.value);return o.watch(n,s=>{s&&(i.value=!0)}),{isSelected:n,hasBeenSelected:i}}},Id={key:0,class:"ev-tab-panel"};function Ld(t,e,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",Id,[o.renderSlot(t.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const Zn=ce(wd,[["render",Ld]]);Zn.install=t=>{t.component(Zn.name,Zn)};const Td={name:"EvButton",props:{disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},type:{type:String,default:"default"},htmlType:{type:String,default:"button",validator:t=>["button","submit","reset"].includes(t)},shape:{type:String,default:"square"},size:{type:String,default:"medium"}},emits:{click:null},setup(t){const e=o.ref(null);return o.onMounted(()=>{t.autoFocus&&e.value.focus()}),{buttonRef:e}}},Md=["type","disabled","autofocus"];function vd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("button",{ref:"buttonRef",class:o.normalizeClass(["ev-button",{disabled:n.disabled,[`type-${n.type}`]:!!n.type,[`shape-${n.shape}`]:n.shape!=="square",[`size-${n.size}`]:n.size!=="medium"}]),type:n.htmlType,disabled:n.disabled,autofocus:n.autoFocus,onClick:e[0]||(e[0]=a=>t.$emit("click",a))},[o.renderSlot(t.$slots,"default")],10,Md)}const fn=ce(Td,[["render",vd]]);fn.install=t=>{t.component(fn.name,fn)};const Rd={name:"EvButtonGroup"},Vd={class:"ev-button-group"};function Ed(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Vd,[o.renderSlot(t.$slots,"default")])}const Xn=ce(Rd,[["render",Ed]]);Xn.install=t=>{t.component(Xn.name,Xn)};const Wd={name:"EvCheckbox",props:{modelValue:{type:[String,Number,Boolean,Symbol,Array],default:!1},label:{type:[String,Number,Boolean,Symbol,Object],default:null},tooltipTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:{"update:modelValue":null,"update:indeterminate":[Boolean],change:null},setup(t,{emit:e}){const n=o.ref();o.onMounted(()=>{n.value&&t.tooltipTitle&&(n.value.title=t.tooltipTitle)});const i=o.ref(null),s=o.inject("EvCheckboxGroupMv",o.computed({get:()=>t.modelValue,set:c=>{c&&!i.value.indeterminate&&e("update:indeterminate",!1),e("update:modelValue",c)}})),l=o.computed(()=>t.label),a=o.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=o.inject("EvCheckboxGroupChange",async c=>{await o.nextTick(),e("change",s.value,c)});return o.watch(()=>t.indeterminate,c=>{o.nextTick(()=>{i.value&&(i.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:i,checked:a,changeMv:r}}},Gd=["disabled","value","readonly"],Zd={ref:"checkboxLabel",class:"ev-checkbox-label"};function Xd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:i.checked}]])},[o.withDirectives(o.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":e[0]||(e[0]=a=>i.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:e[1]||(e[1]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,Gd),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",Zd,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))],512)],2)}const mn=ce(Wd,[["render",Xd]]);mn.install=t=>{t.component(mn.name,mn)};const Nd={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:s=>e("update:modelValue",s)});o.provide("EvCheckboxGroupMv",n);const i=async s=>{await o.nextTick(),e("change",n.value,s)};o.provide("EvCheckboxGroupChange",i)}};function Pd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(t.$slots,"default")],2)}const pn=ce(Nd,[["render",Pd]]);pn.install=t=>{t.component(pn.name,pn)};const Bd={name:"EvRadio",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},label:{type:[String,Number,Symbol,Boolean],default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:""}},emits:{"update:modelValue":null,change:null},setup(t,{emit:e}){const n=o.inject("EvRadioGroupMv",o.computed({get:()=>t.modelValue,set:l=>e("update:modelValue",l)})),i=o.inject("EvRadioGroupChange",async l=>{await o.nextTick(),e("change",n.value,l)}),s=o.computed(()=>n.value===t.label);return{mv:n,checked:s,changeMv:i}}},Dd=["value","disabled"],Yd={class:"ev-radio-label"};function Od(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:i.checked},n.size]])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:e[1]||(e[1]=o.withModifiers((...a)=>i.changeMv&&i.changeMv(...a),["stop"]))},null,40,Dd),[[o.vModelRadio,i.mv]]),o.createElementVNode("span",Yd,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))])],2)}const Nn=ce(Bd,[["render",Od]]);Nn.install=t=>{t.component(Nn.name,Nn)};const Hd={name:"EvRadioGroup",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},type:{type:String,default:"radio"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:s=>e("update:modelValue",s)});o.provide("EvRadioGroupMv",n);const i=async s=>{await o.nextTick(),e("change",n.value,s)};o.provide("EvRadioGroupChange",i)}};function Fd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(t.$slots,"default")],2)}const Pn=ce(Hd,[["render",Fd]]);Pn.install=t=>{t.component(Pn.name,Pn)};const Hi={mounted(t,e){const n=t,i=e.modifiers.bubbles,s=l=>{(i||n!==l.target&&!n.contains(l.target))&&e.value(l)};n.vueClickOutside=s,document.addEventListener("mousedown",s)},unmounted(t){const e=t;document.removeEventListener("mousedown",e.vueClickOutside),e.vueClickOutside=null}},zd={mounted(t,e){const n=t;let i=null;const s=e.modifiers.bubble,l=document.body.getElementsByClassName("ev-select-dropbox"),a="ev-tag-name",r="ev-tag-suffix-close",c=d=>{if(!(d.target.classList.contains(a)||d.target.classList.contains(r))&&l&&l.length&&(s||n!==d.target&&!n.contains(d.target))){for(let h=0;h<l.length;h++)if(i=l[h],i!==d.target&&!i.contains(d.target)){e.value(d);break}}};n.vueClickOutside=c,document.addEventListener("mousedown",c)},unmounted(t){const e=t;document.removeEventListener("mousedown",e.vueClickOutside),e.vueClickOutside=null}},Ad={mounted(t,e){const n=t,i=e.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(i||n!==a.target&&!n.contains(a.target))||s&&s[0]&&s[0]!==a.target&&!s[0].contains(a.target)&&n!==a.target&&!n.contains(a.target))&&e.value(a)};n.vueClickOutside=l,document.addEventListener("mousedown",l)},unmounted(t){const e=t;document.removeEventListener("mousedown",e.vueClickOutside),e.vueClickOutside=null}};var Pt=function(){return Pt=Object.assign||function(e){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},Pt.apply(this,arguments)};function gn(t,e,n){if(n||arguments.length===2)for(var i=0,s=e.length,l;i<s;i++)(l||!(i in e))&&(l||(l=Array.prototype.slice.call(e,0,i)),l[i]=e[i]);return t.concat(l||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Fi=44032,Bn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Oe=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],We=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Bt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},eo={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},na=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],ia=[["ㄱ","r"],["ㄲ","R"],["ㄴ","s"],["ㄷ","e"],["ㄸ","E"],["ㄹ","f"],["ㅁ","a"],["ㅂ","q"],["ㅃ","Q"],["ㅅ","t"],["ㅆ","T"],["ㅇ","d"],["ㅈ","w"],["ㅉ","W"],["ㅊ","c"],["ㅋ","z"],["ㅌ","x"],["ㅍ","v"],["ㅎ","g"],["ㅏ","k"],["ㅐ","o"],["ㅑ","i"],["ㅒ","O"],["ㅓ","j"],["ㅔ","p"],["ㅕ","u"],["ㅖ","P"],["ㅗ","h"],["ㅛ","y"],["ㅜ","n"],["ㅠ","b"],["ㅡ","m"],["ㅣ","l"]];function sa(t){var e="",n="",i="",s=-1,l=-1,a=-1;if(t.match(/[ㄱ-ㅎ]/))e=t,s=Bn.join("").search(t);else if(t.match(/[가-힣]/)){var r=t.charCodeAt(0)-Fi;a=r%We.length,l=(r-a)/We.length%Oe.length,s=((r-a)/We.length-l)/Oe.length,e=Bn[s],n=Oe[l],i=We[a]}return{initial:e,medial:n,finale:i,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(t,e){var n=e[0],i=e[1];return gn(gn([],t,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(i,"\\)(\\s+)"),"g"),n,i],[RegExp(`([가-힣]['" ]{0,1})`.concat(i,"\\(").concat(n,"\\)(\\s+)"),"g"),n,i]],!1)},[]);function Kd(t,e){var n=e===void 0?{}:e,i=n.grouped,s=i===void 0?!1:i,l=[];return t.split("").forEach(function(a){var r=sa(a),c=r.initial,d=r.medial,h=r.finale,u=r.initialOffset,f=r.medialOffset,m=r.finaleOffset;l.push((u!==-1||f!==-1||m!==-1?[c,Bt[d]&&na.indexOf(d)===-1?Bt[d]:d,Bt[h]&&na.indexOf(h)===-1?Bt[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var jt=Object.entries(Bt).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[s.join("")]=i,n))},{}),oa=function(t){return typeof t<"u"};function _d(t){var e=t.findIndex(function(d){return Oe.indexOf(d)!==-1}),n=e!==-1&&Oe.indexOf(t[e+1])!==-1?e+1:e,i=t.slice(0,e).join(""),s=t.slice(e,n+1).join(""),l=t.slice(n+1).join(""),a=Bn.indexOf(jt[i]||i),r=Oe.indexOf(jt[s]||s),c=We.indexOf(jt[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Fi+a*(Oe.length*We.length)+r*We.length+c):t.join("")}function Ud(t){var e=[];(typeof t=="string"?t.split(""):t).forEach(function(l,a,r){typeof l=="string"&&e.length>0&&Oe.indexOf(r[a-1])!==-1&&Oe.indexOf(l)!==-1&&jt["".concat(r[a-1]).concat(l)]?e[e.length-1]=jt["".concat(r[a-1]).concat(l)]:e.push(l)});var n={medial:null,finales:[]},i=[n];e.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},i.push({grouped:l,finales:[]}),i.push(n)):Oe.indexOf(l)!==-1?(n={medial:l,finales:[]},i.push(n)):n.finales.push(l)}),i.forEach(function(l,a,r){if(a>0){var c=r[a-1];if(!c.medial||c.finales.length===1)l.initials=c.finales,c.finales=[];else{var d=c.finales,h=d[0],u=d.slice(1);l.initials=u,c.finales=h?[h]:[]}if(l.finales.length>2||a===i.length-1&&l.finales.length>1){var f=l.finales,m=f[0],g=f[1],p=f.slice(2);jt["".concat(m).concat(g)]&&(l.finales=gn([jt["".concat(m).concat(g)]],p,!0))}}});var s=[];return i.forEach(function(l){var a=l.initials,r=a===void 0?[]:a,c=l.medial,d=l.finales,h=l.grouped;if(h)s.push(h);else{var u=r.slice(),f=u.pop(),m=d[0],g=d.slice(1);We.indexOf(m)===-1&&(g=gn([m],g,!0),m=""),u.filter(oa).forEach(function(p){return s.push([p])}),s.push([f,c,m].filter(Boolean)),g.filter(oa).forEach(function(p){return s.push([p])})}}),s.map(_d).join("")}var Jd=Object.values(ia).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[s]=i,n))},{});function la(t){return Ud(t.split("").map(function(e){return Jd[e]||e}).join(""))}var aa=/[\\^$.*+?()[\]{}|]/g,jd=RegExp(aa.source);function to(t){return t&&jd.test(t)?t.replace(aa,"\\$&"):t||""}var zi=function(t,e){e===void 0&&(e=!1);var n=Bn.indexOf(t);if(n!==-1){var i=n*Oe.length*We.length+Fi;return"[".concat(e?t:"").concat(String.fromCharCode(i),"-").concat(String.fromCharCode(i+Oe.length*We.length-1),"]")}return t},ra="__".concat(parseInt("fuzzy",36),"__"),ca="__".concat(parseInt("ignorespace",36),"__"),no=function(){var t,e;return function(n,i){var s=i===void 0?{}:i,l=s.initialSearch,a=l===void 0?!1:l,r=s.startsWith,c=r===void 0?!1:r,d=s.endsWith,h=d===void 0?!1:d,u=s.ignoreSpace,f=u===void 0?!1:u,m=s.ignoreCase,g=m===void 0?!0:m,p=s.global,y=p===void 0?!1:p,C=s.fuzzy,b=C===void 0?!1:C,k=s.nonCaptureGroup,T=k===void 0?!1:k,w=s.engToKor,M=w===void 0?!1:w;if(t===n)return e;var V=n,x=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var S=la(n.trim());S.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=S,x.push(to(n.trim())))}var L=V.split(""),I=L.slice(-1)[0],v="",W=sa(I||"");if(W.initialOffset!==-1){L=L.slice(0,-1);var E=W.initial,G=W.medial,R=W.finale,X=W.initialOffset,Z=W.medialOffset,N=X*Oe.length*We.length+Fi,P=[];switch(!0){case R!=="":{P.push(I),Bn.includes(R)&&P.push("".concat(String.fromCharCode(N+Z*We.length)).concat(zi(R))),Bt[R]&&P.push("".concat(String.fromCharCode(N+Z*We.length+We.join("").search(Bt[R][0])+1)).concat(zi(Bt[R][1])));break}case G!=="":{var B=void 0,Y=void 0;eo[G]?(B=N+Oe.join("").search(eo[G][0])*We.length,Y=N+Oe.join("").search(eo[G][1])*We.length+We.length-1):(B=N+Z*We.length,Y=B+We.length-1),P.push("[".concat(String.fromCharCode(B),"-").concat(String.fromCharCode(Y),"]"));break}case E!=="":{P.push(zi(E,!0));break}}v=P.length>1?T?"(?:".concat(P.join("|"),")"):"(".concat(P.join("|"),")"):P[0]}var H=b?ra:f?ca:"",K=a?L.map(function(ee){return ee.search(/[ㄱ-ㅎ]/)!==-1?zi(ee,!0):to(ee)}).join(H):to(L.join(H)),D=K.trim()!==""&&v.trim()!=="",z=D?"".concat(K).concat(H).concat(v):"".concat(K).concat(v),_=(c?"^":"")+z+(h?"$":"");return H&&(_=_.replace(RegExp(ra,"g"),".*").replace(RegExp(ca,"g"),"\\s*")),x.length>0&&(_=gn(gn([],x,!0),[_],!1).map(function(ee){return"(".concat(ee,")")}).join("|")),e=RegExp(_,(y?"g":"")+(g?"i":"")),e}}(),Qd=Object.values(ia).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[i]=s,n))},{});function $d(t){return t.split("").map(function(e){return Kd(e,{grouped:!1}).map(function(n){return Qd[n]||n})}).flat().join("")}const qd=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n={get:()=>t.items.some(p=>p.value===t.modelValue)?t.modelValue:null,set:p=>e("update:modelValue",p)},i={get:()=>Array.isArray(t.modelValue)?t.modelValue:[],set:p=>e("update:modelValue",p)},s=o.computed(t.multiple?i:n),l=()=>{var p;return(p=t.items.find(y=>y.value===s.value))==null?void 0:p.name},a=()=>t.items.filter(p=>t.modelValue.includes(p.value)),r=o.computed(t.multiple?a:l),c=o.computed(()=>t.multiple&&s.value.length?null:t.placeholder),d=()=>s.value,h=()=>s.value.length,u=o.computed(t.multiple?h:d),f=()=>{t.disabled||(t.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},m=async()=>{await o.nextTick(),e("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:u,removeAllMv:f,removeMv:async p=>{if(!t.disabled){const y=s.value.indexOf(p);s.value.splice(y,1),s.value=[...s.value],await m()}},changeMv:m}},eh=t=>{const{props:e}=o.getCurrentInstance(),{mv:n,changeMv:i}=t,s=o.ref(!1),l=o.ref(e.filterText),a=o.ref(null),r=o.ref(null),c=o.ref(null),d=o.ref(null),h=o.ref("100%"),u=o.ref(null),f=o.reactive({top:0}),m=o.computed(()=>{var R;if(!l.value||!e.filterable)return e.items;const W=(R=l.value)==null?void 0:R.trim(),E=la(W),G=$d(W);return e.items.filter(({name:X})=>X.search(no(W))>-1||X.search(no(E))>-1||X.search(no(G))>-1)}),g=W=>{var E;l.value=(E=W==null?void 0:W.target)==null?void 0:E.value},p=async()=>{var X,Z,N;await o.nextTick();const W=(X=r.value)==null?void 0:X.getBoundingClientRect().height,E=(Z=r.value)==null?void 0:Z.getBoundingClientRect().y,G=(N=c.value)==null?void 0:N.getBoundingClientRect().height;document.documentElement.clientHeight<E+W+G?f.top=`-${G}px`:f.top=`${W}px`},y=()=>{var X,Z,N;if(!((N=(Z=(X=d.value)==null?void 0:X.children[0])==null?void 0:Z.children)!=null&&N.length))return;const W="selected",E=d.value.children[0].children,G=d.value.offsetTop;let R=null;for(let P=0;P<E.length;P++)if(R=E[P],R.classList.contains(W)){if(!R.offsetTop)return;d.value.scrollTop=R.offsetTop-G;break}},C=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth);const W=d.value.querySelectorAll(".ev-select-dropbox-item");let E=0;W.forEach(K=>{const D=K.scrollWidth;D>E&&(E=D)});const{borderLeftWidth:G,borderRightWidth:R}=window.getComputedStyle(c.value),X=parseInt(G)+parseInt(R),Z=d.value.offsetWidth-d.value.clientWidth;E+=Z+X;const N=window.innerWidth,B=c.value.getBoundingClientRect().left,Y=N-B-20,H=Math.max(Math.min(E,Y),u.value);h.value=`${H}px`}else h.value="100%"};o.watch(()=>s.value,async W=>{W&&(await y(),await C())}),o.watch(()=>m.value,async()=>{await p()}),e.filterable&&o.watch(()=>m.value,()=>p());const b=async()=>{e.items.length&&!e.disabled&&(s.value=!s.value,s.value&&await p())},k=()=>{e.filterable&&(l.value=""),s.value=!1},T=o.ref(!1),w=W=>{W||(T.value=!T.value),T.value?n.value=m.value.filter(E=>!E.disabled).map(E=>E.value):n.value=[]},M=W=>{e.filterable&&(l.value=""),s.value=!1,n.value!==W&&(n.value=W,i())},V=W=>{if(e.filterable&&(l.value=""),!n.value.includes(W))n.value.push(W);else{const E=n.value.indexOf(W);n.value.splice(E,1)}T.value=n.value.length===m.value.filter(E=>!E.disabled).length,n.value=[...n.value],i()},x=e.multiple?V:M,S=W=>W===n.value,L=W=>n.value.includes(W),I=e.multiple?L:S;o.watch(()=>n.value,W=>{e.multiple&&e.checkable&&(W.length===0?T.value=!1:T.value=W.length===m.value.filter(E=>!E.disabled).length,p())});const v=()=>{s.value&&(C(),p())};return o.onMounted(()=>{window.addEventListener("resize",v)}),o.onUnmounted(()=>{window.removeEventListener("resize",v)}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:m,clickSelectInput:b,clickOutsideDropbox:k,changeFilterText:g,changeDropboxPosition:p,clickItem:x,selectedItemClass:I,allCheck:T,changeAllCheck:w,dropboxWidth:h}},th={name:"EvSelect",components:{EvCheckbox:mn,EvCheckboxGroup:pn},directives:{clickoutside:zd},props:{modelValue:{type:[Boolean,String,Number,Array,Object],default:null},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:"Please Enter a Search Words."},noMatchingText:{type:String,default:"NO MATCHING DATA"},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterText:{type:String,default:""},allCheckLabel:{type:String,default:"Select All"}},emits:{"update:modelValue":null,change:null},setup(){const{mv:t,selectedModel:e,computedPlaceholder:n,isClearableIcon:i,changeMv:s,removeMv:l,removeAllMv:a}=qd(),{select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:m,filteredItems:g,clickSelectInput:p,clickOutsideDropbox:y,changeFilterText:C,changeDropboxPosition:b,clickItem:k,selectedItemClass:T,allCheck:w,changeAllCheck:M,dropboxWidth:V}=eh({mv:t,changeMv:s});return{mv:t,selectedModel:e,computedPlaceholder:n,isClearableIcon:i,changeMv:s,removeMv:l,removeAllMv:a,select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:m,filteredItems:g,clickSelectInput:p,clickOutsideDropbox:y,changeFilterText:C,changeDropboxPosition:b,clickItem:k,selectedItemClass:T,allCheck:w,changeAllCheck:M,dropboxWidth:V}}},nh={ref:"selectWrapper",class:"ev-select__wrapper"},ih=["placeholder","disabled"],sh={key:1,class:"ev-select-tag-wrapper"},oh=["placeholder","disabled"],lh={class:"ev-tag-name"},ah=["onClick"],rh={key:0,class:"ev-select-tag"},ch={class:"ev-tag-name"},dh={key:1,class:"ev-select-tag num"},hh={class:"ev-tag-name"},uh={class:"ev-select-dropbox-wrapper"},fh=["placeholder","value"],mh={ref:"itemWrapper",class:"ev-select-dropbox-list"},ph={key:0,class:"ev-select-dropbox-ul"},gh=["title","onClick"],bh={key:1},yh={class:"ev-select-dropbox-item disabled"},xh={key:0,class:"ev-select-dropbox-ul"},Sh=["title","onClick"],Ch={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},kh={key:0,class:"ev-select-dropbox-ul"},wh=["title","onClick"],Ih={key:1},Lh={class:"ev-select-dropbox-item disabled"};function Th(t,e,n,i,s,l){const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-checkbox-group"),c=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"select",class:o.normalizeClass(["ev-select",{selected:i.isDropbox,disabled:n.disabled}])},[o.createElementVNode("div",nh,[n.multiple?(o.openBlock(),o.createElementBlock("div",sh,[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:e[3]||(e[3]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:e[4]||(e[4]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,oh),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",rh,[o.createElementVNode("span",ch,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:e[5]||(e[5]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...e[13]||(e[13]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):o.createCommentVNode("",!0),i.selectedModel.length>1?(o.openBlock(),o.createElementBlock("div",dh,[o.createElementVNode("span",hh," + "+o.toDisplayString(i.selectedModel.length-1),1)])):o.createCommentVNode("",!0)],64)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.selectedModel,d=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"ev-select-tag"},[o.createElementVNode("span",lh,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...e[12]||(e[12]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,ah)]))),128))])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:e[0]||(e[0]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=d=>i.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:e[2]||(e[2]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,ih),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:e[6]||(e[6]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...e[14]||(e[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",uh,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:"ev-select-dropbox",style:o.normalizeStyle([i.dropboxPosition,{width:i.dropboxWidth}])},[n.filterable?o.renderSlot(t.$slots,"search-filter",{key:0,item:{value:i.filterTextRef,onInput:i.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[o.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:i.filterTextRef,onInput:e[7]||(e[7]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,fh)]):o.createCommentVNode("",!0),n.checkable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-select-dropbox-item all-check",{selected:i.allCheck}]),onClick:e[10]||(e[10]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":e[8]||(e[8]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:e[9]||(e[9]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",mh,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":e[11]||(e[11]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",ph,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["self","prevent"])},[o.createVNode(a,{label:d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)]),_:2},1032,["label","disabled"])],10,gh))),128))])):(o.openBlock(),o.createElementBlock("ul",bh,[o.createElementVNode("li",yh,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",xh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[o.createVNode(a,{"model-value":i.mv===d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)]),_:2},1032,["model-value","disabled"])],10,Sh))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",Ch,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",kh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)],10,wh))),128))])):(o.openBlock(),o.createElementBlock("ul",Ih,[o.createElementVNode("li",Lh,o.toDisplayString(n.noMatchingText),1)]))],512))],4)):o.createCommentVNode("",!0)])],512)],2)),[[c,i.clickOutsideDropbox]])}const Dn=ce(th,[["render",Th]]);Dn.install=t=>{t.component(Dn.name,Dn)};const Mh={name:"EvToggle",props:{modelValue:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeColor:{type:String,default:"#409EFF"},inactiveColor:{type:String,default:"#DCDFE6"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:s=>{e("update:modelValue",s),e("change",s)}});return{mv:n,clickMv:()=>{!t.disabled&&!t.readonly&&(n.value=!n.value)}}}};function vh(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:o.normalizeStyle({width:`${n.width}px`,border:`1px solid ${n.modelValue?n.activeColor:n.inactiveColor}`,"background-color":`${n.modelValue?n.activeColor:n.inactiveColor}`}),onClick:e[0]||(e[0]=(...a)=>i.clickMv&&i.clickMv(...a))},null,6)}const Yn=ce(Mh,[["render",vh]]);Yn.install=t=>{t.component(Yn.name,Yn)};const Rh={name:"EvTextField",props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:"text"},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{type:Number,default:null},maxUnit:{type:String,default:"count"},showMaxLength:{type:Boolean,default:!1},errorMsg:{type:String,default:""},autocomplete:{type:String,default:"off"},modelModifiers:{type:Object,default:()=>({})}},emits:["update:modelValue","focus","blur","input","change","search"],setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:p=>e("update:modelValue",p)}),i=o.ref(!1),s=()=>{t.type==="password"&&(i.value=!i.value)},l=o.computed(()=>t.type==="password"?i.value?"text":"password":t.type==="search"?"text":t.type);o.watch(()=>t.type,p=>{p!=="password"&&(i.value=!1)});const a=()=>{n.value=""},r=()=>{e("search",n.value)},c=p=>{t.type==="search"&&(p.key==="Enter"||p.keyCode===13)&&r()},d=p=>{e("focus",p)},h=p=>{if(t.modelModifiers.trim&&typeof p.target.value=="string"){const y=p.target.value.trim();y!==p.target.value&&(n.value=y,p.target.value=y)}e("blur",p)},u=p=>new TextEncoder().encode(p).length,f=o.computed(()=>t.maxUnit==="byte"?u(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:i,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:p=>{let y=p.target.value;if(t.maxLength&&t.maxUnit==="byte"){for(;u(y)>t.maxLength;)y=y.slice(0,-1);p.target.value=y}n.value=y,e("input",y,p)},changeMv:p=>e("change",n.value,p),currentLength:f}}},Vh={class:"ev-text-field-wrapper"},Eh=["placeholder","disabled","readonly","autocomplete","maxlength"],Wh=["type","placeholder","disabled","readonly","autocomplete","maxlength"],Gh={key:3,class:"ev-text-field-icon icon-suffix"},Zh={key:4,class:"ev-text-field-icon icon-prefix"},Xh={key:0,class:"ev-text-field-error"},Nh={class:"curr-length"};function Ph(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-text-field",{disabled:n.disabled,clearable:n.clearable,readonly:n.readonly,error:!!n.errorMsg,"show-password":n.showPassword,"show-maxlength":n.showMaxLength,[`type-${n.type}`]:!!n.type,"ev-text-field-prefix":t.$slots["icon-prefix"],"ev-text-field-suffix":t.$slots["icon-suffix"],"ev-text-field-prefix-suffix":t.$slots["icon-prefix"]&&t.$slots["icon-suffix"]}])},[o.createElementVNode("div",Vh,[n.type==="textarea"?o.withDirectives((o.openBlock(),o.createElementBlock("textarea",{key:0,"onUpdate:modelValue":e[0]||(e[0]=a=>i.mv=a),class:"ev-textarea",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:e[1]||(e[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:e[2]||(e[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:e[3]||(e[3]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:e[4]||(e[4]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,Eh)),[[o.vModelText,i.mv]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[5]||(e[5]=a=>i.mv=a),class:"ev-input",type:i.inputType,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:e[6]||(e[6]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:e[7]||(e[7]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:e[8]||(e[8]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:e[9]||(e[9]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeyup:e[10]||(e[10]=(...a)=>i.keyupInput&&i.keyupInput(...a))},null,40,Wh),[[o.vModelDynamic,i.mv]]),n.type==="text"&&n.clearable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:e[11]||(e[11]=(...a)=>i.clearValue&&i.clearValue(...a))},[...e[14]||(e[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):o.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["ev-text-field-icon icon-password",{on:i.isPasswordVisible}]),onClick:e[12]||(e[12]=(...a)=>i.changePasswordVisible&&i.changePasswordVisible(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):o.createCommentVNode("",!0),n.type==="search"?(o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:e[13]||(e[13]=(...a)=>i.searchValue&&i.searchValue(...a))},[...e[15]||(e[15]=[o.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):o.createCommentVNode("",!0),t.$slots["icon-suffix"]?(o.openBlock(),o.createElementBlock("span",Gh,[o.renderSlot(t.$slots,"icon-suffix")])):o.createCommentVNode("",!0),t.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",Zh,[o.renderSlot(t.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",Xh,o.toDisplayString(n.errorMsg),1)):o.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-text-field-maxlength",{max:i.currentLength>n.maxLength}])},[o.createElementVNode("span",Nh,o.toDisplayString(i.currentLength),1),o.createTextVNode(" / "+o.toDisplayString(n.maxLength)+o.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):o.createCommentVNode("",!0)],2)}const On=ce(Rh,[["render",Ph]]);On.install=t=>{t.component(On.name,On)};const bn=globalThis.console,Hn={log(...t){bn.log(...t)},warn(...t){bn.warn(...t)},info(...t){bn.info(...t)},error(...t){bn.error(...t)},debug(...t){bn.debug(...t)},dir(t,e){bn.dir(t,e)}};function da(t){let e=null;if(typeof t=="string"||typeof t=="number"){const n=/^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(t);e=n?{value:+n[2],unit:n[3]||void 0}:null}return e}function ve(t){return typeof t=="number"&&!Number.isNaN(t)}function yt(...t){return t.every(ve)}function Je(t,e){const n=t/e*100;return!yt(t,e,n)||t===0||e===0?0:n.toFixed(2)}function Bh(t){return yt(t)?1e6*t:0}function Dh(t){return yt(t)?1e9*t:0}function Yh(t){return yt(t)?1e12*t:0}function Oh(t){return yt(t)?1e15*t:0}function Qt(t){const e=/\B(?=(\d{3})+(?!\d))/g;if(yt(t)){if(Number.isInteger(t))return t.toString().replace(e,",");const n=t.toString().split(".");return n[0].replace(e,",")+(n[1]?`.${n[1]}`:"")}return!1}function Fn(t){const e=(t==null?void 0:t.toString().split(".")[1])||0;return e?e.length:0}function io(t){return t==null}function Hh(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function $t(t,{min:e,max:n,step:i}){const s=Math.floor((t-e)/i),l=(t-e)%i,a=Math.floor((n-e)/i),r=Math.max(Fn(i),Fn(e));let c=!1,d;if(r){let h=+parseFloat(i*s).toFixed(r);d=+(h+e).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==i,l>i/2&&!c&&(d=+(d+i).toFixed(r)),d>n?(h=+parseFloat(i*a).toFixed(r),d=+(h+e).toFixed(r)):d<e&&(d=e)}else d=i*s+e,c=s===a&&n-d!==i,l>i/2&&!c&&(d+=i),d>n?d=i*a+e:d<e&&(d=e);return d}function Fh(){const{props:t,emit:e}=o.getCurrentInstance(),n=o.ref(t.modelValue),i=o.ref(t.modelValue),s=d=>{if(t.precision&&(d||d===0)){const h=Number(d).toFixed(t.precision);return t.trimTrailingZero?String(parseFloat(h)):h}return d},l=d=>{let h=d;!d&&d!==0?t.disableEmpty?(h=0,t.stepStrictly?h=$t(h,{min:t.min===-1/0?0:t.min,max:t.max,step:t.step}):(t.min||t.min===0)&&h<t.min?h=t.min:(t.max||t.max===0)&&h>t.max&&(h=t.max)):h=t.stepStrictly?i.value:null:isNaN(d)?h=i.value:t.stepStrictly?(t.min===-1/0&&(t.min=0),h=$t(d,{min:t.min,max:t.max,step:t.step})):(t.min||t.min===0)&&h<t.min?h=t.min:(t.max||t.max===0)&&h>t.max?h=t.max:h=+h,n.value=s(h),i.value=s(h),e("update:modelValue",h),e("change",h)},a=d=>{e("focus",d)},r=d=>{e("blur",d)},c=d=>{l(d.target.value)};return o.watch(()=>t.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function zh(t){const{props:e}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=t;return{stepValue:l=>{if(e.readonly||e.disabled)return;const a=!n.value&&n.value!==0;let r;if(a)r=e.min===-1/0?0:e.min;else{const c=+n.value,d=l==="up"?e.step:e.step*-1,u=10**Math.max(Fn(c),Fn(e.step));r=(Math.round(c*u)+Math.round(d*u))/u}if(e.clampOnStep){r<e.min?r=e.min:r>e.max&&(r=e.max);const c=e.stepStrictly?$t(r,{min:e.min===-1/0?0:e.min,max:e.max,step:e.step}):r;(a||c!==+n.value)&&i(r)}else r>=e.min&&r<=e.max&&i(r)}}}function Ah(t){const{props:e}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=t,s=e.max||e.max===0,l=e.min||e.min===0,a=()=>{s&&l&&e.max<=e.min&&console.warn("[EVUI][InputNumber] Max value must be greater than min value."),e.step&&(e.precision||e.precision===0)&&Fn(e.step)>e.precision&&console.warn("[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.")},r=()=>{let c=n.value;isNaN(n.value)&&(c=0),(c||c===0)&&(s&&c>e.max?c=e.max:l&&c<e.min&&(c=e.min)),i(c)};o.onBeforeMount(()=>{a(),r()})}const Kh={name:"EvInputNumber",props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},step:{type:Number,default:1,validator:t=>t>0},stepStrictly:{type:Boolean,default:!1},precision:{type:Number,default:0,validator:t=>t>=0&&t<=100&&t===parseInt(t,10)},trimTrailingZero:{type:Boolean,default:!1},disableEmpty:{type:Boolean,default:!1},clampOnStep:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:t,validateValue:e,focusInput:n,blurInput:i,changeMv:s}=Fh(),{stepValue:l}=zh({currentValue:t,validateValue:e});return Ah({currentValue:t,validateValue:e}),{currentValue:t,validateValue:e,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},_h={class:"ev-input-number__wrapper"},Uh=["onClick"],Jh=["placeholder","disabled","readonly"];function jh(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[o.createElementVNode("div",_h,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],a=>o.createElementVNode("span",{key:`step-arrow-${a}`,class:o.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>i.stepValue(a)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,Uh)),64)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:e[1]||(e[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:e[2]||(e[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onChange:e[3]||(e[3]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeydown:[e[4]||(e[4]=o.withKeys(o.withModifiers(a=>i.stepValue("up"),["prevent"]),["up"])),e[5]||(e[5]=o.withKeys(o.withModifiers(a=>i.stepValue("down"),["prevent"]),["down"])),e[6]||(e[6]=o.withKeys(o.withModifiers(a=>i.validateValue(i.currentValue),["prevent"]),["enter"]))]},null,40,Jh),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])])],2)}const zn=ce(Kh,[["render",jh]]);zn.install=t=>{t.component(zn.name,zn)};var ha=typeof global=="object"&&global&&global.Object===Object&&global,Qh=typeof self=="object"&&self&&self.Object===Object&&self,rt=ha||Qh||Function("return this")(),xt=rt.Symbol,ua=Object.prototype,$h=ua.hasOwnProperty,qh=ua.toString,An=xt?xt.toStringTag:void 0;function eu(t){var e=$h.call(t,An),n=t[An];try{t[An]=void 0;var i=!0}catch{}var s=qh.call(t);return i&&(e?t[An]=n:delete t[An]),s}var tu=Object.prototype,nu=tu.toString;function iu(t){return nu.call(t)}var su="[object Null]",ou="[object Undefined]",fa=xt?xt.toStringTag:void 0;function Dt(t){return t==null?t===void 0?ou:su:fa&&fa in Object(t)?eu(t):iu(t)}function ct(t){return t!=null&&typeof t=="object"}var lu="[object Symbol]";function Ai(t){return typeof t=="symbol"||ct(t)&&Dt(t)==lu}function au(t,e){for(var n=-1,i=t==null?0:t.length,s=Array(i);++n<i;)s[n]=e(t[n],n,t);return s}var qe=Array.isArray,ma=xt?xt.prototype:void 0,pa=ma?ma.toString:void 0;function ga(t){if(typeof t=="string")return t;if(qe(t))return au(t,ga)+"";if(Ai(t))return pa?pa.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var ru=/\s/;function cu(t){for(var e=t.length;e--&&ru.test(t.charAt(e)););return e}var du=/^\s+/;function hu(t){return t&&t.slice(0,cu(t)+1).replace(du,"")}function He(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ba=NaN,uu=/^[-+]0x[0-9a-f]+$/i,fu=/^0b[01]+$/i,mu=/^0o[0-7]+$/i,pu=parseInt;function Ki(t){if(typeof t=="number")return t;if(Ai(t))return ba;if(He(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=He(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=hu(t);var n=fu.test(t);return n||mu.test(t)?pu(t.slice(2),n?2:8):uu.test(t)?ba:+t}var ya=1/0,gu=17976931348623157e292;function xa(t){if(!t)return t===0?t:0;if(t=Ki(t),t===ya||t===-ya){var e=t<0?-1:1;return e*gu}return t===t?t:0}function so(t){return t}var bu="[object AsyncFunction]",yu="[object Function]",xu="[object GeneratorFunction]",Su="[object Proxy]";function Kn(t){if(!He(t))return!1;var e=Dt(t);return e==yu||e==xu||e==bu||e==Su}var oo=rt["__core-js_shared__"],Sa=function(){var t=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Cu(t){return!!Sa&&Sa in t}var ku=Function.prototype,wu=ku.toString;function qt(t){if(t!=null){try{return wu.call(t)}catch{}try{return t+""}catch{}}return""}var Iu=/[\\^$.*+?()[\]{}|]/g,Lu=/^\[object .+?Constructor\]$/,Tu=Function.prototype,Mu=Object.prototype,vu=Tu.toString,Ru=Mu.hasOwnProperty,Vu=RegExp("^"+vu.call(Ru).replace(Iu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Eu(t){if(!He(t)||Cu(t))return!1;var e=Kn(t)?Vu:Lu;return e.test(qt(t))}function Wu(t,e){return t==null?void 0:t[e]}function en(t,e){var n=Wu(t,e);return Eu(n)?n:void 0}var lo=en(rt,"WeakMap"),Ca=Object.create,Gu=function(){function t(){}return function(e){if(!He(e))return{};if(Ca)return Ca(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ka(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Zu(){}function Xu(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var Nu=800,Pu=16,Bu=Date.now;function Du(t){var e=0,n=0;return function(){var i=Bu(),s=Pu-(i-n);if(n=i,s>0){if(++e>=Nu)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Yu(t){return function(){return t}}var _i=function(){try{var t=en(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ou=_i?function(t,e){return _i(t,"toString",{configurable:!0,enumerable:!1,value:Yu(e),writable:!0})}:so,Hu=Du(Ou);function Fu(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}function zu(t,e,n,i){for(var s=t.length,l=n+-1;++l<s;)if(e(t[l],l,t))return l;return-1}function Au(t){return t!==t}function Ku(t,e,n){for(var i=n-1,s=t.length;++i<s;)if(t[i]===e)return i;return-1}function _u(t,e,n){return e===e?Ku(t,e,n):zu(t,Au,n)}function Uu(t,e){var n=t==null?0:t.length;return!!n&&_u(t,e,0)>-1}var Ju=9007199254740991,ju=/^(?:0|[1-9]\d*)$/;function ao(t,e){var n=typeof t;return e=e??Ju,!!e&&(n=="number"||n!="symbol"&&ju.test(t))&&t>-1&&t%1==0&&t<e}function ro(t,e,n){e=="__proto__"&&_i?_i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function yn(t,e){return t===e||t!==t&&e!==e}var Qu=Object.prototype,$u=Qu.hasOwnProperty;function wa(t,e,n){var i=t[e];(!($u.call(t,e)&&yn(i,n))||n===void 0&&!(e in t))&&ro(t,e,n)}function qu(t,e,n,i){var s=!n;n||(n={});for(var l=-1,a=e.length;++l<a;){var r=e[l],c=void 0;c===void 0&&(c=t[r]),s?ro(n,r,c):wa(n,r,c)}return n}var Ia=Math.max;function ef(t,e,n){return e=Ia(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,l=Ia(i.length-e,0),a=Array(l);++s<l;)a[s]=i[e+s];s=-1;for(var r=Array(e+1);++s<e;)r[s]=i[s];return r[e]=n(a),ka(t,this,r)}}function co(t,e){return Hu(ef(t,e,so),t+"")}var tf=9007199254740991;function ho(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=tf}function Ui(t){return t!=null&&ho(t.length)&&!Kn(t)}function La(t,e,n){if(!He(n))return!1;var i=typeof e;return(i=="number"?Ui(n)&&ao(e,n.length):i=="string"&&e in n)?yn(n[e],t):!1}function Ta(t){return co(function(e,n){var i=-1,s=n.length,l=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(l=t.length>3&&typeof l=="function"?(s--,l):void 0,a&&La(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),e=Object(e);++i<s;){var r=n[i];r&&t(e,r,i,l)}return e})}var nf=Object.prototype;function uo(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||nf;return t===n}function sf(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}var of="[object Arguments]";function Ma(t){return ct(t)&&Dt(t)==of}var va=Object.prototype,lf=va.hasOwnProperty,af=va.propertyIsEnumerable,Ji=Ma(function(){return arguments}())?Ma:function(t){return ct(t)&&lf.call(t,"callee")&&!af.call(t,"callee")};function rf(){return!1}var Ra=typeof le=="object"&&le&&!le.nodeType&&le,Va=Ra&&typeof module=="object"&&module&&!module.nodeType&&module,cf=Va&&Va.exports===Ra,Ea=cf?rt.Buffer:void 0,df=Ea?Ea.isBuffer:void 0,_n=df||rf,hf="[object Arguments]",uf="[object Array]",ff="[object Boolean]",mf="[object Date]",pf="[object Error]",gf="[object Function]",bf="[object Map]",yf="[object Number]",xf="[object Object]",Sf="[object RegExp]",Cf="[object Set]",kf="[object String]",wf="[object WeakMap]",If="[object ArrayBuffer]",Lf="[object DataView]",Tf="[object Float32Array]",Mf="[object Float64Array]",vf="[object Int8Array]",Rf="[object Int16Array]",Vf="[object Int32Array]",Ef="[object Uint8Array]",Wf="[object Uint8ClampedArray]",Gf="[object Uint16Array]",Zf="[object Uint32Array]",Ce={};Ce[Tf]=Ce[Mf]=Ce[vf]=Ce[Rf]=Ce[Vf]=Ce[Ef]=Ce[Wf]=Ce[Gf]=Ce[Zf]=!0,Ce[hf]=Ce[uf]=Ce[If]=Ce[ff]=Ce[Lf]=Ce[mf]=Ce[pf]=Ce[gf]=Ce[bf]=Ce[yf]=Ce[xf]=Ce[Sf]=Ce[Cf]=Ce[kf]=Ce[wf]=!1;function Xf(t){return ct(t)&&ho(t.length)&&!!Ce[Dt(t)]}function fo(t){return function(e){return t(e)}}var Wa=typeof le=="object"&&le&&!le.nodeType&&le,Un=Wa&&typeof module=="object"&&module&&!module.nodeType&&module,Nf=Un&&Un.exports===Wa,mo=Nf&&ha.process,xn=function(){try{var t=Un&&Un.require&&Un.require("util").types;return t||mo&&mo.binding&&mo.binding("util")}catch{}}(),Ga=xn&&xn.isTypedArray,po=Ga?fo(Ga):Xf,Pf=Object.prototype,Bf=Pf.hasOwnProperty;function Za(t,e){var n=qe(t),i=!n&&Ji(t),s=!n&&!i&&_n(t),l=!n&&!i&&!s&&po(t),a=n||i||s||l,r=a?sf(t.length,String):[],c=r.length;for(var d in t)(e||Bf.call(t,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ao(d,c)))&&r.push(d);return r}function Xa(t,e){return function(n){return t(e(n))}}var Df=Xa(Object.keys,Object),Yf=Object.prototype,Of=Yf.hasOwnProperty;function Hf(t){if(!uo(t))return Df(t);var e=[];for(var n in Object(t))Of.call(t,n)&&n!="constructor"&&e.push(n);return e}function Na(t){return Ui(t)?Za(t):Hf(t)}function Ff(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var zf=Object.prototype,Af=zf.hasOwnProperty;function Kf(t){if(!He(t))return Ff(t);var e=uo(t),n=[];for(var i in t)i=="constructor"&&(e||!Af.call(t,i))||n.push(i);return n}function go(t){return Ui(t)?Za(t,!0):Kf(t)}var _f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uf=/^\w*$/;function bo(t,e){if(qe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ai(t)?!0:Uf.test(t)||!_f.test(t)||e!=null&&t in Object(e)}var Jn=en(Object,"create");function Jf(){this.__data__=Jn?Jn(null):{},this.size=0}function jf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qf="__lodash_hash_undefined__",$f=Object.prototype,qf=$f.hasOwnProperty;function em(t){var e=this.__data__;if(Jn){var n=e[t];return n===Qf?void 0:n}return qf.call(e,t)?e[t]:void 0}var tm=Object.prototype,nm=tm.hasOwnProperty;function im(t){var e=this.__data__;return Jn?e[t]!==void 0:nm.call(e,t)}var sm="__lodash_hash_undefined__";function om(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jn&&e===void 0?sm:e,this}function tn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}tn.prototype.clear=Jf,tn.prototype.delete=jf,tn.prototype.get=em,tn.prototype.has=im,tn.prototype.set=om;function lm(){this.__data__=[],this.size=0}function ji(t,e){for(var n=t.length;n--;)if(yn(t[n][0],e))return n;return-1}var am=Array.prototype,rm=am.splice;function cm(t){var e=this.__data__,n=ji(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():rm.call(e,n,1),--this.size,!0}function dm(t){var e=this.__data__,n=ji(e,t);return n<0?void 0:e[n][1]}function hm(t){return ji(this.__data__,t)>-1}function um(t,e){var n=this.__data__,i=ji(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function It(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}It.prototype.clear=lm,It.prototype.delete=cm,It.prototype.get=dm,It.prototype.has=hm,It.prototype.set=um;var jn=en(rt,"Map");function fm(){this.size=0,this.__data__={hash:new tn,map:new(jn||It),string:new tn}}function mm(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Qi(t,e){var n=t.__data__;return mm(e)?n[typeof e=="string"?"string":"hash"]:n.map}function pm(t){var e=Qi(this,t).delete(t);return this.size-=e?1:0,e}function gm(t){return Qi(this,t).get(t)}function bm(t){return Qi(this,t).has(t)}function ym(t,e){var n=Qi(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}function Lt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Lt.prototype.clear=fm,Lt.prototype.delete=pm,Lt.prototype.get=gm,Lt.prototype.has=bm,Lt.prototype.set=ym;var xm="Expected a function";function yo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(xm);var n=function(){var i=arguments,s=e?e.apply(this,i):i[0],l=n.cache;if(l.has(s))return l.get(s);var a=t.apply(this,i);return n.cache=l.set(s,a)||l,a};return n.cache=new(yo.Cache||Lt),n}yo.Cache=Lt;var Sm=500;function Cm(t){var e=yo(t,function(i){return n.size===Sm&&n.clear(),i}),n=e.cache;return e}var km=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wm=/\\(\\)?/g,Im=Cm(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(km,function(n,i,s,l){e.push(s?l.replace(wm,"$1"):i||n)}),e});function Lm(t){return t==null?"":ga(t)}function Pa(t,e){return qe(t)?t:bo(t,e)?[t]:Im(Lm(t))}function $i(t){if(typeof t=="string"||Ai(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ba(t,e){e=Pa(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[$i(e[n++])];return n&&n==i?t:void 0}function Tm(t,e,n){var i=t==null?void 0:Ba(t,e);return i===void 0?n:i}function Mm(t,e){for(var n=-1,i=e.length,s=t.length;++n<i;)t[s+n]=e[n];return t}var Da=Xa(Object.getPrototypeOf,Object),vm="[object Object]",Rm=Function.prototype,Vm=Object.prototype,Ya=Rm.toString,Em=Vm.hasOwnProperty,Wm=Ya.call(Object);function Gm(t){if(!ct(t)||Dt(t)!=vm)return!1;var e=Da(t);if(e===null)return!0;var n=Em.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Ya.call(n)==Wm}function Zm(){this.__data__=new It,this.size=0}function Xm(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Nm(t){return this.__data__.get(t)}function Pm(t){return this.__data__.has(t)}var Bm=200;function Dm(t,e){var n=this.__data__;if(n instanceof It){var i=n.__data__;if(!jn||i.length<Bm-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Lt(i)}return n.set(t,e),this.size=n.size,this}function dt(t){var e=this.__data__=new It(t);this.size=e.size}dt.prototype.clear=Zm,dt.prototype.delete=Xm,dt.prototype.get=Nm,dt.prototype.has=Pm,dt.prototype.set=Dm;var Oa=typeof le=="object"&&le&&!le.nodeType&&le,Ha=Oa&&typeof module=="object"&&module&&!module.nodeType&&module,Ym=Ha&&Ha.exports===Oa,Fa=Ym?rt.Buffer:void 0,za=Fa?Fa.allocUnsafe:void 0;function Aa(t,e){if(e)return t.slice();var n=t.length,i=za?za(n):new t.constructor(n);return t.copy(i),i}function Om(t,e){for(var n=-1,i=t==null?0:t.length,s=0,l=[];++n<i;){var a=t[n];e(a,n,t)&&(l[s++]=a)}return l}function Hm(){return[]}var Fm=Object.prototype,zm=Fm.propertyIsEnumerable,Ka=Object.getOwnPropertySymbols,Am=Ka?function(t){return t==null?[]:(t=Object(t),Om(Ka(t),function(e){return zm.call(t,e)}))}:Hm;function Km(t,e,n){var i=e(t);return qe(t)?i:Mm(i,n(t))}function xo(t){return Km(t,Na,Am)}var So=en(rt,"DataView"),Co=en(rt,"Promise"),Sn=en(rt,"Set"),_a="[object Map]",_m="[object Object]",Ua="[object Promise]",Ja="[object Set]",ja="[object WeakMap]",Qa="[object DataView]",Um=qt(So),Jm=qt(jn),jm=qt(Co),Qm=qt(Sn),$m=qt(lo),ht=Dt;(So&&ht(new So(new ArrayBuffer(1)))!=Qa||jn&&ht(new jn)!=_a||Co&&ht(Co.resolve())!=Ua||Sn&&ht(new Sn)!=Ja||lo&&ht(new lo)!=ja)&&(ht=function(t){var e=Dt(t),n=e==_m?t.constructor:void 0,i=n?qt(n):"";if(i)switch(i){case Um:return Qa;case Jm:return _a;case jm:return Ua;case Qm:return Ja;case $m:return ja}return e});var qm=Object.prototype,ep=qm.hasOwnProperty;function tp(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&ep.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var qi=rt.Uint8Array;function ko(t){var e=new t.constructor(t.byteLength);return new qi(e).set(new qi(t)),e}function np(t,e){var n=ko(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var ip=/\w*$/;function sp(t){var e=new t.constructor(t.source,ip.exec(t));return e.lastIndex=t.lastIndex,e}var $a=xt?xt.prototype:void 0,qa=$a?$a.valueOf:void 0;function op(t){return qa?Object(qa.call(t)):{}}function er(t,e){var n=e?ko(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var lp="[object Boolean]",ap="[object Date]",rp="[object Map]",cp="[object Number]",dp="[object RegExp]",hp="[object Set]",up="[object String]",fp="[object Symbol]",mp="[object ArrayBuffer]",pp="[object DataView]",gp="[object Float32Array]",bp="[object Float64Array]",yp="[object Int8Array]",xp="[object Int16Array]",Sp="[object Int32Array]",Cp="[object Uint8Array]",kp="[object Uint8ClampedArray]",wp="[object Uint16Array]",Ip="[object Uint32Array]";function Lp(t,e,n){var i=t.constructor;switch(e){case mp:return ko(t);case lp:case ap:return new i(+t);case pp:return np(t);case gp:case bp:case yp:case xp:case Sp:case Cp:case kp:case wp:case Ip:return er(t,n);case rp:return new i;case cp:case up:return new i(t);case dp:return sp(t);case hp:return new i;case fp:return op(t)}}function tr(t){return typeof t.constructor=="function"&&!uo(t)?Gu(Da(t)):{}}var Tp="[object Map]";function Mp(t){return ct(t)&&ht(t)==Tp}var nr=xn&&xn.isMap,vp=nr?fo(nr):Mp,Rp="[object Set]";function Vp(t){return ct(t)&&ht(t)==Rp}var ir=xn&&xn.isSet,Ep=ir?fo(ir):Vp,Wp=1,sr="[object Arguments]",Gp="[object Array]",Zp="[object Boolean]",Xp="[object Date]",Np="[object Error]",or="[object Function]",Pp="[object GeneratorFunction]",Bp="[object Map]",Dp="[object Number]",lr="[object Object]",Yp="[object RegExp]",Op="[object Set]",Hp="[object String]",Fp="[object Symbol]",zp="[object WeakMap]",Ap="[object ArrayBuffer]",Kp="[object DataView]",_p="[object Float32Array]",Up="[object Float64Array]",Jp="[object Int8Array]",jp="[object Int16Array]",Qp="[object Int32Array]",$p="[object Uint8Array]",qp="[object Uint8ClampedArray]",eg="[object Uint16Array]",tg="[object Uint32Array]",ye={};ye[sr]=ye[Gp]=ye[Ap]=ye[Kp]=ye[Zp]=ye[Xp]=ye[_p]=ye[Up]=ye[Jp]=ye[jp]=ye[Qp]=ye[Bp]=ye[Dp]=ye[lr]=ye[Yp]=ye[Op]=ye[Hp]=ye[Fp]=ye[$p]=ye[qp]=ye[eg]=ye[tg]=!0,ye[Np]=ye[or]=ye[zp]=!1;function Qn(t,e,n,i,s,l){var a,r=e&Wp;if(n&&(a=s?n(t,i,s,l):n(t)),a!==void 0)return a;if(!He(t))return t;var c=qe(t);if(c)a=tp(t);else{var d=ht(t),h=d==or||d==Pp;if(_n(t))return Aa(t,r);if(d==lr||d==sr||h&&!s)a=h?{}:tr(t);else{if(!ye[d])return s?t:{};a=Lp(t,d,r)}}l||(l=new dt);var u=l.get(t);if(u)return u;l.set(t,a),Ep(t)?t.forEach(function(g){a.add(Qn(g,e,n,g,t,l))}):vp(t)&&t.forEach(function(g,p){a.set(p,Qn(g,e,n,p,t,l))});var f=xo,m=c?void 0:f(t);return Fu(m||t,function(g,p){m&&(p=g,g=t[p]),wa(a,p,Qn(g,e,n,p,t,l))}),a}var ng=1,ig=4;function Re(t){return Qn(t,ng|ig)}var sg=1,og=4;function ar(t,e){return e=typeof e=="function"?e:void 0,Qn(t,sg|og,e)}var lg="__lodash_hash_undefined__";function ag(t){return this.__data__.set(t,lg),this}function rg(t){return this.__data__.has(t)}function $n(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Lt;++e<n;)this.add(t[e])}$n.prototype.add=$n.prototype.push=ag,$n.prototype.has=rg;function cg(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}function rr(t,e){return t.has(e)}var dg=1,hg=2;function cr(t,e,n,i,s,l){var a=n&dg,r=t.length,c=e.length;if(r!=c&&!(a&&c>r))return!1;var d=l.get(t),h=l.get(e);if(d&&h)return d==e&&h==t;var u=-1,f=!0,m=n&hg?new $n:void 0;for(l.set(t,e),l.set(e,t);++u<r;){var g=t[u],p=e[u];if(i)var y=a?i(p,g,u,e,t,l):i(g,p,u,t,e,l);if(y!==void 0){if(y)continue;f=!1;break}if(m){if(!cg(e,function(C,b){if(!rr(m,b)&&(g===C||s(g,C,n,i,l)))return m.push(b)})){f=!1;break}}else if(!(g===p||s(g,p,n,i,l))){f=!1;break}}return l.delete(t),l.delete(e),f}function ug(t){var e=-1,n=Array(t.size);return t.forEach(function(i,s){n[++e]=[s,i]}),n}function wo(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}var fg=1,mg=2,pg="[object Boolean]",gg="[object Date]",bg="[object Error]",yg="[object Map]",xg="[object Number]",Sg="[object RegExp]",Cg="[object Set]",kg="[object String]",wg="[object Symbol]",Ig="[object ArrayBuffer]",Lg="[object DataView]",dr=xt?xt.prototype:void 0,Io=dr?dr.valueOf:void 0;function Tg(t,e,n,i,s,l,a){switch(n){case Lg:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ig:return!(t.byteLength!=e.byteLength||!l(new qi(t),new qi(e)));case pg:case gg:case xg:return yn(+t,+e);case bg:return t.name==e.name&&t.message==e.message;case Sg:case kg:return t==e+"";case yg:var r=ug;case Cg:var c=i&fg;if(r||(r=wo),t.size!=e.size&&!c)return!1;var d=a.get(t);if(d)return d==e;i|=mg,a.set(t,e);var h=cr(r(t),r(e),i,s,l,a);return a.delete(t),h;case wg:if(Io)return Io.call(t)==Io.call(e)}return!1}var Mg=1,vg=Object.prototype,Rg=vg.hasOwnProperty;function Vg(t,e,n,i,s,l){var a=n&Mg,r=xo(t),c=r.length,d=xo(e),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in e:Rg.call(e,f)))return!1}var m=l.get(t),g=l.get(e);if(m&&g)return m==e&&g==t;var p=!0;l.set(t,e),l.set(e,t);for(var y=a;++u<c;){f=r[u];var C=t[f],b=e[f];if(i)var k=a?i(b,C,f,e,t,l):i(C,b,f,t,e,l);if(!(k===void 0?C===b||s(C,b,n,i,l):k)){p=!1;break}y||(y=f=="constructor")}if(p&&!y){var T=t.constructor,w=e.constructor;T!=w&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof w=="function"&&w instanceof w)&&(p=!1)}return l.delete(t),l.delete(e),p}var Eg=1,hr="[object Arguments]",ur="[object Array]",es="[object Object]",Wg=Object.prototype,fr=Wg.hasOwnProperty;function Gg(t,e,n,i,s,l){var a=qe(t),r=qe(e),c=a?ur:ht(t),d=r?ur:ht(e);c=c==hr?es:c,d=d==hr?es:d;var h=c==es,u=d==es,f=c==d;if(f&&_n(t)){if(!_n(e))return!1;a=!0,h=!1}if(f&&!h)return l||(l=new dt),a||po(t)?cr(t,e,n,i,s,l):Tg(t,e,c,n,i,s,l);if(!(n&Eg)){var m=h&&fr.call(t,"__wrapped__"),g=u&&fr.call(e,"__wrapped__");if(m||g){var p=m?t.value():t,y=g?e.value():e;return l||(l=new dt),s(p,y,n,i,l)}}return f?(l||(l=new dt),Vg(t,e,n,i,s,l)):!1}function ts(t,e,n,i,s){return t===e?!0:t==null||e==null||!ct(t)&&!ct(e)?t!==t&&e!==e:Gg(t,e,n,i,ts,s)}var Zg=1,Xg=2;function Ng(t,e,n,i){var s=n.length,l=s;if(t==null)return!l;for(t=Object(t);s--;){var a=n[s];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++s<l;){a=n[s];var r=a[0],c=t[r],d=a[1];if(a[2]){if(c===void 0&&!(r in t))return!1}else{var h=new dt,u;if(!(u===void 0?ts(d,c,Zg|Xg,i,h):u))return!1}}return!0}function mr(t){return t===t&&!He(t)}function Pg(t){for(var e=Na(t),n=e.length;n--;){var i=e[n],s=t[i];e[n]=[i,s,mr(s)]}return e}function pr(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Bg(t){var e=Pg(t);return e.length==1&&e[0][2]?pr(e[0][0],e[0][1]):function(n){return n===t||Ng(n,t,e)}}function Dg(t,e){return t!=null&&e in Object(t)}function Yg(t,e,n){e=Pa(e,t);for(var i=-1,s=e.length,l=!1;++i<s;){var a=$i(e[i]);if(!(l=t!=null&&n(t,a)))break;t=t[a]}return l||++i!=s?l:(s=t==null?0:t.length,!!s&&ho(s)&&ao(a,s)&&(qe(t)||Ji(t)))}function Og(t,e){return t!=null&&Yg(t,e,Dg)}var Hg=1,Fg=2;function zg(t,e){return bo(t)&&mr(e)?pr($i(t),e):function(n){var i=Tm(n,t);return i===void 0&&i===e?Og(n,t):ts(e,i,Hg|Fg)}}function Ag(t){return function(e){return e==null?void 0:e[t]}}function Kg(t){return function(e){return Ba(e,t)}}function _g(t){return bo(t)?Ag($i(t)):Kg(t)}function Ug(t){return typeof t=="function"?t:t==null?so:typeof t=="object"?qe(t)?zg(t[0],t[1]):Bg(t):_g(t)}function Jg(t){return function(e,n,i){for(var s=-1,l=Object(e),a=i(e),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return e}}var jg=Jg(),Lo=function(){return rt.Date.now()},Qg="Expected a function",$g=Math.max,qg=Math.min;function ns(t,e,n){var i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;if(typeof t!="function")throw new TypeError(Qg);e=Ki(e)||0,He(n)&&(h=!!n.leading,u="maxWait"in n,l=u?$g(Ki(n.maxWait)||0,e):l,f="trailing"in n?!!n.trailing:f);function m(M){var V=i,x=s;return i=s=void 0,d=M,a=t.apply(x,V),a}function g(M){return d=M,r=setTimeout(C,e),h?m(M):a}function p(M){var V=M-c,x=M-d,S=e-V;return u?qg(S,l-x):S}function y(M){var V=M-c,x=M-d;return c===void 0||V>=e||V<0||u&&x>=l}function C(){var M=Lo();if(y(M))return b(M);r=setTimeout(C,p(M))}function b(M){return r=void 0,f&&i?m(M):(i=s=void 0,a)}function k(){r!==void 0&&clearTimeout(r),d=0,i=c=s=r=void 0}function T(){return r===void 0?a:b(Lo())}function w(){var M=Lo(),V=y(M);if(i=arguments,s=this,c=M,V){if(r===void 0)return g(c);if(u)return clearTimeout(r),r=setTimeout(C,e),m(c)}return r===void 0&&(r=setTimeout(C,e)),a}return w.cancel=k,w.flush=T,w}var gr=Object.prototype,eb=gr.hasOwnProperty,tb=co(function(t,e){t=Object(t);var n=-1,i=e.length,s=i>2?e[2]:void 0;for(s&&La(e[0],e[1],s)&&(i=1);++n<i;)for(var l=e[n],a=go(l),r=-1,c=a.length;++r<c;){var d=a[r],h=t[d];(h===void 0||yn(h,gr[d])&&!eb.call(t,d))&&(t[d]=l[d])}return t});function To(t,e,n){(n!==void 0&&!yn(t[e],n)||n===void 0&&!(e in t))&&ro(t,e,n)}function nb(t){return ct(t)&&Ui(t)}function Mo(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function ib(t){return qu(t,go(t))}function sb(t,e,n,i,s,l,a){var r=Mo(t,n),c=Mo(e,n),d=a.get(c);if(d){To(t,n,d);return}var h=l?l(r,c,n+"",t,e,a):void 0,u=h===void 0;if(u){var f=qe(c),m=!f&&_n(c),g=!f&&!m&&po(c);h=c,f||m||g?qe(r)?h=r:nb(r)?h=Xu(r):m?(u=!1,h=Aa(c,!0)):g?(u=!1,h=er(c,!0)):h=[]:Gm(c)||Ji(c)?(h=r,Ji(r)?h=ib(r):(!He(r)||Kn(r))&&(h=tr(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),To(t,n,h)}function is(t,e,n,i,s){t!==e&&jg(e,function(l,a){if(s||(s=new dt),He(l))sb(t,e,a,n,is,i,s);else{var r=i?i(Mo(t,a),l,a+"",t,e,s):void 0;r===void 0&&(r=l),To(t,a,r)}},go)}function br(t,e,n,i,s,l){return He(t)&&He(e)&&(l.set(e,t),is(t,e,void 0,br,l),l.delete(e)),t}var ob=Ta(function(t,e,n,i){is(t,e,n,i)}),Xe=co(function(t){return t.push(void 0,br),ka(ob,void 0,t)}),lb=Math.max,ab=Math.min;function rb(t,e,n){return t>=ab(e,n)&&t<lb(e,n)}function St(t,e,n){return e=xa(e),n===void 0?(n=e,e=0):n=xa(n),t=Ki(t),rb(t,e,n)}function Fe(t,e){return ts(t,e)}var cb="[object Number]";function db(t){return typeof t=="number"||ct(t)&&Dt(t)==cb}function Yt(t){return t==null}function hb(t){return t===void 0}var vo=Ta(function(t,e,n){is(t,e,n)}),ub=Array.prototype,fb=ub.reverse;function mb(t){return t==null?t:fb.call(t)}var pb="Expected a function";function ss(t,e,n){var i=!0,s=!0;if(typeof t!="function")throw new TypeError(pb);return He(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),ns(t,e,{leading:i,maxWait:e,trailing:s})}var gb=1/0,bb=Sn&&1/wo(new Sn([,-0]))[1]==gb?function(t){return new Sn(t)}:Zu,yb=200;function xb(t,e,n){var i=-1,s=Uu,l=t.length,a=!0,r=[],c=r;if(l>=yb){var d=e?null:bb(t);if(d)return wo(d);a=!1,s=rr,c=new $n}else c=e?[]:r;e:for(;++i<l;){var h=t[i],u=e?e(h):h;if(h=h!==0?h:0,a&&u===u){for(var f=c.length;f--;)if(c[f]===u)continue e;e&&c.push(u),r.push(h)}else s(c,u,n)||(c!==r&&c.push(u),r.push(h))}return r}function Sb(t,e){return t&&t.length?xb(t,Ug(e)):[]}const Cb=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.ref(t.modelValue),i=()=>{if(!t.showStep)return[];const f=t.max-t.min,m=f/t.step,g=Je(t.step,f),p=[];for(let y=1;y<m;y++)p.push(y*g);return p},s=()=>{if(!t.mark||!Object.keys(t.mark).length)return[];const f=(g,p="value")=>{if(!g)return[];const y=t.mark.style&&typeof t.mark.style=="object"?t.mark.style:{},C=Object.keys(g),b=[];let k;for(let T=0;T<C.length;T++)k=+C[T],isNaN(k)||b.push({posX:p==="value"?Je(k,t.max-t.min):k,label:g[k],style:y});return b};return t.mark.value||t.mark.percent?[...f(t.mark.value),...f(t.mark.percent,"percent")]:[...f(t.mark)]},l=o.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=o.reactive({valueRange:0,stepList:o.computed(i),markList:o.computed(s),offset:{left:0,width:0}}),r=o.ref(),c=o.computed(()=>{const f=t.tooltipFormat,m=f instanceof Function;return{left:m?f(l.leftValue):l.leftValue,right:m?f(l.rightValue):l.rightValue}}),d=f=>{const m={min:t.min,max:t.max,step:t.step};let g,p;t.range&&Array.isArray(f)?(g=typeof f[0]=="number"&&!isNaN(f[0])?f[0]:t.min,p=typeof f[1]=="number"&&!isNaN(f[1])?f[1]:t.min,l.leftValue=$t(g,m),l.rightValue=$t(p,m)):(g=t.min,p=typeof f=="number"&&!isNaN(f)?f:t.min,l.leftValue=$t(g,m),l.rightValue=$t(p,m))},h=f=>{if(a.valueRange<=0)return;d(f);let m;if(t.range&&Array.isArray(f)){const g=Math.min(l.leftValue,l.rightValue),p=Math.max(l.leftValue,l.rightValue);m=[g,p]}else m=l.rightValue;n.value=m,e("update:modelValue",m),e("change",m)},u=()=>{const f=r.value.getBoundingClientRect();a.offset.left=f.left,a.offset.width=f.width,a.valueRange=t.max-t.min};return o.watch(()=>t.modelValue,(f,m)=>{db(f)&&f>=0&&!Fe(f,m)&&!l.dragging&&(d(f),n.value=f)}),o.watch(()=>t.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:u,setSliderValue:h}},kb=t=>{const{props:e}=o.getCurrentInstance(),{state:n,slider:i}=t,s="transparent",l=o.computed(()=>({left:i.valueRange>0?`${Je(n.leftValue-e.min,i.valueRange)}%`:0})),a=o.computed(()=>({left:i.valueRange>0?`${Je(n.rightValue-e.min,i.valueRange)}%`:0})),r=o.computed(()=>!e.color||Array.isArray(e.color)&&e.color.length!==1?{}:{borderColor:(typeof e.color=="string"?e.color:e.color[0])||s}),c=o.computed(()=>e.color&&Array.isArray(e.color)),d=o.computed(()=>{const f=Math.min(n.leftValue,n.rightValue),g=+(Math.max(n.leftValue,n.rightValue)-f).toFixed(2),p=i.valueRange>0&&e.range?Je(+(f-e.min).toFixed(2),i.valueRange):0,y=g>0?Je(g,i.valueRange):0,C={};return e.color&&(typeof e.color=="string"||Array.isArray(e.color)&&e.color.length===1?C.backgroundColor=(typeof e.color=="string"?e.color:e.color[0])||s:Array.isArray(e.color)&&e.color.length>1&&(C.backgroundColor=(e.range?e.color[1]:e.color[0])||s)),{left:`${p}%`,width:`${y}%`,...C}}),h=o.computed(()=>{if(!c.value||e.color.length<2||!e.range)return{};const f=Math.min(n.leftValue,n.rightValue);return{width:`${Je(Math.abs(f-e.min),i.valueRange)}%`,backgroundColor:e.color[0]||s}}),u=o.computed(()=>{if(!c.value||e.color.length<2)return{};const f=Math.max(n.leftValue,n.rightValue),m=Je(+(f-e.min).toFixed(2),i.valueRange),g=Je(+(e.max-f).toFixed(2),i.valueRange),p=e.range?2:e.color.length-1;return{left:`${m}%`,width:`${g}%`,backgroundColor:e.color[p]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:u}},wb=t=>{const{props:e}=o.getCurrentInstance(),{currentValue:n,state:i,slider:s,updateSliderInfo:l,setSliderValue:a}=t,r=m=>{i.dragging||l();const g=m.type.indexOf("touch")!==-1?m.touches[0].clientX:m.clientX,{valueRange:p,offset:y}=s;let C=e.min+(g-y.left)*p/y.width;return C<e.min?C=e.min:C>e.max&&(C=e.max),C},c=m=>{if(e.readonly||e.disabled||i.dragging)return;const g=r(m);let p;if(e.range){const C=Math.min(i.leftValue,i.rightValue)+Math.abs((i.rightValue-i.leftValue)/2),b=i.leftValue>i.rightValue;g<C?i.handleType=b?"right":"left":i.handleType=b?"left":"right",p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]}else i.handleType="right",p=g;a(p)},d=m=>{const g=r(m);i.dragging=!0;let p;e.range?p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]:p=g,a(p)},h=()=>{i.handleType=null,i.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:m=>{e.readonly||e.disabled||(i.handleType=m,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(m,g)=>{if(e.showInput&&!i.dragging&&i.isInit)if(e.range&&Array.isArray(n.value)){const p=g==="left"?[m,n.value[1]]:[n.value[0],m];a(p)}else e.range||a(m)}}},Ib=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{currentValue:i,state:s,slider:l,updateSliderInfo:a,setSliderValue:r}=t,c=()=>{const h=e.max||e.max===0,u=e.min||e.min===0;h&&u&&e.max<=e.min&&console.warn("[EVUI][Slider] Max value must be greater than min value.")},d=()=>{a(),l.valueRange<=0&&(i.value=e.range?[e.min,e.min]:e.min,n("update:modelValue",i.value)),r(i.value),s.isInit=!0};o.onMounted(()=>{c(),d()})},Lb={name:"EvSlider",components:{},props:{modelValue:{type:[Number,Array],default:null},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1,validator:t=>t>0},mark:{type:Object,default:()=>{}},showStep:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},color:{type:[String,Array],default:null},tooltipFormat:{type:Function,default:null}},emits:["update:modelValue","change"],setup(){const{currentValue:t,state:e,slider:n,formatValue:i,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=Cb(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m}=kb({state:e,slider:n}),{startDrag:g,clickSlider:p,changeInput:y}=wb({currentValue:t,state:e,slider:n,updateSliderInfo:l,setSliderValue:a});return Ib({currentValue:t,state:e,slider:n,updateSliderInfo:l,setSliderValue:a}),{currentValue:t,isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m,sliderLine:s,...o.toRefs(e),...o.toRefs(n),formatValue:i,startDrag:g,clickSlider:p,changeInput:y}}},Tb={class:"ev-slider-wrapper"},Mb={ref:"sliderLine",class:"ev-slider-line"},vb={key:0,class:"ev-slider-step-wrapper"},Rb={key:2,class:"ev-slider-mark-wrapper"},Vb={class:"ev-slider-mark-label"},Eb=["innerHTML"],Wb=["innerHTML"];function Gb(t,e,n,i,s,l){const a=o.resolveComponent("ev-input-number");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":i.isColorArray,"show-mark":t.markList.length}])},[o.createElementVNode("div",Tb,[o.createElementVNode("div",Mb,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",vb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.stepList,(r,c)=>(o.openBlock(),o.createElementBlock("span",{key:`slider-step-${c}`,style:o.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):o.createCommentVNode("",!0),i.isColorArray&&n.color.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.range?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle(i.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle(i.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"ev-slider-thumb",style:o.normalizeStyle(i.rangeThumbStyle)},null,4),t.markList.length>0?(o.openBlock(),o.createElementBlock("div",Rb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.markList,(r,c)=>(o.openBlock(),o.createElementBlock("div",{key:`slider-step-${c}`,style:o.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[o.createElementVNode("span",Vb,o.toDisplayString(r.label),1)],4))),128))])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-slider-line-layer",onClick:e[0]||(e[0]=(...r)=>i.clickSlider&&i.clickSlider(...r))})],512),n.range?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-slider-handle",{dragging:t.dragging&&t.handleType==="left"}]),style:o.normalizeStyle(i.leftHandleStyle),onMousedown:e[1]||(e[1]=o.withModifiers(r=>i.startDrag("left"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.left},null,8,Eb)],38)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ev-slider-handle",{dragging:t.dragging&&t.handleType==="right"}]),style:o.normalizeStyle(i.rightHandleStyle),onMousedown:e[2]||(e[2]=o.withModifiers(r=>i.startDrag("right"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.right},null,8,Wb)],38)]),n.showInput&&!n.range?(o.openBlock(),o.createBlock(a,{key:0,modelValue:i.currentValue,"onUpdate:modelValue":e[3]||(e[3]=r=>i.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:i.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(a,{modelValue:i.currentValue[0],"onUpdate:modelValue":e[4]||(e[4]=r=>i.currentValue[0]=r),step:n.step,min:n.min,max:i.currentValue[1],"step-strictly":"",onChange:e[5]||(e[5]=r=>i.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),o.createVNode(a,{modelValue:i.currentValue[1],"onUpdate:modelValue":e[6]||(e[6]=r=>i.currentValue[1]=r),step:n.step,min:i.currentValue[0],max:n.max,"step-strictly":"",onChange:e[7]||(e[7]=r=>i.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):o.createCommentVNode("",!0)],2)}const qn=ce(Lb,[["render",Gb]]);qn.install=t=>{t.component(qn.name,qn)};const Zb={name:"EvIcon",props:{icon:{type:String,default:""},size:{type:String,default:""},color:{type:String,default:""}},emits:{click:null,"dbl-click":null,"context-menu":null},setup(t,{emit:e}){return{onClick:l=>{e("click",l)},onDblClick:l=>{e("dbl-click",l)},onContextMenu:l=>{e("context-menu",l)}}}};function Xb(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("i",{class:o.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:o.normalizeStyle({color:n.color}),onClick:e[0]||(e[0]=(...a)=>i.onClick&&i.onClick(...a)),"on:dblClick":e[1]||(e[1]=(...a)=>i.onDblClick&&i.onDblClick(...a)),onContextmenu:e[2]||(e[2]=(...a)=>i.onContextMenu&&i.onContextMenu(...a))},null,38)}const Cn=ce(Zb,[["render",Xb]]);Cn.install=t=>{t.component(Cn.name,Cn)};const Ro=6,Vo=7,Eo=4,Wo=3,Go=5,Zo=4,je=12,Nb=24,Pb=60,Bb=60,ut=12,yr=4,Xo=20,No={fullName:["January","February","March","April","May","June","July","August","September","October","November","December"],numberName:["1","2","3","4","5","6","7","8","9","10","11","12"],abbrName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],korName:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},Db={abbrUpperName:["SUN","MON","TUE","WED","THU","FRI","SAT"],abbrLowerName:["sun","mon","tue","wed","thu","fri","sat"],abbrPascalName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbrKorName:["일","월","화","수","목","금","토"]},et={DATE:"date",MONTH:"month",YEAR:"year"},os=864e5,ls=+new Date("1970-01-01 00:00:00"),xr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Sr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),Yb=(t,e)=>t.length?t.reduce((n,i)=>new Date(n).getTime()>new Date(i).getTime()?n:i):"",Ge=t=>t===null?"00":+t<10?`0${t}`:t,kn=(t,e)=>Array.from(Array(t),()=>Array(e).fill(!1)),Ob=(t,e)=>new Date(`${t}-${e}-1`).getDay(),Po=(t,e)=>{let n;switch(e){case 4:case 6:case 9:case 11:n=30;break;case 2:t%4===0&&t%100!==0||t%400===0?n=29:n=28;break;default:n=31;break}return n},ei=({year:t,month:e,date:n,hour:i,min:s,sec:l})=>i!==void 0&&s!==void 0&&l!==void 0?`${t}-${Ge(e)}-${Ge(n)} ${Ge(i)}:${Ge(s)}:${Ge(l)}`:`${t}-${Ge(e)}-${Ge(n)}`,Ze=(t,e)=>{var s,l,a,r,c,d;let n=o.unref(t);Array.isArray(n)&&(n=Yb(t));const i={year:+((s=n==null?void 0:n.split(" ")[0])==null?void 0:s.split("-")[0])||null,month:+((l=n==null?void 0:n.split(" ")[0])==null?void 0:l.split("-")[1])||null,date:+((a=n==null?void 0:n.split(" ")[0])==null?void 0:a.split("-")[2])||null,hour:+((r=n==null?void 0:n.split(" ")[1])==null?void 0:r.split(":")[0])||0,min:+((c=n==null?void 0:n.split(" ")[1])==null?void 0:c.split(":")[1])||0,sec:+((d=n==null?void 0:n.split(" ")[1])==null?void 0:d.split(":")[2])||0};return e==="year"?i.year:e==="month"?i.month:e==="date"?i.date:e==="hour"?i.hour:e==="min"?i.min:e==="sec"?i.sec:i},Cr=(t,e,n)=>t==="next"?{year:n===12?e+1:e,month:(n+1)%12||12}:{year:n===1?e-1:e,month:(n-1)%12||12},ti=(t,e,n)=>{const i=Ze(e,n);if(t){const s=t==null?void 0:t.split(":")[0],l=t==null?void 0:t.split(":")[1],a=t==null?void 0:t.split(":")[2];if(n==="hour")return s==="HH"?i:+s;if(n==="min")return l==="mm"?i:+l;if(n==="sec")return a==="ss"?i:+a}return i},Te=(t,e)=>{if(!e)return"";const n=Ge(ti(t,e,"hour")),i=Ge(ti(t,e,"min")),s=Ge(ti(t,e,"sec"));return`${e.split(" ")[0]} ${n}:${i}:${s}`},as=(t,e,n,i)=>{if(!i.length)return!1;let s=e==="main"?n:i[0],l=e==="expanded"?n:i[1],a=s,r=l;if(!n.split(" ")[1])if(t==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=i[0].split(" ")[1],d=i[1].split(" ")[1];a=`${s} ${c}`,r=`${l} ${d}`}else a=`${s} 00:00:00`,r=`${l} 23:59:59`;return a&&r&&new Date(a).getTime()>+new Date(r).getTime()},wn=t=>new Date(`${t}`).getTime(),kr=t=>{const e=10**(t.toString().length-1),n=Math.floor(t/e),i=Math.floor(t%(e*n)),s=n*e+Math.floor(i/Xo)*Xo,l=s+Xo-1;return{start:s,end:l}},Hb=()=>{var p,y,C;const{props:t}=o.getCurrentInstance(),e=(p=t.options)==null?void 0:p.timeFormat,n=o.computed(()=>["dateRange","dateTimeRange"].includes(t.mode)?["main","expanded"]:["main"]);let i;if(t.mode!=="dateMulti"&&t.mode!=="dateRange"&&t.mode!=="dateTimeRange")if(t.modelValue&&(t.modelValue.length===10&&xr.exec((y=t.modelValue)==null?void 0:y.toString())||t.modelValue.length===19&&Sr.exec((C=t.modelValue)==null?void 0:C.toString())))if(t.mode==="dateTime"&&e){const b=Te(e,t.modelValue);i=o.ref(b)}else i=o.ref(t.modelValue);else i=o.ref("");else if(Array.isArray(t.modelValue)&&t.modelValue.every(b=>!b||b.length===10&&xr.exec(b)||b.length===19&&Sr.exec(b)))if(t.mode==="dateTimeRange"&&t.modelValue.length===2&&e){const b=[];b.push(Te(e[0],t.modelValue[0])),b.push(Te(e[1],t.modelValue[1])),i=o.ref([...b])}else i=o.ref([...t.modelValue]);else i=o.ref([]);const s=()=>{t.mode==="date"&&t.modelValue&&typeof t.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type."):t.mode==="dateTime"&&t.modelValue&&typeof t.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type."):t.mode==="dateMulti"&&t.modelValue&&!Array.isArray(t.modelValue)?console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type."):t.mode==="dateRange"&&t.modelValue?Array.isArray(t.modelValue)?wn(`${t.modelValue[0]} 00:00:00`)>wn(`${t.modelValue[1]} 00:00:00`)&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type."):t.mode==="dateTimeRange"&&t.modelValue&&(Array.isArray(t.modelValue)?wn(t.modelValue[0])>wn(t.modelValue[1])&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."))};let l;const a=["dateRange","dateTimeRange"].includes(t.mode)?i.value[0]:i.value;a!=null&&a.length?l={year:Ze(a,"year"),month:Ze(a,"month"),hour:Math.floor(Ze(a,"hour")/ut)+1||1,min:Math.floor(Ze(a,"min")/ut)+1||1,sec:Math.floor(Ze(a,"sec")/ut)+1||1}:l={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};let r;if(["dateRange","dateTimeRange"].includes(t.mode)&&Array.isArray(i.value)&&i.value[1]){const b=i.value[1];r={year:Ze(b,"year"),month:Ze(b,"month")},t.mode==="dateTimeRange"&&(r.hour=Math.floor(Ze(b,"hour")/ut)+1||1,r.min=Math.floor(Ze(b,"min")/ut)+1||1,r.sec=Math.floor(Ze(b,"sec")/ut)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=o.reactive({main:l,expanded:r}),d=o.reactive({main:o.computed(()=>kr(c.main.year)),expanded:o.computed(()=>kr(c.expanded.year))}),h=o.computed(()=>No[t.monthNotation][c.main.month-1]),u=o.computed(()=>No[t.monthNotation][c.expanded.month-1]),f=o.reactive({main:h,expanded:u}),m=o.computed(()=>Db[t.dayOfTheWeekNotation]),g=o.reactive({main:et.DATE,expanded:et.DATE});return o.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:i,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:f,dayOfTheWeekList:m,selectedListType:g}},Fb=t=>{const{props:e}=o.getCurrentInstance(),{selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:s}=t,l=o.reactive({main:kn(Go,Zo),expanded:kn(Go,Zo)}),a=o.reactive({main:kn(Eo,Wo),expanded:kn(Eo,Wo)}),r=o.reactive({main:kn(Ro,Vo),expanded:kn(Ro,Vo)}),c=o.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:g=>{const p=i[g];let y=e.options.disabledDate;y&&Array.isArray(y)&&(y=g==="main"?y[0]:y[1]);const C=["dateRange","dateTimeRange"].includes(e.mode),b=ei({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),k=(je+p.month-1)%je||je,T=(p.month+1)%je||je,w=p.month===1?p.year-1:p.year,M=p.month===12?p.year+1:p.year,V=Ob(p.year,p.month),x=Po(p.month===1?p.year-1:p.year,(je+p.month-1)%je||je),S=Po(p.year,p.month);let L="";e.mode.includes("Time")&&(e.mode==="dateTime"?L=n.value:L=g==="main"?n.value[0]:n.value[1]);let I=0,v=0,W=0,E=0,G="";const R=(X,Z,N)=>{var z,_,ee;G=ei({year:v,month:W,date:E});const P=(L==null?void 0:L.split(" ")[1])??"",B=C&&!y&&as(e.mode,g,G,n.value)||+new Date(`${G} ${P}`)<ls,Y=y&&y(new Date(`${G} ${P}`))||B,H=+(g!=="main"),K=C&&n.value.length>H&&((_=(z=n.value)==null?void 0:z[H])==null?void 0:_.includes(G)),D=!Y&&(C?K:(ee=n.value)==null?void 0:ee.includes(G));r[g][Z][N]={monthType:`${X}${Y?" disabled":""}`,isToday:b===G,isSelected:D,year:v,month:W,date:E}};for(let X=0;X<Ro;X++)for(let Z=0;Z<Vo;Z++)X===0?V!==0?Z<V?(v=w,W=k,E=x-V+1+Z,R("prev",X,Z)):(I++,v=p.year,W=p.month,E=I,R("",X,Z)):(v=w,W=k,E=x-6+Z,R("prev",X,Z)):S<=I?(I++,v=M,W=T,E=I-S,R("next",X,Z)):(I++,v=p.year,W=p.month,E=I,R("",X,Z))},setCalendarMonth:g=>{let p=0;const y=new Date().getFullYear(),C=new Date().getMonth()+1,{year:b,month:k}=i[g];for(let T=0;T<Eo;T++)for(let w=0;w<Wo;w++)a[g][T][w]={label:No.abbrName[p++],value:p,today:b===y&&p===C,isSelected:p===k}},setCalendarYear:g=>{let p=s[g].start;const y=new Date().getFullYear(),C=new Date(ls).getFullYear();for(let b=0;b<Go;b++)for(let k=0;k<Zo;k++)l[g][b][k]={label:p,value:p,today:p===y,isSelected:p===i[g].year,disabled:p<C},p++},setHmsTime:()=>{var V,x;const g=(V=e.options)==null?void 0:V.timeFormat,p=(x=e.options)==null?void 0:x.disabledDate,y=Array.isArray(g)?g[0]:g,C=Array.isArray(g)?g[1]:"",b=e.mode==="dateTimeRange"?n.value[0]:n.value,k=e.mode==="dateTimeRange"?n.value[1]:"",T=Array.isArray(p)?p[0]:p,w=Array.isArray(p)?p[1]:p,M=(S,L,I)=>{const v=S==="main"?b:k,W=S==="main"?T:w;if(!v)return!1;const E=v.split(" ")[0];let G=Ze(v,"hour"),R=Ze(v,"min"),X=Ze(v,"sec");L==="hour"?G=I:L==="min"?R=I:L==="sec"&&(X=I);const Z=`${E} ${Ge(G)}:${Ge(R)}:${Ge(X)}`;return W&&W(new Date(Z))?!0:!W&&as(e.mode,S,Z,n.value)};["hour","min","sec"].forEach(S=>{let L=Bb;S==="hour"?L=Nb:S==="min"&&(L=Pb);const I=b&&b.length>0?ti(y,b,S):-1,v=k&&k.length>0?ti(C,k,S):-1;for(let W=0;W<L;W++){let E=e.mode==="dateTimeRange"&&M("main",S,W);c.main[S][W]={timeType:S,num:W,isSelected:!E&&I===W,isDisabled:E},e.mode==="dateTimeRange"&&(E=M("expanded",S,W),c.expanded[S][W]={timeType:S,num:W,isSelected:!E&&v===W,isDisabled:E})}})},getTimeInfo:(g,p,y,C)=>{const b=i[C],k=c[C],T=b[g]-1,w=p-1,M=y-1,V=T*ut+w*yr+M;return k[g][V]}}},zb=t=>{var G;const{props:e,emit:n}=o.getCurrentInstance(),i=(G=e.options)==null?void 0:G.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:u}=t,f=o.ref(""),m=o.ref(null),g=Array.isArray(i)?i[0]:i,p=Array.isArray(i)?i[1]:"",y={main:{hour:g&&g.split(":")[0]!=="HH",min:g&&g.split(":")[1]!=="mm",sec:g&&g.split(":")[2]!=="ss"},expanded:{hour:p&&p.split(":")[0]!=="HH",min:p&&p.split(":")[1]!=="mm",sec:p&&p.split(":")[2]!=="ss"}},C=(R,X)=>{const Z=l[R],{year:N,month:P,hour:B,min:Y,sec:H}=X;N&&(Z.year=N),P&&(Z.month=P),B&&(Z.hour=B),Y&&(Z.min=Y),H&&(Z.sec=H)},b=R=>{R==null||R.forEach((X,Z)=>{const N=Z===0?"main":"expanded";C(N,{year:Ze(X,"year"),month:Ze(X,"month"),hour:Math.floor(Ze(X,"hour")/ut)+1,min:Math.floor(Ze(X,"min")/ut)+1,sec:Math.floor(Ze(X,"sec")/ut)+1}),r(N)})},k=(R,X)=>{const Z=u[R]===et.MONTH?1:20,N=X==="prev"?-Z:Z,P=new Date(ls).getFullYear(),B=l[R].year+N;l[R].year=B<P?P:B},T=(R,X)=>{const Z=l[R];if(X==="prev"){const N=new Date(ls).getFullYear();if(Z.year===N&&Z.month===1)return;Z.month===1?(Z.year-=1,Z.month=12):Z.month-=1}else Z.month===12?(Z.year+=1,Z.month=1):Z.month+=1},w=(R,X)=>{switch(u[R]){case et.DATE:{T(R,X),r(R);break}case et.MONTH:k(R,X),c(R);break;case et.YEAR:k(R,X),d(R);break}},M=(R,X)=>{X===et.DATE?r(R):X===et.MONTH?c(R):X===et.YEAR&&d(R),u[R]=X},V=(R,X)=>{const{value:Z}=X;X.disabled||(u[R]===et.YEAR?(l[R].year=Z,u[R]=et.MONTH,c(R)):(l[R].month=Z,u[R]=et.DATE,r(R)))},x=(R,X)=>{var U,ne,Q,$;const{year:Z,month:N,date:P,monthType:B}=X,Y=ei({year:Z,month:N,date:P}),H=e.modelValue?(Array.isArray(e.modelValue)?((U=e.modelValue)==null?void 0:U.map(j=>j==null?void 0:j.split(" ")[0]))??[]:e.modelValue.split(" ")[0]).includes(Y):!1;let K=e.options.disabledDate;if(K&&Array.isArray(K)&&(K=R==="main"?K[0]:K[1]),K&&K(new Date(Y))&&!H)return;if(!K&&["dateRange","dateTimeRange"].includes(e.mode)&&as(e.mode,R,Y,s.value))return;const D=l[R],z=(je+D.month-1)%je||je,_=D.month===1?D.year-1:D.year,ee=(D.month+1)%je||je,J=D.month===12?D.year+1:D.year,te=()=>{B.includes("prev")?(D.year=_,D.month=z):B.includes("next")&&(D.year=J,D.month=ee)};switch(e.mode){case"date":n("update:modelValue",Y);break;case"dateTime":{const he=!!((ne=s.value)!=null&&ne.split(" ")[1])?(Q=s.value)==null?void 0:Q.split(" ")[1]:"00:00:00",me=Te(i,`${Y} ${he}`);n("update:modelValue",me);break}case"dateMulti":{const j=e.options.multiType,he=e.options.multiDayLimit;if(j==="date"){const me=s.value.indexOf(Y);me>-1?(s.value.splice(me,1),n("update:modelValue",[...s.value])):s.value.length<he&&(s.value.push(Y),te(),n("update:modelValue",[...s.value]))}else if(j==="week"||j==="weekday"){const me=j==="week"?7:5,ae=j==="week"?6:5,xe=new Date(`${Y} 00:00:00`),be=xe.getDay(),oe=ae-be,re=xe.getTime()+os*oe;for(let pe=0;pe<me;pe++){const Ie=new Date(re-pe*os).getFullYear(),Ee=new Date(re-pe*os).getMonth()+1,kt=new Date(re-pe*os).getDate(),Vt=`${Ie}-${Ge(Ee)}-${Ge(kt)}`;if(pe===0)if(s.value.includes(Vt)){s.value.splice(0);break}else s.value.splice(0),te();(!K||!K(new Date(Vt)))&&s.value.unshift(Vt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let j=[...s.value];if(!s.value.length)j=[Y,Y];else{const he=+(R==="expanded");j[he]=Y}n("update:modelValue",j);break}case"dateTimeRange":{let j=[...s.value];if(j.length){const he=+(R==="expanded"),me=(($=j[he])==null?void 0:$.split(" ")[1])||"00:00:00";let ae=`${Y} ${me}`;i&&i.length&&(ae=Te(i[he],ae)),j[he]=ae}else{let he=`${Y} 00:00:00`,me=`${Y} 00:00:00`;i&&i.length&&(he=Te(i[0],he),me=Te(i[1],me)),j=[he,me]}n("update:modelValue",j);break}}},S=(R,X,Z)=>{if(y[R][X])return;const N=l[R],P=1;X==="hour"?Z==="down"&&N.hour<2?N.hour++:Z==="up"&&N.hour>P&&N.hour--:X==="min"?Z==="down"&&N.min<5?N.min++:Z==="up"&&N.min>P&&N.min--:X==="sec"&&(Z==="down"&&N.sec<5?N.sec++:Z==="up"&&N.sec>P&&N.sec--)},L=(R,X,Z,N)=>{var ne;if(y[R][X])return;const P=l[R],B=a[R],Y=P[X]-1,H=Z-1,K=N-1,D=Y*ut+H*yr+K;if((ne=B[X][D])!=null&&ne.isDisabled)return;const z=new Date,_={year:z.getFullYear(),month:z.getMonth()+1,date:z.getDate()};let ee=!0,J=[];const te=()=>{let Q;return X==="hour"?Q=`${Ge(D)}:00:00'`:X==="min"?Q=`00:${Ge(D)}:00`:X==="sec"&&(Q=`00:00:${Ge(D)}`),`${ei(_)} ${Q}`},U=Q=>{let ae=11;return X==="min"?ae=14:X==="sec"&&(ae=17),`${Q==null?void 0:Q.substr(0,ae)}${Ge(D)}${Q==null?void 0:Q.substr(ae+2)}`};if(e.mode==="dateTime"){let Q;e.modelValue?Q=Te(i,U(e.modelValue)):(ee=!1,Q=Te(i,te())),n("update:modelValue",Q),J.push(Q)}else{const Q=R!=="main"|0;let $=[...s.value];if(e.modelValue.length){let j=U(e.modelValue[Q]);i&&i.length&&(j=Te(i[Q],j)),$[Q]=j}else{const j=te();$=[j,j],i&&i.length&&($=[...$.map((he,me)=>Te(i[me],he))]),ee=!1,J=$}n("update:modelValue",$)}h(),ee||b(J)},I=(R,X)=>{w(R,X.deltaY>0?"next":"prev")},v=(R,X,Z)=>{y[R][X]||S(R,X,Z.deltaY>0?"down":"up")},W=ss((R,X)=>{const Z=X.target.tagName==="TD"?X.target:X.target.parentElement,N=Z.classList.contains("disabled"),P=Z.classList.contains("prev"),B=Z.classList.contains("next");if(Z.classList.length>0&&!N){const Y=l[R];let H={year:+Y.year,month:+Y.month,date:X.target.innerText};P?H={...H,...Cr("prev",H.year,H.month)}:B&&(H={...H,...Cr("next",H.year,H.month)});const K=f.value,D=ei({year:H.year,month:H.month,date:H.date});wn(D)<wn(K)?(s.value[0]=D,s.value[1]=K):(s.value[0]=K,s.value[1]=D),r("main"),r("expanded")}},10),E=R=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode),Z=e.options.disabledDate;if(X){const[N,P]=s.value;let[B,Y]=[Z,Z];if(Z&&Array.isArray(Z)&&([B,Y]=Z),R[0]&&R[0]!==N&&B&&B(new Date(R[0])))return!0;if(R[1]&&R[1]!==P&&Y&&Y(new Date(R[1])))return!0;if(!Z&&as(e.mode,"main",R[0],R))return!0}else{if(e.mode==="dateMulti")return R.some(N=>Z&&Z(new Date(N)));if(Z&&Z(new Date(R)))return!0}return!1};return o.watch(()=>e.modelValue,R=>{if(E(R)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode);if(s.value=X?[...R]:R,e.mode==="dateRange")b(R);else if(e.mode.includes("Time")){let Z=[];e.mode==="dateTime"?Z=[R]:e.mode==="dateTimeRange"&&(Z=R),b(Z),h()}else e.mode==="date"&&b([R])}),{clickYearMonthBtn:M,clickPrevNextBtn:w,clickDate:x,clickYearMonth:V,clickHmsBtn:S,clickTime:L,wheelMonth:I,wheelTime:v,calendarEventName:m,onMousemoveDate:W,preventTimeEventType:y}},Ab={name:"EvCalendar",props:{modelValue:{type:[String,Array],default:"",validator:t=>{const e=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(t)?t.every(i=>!!(!i||i.length===10&&e.exec(i))||i.length===19&&n.exec(i)):!!(!t||t.length===10&&e.exec(t)||t.length===19&&n.exec(t))}},mode:{type:String,default:"date",validator:t=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(t)!==-1},monthNotation:{type:String,default:"fullName",validator:t=>["fullName","abbrName","numberName","korName"].indexOf(t)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:t=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(t)!==-1},options:{type:Object,default:()=>({multiType:"date",limit:1}),validator:({multiType:t,multiDayLimit:e,disabledDate:n,timeFormat:i})=>{const s=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!t||["weekday","week","date"].indexOf(t)!==-1)&&(!e||typeof e=="number"&&e>0)&&(!n||typeof n=="function"||Array.isArray(n))&&Array.isArray(i)?i.every(l=>!!(!l||s.exec(l))):!!(!i||s.exec(i))}}},emits:{"update:modelValue":[Array,String]},setup(t){const{calendarList:e,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=Hb(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p,getTimeInfo:y}=Fb({selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:a}),{clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:T,clickHmsBtn:w,clickTime:M,wheelMonth:V,wheelTime:x,calendarEventName:S,onMousemoveDate:L,preventTimeEventType:I}=zb({selectedValue:n,calendarPageInfo:i,calendarTimeTableInfo:u,selectedListType:r,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p});return f("main"),["dateRange","dateTimeRange"].includes(t.mode)&&f("expanded"),["dateTime","dateTimeRange"].includes(t.mode)&&p(),{calendarList:e,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,getTimeInfo:y,clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:T,clickHmsBtn:w,clickTime:M,wheelMonth:V,wheelTime:x,calendarEventName:S,onMousemoveDate:L,preventTimeEventType:I}}},Kb={class:"ev-calendar-wrapper"},_b={class:"ev-calendar-date-area"},Ub={class:"ev-calendar-header"},Jb=["onClick"],jb={class:"ev-calendar-year-month-wrapper"},Qb={key:0,class:"ev-calendar-year-range"},$b=["onClick"],qb=["onClick"],ey=["onClick"],ty={class:"ev-calendar-body"},ny=["onWheel"],iy=["onClick"],sy=["onWheel"],oy=["onClick"],ly={key:2,class:"ev-calendar-selector-btn-wrapper"},ay={key:0,class:"ev-calendar-time-area"},ry={key:0,class:"ev-calendar-time-area-disabled"},cy={class:"ev-calendar-time-side"},dy={class:"ev-calendar-time-center"},hy=["onWheel"],uy=["onClick"],fy={class:"ev-calendar-time-side"},my=["onClick"];function py(t,e,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",Kb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",_b,[o.createElementVNode("div",Ub,[o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"prev")},[...e[0]||(e[0]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,Jb),o.createElementVNode("div",jb,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",Qb,o.toDisplayString(i.calendarYearRangeInfo[r].start+" - "+i.calendarYearRangeInfo[r].end),1)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>i.clickYearMonthBtn(r,"year")},o.toDisplayString(i.calendarPageInfo[r].year),9,$b),i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>i.clickYearMonthBtn(r,"month")},o.toDisplayString(i.calendarMonth[r]),9,qb)):o.createCommentVNode("",!0)],64))]),o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"next")},[...e[1]||(e[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,ey)]),o.createElementVNode("div",ty,[i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[o.createElementVNode("thead",null,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.dayOfTheWeekList,c=>(o.openBlock(),o.createElementBlock("th",{key:c},o.toDisplayString(c),1))),128))])]),o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>i.clickDate(r,d)},{[o.toHandlerKey(`${i.calendarEventName}`)]:h=>i.onMousemoveDate(r,h)}),[o.createElementVNode("div",null,[o.createElementVNode("span",null,o.toDisplayString(d.date),1)])],16,iy))),128))]))),128))],40,ny)])):(o.openBlock(),o.createElementBlock("table",{key:1,class:o.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${i.selectedListType[r]}`])},[o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.selectedListType[r]==="month"?i.calendarMonthTableInfo[r]:i.calendarYearTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",{key:d.value,onClick:h=>i.clickYearMonth(r,d)},[o.createElementVNode("div",{class:o.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},o.toDisplayString(d.label),3)],8,oy))),128))]))),128))],40,sy)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",ly,[o.createVNode(a,{onClick:c=>i.clickYearMonthBtn(r,"date")},{default:o.withCtx(()=>[...e[2]||(e[2]=[o.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(o.openBlock(),o.createElementBlock("div",ay,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",ry)):o.createCommentVNode("",!0),o.createElementVNode("div",cy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["HOUR","MIN","SEC"],c=>o.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},o.toDisplayString(c),1)),64))]),o.createElementVNode("div",dy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>o.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[o.createElementVNode("tbody",{onWheel:o.withModifiers(d=>i.wheelTime(r,c,d),["prevent"])},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,d=>o.createElementVNode("tr",{key:`${c}_${d}_tr`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(4,h=>o.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:o.normalizeClass(["ev-calendar-time-td",{selected:i.getTimeInfo(c,d,h,r).isSelected},{disabled:i.preventTimeEventType[r][c]||i.getTimeInfo(c,d,h,r).isDisabled}]),onClick:u=>i.clickTime(r,c,d,h)},[o.createElementVNode("div",null,o.toDisplayString(i.getTimeInfo(c,d,h,r).num),1)],10,uy)),64))])),64))],40,hy)])),64))]),o.createElementVNode("div",fy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${c}_btn_area`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],d=>o.createElementVNode("div",{key:`${c}_${d}_btn`,class:o.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:i.preventTimeEventType[r][c]}]),onClick:h=>i.clickHmsBtn(r,c,d)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,my)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const ni=ce(Ab,[["render",py]]);ni.install=t=>{t.component(ni.name,ni)};const gy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),by=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),yy=()=>{var f;const{props:t,emit:e}=o.getCurrentInstance(),n=(f=t.options)==null?void 0:f.timeFormat,i=["dateTimeRange","dateRange","dateMulti"].includes(t.mode),s=m=>{let g;if(t.mode==="dateTime")g=Te(n,m);else if(t.modelValue.length){const[p,y]=n;g=[Te(p,m[0]),Te(y,m[1])]}return g},l=o.computed({get:()=>t.modelValue?["dateTime","dateTimeRange"].includes(t.mode)&&n?s(t.modelValue):i?[...t.modelValue]:t.modelValue:t.mode==="date"||t.mode==="dateTime"?"":[],set:m=>{if(["dateTime","dateTimeRange"].includes(t.mode)&&n){e("update:modelValue",s(m));return}e("update:modelValue",m)}});let a;if(["dateTimeRange","dateTime"].includes(t.mode)&&n)if(t.mode==="dateTimeRange"&&Array.isArray(t.modelValue)&&t.modelValue.length===2){const[m,g]=t.modelValue,[p,y]=n;t.modelValue=[Te(p,m),Te(y,g)],a=o.ref([...t.modelValue])}else t.mode==="dateTime"&&t.modelValue?a=o.ref(Te(n,t.modelValue)):a=o.ref(t.modelValue);else a=o.ref(i?[...t.modelValue]:t.modelValue);const r=m=>{const g=b=>!!(b.length===10&&gy.exec(b)),p=b=>!!(b.length===19&&by.exec(b)),y=b=>{const k=b.split(" ")[0],T=+k.split("-")[0],w=+k.split("-")[1],M=+k.split("-")[2],V=Po(T,w);return+M<=V&&T>=new Date(0).getFullYear()};let C=!0;t.mode==="date"?C=g(m)&&y(m):t.mode==="dateTime"?C=p(m)&&y(m):t.mode==="dateRange"?C=m.every(b=>g(b)&&y(b)):t.mode==="dateTimeRange"&&(C=m.every(b=>p(b)&&y(b))),C&&(l.value=i?[...m]:m),a.value=i?[...l.value]:l.value},c=o.computed(()=>t.mode==="date"||t.mode==="dateTime"?l.value:l.value.length);return{mv:l,currentValue:a,isClearableIcon:c,validateValue:r,removeAllMv:()=>{t.mode==="date"||t.mode==="dateTime"?l.value=null:(l.value.splice(0),l.value=[...l.value])},changeMv:async m=>{await o.nextTick(),e("change",l.value,m)},removeMv:m=>{if(!t.disabled){const g=l.value.indexOf(m);l.value.splice(g,1),l.value=[...l.value]}}}},xy=()=>{const{props:t}=o.getCurrentInstance(),e=o.ref(!1),n=o.ref(null),i=o.ref(null),s=o.ref(null),l=o.ref(null),a=o.reactive({top:null,right:null,left:null}),r=async()=>{var k,T;await o.nextTick();const h=(k=i.value)==null?void 0:k.getBoundingClientRect(),u=(T=s.value)==null?void 0:T.getBoundingClientRect(),f=h.height,m=h.y,g=h.x,p=u.height,y=u.width,C=document.documentElement.clientHeight,b=document.documentElement.clientWidth;C<m+f+p?(a.top=`-${p}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${f}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:e,datePicker:n,datePickerWrapper:i,dropbox:s,itemWrapper:l,dropboxPosition:a,clickSelectInput:async()=>{t.disabled||(e.value=t.enableTextInput?!0:!e.value,e.value&&await r())},clickOutsideDropbox:()=>{e.value=!1},changeDropboxPosition:r}},Sy=t=>{var m;const{props:e}=o.getCurrentInstance(),{mv:n,currentValue:i,clickOutsideDropbox:s}=t,l=o.reactive([]);(m=e.shortcuts)==null||m.forEach(({value:g,label:p,shortcutDate:y})=>{l.push({key:g,label:p,shortcutDate:y,isActive:!1})});const a=()=>{const g=l.find(p=>p.isActive);g&&(g.isActive=!1)},r=g=>{const p=l.find(y=>y.key===g);p&&(p.isActive=!0)},c=g=>g===null?"00":+g<10?`0${g}`:g,d=g=>{const p=g?new Date(g):new Date,y=p.getFullYear(),C=p.getMonth()+1,b=p.getDate();return`${y}-${c(C)}-${c(b)}`},h=g=>{const p=g?new Date(g):new Date,y=p.getHours(),C=p.getMinutes(),b=p.getSeconds();return`${d(p)} ${c(y)}:${c(C)}:${c(b)}`},u=()=>{var y,C;a();const g=["dateRange","dateTimeRange"].includes(e.mode);if(!l.length||e.mode==="dateMulti"&&((y=e.options)==null?void 0:y.multiType)!=="date"||g&&!n.value.length||!g&&!n.value)return;let p;if(g){const b=(C=e.options)==null?void 0:C.timeFormat,[k,T]=n.value;let w;e.mode==="dateTimeRange"&&(b!=null&&b.length)?w=l.find(({shortcutDate:M})=>{const[V,x]=M(),[S,L]=b,I=Te(S,h(V)),v=Te(L,h(x)),W=I===h(k),E=v===h(T);return W&&E}):w=l.find(({shortcutDate:M})=>{const[V,x]=M(),S=e.mode==="dateTimeRange"?h:d,L=S(V)===S(k),I=S(x)===S(T);return L&&I}),p=w==null?void 0:w.key}else{const b=e.mode==="dateTime"?h:d,k=b(n.value),T=l.find(({shortcutDate:w})=>b(w())===k);p=T==null?void 0:T.key}p&&r(p)},f=g=>{var k;const p=["dateRange","dateTimeRange"].includes(e.mode),y=l.find(({key:T})=>T===g);if(!y)return;const C=y.shortcutDate,b=(k=e.options)==null?void 0:k.timeFormat;if(p){const[T,w]=C();if(e.mode==="dateTimeRange")if(b!=null&&b.length){const[M,V]=b;n.value=[Te(M,h(T)),Te(V,h(w))]}else n.value=[h(T),h(w)];else n.value=[d(T),d(w)]}else{const T=C();n.value=e.mode==="dateTime"?Te(b,h(T)):d(T)}a(),r(g)};return o.watch(()=>e.modelValue,g=>{var p,y;if(u(),!(e.mode==="dateMulti"&&((p=e==null?void 0:e.options)==null?void 0:p.multiType)==="date"&&((y=e==null?void 0:e.options)==null?void 0:y.multiDayLimit)>g.length)){if(e.mode==="dateRange"||e.mode==="dateTimeRange"){i.value=[...g];return}else if(e.mode==="dateTime"){i.value=g;return}i.value=g,s()}}),{usedShortcuts:l,clickShortcut:f,setActiveShortcut:u}},Cy={name:"EvDatePicker",directives:{clickoutside:Ad},props:{modelValue:{type:[String,Array],default:"",validator:t=>{const e=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(t)?t.every(i=>!!(!i||i.length===10&&e.exec(i))||i.length===19&&n.exec(i)):!!(!t||t.length===10&&e.exec(t)||t.length===19&&n.exec(t))}},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},enableTextInput:{type:Boolean,default:!1},mode:{type:String,default:"date",validator:t=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(t)!==-1},monthNotation:{type:String,default:"fullName",validator:t=>["fullName","abbrName","numberName","korName"].indexOf(t)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:t=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(t)!==-1},options:{type:Object,default:()=>({type:"date",limit:1,tagShorten:!1}),validator:({multiType:t,multiDayLimit:e,disabledDate:n,tagShorten:i,timeFormat:s})=>{const l=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!t||["weekday","week","date"].indexOf(t)!==-1)&&(!e||typeof e=="number"&&e>0)&&(!n||typeof n=="function"||Array.isArray(n))&&(i===void 0||typeof i=="boolean")&&Array.isArray(s)?s.every(a=>!!(!a||l.exec(a))):!!(!s||l.exec(s))}},shortcuts:{type:Array,default:()=>[],validator:t=>t.length?t.every(({shortcutDate:e})=>{if(typeof e!="function")return!1;const n=e();return Array.isArray(n)&&n.every(i=>i instanceof Date)&&n[0]<=n[1]||typeof n=="object"&&n instanceof Date}):!0}},emits:{"update:modelValue":[Array,String]},setup(){const{mv:t,currentValue:e,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a}=yy(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p}=xy(),{usedShortcuts:y,clickShortcut:C,setActiveShortcut:b}=Sy({mv:t,currentValue:e,clickOutsideDropbox:g});return b(),{mv:t,currentValue:e,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p,usedShortcuts:y,clickShortcut:C}}},ky={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},wy=["placeholder","readonly","disabled"],Iy=["placeholder","disabled"],Ly={class:"ev-tag-name"},Ty=["onClick"],My={key:0,class:"ev-select-tag num"},vy={class:"ev-tag-name"},Ry={class:"ev-select-tag num"},Vy={class:"ev-tag-name"},Ey={class:"ev-date-picker-dropbox-wrapper"},Wy={key:0,class:"ev-date-picker-dropbox__button-layout"},Gy={key:1,class:"ev-date-picker-dropbox__divider"};function Zy(t,e,n,i,s,l){const a=o.resolveComponent("ev-button"),r=o.resolveComponent("ev-button-group"),c=o.resolveComponent("ev-calendar"),d=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"datePicker",class:o.normalizeClass(["ev-date-picker",{disabled:t.$props.disabled}])},[o.createElementVNode("div",ky,[t.$props.mode==="date"||t.$props.mode==="dateTime"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e[15]||(e[15]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=h=>i.currentValue=h),type:"text",class:o.normalizeClass(["ev-input",{readonly:!t.$props.enableTextInput}]),placeholder:t.$props.placeholder,readonly:!t.$props.enableTextInput,disabled:t.$props.disabled,onClick:e[1]||(e[1]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h)),onKeydown:e[2]||(e[2]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:e[3]||(e[3]=h=>i.validateValue(i.currentValue))},null,42,wy),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])],64)):t.$props.mode==="dateMulti"||!t.$props.enableTextInput?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:e[4]||(e[4]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[e[18]||(e[18]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:t.$props.placeholder,disabled:t.$props.disabled},null,8,Iy),t.$props.mode==="dateMulti"&&(t.$props.options.multiType==="date"||!t.$props.options.tagShorten)?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.mv,(h,u)=>(o.openBlock(),o.createElementBlock("div",{key:`${h}_${u}`,class:o.normalizeClass(["ev-select-tag",{num:t.$props.options.multiType!=="date"}])},[o.createElementVNode("span",Ly,o.toDisplayString(h),1),t.$props.options.multiType==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:o.withModifiers(f=>[i.removeMv(h),i.changeDropboxPosition()],["stop"])},[...e[16]||(e[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Ty)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",My,[o.createElementVNode("span",vy,o.toDisplayString(i.mv[0]),1)])):o.createCommentVNode("",!0),i.mv[i.mv.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e[17]||(e[17]=o.createElementVNode("div",{class:"ev-select-tag num"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.createElementVNode("div",Ry,[o.createElementVNode("span",Vy,o.toDisplayString(i.mv[i.mv.length-1]),1)])],64)):o.createCommentVNode("",!0)],64))])):(o.openBlock(),o.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:e[11]||(e[11]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[e[20]||(e[20]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[5]||(e[5]=h=>i.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:e[6]||(e[6]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:e[7]||(e[7]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[0],void 0,{trim:!0}]]),i.currentValue[i.currentValue.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e[19]||(e[19]=o.createElementVNode("div",{class:"ev-date-picker-range-separator"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[8]||(e[8]=h=>i.currentValue[i.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:e[9]||(e[9]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:e[10]||(e[10]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[i.currentValue.length-1],void 0,{trim:!0}]])],64)):o.createCommentVNode("",!0)])),t.$props.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:e[12]||(e[12]=o.withModifiers(h=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...e[21]||(e[21]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",Ey,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-date-picker-dropdown",t.$props.mode]),style:o.normalizeStyle(i.dropboxPosition)},[i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",Wy,[i.usedShortcuts.length===1?(o.openBlock(),o.createBlock(a,{key:0,type:i.usedShortcuts[0].isActive?"primary":"default",onClick:e[13]||(e[13]=h=>i.clickShortcut(i.usedShortcuts[0].key))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.usedShortcuts[0].label),1)]),_:1},8,["type"])):(o.openBlock(),o.createBlock(r,{key:1},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.usedShortcuts,h=>(o.openBlock(),o.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:u=>i.clickShortcut(h.key)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):o.createCommentVNode("",!0),i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",Gy)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass({"ev-date-picker-dropbox__calendar":i.usedShortcuts.length})},[o.createVNode(c,{key:"fromCalendar",modelValue:i.mv,"onUpdate:modelValue":e[14]||(e[14]=h=>i.mv=h),mode:t.$props.mode,"month-notation":t.$props.monthNotation,"day-of-the-week-notation":t.$props.dayOfTheWeekNotation,options:t.$props.options},null,8,["modelValue","mode","month-notation","day-of-the-week-notation","options"])],2)],6)):o.createCommentVNode("",!0)])],512)],2)),[[d,i.clickOutsideDropbox]])}const ii=ce(Cy,[["render",Zy]]);ii.install=t=>{t.component(ii.name,ii)};const Xy={name:"EvMessage",props:{type:{type:String,default:"info",validator:t=>["info","success","warning","error"].includes(t)},message:{type:String,default:""},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!1},iconClass:{type:String,default:""},onClose:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(t,e){const n=o.reactive({timer:null,isShow:!0}),i=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,t.onClose&&t.onClose(),i(),t.unmount&&setTimeout(t.unmount,1e3)},l=()=>{t.duration>0&&(n.timer=setTimeout(()=>{n.isShow&&s()},t.duration))},a=c=>{c.keyCode===27&&n.isShow&&s()},r=()=>{s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),i()}),e.expose({hide:r}),{startTimer:l,clearTimer:i,closeMsg:s,...o.toRefs(n),hide:r}}},Ny={key:0,class:"ev-message-icon"},Py=["innerHTML"],By={key:2,class:"ev-message-content"};function Dy(t,e,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-message-modal"},[o.createVNode(o.Transition,{name:"ev-message-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:e[1]||(e[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:e[2]||(e[2]=(...a)=>i.startTimer&&i.startTimer(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Ny,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,Py)):(o.openBlock(),o.createElementBlock("div",By,o.toDisplayString(n.message),1)),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-message-close",onClick:e[0]||(e[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...e[3]||(e[3]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,t.isShow]])]),_:1})])}const Yy=ce(Xy,[["render",Dy]]),Oy=o.defineComponent(Yy),wr="ev-message-modal",Ir=document.createElement("div");Ir.id=wr;const rs=(t={})=>{document.getElementById(wr)||document.body.appendChild(Ir);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof t=="string"?{message:t,unmount:i}:{...t,unmount:i},l=o.h(Oy,s);return o.render(l,n),l.component.exposed};rs.install=t=>{const e=t.config.globalProperties;e.$message=rs};const Hy={name:"EvNotification",props:{type:{type:String,default:"info",validator:t=>["info","success","warning","error"].includes(t)},title:{type:String,default:""},message:{type:String,default:""},position:{type:String,default:"top-right",validator:t=>["top-left","top-right","bottom-left","bottom-right"].includes(t)},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},iconClass:{type:String,default:""},onClose:{type:Function,default:null},onClick:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(t){const e=o.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(e.timer),e.timer=null},i=r=>{r.target.className!=="ev-notification-close"&&t.onClick&&t.onClick()},s=()=>{e.isShow=!1,t.onClose&&t.onClose(),n(),t.unmount&&setTimeout(t.unmount,1e3)},l=()=>{t.duration>0&&(e.timer=setTimeout(()=>{e.isShow&&s()},t.duration))},a=r=>{r.keyCode===27&&e.isShow&&s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:i,closeMsg:s,...o.toRefs(e)}}},Fy={key:0,class:"ev-notification-icon"},zy={class:"ev-notification-content"},Ay={key:0,class:"title"},Ky=["innerHTML"],_y={key:2,class:"message"};function Uy(t,e,n,i,s,l){return o.openBlock(),o.createBlock(o.Transition,{name:"ev-notification-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["ev-notification",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-click":!!n.onClick}]),onMouseenter:e[1]||(e[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:e[2]||(e[2]=(...a)=>i.startTimer&&i.startTimer(...a)),onClick:e[3]||(e[3]=(...a)=>i.clickMsg&&i.clickMsg(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Fy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",zy,[n.title?(o.openBlock(),o.createElementBlock("p",Ay,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,Ky)):(o.openBlock(),o.createElementBlock("p",_y,o.toDisplayString(n.message),1))]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:e[0]||(e[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...e[4]||(e[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,t.isShow]])]),_:1})}const Jy=ce(Hy,[["render",Uy]]),jy=o.defineComponent(Jy),Lr="ev-notification-modal",cs=document.createElement("div");cs.id=Lr;const Qy=["top-left","top-right","bottom-left","bottom-right"],ds=(t={})=>{const e=t.position||"top-right";if(!Qy.includes(e)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(Lr)||document.body.appendChild(cs);let i=cs.getElementsByClassName(`modal-${e}`);i.length?i=i[0]:(i=document.createElement("div"),i.classList.add(`modal-${e}`),cs.appendChild(i));const l=document.createElement("div"),a=()=>o.render(null,l),r=typeof t=="string"?{message:t,unmount:a}:{...t,unmount:a},c=o.h(jy,r);o.render(c,l),i.appendChild(c.el)};ds.install=t=>{const e=t.config.globalProperties;e.$notify=ds};const $y={name:"EvMessageBox",components:{EvButton:fn},props:{type:{type:String,default:"",validator:t=>["","info","success","warning","error"].includes(t)},title:{type:String,default:""},message:{type:[String,Array],default:""},iconClass:{type:String,default:""},onClose:{type:Function,default:null},showClose:{type:Boolean,default:!0},showConfirmBtn:{type:Boolean,default:!0},showCancelBtn:{type:Boolean,default:!0},confirmBtnText:{type:String,default:"OK"},cancelBtnText:{type:String,default:"Cancel"},closeOnClickModal:{type:Boolean,default:!0},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null},focusable:{type:Boolean,default:!1}},setup(t){const e=o.ref(null),n=o.reactive({isShow:!0,iconClass:""}),i=c=>{if(!t.closeOnClickModal&&c==="modal")return;const d=c==="modal"?"cancel":c;n.isShow=!1,t.onClose&&t.onClose(d),t.unmount&&setTimeout(t.unmount,1e3)},s=c=>{c.keyCode===27&&n.isShow&&i()},l=c=>{switch(c){case"success":return"ev-icon-arrow-check";case"warning":return"ev-icon-warning2";case"error":return"ev-icon-warning3";case"info":default:return"ev-icon-info2"}},a=()=>{t.iconClass?n.iconClass=t.iconClass:t.type&&(n.iconClass=l(t.type))},r=c=>{if(!t.focusable)return!1;switch(c){case"confirmBtn":return t.showConfirmBtn;case"cancelBtn":return!t.showConfirmBtn&&t.showCancelBtn;case"messagebox":return!t.showConfirmBtn&&!t.showCancelBtn;default:return!1}};return o.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&e.value.focus()}),o.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:i,...o.toRefs(n),msgRef:e,hasFocus:r}}},qy={key:0,class:"ev-message-box-icon"},ex={class:"ev-message-box-content"},tx={key:0,class:"ev-message-box-title"},nx=["innerHTML"],ix={key:2,class:"ev-message-box-message"},sx={class:"ev-message-box-btn"};function ox(t,e,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"ev-message-box-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{id:"ev-message-box-modal",onClick:e[3]||(e[3]=o.withModifiers(r=>i.closeMsg("modal"),["self"])),onWheel:o.withModifiers(()=>{},["stop","prevent"])},[o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message-box",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-title":!!n.title}]),tabindex:"-1"},[n.iconClass?(o.openBlock(),o.createElementBlock("span",qy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",ex,[n.title?(o.openBlock(),o.createElementBlock("p",tx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,nx)):(o.openBlock(),o.createElementBlock("p",ix,o.toDisplayString(n.message),1))]),o.createElementVNode("div",sx,[n.showCancelBtn?(o.openBlock(),o.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":i.hasFocus("cancelBtn"),onClick:e[0]||(e[0]=r=>i.closeMsg("cancel"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0),n.showConfirmBtn?(o.openBlock(),o.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":i.hasFocus("confirmBtn"),onClick:e[1]||(e[1]=r=>i.closeMsg("ok"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0)]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:e[2]||(e[2]=r=>i.closeMsg("cancel"))},[...e[4]||(e[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],2)],544),[[o.vShow,t.isShow]])]),_:1})])}const lx=ce($y,[["render",ox]]),ax=o.defineComponent(lx),hs=(t={})=>{const e=document.createElement("div"),n=()=>o.render(null,e),i=typeof t=="string"?{message:t,unmount:n}:{...t,unmount:n},s=o.h(ax,i);o.render(s,e)};hs.install=t=>{const e=t.config.globalProperties;e.$messagebox=hs};const Tr=(t,e)=>Array.from(Array(t),()=>Array(e).fill(!1)),rx=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.computed({get:()=>t.modelValue.length!==t.rowLabels.length||!t.modelValue[0]||t.modelValue[0].length!==t.colLabels.length?Tr(t.rowLabels.length,t.colLabels.length):t.modelValue,set:s=>{e("update:modelValue",s),e("change",s)}});return{mv:n,validateValue:()=>{(t.modelValue.length!==t.rowLabels.length||!t.modelValue[0]||t.modelValue[0].length!==t.colLabels.length)&&(n.value=[...Tr(t.rowLabels.length,t.colLabels.length)])}}},cx=t=>{const{mv:e}=t,n=o.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),i=(h,u)=>{if(n.dragCol===null||n.dragRow===null)return{};const f=n.startRow<n.dragRow?n.startRow:n.dragRow,m=n.startRow>n.dragRow?n.startRow:n.dragRow,g=n.startCol<n.dragCol?n.startCol:n.dragCol,p=n.startCol>n.dragCol?n.startCol:n.dragCol;if(f>h||m<h||g>u||p<u)return{};const y="2px solid #5292F7";let C={};return h===f&&(C={...C,"border-top":y}),h===m&&(C={...C,"border-bottom":y}),u===g&&(C={...C,"border-left":y}),u===p&&(C={...C,"border-right":y}),C},s=(h,u)=>{n.startRow=h,n.startCol=u,n.dragRow=h,n.dragCol=u,n.dragEventName="mousemove"},l=(h,u)=>{if(!n.dragEventName)return;n.endRow=h,n.endCol=u,n.dragEventName=null;const f=[...e.value],m=n.startRow<n.endRow?n.startRow:n.endRow,g=n.startRow>n.endRow?n.startRow:n.endRow,p=n.startCol<n.endCol?n.startCol:n.endCol,y=n.startCol>n.endCol?n.startCol:n.endCol;for(let C=m;C<=g;C++)for(let b=p;b<=y;b++)f[C][b]=!f[C][b];e.value=[...f],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:(h,u)=>{n.dragRow=h,n.dragCol=u},mouseleaveBoxArea:()=>{l(n.dragRow,n.dragCol)},selectColumn:h=>{const u=[...e.value],f=u[0][h];for(let m=0;m<u.length;m++)u[m][h]=!f;e.value=[...u]},selectRow:h=>{const u=[...e.value],f=u[h][0];for(let m=0;m<u[0].length;m++)u[h][m]=!f;e.value=[...u]}}},dx={name:"EvScheduler",props:{modelValue:{type:Array,default:()=>[]},colLabels:{type:Array,default:()=>['<span style="color: #FF0000">SUN</span>',"MON","TUE","WED","THU","FRI",'<span style="color: #0006F9">SAT</span>']},rowLabels:{type:Array,default:()=>["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"]}},emits:{"update:modelValue":Array,change:Array},setup(){const{mv:t,validateValue:e}=rx();e();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=cx({mv:t});return{mv:t,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},hx={class:"ev-scheduler-header"},ux=["onClick","innerHTML"],fx=["onClick","innerHTML"],mx=["onMousedown","onMouseup"];function px(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("table",{class:o.normalizeClass(["ev-scheduler",{draggable:!!t.dragEventName}])},[o.createElementVNode("thead",null,[o.createElementVNode("tr",hx,[e[1]||(e[1]=o.createElementVNode("td",null,null,-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>i.selectColumn(r),innerHTML:n.colLabels[r]},null,8,ux))),128))])]),o.createElementVNode("tbody",{onMouseleave:e[0]||(e[0]=(...a)=>i.mouseleaveBoxArea&&i.mouseleaveBoxArea(...a))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.rowLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>i.selectRow(r),innerHTML:n.rowLabels[r]},null,8,fx)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(c,d)=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:i.mv[r][d]}],style:i.selectionStyle(r,d),onMousedown:o.withModifiers(h=>i.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:o.withModifiers(h=>i.mouseupBox(r,d),["stop","prevent"])},{[o.toHandlerKey(`${t.dragEventName}`)]:h=>i.mousemoveBox(r,d)}),null,16,mx))),128))]))),128))],32)],2)}const si=ce(dx,[["render",px]]);si.install=t=>{t.component(si.name,si)};const gx=()=>{const t=o.defineComponent(Mr),e=o.ref([]);return{comp:t,childrenItems:e,initWrapperDiv:()=>{const i=document.createElement("div");i.id="ev-context-menu-modal",i.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(i)}}},bx=()=>{const{props:t}=o.getCurrentInstance(),e=o.computed(()=>t.isShowMenuOnClick),n=o.ref(!1),i=o.ref(null),s=o.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:i,menuStyle:s,show:async r=>{var d,h;n.value=!0,await o.nextTick();const c=(h=(d=i.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const u=c.height,f=c.width,m=document.documentElement.clientHeight,g=document.documentElement.clientWidth,p=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,m<r.clientY+u?s.top=`${r.pageY-u}px`:s.top=`${r.pageY}px`,g<r.clientX+f+p?s.left=`${r.pageX-f}px`:s.left=`${r.pageX}px`}},hide:async()=>{await o.nextTick(),!e.value&&(n.value=!1)}}},yx=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.computed({get:()=>t.isShow,set:f=>e("update:isShow",f)}),i=o.computed(()=>!!t.items.some(f=>f.children)),s=o.ref([]),l=o.ref(!1),a=o.ref(null),r=o.reactive({top:null,left:null,right:null}),c=f=>{f||(n.value=!1)},d=f=>{var I,v,W;const m=document.documentElement.clientWidth,g=document.documentElement.clientHeight,p=20,y=(I=f.target.parentElement)==null?void 0:I.getBoundingClientRect(),{x:C,y:b,width:k,height:T}=y,w=(W=(v=a.value)==null?void 0:v.$el)==null?void 0:W.children[0].getBoundingClientRect(),{width:M,height:V}=w,x=f.target.offsetTop,S=g<b+x+V,L=m<C+k+M+p;S?r.top=`${T-V}px`:r.top=`${x}px`,L?r.left=`${0-M}px`:r.left=`${k}px`};return{computedIsShow:n,isExistChild:i,isShowChild:l,childMenu:a,menuStyle:r,childrenItems:s,handleItemClick:f=>{f.click&&!f.disabled&&f.click(f),f.isShowMenu||c(f.children)},handleMouseEnter:async(f,m)=>{!m.children||!Array.isArray(m.children)||m.disabled?l.value=!1:(l.value=!0,s.value=m.children,await o.nextTick(),d(f))},hideAll:c}},xx={name:"EvMenuList",props:{isShow:{type:Boolean,default:!1},items:{type:Array,default:()=>[],validator:t=>t.some(e=>e.children!==void 0&&!Array.isArray(e.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):t.some(e=>e.click!==void 0&&typeof e.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},comp:{type:Object,default:()=>{}}},emits:{"update:isShow":[Boolean]},setup(){const{isExistChild:t,computedIsShow:e,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=yx();return{isExistChild:t,computedIsShow:e,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},Sx={class:"ev-menu-list"},Cx={class:"ev-menu-ul"},kx=["onClick","onMouseenter"],wx={class:"ev-menu-li-text"},Ix={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function Lx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Sx,[o.createElementVNode("ul",Cx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(a,r)=>o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:`${a.value}_${r}`,class:o.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>i.handleItemClick(a),onMouseenter:c=>i.handleMouseEnter(c,a)},[a.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",wx,[a.slotKey?o.renderSlot(t.$slots,a.slotKey,{key:0,item:a},()=>[o.createTextVNode(o.toDisplayString(a.text),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(o.openBlock(),o.createElementBlock("i",Ix)):o.createCommentVNode("",!0)],42,kx)),[[o.vShow,!a.hidden]])),128))]),i.isExistChild?o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:i.computedIsShow,"onUpdate:isShow":e[0]||(e[0]=a=>i.computedIsShow=a),comp:n.comp,items:i.childrenItems,style:o.normalizeStyle(i.menuStyle)},o.createSlots({_:2},[o.renderList(t.$slots,(a,r)=>({name:r,fn:o.withCtx(c=>[o.renderSlot(t.$slots,r,o.normalizeProps(o.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[o.vShow,i.childrenItems.length&&i.isShowChild]]):o.createCommentVNode("",!0)])}const Mr=ce(xx,[["render",Lx]]),Tx={name:"EvContextMenu",directives:{clickoutside:Hi},components:{MenuList:Mr},props:{items:{type:Array,default:()=>[],validator:t=>t.some(e=>e.children!==void 0&&!Array.isArray(e.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):t.some(e=>e.click!==void 0&&typeof e.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},customClass:{type:String,default:""},isShowMenuOnClick:{type:Boolean,default:!1}},setup(){const{comp:t,initWrapperDiv:e}=gx(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=bx();return o.onBeforeMount(()=>e()),{isShow:n,rootMenuList:i,menuStyle:s,comp:t,show:l,hide:a}}};function Mx(t,e,n,i,s,l){const a=o.resolveComponent("menu-list"),r=o.resolveDirective("clickoutside");return i.isShow&&n.items.length?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-context-menu-modal"},[o.withDirectives((o.openBlock(),o.createBlock(a,{ref:"rootMenuList",isShow:i.isShow,"onUpdate:isShow":e[0]||(e[0]=c=>i.isShow=c),class:o.normalizeClass(n.customClass),items:n.items,style:o.normalizeStyle(i.menuStyle),comp:i.comp},o.createSlots({_:2},[o.renderList(t.$slots,(c,d)=>({name:d,fn:o.withCtx(h=>[o.renderSlot(t.$slots,d,o.normalizeProps(o.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,i.hide]])])):o.createCommentVNode("",!0)}const oi=ce(Tx,[["render",Mx]]);oi.install=t=>{t.component(oi.name,oi)};const vx=()=>window.innerWidth-document.documentElement.clientWidth,Rx=()=>{const{props:t,emit:e}=o.getCurrentInstance(),n=o.ref(),i=o.ref(),s=o.ref(!1),l=o.computed(()=>s.value?"ev-icon-compress":"ev-icon-expand");let a=document.getElementById("ev-window-modal");(()=>{if(!a){const p=document.createElement("div");p.id="ev-window-modal",document.body.appendChild(p),a=document.getElementById("ev-window-modal")}})();const c=p=>{let y,C;if(typeof p=="string"||typeof p=="number"){const b=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);y=b?{value:+b[2],unit:b[3]||void 0}:void 0}else y=void 0;return y==null?C=void 0:y.unit?C=`${y.value}${y.unit}`:C=`${y.value}px`,C},d=(p,y="horizontal")=>{if(typeof p=="number")return p;if(!p)return 0;let C=0;const b=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);if(y&&["%","vw","vh"].includes(b[3])&&b[2]){const k=y==="horizontal"?window.innerWidth:window.innerHeight;C=Math.floor(k*+b[2]/100)}else b[2]&&(C=+b[2]);return C},h=o.reactive({}),u=o.computed(()=>({...t.style,...h})),f=()=>{if(h.position="fixed",t.fullscreen){h.width="100%",h.height="100%",h.top=0,h.left=0;return}const p=d(t.width,"horizontal"),y=d(t.minWidth,"horizontal");p<y?(console.warn("[EVUI][Window] Since width is less than min-width, it is replaced by min-width."),h.width=c(t.minWidth)):h.width=c(t.width);const C=d(t.height,"vertical"),b=d(t.minHeight,"vertical");C<b?(console.warn("[EVUI][Window] Since height is less than min-height, it is replaced by min-height."),h.height=c(t.minHeight)):h.height=c(t.height),h.top=`calc((100% - ${h.height}) / 2)`,h.left=`calc((100% - ${h.width}) / 2)`,d(t.width,"horizontal")>window.innerWidth&&(h.left=0),d(t.height,"vertical")>window.innerHeight&&(h.top=0)},m=p=>{p==="layer"&&!t.closeOnClickModal||e("update:visible",!1)},g=p=>{var b;const y=(b=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:b.length,C=document.body;if(p){if(t.hideScroll){if(!y){const k=vx();C.style.paddingRight=`${k}px`}C.classList.add("ev-window-scroll-lock")}}else t.hideScroll&&y===1&&(C.style.removeProperty("padding-right"),C.classList.remove("ev-window-scroll-lock"))};return f(),o.watch(()=>t.visible,async p=>{g(p),p&&await o.nextTick(()=>{f()})}),{windowRef:n,headerRef:i,isFullExpandWindow:s,maximizableIcon:l,baseStyle:u,closeWin:m,numberToUnit:c,removeUnit:d}},Vx=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{windowRef:i,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=t,c=50,d=5,h=o.reactive({}),u=o.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),f=o.reactive({top:0,left:0}),m=o.reactive({top:!1,right:!1,left:!1,bottom:!1}),g=o.reactive({width:null,height:null,top:null,left:null}),p=(I,v)=>{if(I==null||v==null)return!1;const W=i.value.getBoundingClientRect(),E=+I-W.left,G=+v-W.top,R=s.value.style,X={top:r(R.paddingTop,"vertical"),left:r(R.paddingLeft,"horizontal"),right:r(R.paddingRight,"horizontal")},Z=X.left,N=W.width-X.right,P=X.top,B=P+s.value.offsetHeight;return E>Z&&E<N&&G>P&&G<B},y=I=>{if(I===null||typeof I!="object")return;let v,W,E,G,R,X;const Z=i.value,N=Object.prototype.hasOwnProperty;N.call(I,"top")?v=I.top:v=u.top,N.call(I,"left")?W=I.left:W=u.left,N.call(I,"width")?E=I.width:E=Z.offsetWidth,N.call(I,"height")?G=I.height:G=Z.offsetHeight,N.call(I,"minWidth")?R=I.minWidth:R=e.minWidth,N.call(I,"minHeight")?X=I.minHeight:X=e.minHeight,E=r(E,"horizontal")>r(R,"horizontal")?E:R,G=r(G,"vertical")>r(X,"vertical")?G:X,h.top=a(v),h.left=a(W),h.width=a(E),h.height=a(G),h.minWidth=a(R),h.minHeight=a(X)},C=I=>{if(!(!i.value||u.pressedSpot))if(e.resizable){const v=i.value.getBoundingClientRect(),W=I.clientX-v.left,E=I.clientY-v.top,G=E<d,R=W<d,X=W>=v.width-d,Z=E>=v.height-d;G&&R||Z&&X?i.value.style.cursor="nwse-resize":G&&X||Z&&R?i.value.style.cursor="nesw-resize":X||R?i.value.style.cursor="ew-resize":Z||G?i.value.style.cursor="ns-resize":e.draggable&&p(I.clientX,I.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else e.draggable&&p(I.clientX,I.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},b=I=>{const v=window.innerWidth,W=window.innerHeight,E=m.top,G=m.left,R=m.right,X=m.bottom,Z=r(e.minWidth,"horizontal"),N=r(e.minHeight,"vertical"),P=I.clientX>=v?v:I.clientX;let B=I.clientY>=W?W:I.clientY;B=I.clientY>0?B:0;const Y=P-u.clientX,H=B-u.clientY;let K=u.top,D=u.left,z=u.width,_=u.height;const ee=K+u.height-N,J=D+u.width-Z;E&&(K=u.top+H,_=u.height-H,K>ee&&(K=ee)),G&&(D=u.left+Y,z=u.width-Y,D>J&&(D=J)),R&&(z=u.width+Y),X&&(_=u.height+H),z=Math.min(Math.max(z,Z),v),_=Math.min(Math.max(_,N),W);const te={top:K,left:D,width:z,height:_};y(te),n("resize",I,{...te})},k=(I,v)=>{let W=v;return W<0?W=0:W>I-c&&(W=Math.floor(I-c)),W},T=(I,v)=>{let W=v;return W<-(u.width-c)?W=-Math.floor(u.width-c):W>I-c&&(W=Math.floor(I-c)),W},w=I=>{if(I.preventDefault(),u.state="mousedown-mousemove",e.draggable&&u.pressedSpot==="header"){const v=document.documentElement.clientWidth,W=document.documentElement.clientHeight,E=I.clientY-u.clientY,G=I.clientX-u.clientX;let R=u.top+E,X=u.left+G;R=k(W,R),X=T(v,X),y({top:`${R}px`,left:`${X}px`,width:h.width??e.width,height:h.height??e.height})}else e.resizable&&u.pressedSpot==="border"&&b(I);n("mousedown-mousemove",I)},M=I=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",I),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",M)},V=I=>{if(!i.value||!e.resizable&&!e.draggable)return;let v="";if(e.resizable){const W=i.value.getBoundingClientRect(),E=I.clientX-W.left,G=I.clientY-W.top,R=G<d,X=E<d,Z=E>=W.width-d,N=G>=W.height-d;m.top=R,m.left=X,m.right=Z,m.bottom=N,(R||X||Z||N)&&(v="border")}if(v!=="border"&&p(I.clientX,I.clientY)&&(v="header"),!v||!e.draggable&&v==="header"||!e.resizable&&v==="border"){u.state="mousedown",u.pressedSpot="",u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=I.clientX,u.clientY=I.clientY,n("mousedown",{...u,ref:i.value});return}u.state="mousedown",u.pressedSpot=v,u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=I.clientX,u.clientY=I.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",w),window.addEventListener("mouseup",M)},x=I=>{!e.draggable&&!e.resizable||C(I)},S=()=>{l.value=!l.value,o.nextTick(()=>{l.value?(g.top=i.value.offsetTop,g.left=i.value.offsetLeft,g.width=i.value.offsetWidth,g.height=i.value.offsetHeight,y({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):y({top:g.top,left:g.left,width:g.width,height:g.height}),n("expand",{top:g.top,left:g.left,width:g.width,height:g.height})})},L=()=>{l.value=!1,u.state="",u.pressedSpot="",u.top=0,u.left=0,u.width=0,u.height=0,u.clientX=0,u.clientY=0,f.top=0,f.left=0,m.top=!1,m.left=!1,m.right=!1,m.bottom=!1,g.top=null,g.left=null,g.width=null,g.height=null,Object.keys(h).forEach(I=>{delete h[I]})};return o.watch(()=>e.visible,I=>{I||L()}),{dragStyle:h,startDrag:V,moveMouse:x,clickExpandBtn:S}},Tt=(()=>{let t=[],e=0;return{add(n){if(n!=null)return n.sequence=e++,t.push(n),n.sequence},remove(n){n!=null&&(t=t.filter(i=>i.sequence!==n.sequence))},get windows(){return t.slice()},getWindowBySequence(n){return t.find(i=>i.sequence===n)},isEmpty(){return t.length<=0},isFirstWindowOpen(){return e===1}}})(),Mt=(()=>{let l=700;return{getNext(){return l>=748?748:(l+=1,l)},getNextOverLimit(){return 749},getPrevFrom(a){const r=l-a*1;return r<=700?700:r},isUpperLimitClose(){return l>=748},resetToLower(){l=700},getAllocableCount(){return Math.floor(48/1)}}})(),Ex=t=>{const e=window.getComputedStyle(t).getPropertyValue("z-index").trim();return!e||isNaN(e)?700:parseInt(e)},Bo=()=>{const t=(n,i)=>n.zIndex>i.zIndex?1:n.zIndex<i.zIndex?-1:n.sequence>i.sequence?1:-1;return Array.prototype.map.call(Tt.windows,n=>({...n,zIndex:Ex(n.elem)})).sort(t)},Wx=({closeWin:t,windowRef:e})=>{const{props:n}=o.getCurrentInstance();let i=null,s=null;const l=()=>Tt.add({sequence:i,closeWin:t,elem:e.value,escClose:n.escClose}),a=y=>{Tt.remove(y)},r=y=>{if(Tt.isEmpty())return;const{code:C}=y;if(C!=="Escape")return;const b=Bo(),k=b[b.length-1];k.escClose&&k.closeWin()},c=()=>{i=l(),e.value.dataset.sequence=i,Tt.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const y=Tt.getWindowBySequence(i);a(y)},h=({elem:y,zIndex:C})=>{if(n.isModal){const b=y.parentElement.getElementsByClassName("ev-window-dim-layer")[0];b.style.zIndex=C}y.style.zIndex=C},u=()=>{Tt.windows.length===1&&Mt.resetToLower();const y=Mt.getNext();h({elem:e.value,zIndex:y})},f=y=>String(y.sequence)===e.value.dataset.sequence,m=()=>{const y=Bo();if(Tt.windows.length>Mt.getAllocableCount()){const b=y.reverse();let k=0;b.forEach(w=>{if(f(w))return;const M=Mt.getPrevFrom(k++);h({elem:w.elem,zIndex:M})});const T=Mt.getNextOverLimit();h({elem:e.value,zIndex:T})}else{Mt.resetToLower(),y.forEach(k=>{if(f(k))return;const T=Mt.getNext();h({elem:k.elem,zIndex:T})});const b=Mt.getNext();h({elem:e.value,zIndex:b})}},g=()=>{Mt.isUpperLimitClose()?m():u()},p=()=>{if(!e.value||!n.focusable)return;const y=Bo(),C=y[y.length-1];f(C)||g()};return o.onMounted(()=>{n.visible&&(c(),s=setTimeout(g,0))}),o.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),o.watch(()=>n.visible,y=>{o.nextTick(()=>{y?(c(),s=setTimeout(g,0)):(d(),clearTimeout(s))})}),o.watch(()=>n.escClose,y=>{if(!n.visible)return;const C=Tt.getWindowBySequence(i);C&&(C.escClose=y)}),{setFocus:p}},Gx={name:"EvWindow",props:{style:{type:Object,default(){return{}}},visible:{type:Boolean,default:!1},title:{type:[String,Number],default:null},windowClass:{type:String,default:""},iconClass:{type:String,default:""},width:{type:[String,Number],default:"50vw"},height:{type:[String,Number],default:"50vh"},minWidth:{type:[String,Number],default:150},minHeight:{type:[String,Number],default:150},fullscreen:{type:Boolean,default:!1},isModal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},hideScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!1},escClose:{type:Boolean,default:!1},focusable:{type:Boolean,default:!1}},emits:["update:visible","mousedown","mousedown-mouseup","mousedown-mousemove","resize","expand"],setup(){const{windowRef:t,headerRef:e,isFullExpandWindow:n,maximizableIcon:i,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=Rx(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=Vx({windowRef:t,headerRef:e,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=Wx({closeWin:l,windowRef:t});return{windowRef:t,headerRef:e,baseStyle:s,dragStyle:c,maximizableIcon:i,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:u,setFocus:f}}},Zx={key:0,ref:"headerRef",class:"ev-window-header"},Xx={key:0,class:"ev-window-icon"},Nx={key:1,class:"ev-window-title"},Px={class:"ev-window-content"},Bx={key:1,class:"ev-window-footer"},Dx={class:"ev-window-top-right-icon"};function Yx(t,e,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-window-modal"},[o.createVNode(o.Transition,{name:"ev-window-fade",appear:""},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:e[0]||(e[0]=a=>i.closeWin("layer")),onWheel:o.withModifiers(()=>{},["stop","prevent"])},null,32)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref:"windowRef",class:o.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:o.normalizeStyle({...i.baseStyle,...i.dragStyle}),onMousedown:e[3]||(e[3]=(...a)=>i.startDrag&&i.startDrag(...a)),onMousemove:e[4]||(e[4]=(...a)=>i.moveMouse&&i.moveMouse(...a)),onClick:e[5]||(e[5]=(...a)=>i.setFocus&&i.setFocus(...a))},[t.$slots.header||n.iconClass||n.title?(o.openBlock(),o.createElementBlock("div",Zx,[t.$slots.header?o.renderSlot(t.$slots,"header",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Xx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",Nx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",Px,[o.renderSlot(t.$slots,"default")]),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",Bx,[o.renderSlot(t.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",Dx,[n.maximizable&&!n.fullscreen?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:e[1]||(e[1]=(...a)=>i.clickExpandBtn&&i.clickExpandBtn(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.maximizableIcon)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-window-close",onClick:e[2]||(e[2]=(...a)=>i.closeWin&&i.closeWin(...a))},[...e[6]||(e[6]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):o.createCommentVNode("",!0)]),_:3})])}const li=ce(Gx,[["render",Yx]]);li.install=t=>{t.component(li.name,li)};const Ox={name:"EvLoading",props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},clickOutside:{type:Boolean,default:!1},iconClass:{type:String,default:null},iconStyle:{type:Object,default:()=>{}}},emits:{"update:modelValue":[Boolean]},setup(t,{emit:e}){return{clickEventName:o.computed(()=>t.clickOutside?"click":null),closeLoading:()=>e("update:modelValue",!1)}}},Hx={class:"ev-loading-spinner"},Fx={class:"ev-loading-spinner"};function zx(t,e,n,i,s,l){return n.fullscreen?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"body"},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading full-screen"},{[o.toHandlerKey(`${i.clickEventName}`)]:e[0]||(e[0]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",Hx,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading"},{[o.toHandlerKey(`${i.clickEventName}`)]:e[1]||(e[1]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",Fx,[t.$slots.default?o.renderSlot(t.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)],64))}const ai=ce(Ox,[["render",zx]]);ai.install=t=>{t.component(ai.name,ai)};const Ax={name:"EvProgress",props:{modelValue:{type:Number,default:0,validator:t=>t>=0&&t<=100},color:{type:[String,Array],default:"#409EFF"},strokeWidth:{type:Number,default:6},innerText:{type:String,default:""}},emits:{},setup(t){const e=o.computed(()=>({height:`${t.strokeWidth}px`})),n=o.computed(()=>{if(Array.isArray(t.color)){const i=[...t.color].sort((l,a)=>l.value-a.value);let s=i[0].color;if(!t.modelValue)return{width:`${t.modelValue}%`,"background-color":s};for(let l=0;l<i.length;l++){const a=l===0?0:i[l-1].value,r=i[l].value;if(t.modelValue>a&&t.modelValue<=r){s=i[l].color;break}}return{width:`${t.modelValue}%`,"background-color":s}}return{width:`${t.modelValue}%`,"background-color":t.color}});return{wrapperStyle:e,innerStyle:n}}},Kx={class:"ev-progress"},_x={key:0,class:"ev-progress-inner-text"},Ux={key:0,class:"ev-progress-label"};function Jx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Kx,[o.createElementVNode("div",{class:"ev-progress-wrapper",style:o.normalizeStyle(i.wrapperStyle)},[o.createElementVNode("div",{class:"ev-progress-inner",style:o.normalizeStyle(i.innerStyle)},[n.innerText?(o.openBlock(),o.createElementBlock("div",_x,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),t.$slots.default?(o.openBlock(),o.createElementBlock("div",Ux,[o.renderSlot(t.$slots,"default")])):o.createCommentVNode("",!0)])}const ri=ce(Ax,[["render",Jx]]);ri.install=t=>{t.component(ri.name,ri)};const jx={name:"MenuItem",props:{selectedItem:{type:[String,Number],default:""},item:{type:Object,default:()=>{},validator:t=>{if(t.value){if(t.children!==void 0&&!Array.isArray(t.children))return console.warn("[EVUI][Menu] children attribute must be 'Array' type."),!1;if(t.expand!==void 0&&typeof t.expand!="boolean")return console.warn("[EVUI][Menu] expand attribute must be 'Boolean' type."),!1;if(t.hidden!==void 0&&typeof t.hidden!="boolean")return console.warn("[EVUI][Menu] hidden attribute must be 'Boolean' type."),!1;if(t.disabled!==void 0&&typeof t.disabled!="boolean")return console.warn("[EVUI][Menu] disabled attribute must be 'Boolean' type."),!1;if(t.slotKey!==void 0&&typeof t.slotKey!="string")return console.warn("[EVUI][Menu] slotKey attribute must be 'String' type."),!1}else return console.warn("[EVUI][Menu] value attribute is required."),!1;return!0}},depth:{type:Number,default:1},expandable:{type:Boolean,default:!0},comp:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=t.expandable&&t.item.expand!==void 0&&typeof t.item.expand=="boolean"?t.item.expand:!0,i=o.ref(n),s=o.computed(()=>!!t.item.children&&!!t.item.children.length);return{isExpand:i,hasChild:s,clickMenu:a=>{s.value&&a.depth===t.depth?t.expandable&&(i.value=!i.value):e("click",a)}}}},Qx={class:"text"};function $x(t,e,n,i,s,l){return n.item.hidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[o.createElementVNode("div",{class:o.normalizeClass(["ev-menu-title",{expandable:i.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:e[0]||(e[0]=a=>i.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["front-icon",n.item.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",Qx,[n.item.slotKey?o.renderSlot(t.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&i.hasChild?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["list-expend-icon",{expend:n.expandable&&i.isExpand}])},[...e[1]||(e[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):o.createCommentVNode("",!0)],2),i.hasChild?o.withDirectives((o.openBlock(),o.createElementBlock("ol",{key:0,class:o.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.item.children,(a,r)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${a.value}_${r}_${n.depth+1}`,depth:n.depth+1,item:a,"selected-item":n.selectedItem,expandable:n.expandable,disabled:n.disabled,comp:n.comp,onClick:i.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[o.vShow,i.isExpand]]):o.createCommentVNode("",!0)],2))}const vr=ce(jx,[["render",$x]]),qx={name:"EvMenu",components:{MenuItem:vr},props:{modelValue:{type:[String,Number],default:""},items:{type:Array,default:()=>[]},expandable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=o.ref(t.items.filter(l=>t.modelValue===l.value));return{clickMenu:l=>{if(!l.disabled){const a=l.item;e("update:modelValue",a.value),e("change",a,n.value),n.value=a}},component:vr}}},e0={class:"ev-menu"};function t0(t,e,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",e0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:i.component,onClick:i.clickMenu},o.createSlots({_:2},[o.renderList(t.$slots,(d,h)=>({name:h,fn:o.withCtx(u=>[o.renderSlot(t.$slots,h,o.mergeProps({ref_for:!0},u))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const ci=ce(qx,[["render",t0]]);ci.install=t=>{t.component(ci.name,ci)};const n0={name:"TreeNode",props:{data:{type:Object,require:!0,default:()=>({})},useCheckbox:{type:Boolean,default:!1},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},comp:{type:Object,default:()=>{}}},emits:{"update-checked-info":null,"click-node":null,"dblclick-node":null,"show-context-menu":null},setup(t,{emit:e}){const n=o.reactive(t.data),i=o.computed(()=>t.data.children&&t.data.children.length),s=o.computed(()=>{const p=t.expandIcon?t.expandIcon:"ev-icon-s-play",y=t.expandIcon?t.collapseIcon:"ev-icon-s-play";return t.data.expand?y:p}),l=o.computed(()=>t.data.children);function a(p,y){e("update-checked-info",{nodeKey:y,isChecked:p})}function r({nodeKey:p,isChecked:y}){e("update-checked-info",{nodeKey:p,isChecked:y})}function c(){n.expand=!n.expand}function d(){n.disabled||(n.selected=!n.selected,e("click-node",n.nodeKey))}function h(p){e("click-node",p)}function u(){n.disabled||e("dblclick-node",n.nodeKey)}function f(p){e("dblclick-node",p)}function m(p){e("show-context-menu",!0,p)}return{expandIconClasses:s,showExpandIcon:i,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:u,emitDblClickedContent:f,handleContextmenu:m,emitContextMenuFlag:(p,y)=>{e("show-context-menu",p,y)}}}},i0={class:"ev-tree-children"},s0={class:"ev-tree-node"};function o0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-checkbox");return o.withDirectives((o.openBlock(),o.createElementBlock("ul",i0,[o.createElementVNode("li",null,[o.createElementVNode("span",{class:o.normalizeClass([{expand:i.treeData.expand},"ev-tree-toggle"])},[i.showExpandIcon?(o.openBlock(),o.createBlock(a,{key:0,icon:i.expandIconClasses,onClick:i.handleExpand},null,8,["icon","onClick"])):o.createCommentVNode("",!0)],2),o.createElementVNode("div",s0,[n.useCheckbox?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.treeData.checked,"onUpdate:modelValue":e[0]||(e[0]=c=>i.treeData.checked=c),indeterminate:i.treeData.indeterminate,disabled:i.treeData.disabled,onChange:e[1]||(e[1]=c=>i.handleCheck(i.treeData.checked,i.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):o.createCommentVNode("",!0),i.treeData.iconClass?(o.openBlock(),o.createBlock(a,{key:1,icon:i.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass([{"ev-tree-title-selected":i.treeData.selected,"ev-tree-title-disabled":i.treeData.disabled},"ev-tree-title"]),onContextmenu:e[2]||(e[2]=(...c)=>i.handleContextmenu&&i.handleContextmenu(...c)),onClick:e[3]||(e[3]=(...c)=>i.clickTreeContent&&i.clickTreeContent(...c)),onDblclick:e[4]||(e[4]=(...c)=>i.dblClickTreeContent&&i.dblClickTreeContent(...c))},o.toDisplayString(i.treeData.title),35)]),o.createVNode(o.TransitionGroup,{name:"fade"},{default:o.withCtx(()=>[i.treeData.expand?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.childrenInfo,(c,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${c.value}-${d}`,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:n.comp,onUpdateCheckedInfo:i.emitCheckedInfo,onClickNode:i.emitClickedContent,onDblclickNode:i.emitDblClickedContent,onShowContextMenu:i.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):o.createCommentVNode("",!0)]),_:1})])],512)),[[o.vShow,i.treeData.visible]])}const Rr=ce(n0,[["render",o0]]),l0={name:"EvTree",components:{TreeNode:Rr},props:{data:{type:Array,default:()=>[]},useCheckbox:{type:Boolean,default:!1},emptyText:{type:String,default:"No Data"},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},contextMenuItems:{type:Array,default:()=>[]},searchWord:{type:String,default:""},searchIncludeChildren:{type:Boolean,default:!1}},emits:{"click-node":null,"dblclick-node":null,check:Array},setup(t,{emit:e}){const n=o.ref(t.data);let i=[];const s=o.ref(null);let l=!1;const a=Rr;function r(x){const S=i[x].parent;if(typeof S>"u")return;const L=i[x].node,I=i[S].node;if(!(L.checked===I.checked&&L.indeterminate===I.indeterminate)){if(L.checked)I.checked=I.children.every(v=>v.checked),I.indeterminate=!I.checked;else{const v=W=>W.checked||L.indeterminate;I.checked=!1,I.indeterminate=I.children.some(v)}r(S)}}function c(x,S={}){const L=Object.keys(S);for(let I=0;I<L.length;I++)x[L[I]]=S[L[I]];x.children&&x.children.forEach(I=>{c(I,S)})}function d(){let x=0;const S=[],L=[];function I(v,W){const E=v;E.nodeKey=x++,Object.hasOwnProperty.call(E,"selected")||(E.selected=!1),Object.hasOwnProperty.call(E,"visible")||(E.visible=!0),"value"in E&&L.includes(E.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),E.value+=E.nodeKey):"value"in E||(E.value=E.title+E.nodeKey),L.push(E.value),S[E.nodeKey]={node:E,nodeKey:E.nodeKey},typeof W<"u"&&(S[E.nodeKey].parent=W.nodeKey,S[W.nodeKey].children.push(E.nodeKey)),E.children&&(S[E.nodeKey].children=[],E.children.forEach(G=>I(G,E)))}return n.value.length&&I(n.value[0]),S}i=d();function h(){return i.filter(x=>x.node.checked).map(x=>x.node)}function u(){h().forEach(S=>{c(S,{checked:!0});const L=i[S.nodeKey].parent;if(!L&&L!==0)return;const I=i[L].node;typeof S.checked<"u"&&S.checked&&I.checked!==S.checked&&r(S.nodeKey)})}function f({nodeKey:x,isChecked:S}){const L=i[x].node;L.checked=S,L.indeterminate=!1,r(x),c(L,{checked:S,indeterminate:!1});const I=h();e("check",I),u()}function m(x){const S=i[x].node;for(let L=0;L<i.length;L++)i[L].node.nodeKey!==x&&(i[L].node.selected=!1);e("click-node",{title:S.title,value:S.value})}function g(x){const S=i[x].node;e("dblclick-node",{title:S.title,value:S.value})}const p=x=>{t.contextMenuItems.length&&l&&(s.value.show(x),l=!1)},y=(x,S)=>{l=x,p(S)},C=(x,S)=>x.toLowerCase().includes(S.toLowerCase()),b=x=>{var S;if(x.children){const L=!!((S=x.children.filter(I=>C(I.title,t.searchWord)))!=null&&S.length);x.children.forEach(I=>{b(I),I.visible=L&&C(I.title,t.searchWord)||!L})}};function k(x){x.children&&x.children.forEach(S=>{S.visible=!1,k(S)})}function T(x){if(!x&&x!==0)return;const S=i[x];S.node.visible=!0,S.parent!==void 0&&T(S.parent)}function w(x){i.forEach(L=>{const I=L.node;I.visible=!1}),i.filter(L=>C(L.node.title,x)).forEach(L=>{const I=L.node;I.visible=!0,t.searchIncludeChildren?b(I):k(I);const v=i[I.nodeKey].parent;T(v)})}const M=o.computed(()=>!n.value.length||n.value.every(x=>!x.visible));o.watch(()=>t.data,x=>{n.value=x,i=d()},{deep:!0});let V;return o.watch(()=>t.searchWord,x=>{V&&clearTimeout(V),V=setTimeout(()=>{x?w(x):i.forEach(S=>{const L=S.node;L.visible=!0})},200)}),o.onMounted(()=>{u();const x=h();x.length&&e("check",x)}),o.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:f,clickContent:m,dblClickContent:g,showContextMenu:p,getContextMenuFlag:y}}},a0={class:"ev-tree-view"},r0={key:0};function c0(t,e,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",a0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.treeNodeData,(c,d)=>(o.openBlock(),o.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:i.component,onUpdateCheckedInfo:i.updateCheckedInfo,onClickNode:i.clickContent,onDblclickNode:i.dblClickContent,onShowContextMenu:i.getContextMenuFlag,onContextmenu:o.withModifiers(i.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),i.isShowEmptyText?(o.openBlock(),o.createElementBlock("div",r0,o.toDisplayString(n.emptyText),1)):o.createCommentVNode("",!0),n.contextMenuItems.length?(o.openBlock(),o.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):o.createCommentVNode("",!0)])}const di=ce(l0,[["render",c0]]);di.install=t=>{t.component(di.name,di)};const d0={name:"EvTimePicker",props:{modelValue:{type:[Array,String],default:"",validator:t=>{const e=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;return Array.isArray(t)&&(!e.test(t[0])||!e.test(t[1]))||!Array.isArray(t)&&!e.test(t)?(console.warn("[EVUI][TimePicker] Please check the time format in the Timepicker."),!1):!0}},type:{type:String,default:"range"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:[String,Array],required:!1,default:void 0}},emits:{"update:modelValue":null,focus:null,blur:null,change:null},setup(t,{emit:e}){const n=o.computed({get:()=>t.modelValue,set:w=>{if(t.type==="range"){if(Array.isArray(w)){const M=w[0]>w[1]?"00:00":w[0],V=M.value>w[1]?"23:59":w[1];e("update:modelValue",[M,V])}}else e("update:modelValue",w)}}),i=o.computed(()=>{const w=["start time","end time"];return Array.isArray(t.placeholder)?[typeof t.placeholder[0]=="string"?t.placeholder[0]:w[0],typeof t.placeholder[1]=="string"?t.placeholder[1]:w[1]]:typeof t.placeholder=="string"?[t.placeholder,t.placeholder]:w}),s=o.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=o.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=w=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(w),r=()=>{Array.isArray(n.value)&&(a(n.value[0])||(n.value[0]=s.value[0]),n.value[1]&&n.value[0]>n.value[1]&&(n.value[0]=n.value[1]),s.value[0]=n.value[0])},c=()=>{Array.isArray(n.value)&&(a(n.value[1])||(n.value[1]=s.value[1]),n.value[0]&&n.value[0]>n.value[1]&&(n.value[1]=s.value[1],n.value[0]>s.value[1]&&(n.value[1]=n.value[0])),s.value[1]=n.value[1])};return{time:n,isWrongType:l,previousValue:s,clearContents:()=>{n.value="",l.single=!0},clearStartTime:()=>{n.value[0]="",l.rangeStart=!0},clearEndTime:()=>{n.value[1]="",l.rangeEnd=!0},focusInputTime:w=>{e("focus",w)},blurInputTime:w=>{e("blur",w)},changeTime:w=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),e("change",w,n.value)},focusInputStartTime:w=>{e("focus",w)},blurInputStartTime:w=>{e("blur",w)},changeStartTime:w=>{r(),l.rangeStart=!1,e("change",w,n.value)},focusInputEndTime:w=>{e("focus",w)},blurInputEndTime:w=>{e("blur",w)},changeEndTime:w=>{c(),l.rangeEnd=!1,e("change",w,n.value)},placeholders:i}}},h0={class:"ev-time-picker"},u0={key:0,class:"ev-time-picker-range"},f0=["disabled","readonly","placeholder"],m0=["disabled","readonly","placeholder"],p0={key:1,class:"ev-time-picker-single"},g0=["disabled","readonly","placeholder"];function b0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",h0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",u0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=r=>i.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[0],onFocus:e[1]||(e[1]=(...r)=>i.focusInputStartTime&&i.focusInputStartTime(...r)),onBlur:e[2]||(e[2]=(...r)=>i.blurInputStartTime&&i.blurInputStartTime(...r)),onChange:e[3]||(e[3]=(...r)=>i.changeStartTime&&i.changeStartTime(...r))},null,40,f0),[[o.vModelText,i.time[0]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearStartTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2),e[12]||(e[12]=o.createElementVNode("p",{class:"tilde"},"~",-1)),o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[4]||(e[4]=r=>i.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[1],onFocus:e[5]||(e[5]=(...r)=>i.focusInputEndTime&&i.focusInputEndTime(...r)),onBlur:e[6]||(e[6]=(...r)=>i.blurInputEndTime&&i.blurInputEndTime(...r)),onChange:e[7]||(e[7]=(...r)=>i.changeEndTime&&i.changeEndTime(...r))},null,40,m0),[[o.vModelText,i.time[1]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearEndTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2)])):(o.openBlock(),o.createElementBlock("div",p0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":e[8]||(e[8]=r=>i.time=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:typeof n.placeholder=="string"?n.placeholder:"Enter time",onFocus:e[9]||(e[9]=(...r)=>i.focusInputTime&&i.focusInputTime(...r)),onBlur:e[10]||(e[10]=(...r)=>i.blurInputTime&&i.blurInputTime(...r)),onChange:e[11]||(e[11]=(...r)=>i.changeTime&&i.changeTime(...r))},null,40,g0),[[o.vModelText,i.time]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearContents},null,8,["onClick"])):o.createCommentVNode("",!0)],2)]))])}const hi=ce(d0,[["render",b0]]);hi.install=t=>{t.component(hi.name,hi)};const y0={name:"EvGridToolbar"},x0={class:"gridToolbar"};function S0(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",x0,[o.renderSlot(t.$slots,"toolbarWrapper")])}const C0=ce(y0,[["render",S0]]),k0={name:"EvGridPagination",props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:t=>["left","right","center"].includes(t)}},emits:{"update:modelValue":null},setup(t,{emit:e}){const n=o.ref(t.modelValue),i=s=>{n.value=s>0?s:1,e("update:modelValue",n.value)};return o.watch(()=>t.modelValue,s=>{n.value=s}),{currentValue:n,changePage:i}}},w0={class:"grid-pagination"};function I0(t,e,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",w0,[o.createVNode(a,{modelValue:i.currentValue,"onUpdate:modelValue":e[0]||(e[0]=r=>i.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:i.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const Vr=ce(k0,[["render",I0],["__scopeId","data-v-2e265290"]]);var L0=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Do=Math.ceil,tt=Math.floor,Ue="[BigNumber Error] ",Er=Ue+"Number primitive has more than 15 significant digits: ",ft=1e14,de=14,Yo=9007199254740991,Oo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ot=1e7,Ne=1e9;function Wr(t){var e,n,i,s=b.prototype={constructor:b,toString:null,valueOf:null},l=new b(1),a=20,r=4,c=-7,d=21,h=-1e7,u=1e7,f=!1,m=1,g=0,p={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},y="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function b(x,S){var L,I,v,W,E,G,R,X,Z=this;if(!(Z instanceof b))return new b(x,S);if(S==null){if(x&&x._isBigNumber===!0){Z.s=x.s,!x.c||x.e>u?Z.c=Z.e=null:x.e<h?Z.c=[Z.e=0]:(Z.e=x.e,Z.c=x.c.slice());return}if((G=typeof x=="number")&&x*0==0){if(Z.s=1/x<0?(x=-x,-1):1,x===~~x){for(W=0,E=x;E>=10;E/=10,W++);W>u?Z.c=Z.e=null:(Z.e=W,Z.c=[x]);return}X=String(x)}else{if(!L0.test(X=String(x)))return i(Z,X,G);Z.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(W=X.indexOf("."))>-1&&(X=X.replace(".","")),(E=X.search(/e/i))>0?(W<0&&(W=E),W+=+X.slice(E+1),X=X.substring(0,E)):W<0&&(W=X.length)}else{if(we(S,2,y.length,"Base"),S==10&&C)return Z=new b(x),M(Z,a+Z.e+1,r);if(X=String(x),G=typeof x=="number"){if(x*0!=0)return i(Z,X,G,S);if(Z.s=1/x<0?(X=X.slice(1),-1):1,b.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Er+x)}else Z.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(L=y.slice(0,S),W=E=0,R=X.length;E<R;E++)if(L.indexOf(I=X.charAt(E))<0){if(I=="."){if(E>W){W=R;continue}}else if(!v&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){v=!0,E=-1,W=0;continue}return i(Z,String(x),G,S)}G=!1,X=n(X,S,10,Z.s),(W=X.indexOf("."))>-1?X=X.replace(".",""):W=X.length}for(E=0;X.charCodeAt(E)===48;E++);for(R=X.length;X.charCodeAt(--R)===48;);if(X=X.slice(E,++R)){if(R-=E,G&&b.DEBUG&&R>15&&(x>Yo||x!==tt(x)))throw Error(Er+Z.s*x);if((W=W-E-1)>u)Z.c=Z.e=null;else if(W<h)Z.c=[Z.e=0];else{if(Z.e=W,Z.c=[],E=(W+1)%de,W<0&&(E+=de),E<R){for(E&&Z.c.push(+X.slice(0,E)),R-=de;E<R;)Z.c.push(+X.slice(E,E+=de));E=de-(X=X.slice(E)).length}else E-=R;for(;E--;X+="0");Z.c.push(+X)}}else Z.c=[Z.e=0]}b.clone=Wr,b.ROUND_UP=0,b.ROUND_DOWN=1,b.ROUND_CEIL=2,b.ROUND_FLOOR=3,b.ROUND_HALF_UP=4,b.ROUND_HALF_DOWN=5,b.ROUND_HALF_EVEN=6,b.ROUND_HALF_CEIL=7,b.ROUND_HALF_FLOOR=8,b.EUCLID=9,b.config=b.set=function(x){var S,L;if(x!=null)if(typeof x=="object"){if(x.hasOwnProperty(S="DECIMAL_PLACES")&&(L=x[S],we(L,0,Ne,S),a=L),x.hasOwnProperty(S="ROUNDING_MODE")&&(L=x[S],we(L,0,8,S),r=L),x.hasOwnProperty(S="EXPONENTIAL_AT")&&(L=x[S],L&&L.pop?(we(L[0],-Ne,0,S),we(L[1],0,Ne,S),c=L[0],d=L[1]):(we(L,-Ne,Ne,S),c=-(d=L<0?-L:L))),x.hasOwnProperty(S="RANGE"))if(L=x[S],L&&L.pop)we(L[0],-Ne,-1,S),we(L[1],1,Ne,S),h=L[0],u=L[1];else if(we(L,-Ne,Ne,S),L)h=-(u=L<0?-L:L);else throw Error(Ue+S+" cannot be zero: "+L);if(x.hasOwnProperty(S="CRYPTO"))if(L=x[S],L===!!L)if(L)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=L;else throw f=!L,Error(Ue+"crypto unavailable");else f=L;else throw Error(Ue+S+" not true or false: "+L);if(x.hasOwnProperty(S="MODULO_MODE")&&(L=x[S],we(L,0,9,S),m=L),x.hasOwnProperty(S="POW_PRECISION")&&(L=x[S],we(L,0,Ne,S),g=L),x.hasOwnProperty(S="FORMAT"))if(L=x[S],typeof L=="object")p=L;else throw Error(Ue+S+" not an object: "+L);if(x.hasOwnProperty(S="ALPHABET"))if(L=x[S],typeof L=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(L))C=L.slice(0,10)=="0123456789",y=L;else throw Error(Ue+S+" invalid: "+L)}else throw Error(Ue+"Object expected: "+x);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,u],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:g,FORMAT:p,ALPHABET:y}},b.isBigNumber=function(x){if(!x||x._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var S,L,I=x.c,v=x.e,W=x.s;e:if({}.toString.call(I)=="[object Array]"){if((W===1||W===-1)&&v>=-Ne&&v<=Ne&&v===tt(v)){if(I[0]===0){if(v===0&&I.length===1)return!0;break e}if(S=(v+1)%de,S<1&&(S+=de),String(I[0]).length==S){for(S=0;S<I.length;S++)if(L=I[S],L<0||L>=ft||L!==tt(L))break e;if(L!==0)return!0}}}else if(I===null&&v===null&&(W===null||W===1||W===-1))return!0;throw Error(Ue+"Invalid BigNumber: "+x)},b.maximum=b.max=function(){return T(arguments,-1)},b.minimum=b.min=function(){return T(arguments,1)},b.random=function(){var x=9007199254740992,S=Math.random()*x&2097151?function(){return tt(Math.random()*x)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(L){var I,v,W,E,G,R=0,X=[],Z=new b(l);if(L==null?L=a:we(L,0,Ne),E=Do(L/de),f)if(crypto.getRandomValues){for(I=crypto.getRandomValues(new Uint32Array(E*=2));R<E;)G=I[R]*131072+(I[R+1]>>>11),G>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),I[R]=v[0],I[R+1]=v[1]):(X.push(G%1e14),R+=2);R=E/2}else if(crypto.randomBytes){for(I=crypto.randomBytes(E*=7);R<E;)G=(I[R]&31)*281474976710656+I[R+1]*1099511627776+I[R+2]*4294967296+I[R+3]*16777216+(I[R+4]<<16)+(I[R+5]<<8)+I[R+6],G>=9e15?crypto.randomBytes(7).copy(I,R):(X.push(G%1e14),R+=7);R=E/7}else throw f=!1,Error(Ue+"crypto unavailable");if(!f)for(;R<E;)G=S(),G<9e15&&(X[R++]=G%1e14);for(E=X[--R],L%=de,E&&L&&(G=Oo[de-L],X[R]=tt(E/G)*G);X[R]===0;X.pop(),R--);if(R<0)X=[W=0];else{for(W=-1;X[0]===0;X.splice(0,1),W-=de);for(R=1,G=X[0];G>=10;G/=10,R++);R<de&&(W-=de-R)}return Z.e=W,Z.c=X,Z}}(),b.sum=function(){for(var x=1,S=arguments,L=new b(S[0]);x<S.length;)L=L.plus(S[x++]);return L},n=function(){var x="0123456789";function S(L,I,v,W){for(var E,G=[0],R,X=0,Z=L.length;X<Z;){for(R=G.length;R--;G[R]*=I);for(G[0]+=W.indexOf(L.charAt(X++)),E=0;E<G.length;E++)G[E]>v-1&&(G[E+1]==null&&(G[E+1]=0),G[E+1]+=G[E]/v|0,G[E]%=v)}return G.reverse()}return function(L,I,v,W,E){var G,R,X,Z,N,P,B,Y,H=L.indexOf("."),K=a,D=r;for(H>=0&&(Z=g,g=0,L=L.replace(".",""),Y=new b(I),P=Y.pow(L.length-H),g=Z,Y.c=S(vt(it(P.c),P.e,"0"),10,v,x),Y.e=Y.c.length),B=S(L,I,v,E?(G=y,x):(G=x,y)),X=Z=B.length;B[--Z]==0;B.pop());if(!B[0])return G.charAt(0);if(H<0?--X:(P.c=B,P.e=X,P.s=W,P=e(P,Y,K,D,v),B=P.c,N=P.r,X=P.e),R=X+K+1,H=B[R],Z=v/2,N=N||R<0||B[R+1]!=null,N=D<4?(H!=null||N)&&(D==0||D==(P.s<0?3:2)):H>Z||H==Z&&(D==4||N||D==6&&B[R-1]&1||D==(P.s<0?8:7)),R<1||!B[0])L=N?vt(G.charAt(1),-K,G.charAt(0)):G.charAt(0);else{if(B.length=R,N)for(--v;++B[--R]>v;)B[R]=0,R||(++X,B=[1].concat(B));for(Z=B.length;!B[--Z];);for(H=0,L="";H<=Z;L+=G.charAt(B[H++]));L=vt(L,X,G.charAt(0))}return L}}(),e=function(){function x(I,v,W){var E,G,R,X,Z=0,N=I.length,P=v%Ot,B=v/Ot|0;for(I=I.slice();N--;)R=I[N]%Ot,X=I[N]/Ot|0,E=B*R+X*P,G=P*R+E%Ot*Ot+Z,Z=(G/W|0)+(E/Ot|0)+B*X,I[N]=G%W;return Z&&(I=[Z].concat(I)),I}function S(I,v,W,E){var G,R;if(W!=E)R=W>E?1:-1;else for(G=R=0;G<W;G++)if(I[G]!=v[G]){R=I[G]>v[G]?1:-1;break}return R}function L(I,v,W,E){for(var G=0;W--;)I[W]-=G,G=I[W]<v[W]?1:0,I[W]=G*E+I[W]-v[W];for(;!I[0]&&I.length>1;I.splice(0,1));}return function(I,v,W,E,G){var R,X,Z,N,P,B,Y,H,K,D,z,_,ee,J,te,U,ne,Q=I.s==v.s?1:-1,$=I.c,j=v.c;if(!$||!$[0]||!j||!j[0])return new b(!I.s||!v.s||($?j&&$[0]==j[0]:!j)?NaN:$&&$[0]==0||!j?Q*0:Q/0);for(H=new b(Q),K=H.c=[],X=I.e-v.e,Q=W+X+1,G||(G=ft,X=nt(I.e/de)-nt(v.e/de),Q=Q/de|0),Z=0;j[Z]==($[Z]||0);Z++);if(j[Z]>($[Z]||0)&&X--,Q<0)K.push(1),N=!0;else{for(J=$.length,U=j.length,Z=0,Q+=2,P=tt(G/(j[0]+1)),P>1&&(j=x(j,P,G),$=x($,P,G),U=j.length,J=$.length),ee=U,D=$.slice(0,U),z=D.length;z<U;D[z++]=0);ne=j.slice(),ne=[0].concat(ne),te=j[0],j[1]>=G/2&&te++;do{if(P=0,R=S(j,D,U,z),R<0){if(_=D[0],U!=z&&(_=_*G+(D[1]||0)),P=tt(_/te),P>1)for(P>=G&&(P=G-1),B=x(j,P,G),Y=B.length,z=D.length;S(B,D,Y,z)==1;)P--,L(B,U<Y?ne:j,Y,G),Y=B.length,R=1;else P==0&&(R=P=1),B=j.slice(),Y=B.length;if(Y<z&&(B=[0].concat(B)),L(D,B,z,G),z=D.length,R==-1)for(;S(j,D,U,z)<1;)P++,L(D,U<z?ne:j,z,G),z=D.length}else R===0&&(P++,D=[0]);K[Z++]=P,D[0]?D[z++]=$[ee]||0:(D=[$[ee]],z=1)}while((ee++<J||D[0]!=null)&&Q--);N=D[0]!=null,K[0]||K.splice(0,1)}if(G==ft){for(Z=1,Q=K[0];Q>=10;Q/=10,Z++);M(H,W+(H.e=Z+X*de-1)+1,E,N)}else H.e=X,H.r=+N;return H}}();function k(x,S,L,I){var v,W,E,G,R;if(L==null?L=r:we(L,0,8),!x.c)return x.toString();if(v=x.c[0],E=x.e,S==null)R=it(x.c),R=I==1||I==2&&(E<=c||E>=d)?fs(R,E):vt(R,E,"0");else if(x=M(new b(x),S,L),W=x.e,R=it(x.c),G=R.length,I==1||I==2&&(S<=W||W<=c)){for(;G<S;R+="0",G++);R=fs(R,W)}else if(S-=E+(I===2&&W>E),R=vt(R,W,"0"),W+1>G){if(--S>0)for(R+=".";S--;R+="0");}else if(S+=W-G,S>0)for(W+1==G&&(R+=".");S--;R+="0");return x.s<0&&v?"-"+R:R}function T(x,S){for(var L,I,v=1,W=new b(x[0]);v<x.length;v++)I=new b(x[v]),(!I.s||(L=nn(W,I))===S||L===0&&W.s===S)&&(W=I);return W}function w(x,S,L){for(var I=1,v=S.length;!S[--v];S.pop());for(v=S[0];v>=10;v/=10,I++);return(L=I+L*de-1)>u?x.c=x.e=null:L<h?x.c=[x.e=0]:(x.e=L,x.c=S),x}i=function(){var x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,L=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(W,E,G,R){var X,Z=G?E:E.replace(v,"");if(I.test(Z))W.s=isNaN(Z)?null:Z<0?-1:1;else{if(!G&&(Z=Z.replace(x,function(N,P,B){return X=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!R||R==X?P:N}),R&&(X=R,Z=Z.replace(S,"$1").replace(L,"0.$1")),E!=Z))return new b(Z,X);if(b.DEBUG)throw Error(Ue+"Not a"+(R?" base "+R:"")+" number: "+E);W.s=null}W.c=W.e=null}}();function M(x,S,L,I){var v,W,E,G,R,X,Z,N=x.c,P=Oo;if(N){e:{for(v=1,G=N[0];G>=10;G/=10,v++);if(W=S-v,W<0)W+=de,E=S,R=N[X=0],Z=tt(R/P[v-E-1]%10);else if(X=Do((W+1)/de),X>=N.length)if(I){for(;N.length<=X;N.push(0));R=Z=0,v=1,W%=de,E=W-de+1}else break e;else{for(R=G=N[X],v=1;G>=10;G/=10,v++);W%=de,E=W-de+v,Z=E<0?0:tt(R/P[v-E-1]%10)}if(I=I||S<0||N[X+1]!=null||(E<0?R:R%P[v-E-1]),I=L<4?(Z||I)&&(L==0||L==(x.s<0?3:2)):Z>5||Z==5&&(L==4||I||L==6&&(W>0?E>0?R/P[v-E]:0:N[X-1])%10&1||L==(x.s<0?8:7)),S<1||!N[0])return N.length=0,I?(S-=x.e+1,N[0]=P[(de-S%de)%de],x.e=-S||0):N[0]=x.e=0,x;if(W==0?(N.length=X,G=1,X--):(N.length=X+1,G=P[de-W],N[X]=E>0?tt(R/P[v-E]%P[E])*G:0),I)for(;;)if(X==0){for(W=1,E=N[0];E>=10;E/=10,W++);for(E=N[0]+=G,G=1;E>=10;E/=10,G++);W!=G&&(x.e++,N[0]==ft&&(N[0]=1));break}else{if(N[X]+=G,N[X]!=ft)break;N[X--]=0,G=1}for(W=N.length;N[--W]===0;N.pop());}x.e>u?x.c=x.e=null:x.e<h&&(x.c=[x.e=0])}return x}function V(x){var S,L=x.e;return L===null?x.toString():(S=it(x.c),S=L<=c||L>=d?fs(S,L):vt(S,L,"0"),x.s<0?"-"+S:S)}return s.absoluteValue=s.abs=function(){var x=new b(this);return x.s<0&&(x.s=1),x},s.comparedTo=function(x,S){return nn(this,new b(x,S))},s.decimalPlaces=s.dp=function(x,S){var L,I,v,W=this;if(x!=null)return we(x,0,Ne),S==null?S=r:we(S,0,8),M(new b(W),x+W.e+1,S);if(!(L=W.c))return null;if(I=((v=L.length-1)-nt(this.e/de))*de,v=L[v])for(;v%10==0;v/=10,I--);return I<0&&(I=0),I},s.dividedBy=s.div=function(x,S){return e(this,new b(x,S),a,r)},s.dividedToIntegerBy=s.idiv=function(x,S){return e(this,new b(x,S),0,1)},s.exponentiatedBy=s.pow=function(x,S){var L,I,v,W,E,G,R,X,Z,N=this;if(x=new b(x),x.c&&!x.isInteger())throw Error(Ue+"Exponent not an integer: "+V(x));if(S!=null&&(S=new b(S)),G=x.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!x.c||!x.c[0])return Z=new b(Math.pow(+V(N),G?x.s*(2-us(x)):+V(x))),S?Z.mod(S):Z;if(R=x.s<0,S){if(S.c?!S.c[0]:!S.s)return new b(NaN);I=!R&&N.isInteger()&&S.isInteger(),I&&(N=N.mod(S))}else{if(x.e>9&&(N.e>0||N.e<-1||(N.e==0?N.c[0]>1||G&&N.c[1]>=24e7:N.c[0]<8e13||G&&N.c[0]<=9999975e7)))return W=N.s<0&&us(x)?-0:0,N.e>-1&&(W=1/W),new b(R?1/W:W);g&&(W=Do(g/de+2))}for(G?(L=new b(.5),R&&(x.s=1),X=us(x)):(v=Math.abs(+V(x)),X=v%2),Z=new b(l);;){if(X){if(Z=Z.times(N),!Z.c)break;W?Z.c.length>W&&(Z.c.length=W):I&&(Z=Z.mod(S))}if(v){if(v=tt(v/2),v===0)break;X=v%2}else if(x=x.times(L),M(x,x.e+1,1),x.e>14)X=us(x);else{if(v=+V(x),v===0)break;X=v%2}N=N.times(N),W?N.c&&N.c.length>W&&(N.c.length=W):I&&(N=N.mod(S))}return I?Z:(R&&(Z=l.div(Z)),S?Z.mod(S):W?M(Z,g,r,E):Z)},s.integerValue=function(x){var S=new b(this);return x==null?x=r:we(x,0,8),M(S,S.e+1,x)},s.isEqualTo=s.eq=function(x,S){return nn(this,new b(x,S))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(x,S){return nn(this,new b(x,S))>0},s.isGreaterThanOrEqualTo=s.gte=function(x,S){return(S=nn(this,new b(x,S)))===1||S===0},s.isInteger=function(){return!!this.c&&nt(this.e/de)>this.c.length-2},s.isLessThan=s.lt=function(x,S){return nn(this,new b(x,S))<0},s.isLessThanOrEqualTo=s.lte=function(x,S){return(S=nn(this,new b(x,S)))===-1||S===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(x,S){var L,I,v,W,E=this,G=E.s;if(x=new b(x,S),S=x.s,!G||!S)return new b(NaN);if(G!=S)return x.s=-S,E.plus(x);var R=E.e/de,X=x.e/de,Z=E.c,N=x.c;if(!R||!X){if(!Z||!N)return Z?(x.s=-S,x):new b(N?E:NaN);if(!Z[0]||!N[0])return N[0]?(x.s=-S,x):new b(Z[0]?E:r==3?-0:0)}if(R=nt(R),X=nt(X),Z=Z.slice(),G=R-X){for((W=G<0)?(G=-G,v=Z):(X=R,v=N),v.reverse(),S=G;S--;v.push(0));v.reverse()}else for(I=(W=(G=Z.length)<(S=N.length))?G:S,G=S=0;S<I;S++)if(Z[S]!=N[S]){W=Z[S]<N[S];break}if(W&&(v=Z,Z=N,N=v,x.s=-x.s),S=(I=N.length)-(L=Z.length),S>0)for(;S--;Z[L++]=0);for(S=ft-1;I>G;){if(Z[--I]<N[I]){for(L=I;L&&!Z[--L];Z[L]=S);--Z[L],Z[I]+=ft}Z[I]-=N[I]}for(;Z[0]==0;Z.splice(0,1),--X);return Z[0]?w(x,Z,X):(x.s=r==3?-1:1,x.c=[x.e=0],x)},s.modulo=s.mod=function(x,S){var L,I,v=this;return x=new b(x,S),!v.c||!x.s||x.c&&!x.c[0]?new b(NaN):!x.c||v.c&&!v.c[0]?new b(v):(m==9?(I=x.s,x.s=1,L=e(v,x,0,3),x.s=I,L.s*=I):L=e(v,x,0,m),x=v.minus(L.times(x)),!x.c[0]&&m==1&&(x.s=v.s),x)},s.multipliedBy=s.times=function(x,S){var L,I,v,W,E,G,R,X,Z,N,P,B,Y,H,K,D=this,z=D.c,_=(x=new b(x,S)).c;if(!z||!_||!z[0]||!_[0])return!D.s||!x.s||z&&!z[0]&&!_||_&&!_[0]&&!z?x.c=x.e=x.s=null:(x.s*=D.s,!z||!_?x.c=x.e=null:(x.c=[0],x.e=0)),x;for(I=nt(D.e/de)+nt(x.e/de),x.s*=D.s,R=z.length,N=_.length,R<N&&(Y=z,z=_,_=Y,v=R,R=N,N=v),v=R+N,Y=[];v--;Y.push(0));for(H=ft,K=Ot,v=N;--v>=0;){for(L=0,P=_[v]%K,B=_[v]/K|0,E=R,W=v+E;W>v;)X=z[--E]%K,Z=z[E]/K|0,G=B*X+Z*P,X=P*X+G%K*K+Y[W]+L,L=(X/H|0)+(G/K|0)+B*Z,Y[W--]=X%H;Y[W]=L}return L?++I:Y.splice(0,1),w(x,Y,I)},s.negated=function(){var x=new b(this);return x.s=-x.s||null,x},s.plus=function(x,S){var L,I=this,v=I.s;if(x=new b(x,S),S=x.s,!v||!S)return new b(NaN);if(v!=S)return x.s=-S,I.minus(x);var W=I.e/de,E=x.e/de,G=I.c,R=x.c;if(!W||!E){if(!G||!R)return new b(v/0);if(!G[0]||!R[0])return R[0]?x:new b(G[0]?I:v*0)}if(W=nt(W),E=nt(E),G=G.slice(),v=W-E){for(v>0?(E=W,L=R):(v=-v,L=G),L.reverse();v--;L.push(0));L.reverse()}for(v=G.length,S=R.length,v-S<0&&(L=R,R=G,G=L,S=v),v=0;S;)v=(G[--S]=G[S]+R[S]+v)/ft|0,G[S]=ft===G[S]?0:G[S]%ft;return v&&(G=[v].concat(G),++E),w(x,G,E)},s.precision=s.sd=function(x,S){var L,I,v,W=this;if(x!=null&&x!==!!x)return we(x,1,Ne),S==null?S=r:we(S,0,8),M(new b(W),x,S);if(!(L=W.c))return null;if(v=L.length-1,I=v*de+1,v=L[v]){for(;v%10==0;v/=10,I--);for(v=L[0];v>=10;v/=10,I++);}return x&&W.e+1>I&&(I=W.e+1),I},s.shiftedBy=function(x){return we(x,-Yo,Yo),this.times("1e"+x)},s.squareRoot=s.sqrt=function(){var x,S,L,I,v,W=this,E=W.c,G=W.s,R=W.e,X=a+4,Z=new b("0.5");if(G!==1||!E||!E[0])return new b(!G||G<0&&(!E||E[0])?NaN:E?W:1/0);if(G=Math.sqrt(+V(W)),G==0||G==1/0?(S=it(E),(S.length+R)%2==0&&(S+="0"),G=Math.sqrt(+S),R=nt((R+1)/2)-(R<0||R%2),G==1/0?S="5e"+R:(S=G.toExponential(),S=S.slice(0,S.indexOf("e")+1)+R),L=new b(S)):L=new b(G+""),L.c[0]){for(R=L.e,G=R+X,G<3&&(G=0);;)if(v=L,L=Z.times(v.plus(e(W,v,X,1))),it(v.c).slice(0,G)===(S=it(L.c)).slice(0,G))if(L.e<R&&--G,S=S.slice(G-3,G+1),S=="9999"||!I&&S=="4999"){if(!I&&(M(v,v.e+a+2,0),v.times(v).eq(W))){L=v;break}X+=4,G+=4,I=1}else{(!+S||!+S.slice(1)&&S.charAt(0)=="5")&&(M(L,L.e+a+2,1),x=!L.times(L).eq(W));break}}return M(L,L.e+a+1,r,x)},s.toExponential=function(x,S){return x!=null&&(we(x,0,Ne),x++),k(this,x,S,1)},s.toFixed=function(x,S){return x!=null&&(we(x,0,Ne),x=x+this.e+1),k(this,x,S)},s.toFormat=function(x,S,L){var I,v=this;if(L==null)x!=null&&S&&typeof S=="object"?(L=S,S=null):x&&typeof x=="object"?(L=x,x=S=null):L=p;else if(typeof L!="object")throw Error(Ue+"Argument not an object: "+L);if(I=v.toFixed(x,S),v.c){var W,E=I.split("."),G=+L.groupSize,R=+L.secondaryGroupSize,X=L.groupSeparator||"",Z=E[0],N=E[1],P=v.s<0,B=P?Z.slice(1):Z,Y=B.length;if(R&&(W=G,G=R,R=W,Y-=W),G>0&&Y>0){for(W=Y%G||G,Z=B.substr(0,W);W<Y;W+=G)Z+=X+B.substr(W,G);R>0&&(Z+=X+B.slice(W)),P&&(Z="-"+Z)}I=N?Z+(L.decimalSeparator||"")+((R=+L.fractionGroupSize)?N.replace(new RegExp("\\d{"+R+"}\\B","g"),"$&"+(L.fractionGroupSeparator||"")):N):Z}return(L.prefix||"")+I+(L.suffix||"")},s.toFraction=function(x){var S,L,I,v,W,E,G,R,X,Z,N,P,B=this,Y=B.c;if(x!=null&&(G=new b(x),!G.isInteger()&&(G.c||G.s!==1)||G.lt(l)))throw Error(Ue+"Argument "+(G.isInteger()?"out of range: ":"not an integer: ")+V(G));if(!Y)return new b(B);for(S=new b(l),X=L=new b(l),I=R=new b(l),P=it(Y),W=S.e=P.length-B.e-1,S.c[0]=Oo[(E=W%de)<0?de+E:E],x=!x||G.comparedTo(S)>0?W>0?S:X:G,E=u,u=1/0,G=new b(P),R.c[0]=0;Z=e(G,S,0,1),v=L.plus(Z.times(I)),v.comparedTo(x)!=1;)L=I,I=v,X=R.plus(Z.times(v=X)),R=v,S=G.minus(Z.times(v=S)),G=v;return v=e(x.minus(L),I,0,1),R=R.plus(v.times(X)),L=L.plus(v.times(I)),R.s=X.s=B.s,W=W*2,N=e(X,I,W,r).minus(B).abs().comparedTo(e(R,L,W,r).minus(B).abs())<1?[X,I]:[R,L],u=E,N},s.toNumber=function(){return+V(this)},s.toPrecision=function(x,S){return x!=null&&we(x,1,Ne),k(this,x,S,2)},s.toString=function(x){var S,L=this,I=L.s,v=L.e;return v===null?I?(S="Infinity",I<0&&(S="-"+S)):S="NaN":(x==null?S=v<=c||v>=d?fs(it(L.c),v):vt(it(L.c),v,"0"):x===10&&C?(L=M(new b(L),a+v+1,r),S=vt(it(L.c),L.e,"0")):(we(x,2,y.length,"Base"),S=n(vt(it(L.c),v,"0"),10,x,I,!0)),I<0&&L.c[0]&&(S="-"+S)),S},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,t!=null&&b.set(t),b}function nt(t){var e=t|0;return t>0||t===e?e:e-1}function it(t){for(var e,n,i=1,s=t.length,l=t[0]+"";i<s;){for(e=t[i++]+"",n=de-e.length;n--;e="0"+e);l+=e}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function nn(t,e){var n,i,s=t.c,l=e.c,a=t.s,r=e.s,c=t.e,d=e.e;if(!a||!r)return null;if(n=s&&!s[0],i=l&&!l[0],n||i)return n?i?0:-r:a;if(a!=r)return a;if(n=a<0,i=c==d,!s||!l)return i?0:!s^n?1:-1;if(!i)return c>d^n?1:-1;for(r=(c=s.length)<(d=l.length)?c:d,a=0;a<r;a++)if(s[a]!=l[a])return s[a]>l[a]^n?1:-1;return c==d?0:c>d^n?1:-1}function we(t,e,n,i){if(t<e||t>n||t!==tt(t))throw Error(Ue+(i||"Argument")+(typeof t=="number"?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function us(t){var e=t.c.length-1;return nt(t.e/de)==e&&t.c[e]%2!=0}function fs(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function vt(t,e,n){var i,s;if(e<0){for(s=n+".";++e;s+=n);t=s+t}else if(i=t.length,++e>i){for(s=n,e-=i;--e;s+=n);t+=s}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Gr=Wr();function sn(t){return new Gr(t)}function Ho(t,e){return sn(t).plus(sn(e)).toNumber()}function T0(t,e){return sn(t).minus(sn(e)).toNumber()}function M0(t,e){return sn(t).dividedBy(sn(e)).toNumber()}function Zr(t,e){return sn(t).decimalPlaces(e,Gr.ROUND_DOWN).toNumber()}const v0={name:"EvGridSummary",props:{stores:{type:Object,default:()=>({})},orderedColumns:{type:Object,default:()=>({})},useCheckbox:{type:Boolean,default:!1},styleOption:{type:Object,default:()=>({})},isTree:{type:Boolean,default:!1},scrollLeft:{type:Number,default:0}},setup(t){const e={max:20,default:3},n=o.ref(),i=2,s=o.computed(()=>t.stores),l=o.computed(()=>t.orderedColumns),a=o.computed(()=>t.useCheckbox),r=o.computed(()=>t.styleOption),c=m=>m==null||m<0?e.default:m>e.max?e.max:m,d=(m,g)=>{if(typeof g=="string"&&g.length===0)return g;const{type:p,decimal:y}=m;let C=g;return p==="number"?(C=Qt(g),C=C===!1?g:C):p==="float"&&(C=C.toFixed(c(y??e.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),C},h=m=>l.value.findIndex(g=>g.field===m),u=m=>{const{type:g,field:p,summaryType:y,summaryDecimal:C,summaryOnlyTopParent:b}=m;let k="";const T=h(p);if(T>=0){if(y==="count")return s.value.store.length;if(g==="number"||g==="float"){let w=[];switch(t.isTree?w=s.value.store.reduce((M,V)=>{var x,S;return b?V.parent||M.push((x=V.data)==null?void 0:x[p]):M.push((S=V.data)==null?void 0:S[p]),M},[]):w=s.value.store.map(M=>M[i][T]),y){case"sum":{const M=w.reduce((V,x)=>{const S=Number(x);return Number.isNaN(S)?V:Ho(V,S)},0);k=M&&Zr(M,c(C??e.default));break}case"average":{const M=w.reduce((V,x)=>{const S=Number(x);return Number.isNaN(S)?V:Ho(V,S)},0);k=M&&Zr(M0(M,w.length),c(C??e.default));break}case"max":{const M=w.filter(V=>V!=null);k=M.length?Math.max(...M):"";break}case"min":{const M=w.filter(V=>V!=null);k=M.length?Math.min(...M):"";break}}k=d(m,k)}}return k},f=m=>{const g=m.summaryRenderer,p=m.summaryData?m.summaryData:[],y=[m.field,...p];let C=g;return y.forEach((b,k)=>{const T=h(b);if(T>=0){const w=u(s.value.orderedColumns[T]);C=C.replace(`{${k}}`,w)}}),C};return o.watch(()=>t.scrollLeft,m=>{o.nextTick(()=>{n.value.scrollLeft=m})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:u,getSummaryRenderer:f}}},R0={class:"column-list"},V0=["title"],E0=["title"];function W0(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{ref:"summaryRef",class:o.normalizeClass({"grid-summary":!0,"non-border":i.styleInfo.borderStyle==="none"})},[o.createElementVNode("ul",R0,[i.showCheckbox?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle}),style:o.normalizeStyle({width:`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[o.createElementVNode("span",{style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columns,(a,r)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`summary_${r}`},[a.hide?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:o.normalizeStyle({width:`${a.width}px`,"min-width":`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle({width:"100%",height:`${i.styleInfo.rowHeight}px`})},[a.summaryRenderer?(o.openBlock(),o.createElementBlock("div",{key:0,title:i.getSummaryRenderer(a)},o.toDisplayString(i.getSummaryRenderer(a)),9,V0)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,E0))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const Xr=ce(v0,[["render",W0],["__scopeId","data-v-4b9bef37"]]),G0={name:"EVGridColumnSetting",directives:{clickoutside:Hi},props:{isShow:{type:Boolean,default:!1},columns:{type:[Array],default:()=>[]},hiddenColumn:{type:String,default:""},position:{type:Object,default:()=>({top:0,left:0,columnListMenuWidth:0})},isShowMenuOnClick:{type:Boolean,default:!1},textInfo:{type:Object,default:()=>({title:"Column List",search:"Search",empty:"No records",ok:"OK"})}},emits:{"update:isShow":[Boolean],"update:isShowMenuOnClick":[Boolean],"apply-column":null},setup(t,{emit:e}){const n=o.computed({get:()=>t.isShow,set:I=>e("update:isShow",I)}),i=o.ref(null),s=o.ref(""),l=o.ref(!1),a=o.ref([]),r=o.ref([]),c=o.ref([]),d=o.ref([]),h=o.computed(()=>l.value?c.value:r.value),u=o.computed(()=>!h.value.length);let f=null,m=null;const g=o.reactive({top:null,left:null}),p=o.computed({get:()=>t.isShowMenuOnClick,set:I=>e("update:isShowMenuOnClick",I)}),y=I=>{var v;(I==null?void 0:I.length)===1?m=I[0]:(I==null?void 0:I.length)<1&&(m==null&&(m=(v=r.value[0])==null?void 0:v.text),a.value.push(m))},C=I=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,I){const v=I.toString().toLowerCase();c.value=r.value.filter(W=>W.label.toString().toLowerCase().includes(v)),l.value=!0}},500)},b=()=>{s.value="",l.value=!1,c.value.length=0},k=()=>{const I=d.value.length?d.value:r.value;a.value=I.filter(v=>v.originChecked).map(v=>v.text),b()},T=()=>{d.value=r.value.filter(v=>a.value.includes(v.text));const I=d.value.map(v=>v.text);e("apply-column",I),n.value=!1,p.value=!1},w=o.ref(),M=o.ref(),V=()=>{M.value=Re(a.value),r.value=t.columns.filter(I=>!I.hide&&I.caption).map(I=>{var E,G;const v=(E=w.value)==null?void 0:E.find(R=>R.field===I.field);let W=!1;return v?W=(v==null?void 0:v.hiddenDisplay)!==(I==null?void 0:I.hiddenDisplay)||!((G=M.value)!=null&&G.length)?!(I!=null&&I.hiddenDisplay):M.value.includes(I.field):W=!I.hiddenDisplay,{label:I.caption,text:I.field,originChecked:!I.hiddenDisplay,checked:W,fixed:I.fixed}}),a.value=r.value.filter(I=>I.checked).map(I=>I.text),d.value.length=0,w.value=Re(t.columns)},x=()=>{n.value=!1,p.value=!1},S=()=>{const I=document.createElement("div");I.id="ev-grid-column-setting-modal",I.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(I)},L=async()=>{var B;await o.nextTick();const I=document.documentElement.clientWidth,v=document.documentElement.clientHeight,W=(B=i.value)==null?void 0:B.getBoundingClientRect(),E=W==null?void 0:W.width,G=W==null?void 0:W.height,{top:R,left:X,columnListMenuWidth:Z}=t.position;let N;Z?(N=X,I<X+E&&(N=X-E-Z)):N=X-E;const P=v-G;g.top=`${Math.min(R,P)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>S()),o.watch(()=>t.columns,()=>{V()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{k(),n.value&&await L()}),o.watch(()=>t.hiddenColumn,I=>{const v=d.value.length?d.value.filter(W=>W.text!==I):r.value.filter(W=>W.text!==I&&W.checked);d.value=v,a.value=v.map(W=>W.text)}),{columnSettingWrapper:i,columnSettingStyle:g,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:u,onSearchColumn:C,onApplyColumn:T,onCheckColumn:y,hideColumnSetting:x}}},Z0={class:"ev-grid-column-setting__header"},X0={class:"header-title"},N0={class:"ev-grid-column-setting__content"},P0={key:1,class:"is-empty"},B0={class:"ev-grid-column-setting__footer"};function D0(t,e,n,i,s,l){const a=o.resolveComponent("ev-text-field"),r=o.resolveComponent("ev-checkbox"),c=o.resolveComponent("ev-checkbox-group"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowColumnSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:o.normalizeStyle(i.columnSettingStyle)},[o.createElementVNode("div",Z0,[o.createElementVNode("p",X0,o.toDisplayString(n.textInfo.title),1),o.createVNode(a,{modelValue:i.searchVm,"onUpdate:modelValue":e[0]||(e[0]=u=>i.searchVm=u),type:"search",placeholder:n.textInfo.search,onInput:i.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),o.createElementVNode("div",N0,[i.columnList.length?(o.openBlock(),o.createBlock(c,{key:0,modelValue:i.checkColumnGroup,"onUpdate:modelValue":e[1]||(e[1]=u=>i.checkColumnGroup=u),onChange:i.onCheckColumn},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columnList,(u,f)=>(o.openBlock(),o.createBlock(r,{key:`column_${f}`,label:u==null?void 0:u.text,disabled:!!(u!=null&&u.fixed),"tooltip-title":(u==null?void 0:u.label)??""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u==null?void 0:u.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(o.openBlock(),o.createElementBlock("p",P0,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",B0,[o.createVNode(d,{type:"primary",disabled:i.isDisabled,onClick:i.onApplyColumn},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,i.hideColumnSetting]])])):o.createCommentVNode("",!0)}const Nr=ce(G0,[["render",D0]]),Y0={name:"EVGridFilterSetting",directives:{clickoutside:Hi},props:{isShow:{type:Boolean,default:!1},position:{type:Object,default:()=>({top:0,left:0})},column:{type:Object,default:()=>({})},items:{type:Object,default:()=>({})}},emits:{"update:isShow":null,"apply-filtering":null},setup(t,{emit:e}){const n=o.ref([]),i=o.computed(()=>t.column),s=[{name:"AND",value:"and"},{name:"OR",value:"or"}],l=[{name:"true",value:"true"},{name:"false",value:"false"}],a=[{name:"=",value:"="},{name:"!=",value:"!="},{name:"<",value:"<"},{name:">",value:">"},{name:"<=",value:"<="},{name:">=",value:">="}],r=[{name:"s%",value:"s%"},{name:"%s",value:"%s"},{name:"%s%",value:"%s%"},{name:"Not Like",value:"notLike"},{name:"=",value:"="},{name:"!=",value:"!="}],c=[{name:"Is empty",value:"isEmpty"},{name:"Is not empty",value:"isNotEmpty"}],d=T=>T==="string"||T==="stringNumber"?[...r,...c]:T==="number"||T==="float"?[...a,...c]:T==="boolean"?[{name:"=",value:"="}]:[],h=o.computed(()=>d(t.column.type)),u=o.computed({get:()=>t.isShow,set:T=>e("update:isShow",T)}),f=()=>{const T=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:T,value:"",caption:i.value.caption})},m=T=>{n.value.length>1?n.value.splice(T,1):T===0&&(n.value[0].comparison="=",n.value[0].value="")},g=(T,w)=>{(T==="isEmpty"||T==="isNotEmpty")&&(n.value[w].value="")},p=T=>{n.value=n.value.map(w=>({...w,operator:T}))},y=()=>{e("apply-filtering",i.value.field,n.value.filter(T=>T.value||T.comparison==="isEmpty"||T.comparison==="isNotEmpty"))};o.watch(()=>t.isShow,T=>{var V;const w=[],M=Re(t.items);T&&i.value.field&&((V=M[i.value.field])!=null&&V.length?M[i.value.field].forEach(x=>{w.push(x)}):w.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=w)});const C=(T,w)=>{var M;return((M=T.find(V=>V.value===w))==null?void 0:M.name)||""},b=()=>{const T=document.createElement("div");T.id="ev-grid-filter-setting-modal",T.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(T)};return o.onBeforeMount(()=>{b()}),{filteringItems:n,isShowFilterSetting:u,items1:s,items2:h,booleanItems:l,addRow:f,removeRow:m,changeOperator:p,applyFiltering:y,changeComparison:g,getSelectTitle:C,validateValue:(T,w)=>{(T==="number"||T==="float")&&(w.value=w.value.replace(/[^0-9.,]/g,""))}}}},O0={class:"ev-grid-filter-setting__header"},H0={class:"header-title"},F0={class:"ev-grid-filter-setting__content"},z0={class:"ev-grid-filter-setting__row--button"},A0={class:"ev-grid-filter-setting__footer"};function K0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("ev-text-field"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowFilterSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:"ev-grid-filter-setting",style:o.normalizeStyle({top:t.$props.position.top,left:t.$props.position.left})},[o.createElementVNode("div",O0,[o.createVNode(a,{icon:"ev-icon-filter-list"}),o.createElementVNode("span",H0," Filter ("+o.toDisplayString(t.$props.column.caption)+") ",1)]),o.createElementVNode("div",F0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteringItems,(u,f)=>(o.openBlock(),o.createElementBlock("div",{key:f,class:"ev-grid-filter-setting__row"},[o.createVNode(r,{modelValue:u.operator,"onUpdate:modelValue":m=>u.operator=m,class:"ev-grid-filter-setting__row--operator",title:i.getSelectTitle(i.items1,u.operator),items:i.items1,disabled:f>1,style:o.normalizeStyle({visibility:f>0?"visible":"hidden"}),onChange:i.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),o.createVNode(r,{modelValue:u.comparison,"onUpdate:modelValue":m=>u.comparison=m,class:"ev-grid-filter-setting__row--comparison",title:i.getSelectTitle(i.items2,u.comparison),items:i.items2,onChange:m=>i.changeComparison(u.comparison,f)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),t.$props.column.type==="boolean"?(o.openBlock(),o.createBlock(r,{key:0,modelValue:u.value,"onUpdate:modelValue":m=>u.value=m,class:"ev-grid-filter-setting__row--comparison",items:i.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(o.openBlock(),o.createBlock(c,{key:1,modelValue:u.value,"onUpdate:modelValue":m=>u.value=m,class:"ev-grid-filter-setting__row--value",disabled:u.comparison==="isEmpty"||u.comparison==="isNotEmpty",onInput:m=>i.validateValue(t.$props.column.type,u)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),o.createElementVNode("div",z0,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:m=>i.removeRow(f)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",A0,[o.createVNode(d,{type:"primary",onClick:i.applyFiltering},{default:o.withCtx(()=>[...e[0]||(e[0]=[o.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{i.isShowFilterSetting=!1}]])])):o.createCommentVNode("",!0)}const _0=ce(Y0,[["render",K0]]),U0={name:"GridSortButton",props:{icon:{type:String,default:""}}},J0={key:0},j0={key:1},Q0={key:2};function $0(t,e,n,i,s,l){return n.icon==="basic"?(o.openBlock(),o.createElementBlock("span",J0,[...e[0]||(e[0]=[o.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),o.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508 4.795L5.41508
|
|
6
6
|
5.5L7.00008 3.915ZM7.00008 10.085L5.41508 8.5L4.71008 9.205L7.00008
|
|
7
7
|
11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#121212"}),o.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008
|
|
8
8
|
2.5L4.70508 4.795L5.41508 5.5L7.00008 3.915ZM7.00008 10.085L5.41508
|
|
9
|
-
8.5L4.71008 9.205L7.00008 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#D8D8D8","fill-opacity":"0.09"})],-1)])])):n.icon==="asc"?(o.openBlock(),o.createElementBlock("span",
|
|
9
|
+
8.5L4.71008 9.205L7.00008 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#D8D8D8","fill-opacity":"0.09"})],-1)])])):n.icon==="asc"?(o.openBlock(),o.createElementBlock("span",j0,[...e[1]||(e[1]=[o.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
|
|
10
10
|
4.795L5.41508 5.5L7.00008 3.915Z" fill="#121212"></path><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
|
|
11
11
|
4.795L5.41508 5.5L7.00008 3.915Z" fill="#D8D8D8" fill-opacity="0.09"></path><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
|
|
12
|
-
8.705L5.41508 8L7.00008 9.585Z" fill="#DEE2E6"></path></svg>`,1)])])):n.icon==="desc"?(o.openBlock(),o.createElementBlock("span",
|
|
12
|
+
8.705L5.41508 8L7.00008 9.585Z" fill="#DEE2E6"></path></svg>`,1)])])):n.icon==="desc"?(o.openBlock(),o.createElementBlock("span",Q0,[...e[2]||(e[2]=[o.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
|
|
13
13
|
8.705L5.41508 8L7.00008 9.585Z" fill="#121212"></path><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
|
|
14
14
|
8.705L5.41508 8L7.00008 9.585Z" fill="#D8D8D8" fill-opacity="0.09"></path><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
|
|
15
|
-
4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):o.createCommentVNode("",!0)}const Pr=ce(
|
|
15
|
+
4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):o.createCommentVNode("",!0)}const Pr=ce(U0,[["render",$0]]),q0={name:"GridOptionButton"},eS={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tS(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("svg",eS,[...e[0]||(e[0]=[o.createElementVNode("circle",{cx:"6.49805",cy:"11.998",r:"1.5",transform:"rotate(-90 6.49805 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("circle",{cx:"11.998",cy:"11.998",r:"1.5",transform:"rotate(-90 11.998 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("path",{d:`M17.498 10.498C18.3265 10.498 18.998 11.1696 18.998 11.998C18.998
|
|
16
16
|
12.8265 18.3265 13.498 17.498 13.498C16.6696 13.498 15.998 12.8265
|
|
17
|
-
15.998 11.998C15.998 11.1696 16.6696 10.498 17.498 10.498Z`,fill:"#ADB5BD"},null,-1)])])}const Fo=ce(U0,[["render",j0]]),Rt=0,In=1,ue=2,di=3,zo=4,Q0=()=>{const{props:t}=o.getCurrentInstance();return{isRenderer:(a={})=>{var r;return!!((r=a==null?void 0:a.render)!=null&&r.use)},getComponentName:(a="")=>{const r=h=>h.charAt(0).toUpperCase()+h.slice(1),c="Renderer";let d="";if(a.indexOf("_")!==-1){const h=a.split("_");for(let u=0;u<h.length;u++)d+=r(h[u])}else d=r(a);return d+c},getConvertValue:(a,r)=>{let c=a.type==="number"||a.type==="float"?Number(r):r;return a.type==="number"?(c=Qt(r),c=c===!1?r:c):a.type==="float"&&(c=c.toFixed(a.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),c},getColumnIndex:a=>t.columns.findIndex(r=>r.field===a),setPixelUnit:a=>{let r=a;const c=r.toString().indexOf("px")>=0,d=r.toString().indexOf("%")>=0;return!c&&!d&&(r=`${r}px`),r}}},us=t=>{var i;const e=((i=t.movedColumns)!=null&&i.length?t.movedColumns:t.originColumns)??[],n=new Map((t.filteredColumns??[]).map(s=>[s.index,s]));return e.map(s=>{const l=n.get(s.index)??{};return{...s,...l}})},$0=t=>{const{scrollInfo:e,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=t,h=g=>{var b,w;const p=i.body,y=s.rowHeight,C=d.detailRowHeight??0;if(p){let T=n.store;l.isClientPaging&&(T=r());const k=((b=d.expandedRows)==null?void 0:b.length)??0,M=((w=d.expandedRows)==null?void 0:w.map(E=>T.findIndex(X=>X[ue]===E)))??[],V=T.length*y+k*C;let x=0,S=0;if(k)for(x=0;S+y<p.scrollTop;x++)M.includes(x)&&(S+=C),S+=y;else x=Math.floor(p.scrollTop/y),S=Math.max(x,0)*y;x>T.length-1&&(x=0);let L=0,I=0;if(k)for(let E=x;I<=p.clientHeight;E++)M.includes(E)&&(I+=C),I+=y,L+=1;else L=p.clientHeight>y?Math.ceil(p.clientHeight/y):T.length,I=L*y;const R=x+L+1,v=Math.max(x,0),G=R,W=i.table;n.viewStore=T.slice(v,G),e.hasVerticalScrollBar=L<T.length||p.clientHeight<W.clientHeight,e.vScrollTopHeight=S,e.vScrollBottomHeight=V-I-e.vScrollTopHeight,g&&l.isInfinite&&e.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(G/l.perPage)+1,l.startIndex=G,c({onScrollEnd:!0}))}},u=g=>{if(d.useRowDetail&&!d.detailRowHeight){let p=n.store;l.isClientPaging&&(p=r()),n.viewStore=[...p],e.vScrollTopHeight=0,e.vScrollBottomHeight=0}else h(g)},f=()=>{const g=i.header,p=i.body,y=i.table;g.scrollLeft=p.scrollLeft,a.value=p.scrollLeft,e.hasHorizontalScrollBar=p.clientWidth<y.clientWidth};return{updateVScroll:u,updateHScroll:f,onScroll:()=>{const g=i.body,p=g.scrollTop,y=g.scrollLeft,C=e.lastScroll.top,b=e.lastScroll.left,w=y!==b;p!==C&&(g!=null&&g.clientHeight)&&u(!0),w&&f(),e.lastScroll.top=p,e.lastScroll.left=y}}},q0=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:u}=t,f=()=>{var b;let y=i.columnWidth,C=0;if(i.adjust){const w=s.body;let T=w.offsetWidth;const k=w.offsetHeight,M=((b=w.querySelector("tr"))==null?void 0:b.offsetHeight)||i.rowHeight,V=T-w.clientWidth,x=r.orderedColumns.reduce((S,L)=>(L.hide||L.hiddenDisplay||(L.width?S.totalWidth+=L.width:S.emptyCount++),S),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*e.rows.length>k&&(T-=V),l.useCheckbox.use&&(T-=i.minWidth),a.useRowDetail&&(T-=i.minWidth),y=T-x.totalWidth,y>0){const S=x.emptyCount===0?0:Math.floor(y/x.emptyCount);C=y-S*x.emptyCount,y=x.emptyCount!==0?S:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(r.orderedColumns.forEach(w=>{const T=c(w)?i.rendererMinWidth:i.minWidth;w.width&&w.width<T&&(w.width=T),!w.width&&!w.hide&&(w.width=y)}),C&&r.orderedColumns.length){let w=r.orderedColumns.length-1,T=r.orderedColumns[w];for(;w>0&&T&&(T.hide||T.hiddenDisplay);)w-=1,T=r.orderedColumns[w];T&&(T.width+=C)}},m=()=>{const y=new Map(e.columns.map(C=>[C.field,C.width]));o.nextTick(()=>{var C,b;i.adjust&&r.orderedColumns.forEach(w=>{const T=w;return T.resized||(T.width=y.get(T.field)??0),T},void 0),f(),(C=s.body)!=null&&C.clientHeight&&d(),(b=s.body)!=null&&b.clientWidth&&h()})};return{calculatedColumn:f,onResize:m,onShow:y=>{y&&m()},onColumnResize:(y,C)=>{C.preventDefault();const b=s.header,w=s.body,T=b.getBoundingClientRect().left,k=b.querySelector(`li[data-index="${y}"]`),M=c(r.orderedColumns[y])?i.rendererMinWidth:i.minWidth,V=k.getBoundingClientRect(),x=s.resizeLine,S=V.left-T+M,L=V.right-T,I=C.clientX,R=V.left-T;w.style.overflow="auto",x.style.left=`${L}px`,i.showResizeLine=!0;const v=W=>{const E=W.clientX-I,X=L+E,Z=Math.max(S,X);x.style.left=`${Z}px`},G=()=>{const E=parseInt(x.style.left,10)-R;r.orderedColumns[y]&&(r.orderedColumns[y].width=E,r.orderedColumns[y].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",v),m();const X=us(r);n("resize-column",{column:r.orderedColumns[y],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",v),document.addEventListener("mouseup",G,{once:!0})}}},eS=t=>{const{emit:e}=o.getCurrentInstance(),{selectInfo:n,stores:i}=t,s=(d,h)=>{var m;const u=(m=d.target.tagName)==null?void 0:m.toLowerCase();let f={};return u==="td"?f=d.target.dataset:f=d.target.parentNode.dataset,{event:d,rowData:h[ue],rowIndex:h[Rt],cellName:f.name,cellIndex:f.index}};let l=null,a=-1;return{onRowClick:(d,h,u)=>{var g,p,y;if((g=d.target.parentElement.classList)!=null&&g.contains("row-checkbox-input"))return!1;const f=!!((y=(p=d.target.closest("td"))==null?void 0:p.classList)!=null&&y.contains("row-contextmenu")),m=(C,b,w)=>{if(C==="shift"){const T=h[Rt];if(a>-1)for(let k=Math.min(T,a);k<=Math.max(T,a);k++)if(!b)i.originStore[k][di]=!0,a!==k&&n.selectedRow.push(i.originStore[k][ue]);else{i.originStore[k][di]=!1;const M=n.selectedRow.indexOf(i.originStore[k][ue]);M>-1&&n.selectedRow.splice(M,1)}}else C==="ctrl"&&(b?n.selectedRow.splice(n.selectedRow.indexOf(h[ue]),1):n.selectedRow.push(w))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const C=h[ue],b=h[di];h[di]=!h[di];let w="";d.shiftKey?w="shift":d.ctrlKey&&(w="ctrl"),n.multiple&&w?m(w,b,C):u||f?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(C)||(n.selectedRow=[C])):b?n.selectedRow=[]:n.selectedRow=[C],a=h[Rt],e("update:selected",n.selectedRow),e("click-row",s(d,h))}},100),!0},onRowDblClick:(d,h)=>{l&&clearTimeout(l),e("dblclick-row",s(d,h))}}},tS=t=>{const{checkInfo:e,stores:n,pageInfo:i,getPagingData:s}=t,{props:l,emit:a}=o.getCurrentInstance(),r=h=>{const u=n.originStore.findIndex(f=>f[ue]===h[ue]);u!==-1&&(n.originStore[u][In]=h[In])};return{onCheck:(h,u)=>{if(e.useCheckbox.mode==="single"&&e.prevCheckedRow.length&&(e.prevCheckedRow=[],r(e.prevCheckedRow)),u[In]){e.useCheckbox.mode==="single"?e.checkedRows=[u[ue]]:e.checkedRows.push(u[ue]);let f=n.store;i.isClientPaging&&(f=s());const m=f.filter(g=>!l.uncheckable.includes(g[ue])).filter(g=>!l.disabledRows.includes(g[ue])).every(g=>g[In]);f.length&&m&&(e.isHeaderChecked=!0),e.isHeaderIndeterminate=f.length&&!m}else e.useCheckbox.mode==="single"?e.checkedRows=[]:e.checkedRows.splice(e.checkedRows.indexOf(u[ue]),1),e.isHeaderChecked=!1,e.isHeaderIndeterminate=!!(n.store.length&&e.checkedRows.length);e.prevCheckedRow=u.slice(),a("update:checked",e.checkedRows),a("check-row",h,u[Rt],u[ue])},onCheckAll:h=>{const u=e.isHeaderChecked;let f=n.store;i.isClientPaging&&(f=s()),f.forEach(m=>{const g=l.uncheckable.includes(m[ue])||l.disabledRows.includes(m[ue]);u?!e.checkedRows.includes(m[ue])&&!g&&e.checkedRows.push(m[ue]):e.checkedRows.splice(e.checkedRows.indexOf(m[ue]),1),g||(m[In]=u)}),e.isHeaderIndeterminate=!1,a("update:checked",e.checkedRows),a("check-all",h,e.checkedRows)}}},nS=t=>{const{expandedInfo:e}=t,{emit:n}=o.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[ue],r=e.expandedRows.indexOf(a);r===-1?e.expandedRows.push(a):e.expandedRows.splice(r,1),l[zo]=!l[zo],n("update:expanded",e.expandedRows),n("expand-row",s,l[ue],l[zo],l[Rt])}}},iS=t=>{const{sortInfo:e,stores:n,updatePagingInfo:i}=t,{emit:s}=o.getCurrentInstance(),l=(p=!0)=>p?["asc","desc","init"]:["asc","desc"];function a(){this.orders=l(),this.dequeue=()=>this.orders.shift(),this.enqueue=p=>this.orders.push(p)}const r=(p,y="init")=>{n.orderedColumns.forEach(C=>{C.index===(p==null?void 0:p.index)&&y?C.sortOption={sortType:y}:C.sortOption={sortType:"init"}})},c=()=>{const p=n.originColumns.filter(y=>y.hiddenDisplay||y.hide);p.length&&p.forEach(y=>{y.sortOption={sortType:"init"}})},d=new a,h=(p,y=!0)=>{const{sortType:C}=(p==null?void 0:p.sortOption)||{};e.sortColumn=p,e.sortField=p==null?void 0:p.field,e.sortOrder=C,e.isSorting=!!C,y&&(r(p,C),s("change-column-info",{type:"sort",columns:us(n)}))},u=(p,y)=>{if(p.sortable===void 0?!0:p.sortable){e.sortColumn=p,e.sortField!==(p==null?void 0:p.field)&&(d.orders=l(),e.sortField=p==null?void 0:p.field),y&&(d.orders=l(),y==="desc"&&(e.sortOrder=d.dequeue(),d.enqueue(e.sortOrder))),e.sortOrder=d.dequeue(),d.enqueue(e.sortOrder),e.isSorting=!0,i({onSort:!0}),c(),r(p,e.sortOrder);const b=us(n);s("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:b}),s("change-column-info",{type:"sort",columns:b})}},f=()=>{var L;const{field:p,index:y}=e.sortColumn||{},C=((L=e.sortFunction)==null?void 0:L[p])??null,b=(I,R)=>I>R?-1:1,w=(I,R)=>I<R?-1:1,T=(I,R)=>(I===null)-(R===null)||Number(R)-Number(I),k=(I,R)=>(I===null)-(R===null)||Number(I)-Number(R);if(e.sortOrder==="init"||!e.sortField&&!e.isSorting){n.store.sort((I,R)=>typeof I[Rt]=="number"?w(I[Rt],R[Rt]):0);return}const M=e.sortColumn.type||"string",V=e.sortOrder==="desc"?b:w,x=e.sortOrder==="desc"?T:k,S=(I,R)=>{var W,E;let v=I[ue][y],G=R[ue][y];return I[ue][y]&&typeof I[ue][y]=="object"&&(v=I[ue][y][(W=n.originColumns[y])==null?void 0:W.field],G=R[ue][y][(E=n.originColumns[y])==null?void 0:E.field]),{aCol:v,bCol:G}};if(C){n.store.sort((I,R)=>{const v=I[ue][y],G=R[ue][y],W=C(v,G);return e.sortOrder==="desc"?-W:W});return}switch(M){case"string":n.store.sort((I,R)=>{let{aCol:v,bCol:G}=S(I,R);if((!v||typeof v=="string")&&(!G||typeof G=="string")){v=v||"",G=G||"";const W=v.toLowerCase(),E=G.toLowerCase();if(v!==G&&W===E){const X=Array.from(v).findIndex((Z,N)=>Z!==G[N]);return V(v[X],G[X])}return V(W,E)}return 0});break;case"stringNumber":n.store.sort((I,R)=>{let{aCol:v,bCol:G}=S(I,R);return!v||typeof v=="string"||typeof v=="number"?(v=v===""?null:v,G=G===""?null:G,x(v??null,G??null)):0});break;default:n.store.sort((I,R)=>{const{aCol:v,bCol:G}=S(I,R);return!v||typeof v=="number"||typeof v=="boolean"?x(v??null,G??null):0});break}},m=()=>{var p;return(p=n.orderedColumns)==null?void 0:p.find(y=>(y==null?void 0:y.sortOption)&&l(!1).includes(y.sortOption.sortType))};return{onSort:u,getSortTarget:m,setSort:f,setSortInfo:h,hasSortTarget:()=>!!m()}},sS=t=>{const{props:e}=o.getCurrentInstance(),{columnSettingInfo:n,filterInfo:i,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:u}=t,f=k=>{let M=0;k.forEach(V=>{const x=l.checkedRows.includes(V[ue]);V[In]=x,M+=x?1:0}),k.length&&(l.isHeaderChecked=k.length===M,l.isHeaderIndeterminate=k.length!==M&&M>0,l.isHeaderUncheckable=k.every(V=>e.uncheckable.includes(V[ue])||e.disabledRows.includes(V[ue])))},m=(k,M,V)=>{if(typeof k!="string"||M===null)return!1;const x=M==null?void 0:M.toLowerCase(),S=k==null?void 0:k.toLowerCase();let L=x.includes(S);return V&&(V==="start"?L=x.startsWith(S):V==="end"&&(L=x.endsWith(S))),L},g=(k,M)=>{const V=M.comparison,x=M.value;let S=k[ue][M.index];(S||S===0)&&(S=`${k[ue][M.index]}`);let L;return V==="="?L=(x==null?void 0:x.toLowerCase())===(S==null?void 0:S.toLowerCase()):V==="!="?L=(x==null?void 0:x.toLowerCase())!==(S==null?void 0:S.toLowerCase()):V==="%s%"?L=m(x,S):V==="notLike"?L=!m(x,S):V==="s%"?L=m(x,S,"start"):V==="%s"?L=m(x,S,"end"):V==="isEmpty"?L=S==null||S==="":V==="isNotEmpty"&&(L=!!S),L},p=(k,M,V)=>{const x=M.comparison,S=Number(M.value.replace(/,/g,""));let L=Number(k[ue][M.index]),I;return V==="float"&&(L=Number(L.toFixed(3))),x==="="?I=L===S:x===">"?I=L>S:x==="<"?I=L<S:x==="<="?I=L<=S:x===">="?I=L>=S:x==="!="?I=L!==S:x==="isEmpty"?I=L==null||isNaN(L):x==="isNotEmpty"&&(I=!!L||L===0),I},y=(k,M)=>{const V=M.comparison,x=M.value,S=`${k[ue][M.index]}`;let L;return V==="="&&(L=S===x),L},C=(k,M,V)=>{let x=M==="string"||M==="stringNumber"?g:p;return M==="boolean"&&(x=y),k.filter(S=>x(S,V,M))||[]},b=()=>{const k=i.filteringItemsByColumn,M=Object.keys(k),V=s.originStore;let x=[],S=!1,L=[];M.forEach((I,R)=>{const v=k[I],G=u(I),W=e.columns[G].type,E=i.columnOperator==="or",X=R>0&&i.columnOperator==="and";v.forEach((Z,N)=>{!x.length&&!S?x=C(V,W,{...Z,index:G}):X&&Z.operator==="or"?N>0?x.push(...C(L,W,{...Z,index:G})):x=C(L,W,{...Z,index:G}):N===0&&E||N!==0&&Z.operator==="or"?x.push(...C(V,W,{...Z,index:G})):x=C(x,W,{...Z,index:G}),S=!0}),L=JSON.parse(JSON.stringify(x))}),S?s.filterStore=pb(x,JSON.stringify):s.filterStore=V};let w=null;return{onSearch:k=>{w&&clearTimeout(w),w=setTimeout(()=>{i.isSearch=!1,i.searchWord=k,k&&(s.searchStore=s.store.filter(M=>{let V=!1;const x=n.isFilteringColumn?M[ue].filter((S,L)=>n.visibleColumnIdx.includes(L)):M[ue];for(let S=0;S<s.orderedColumns.length;S++){const L=s.orderedColumns[S]||{};let I=x[L.index]??null;if(L.type=L.type||"string",I!==null&&(I instanceof Array?I=JSON.stringify(I):typeof I=="object"&&(I=I[L.field]),!L.hide&&((L==null?void 0:L.searchable)===void 0||L!=null&&L.searchable)&&(I=r(L,I).toString(),V=I.toLowerCase().includes(k.toString().toLowerCase()),V)))break}return V}),i.isSearch=!0),f(s.store),!k&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:b,setHeaderCheckboxByFilter:f}},oS=t=>{const{contextInfo:e,stores:n,selectInfo:i,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=t;let d=null;const{emit:h}=o.getCurrentInstance(),u=p=>{d&&clearTimeout(d);const y=[];d=setTimeout(()=>{if(e.customContextMenu.length){const C=e.customContextMenu.map(b=>{const w=b;return w.validate&&(w.disabled=!w.validate(w.itemId,i.selectedRow)),w.selectedRow=i.selectedRow??[],w.contextmenuInfo=i.contextmenuInfo??[],w});y.push(...C)}e.contextMenuItems=y,e.menu.show(p)},200)};return{setContextMenu:u,onContextMenu:p=>{var w,T,k;p.preventDefault();const C=(T=(w=p.target.closest(".row"))==null?void 0:w.dataset)==null?void 0:T.index;let b=null;C&&(b=(k=n.viewStore.find(M=>M[Rt]===+C))==null?void 0:k[ue]),b&&(i.contextmenuInfo=[b],u(p))},onColumnContextMenu:(p,y)=>{var C,b,w,T,k,M,V,x;if(p.target.className==="column-name"){const S=y.sortable===void 0?!0:y.sortable,L=l.isFiltering&&y.filterable===void 0?!0:y.filterable,I=[{text:((C=e.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!S,hidden:(b=e.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>s(y,"asc")},{text:((w=e.columnMenuTextInfo)==null?void 0:w.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!S,hidden:(T=e.hiddenColumnMenuItem)==null?void 0:T.descending,click:()=>s(y,"desc")},{text:((k=e.columnMenuTextInfo)==null?void 0:k.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const R=document.documentElement.clientWidth,v=e.columnMenu.menuStyle.clientX,G=e.columnMenu.menuStyle.pageX,W=350;R<v+W&&(e.columnMenu.menuStyle.left=`${G-W}px`),l.filterSettingPosition={top:e.columnMenu.menuStyle.top,left:e.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=y,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!L,hidden:((M=e.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((V=e.columnMenuTextInfo)==null?void 0:V.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||y.fixed,hidden:((x=e.hiddenColumnMenuItem)==null?void 0:x.hide)||!a.value,click:()=>{c(y.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(e.columnMenuItems=[],!S&&!L&&!a.value)return;e.columnMenuItems=I.filter(R=>!R.hidden)}},onGridSettingContextMenu:p=>{const{useDefaultColumnSetting:y,columnSettingTextInfo:C}=r,b={text:(C==null?void 0:C.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,e.isShowMenuOnClick=!0}};e.customGridSettingContextMenu.length&&(e.gridSettingContextMenuItems=[...e.customGridSettingContextMenu]),y&&e.gridSettingContextMenuItems.push(b),e.gridSettingMenu.show(p)}}},lS=t=>{const{props:e}=o.getCurrentInstance(),{selectInfo:n,checkInfo:i,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:u,setFilter:f}=t;return{setStore:({rows:g,isMakeIndex:p=!0,isInit:y=!1})=>{var b,w,T;const C=s.orderedColumns.find(k=>(k==null?void 0:k.sortOption)&&["asc","desc"].includes(k.sortOption.sortType));if(p){const k=[];let M=!1;g.forEach((V,x)=>{const S=e.checked.includes(V),L=e.uncheckable.includes(V)||e.disabledRows.includes(V);let I=!1;n.useSelect&&(I=e.selected.includes(V)),!S&&!L&&(M=!0);let R=!1;c.useRowDetail&&(R=e.expanded.includes(V));const v=e.disabledRows.includes(V);k.push([x,S,V,I,R,L,v])}),g.length!==e.checked.length&&(g.length===((b=e.uncheckable)==null?void 0:b.length)||g.length===((w=e.disabledRows)==null?void 0:w.length))&&(M=!0),i.isHeaderChecked=g.length>0?!M:!1,i.isHeaderIndeterminate=M&&!!i.checkedRows.length,i.isHeaderUncheckable=g.every(V=>e.uncheckable.includes(V)||e.disabledRows.includes(V)),s.originStore=k}r.isFiltering&&f(),C&&y&&h(C,!1),l.sortField&&d(),(T=a.body)!=null&&T.clientHeight&&u()}}},aS=t=>{const{emit:e}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=t,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.store.slice(u,f)},d=u=>{e("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.store.length<=i.perPage)n.pagingStore=n.store;else{const f=(i.currentPage-1)*i.perPage,m=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.store.slice(f,m),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},Dr=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{stores:i,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=t,c=p=>{var y,C,b;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const w=l.gridSettingContextMenuItems.length-1,T=(b=(C=(y=l.gridSettingMenu)==null?void 0:y.rootMenuList)==null?void 0:C.$el)==null?void 0:b.children[0].children[w].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=T.width,s.columnSettingPosition.top=T.top,s.columnSettingPosition.left=T.right}else{const w=p==null?void 0:p.getBoundingClientRect(),T=w==null?void 0:w.height;s.columnSettingPosition.top=(w==null?void 0:w.top)+T,s.columnSettingPosition.left=w==null?void 0:w.right}},d=()=>{i.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(i.movedColumns)&&i.movedColumns.length?i.movedColumns:i.originColumns||[],u=(p,y)=>{var b;if(!p)return;p.hiddenDisplay=y;const C=(b=i.originColumns)==null?void 0:b.find(w=>w.index===p.index);if(C&&C!==p&&(C.hiddenDisplay=y),Array.isArray(i.movedColumns)){const w=i.movedColumns.find(T=>T.index===p.index);w&&w!==p&&(w.hiddenDisplay=y)}},f=()=>{s.visibleColumnIdx=i.filteredColumns.map(C=>C.index);const p=i.originColumns.filter(C=>!C.hide||C.hiddenDisplay).map(C=>C.index),y=s.visibleColumnIdx;s.isFilteringColumn=y.length!==p.length,e.option.searchValue&&a(e.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:p=>{const y=i.orderedColumns.filter(T=>!T.hide&&!T.hiddenDisplay);if(p.length===y.length&&y.every(T=>p.includes(T.field)))return;const b=h(),w=new Set(p);i.filteredColumns=b.filter(T=>{const k=w.has(T.field)||!T.caption;return u(T,!k),k}),s.hiddenColumn="",f(),n("change-column-status",{columns:i.updatedColumns}),n("change-column-info",{type:"display",columns:i.updatedColumns})},setColumnHidden:p=>{const y=i.orderedColumns.filter(b=>!b.hide&&!b.hiddenDisplay);if(y.length===1)return;i.filteredColumns=y.filter(b=>{const w=b.field===p;return u(b,w),!w}),h().forEach(b=>{b.field===p&&u(b,!0)}),s.hiddenColumn=p,f()}}},rS=({stores:t})=>{const{emit:e}=o.getCurrentInstance(),n=r=>{var u;const c=(u=t.movedColumns)!=null&&u.length?[...t.movedColumns]:[...t.originColumns],d=[...r],h=new Set(d.map(f=>f.index));t.movedColumns=c.map(f=>h.has(f.index)?d.shift():f)},i=(r,c)=>{const d=parseInt(r,10),h=parseInt(c,10);if(!Number.isInteger(d)||!Number.isInteger(h))return;const u=[...t.orderedColumns],f=u[d];u.splice(d,1),u.splice(h,0,f),t.filteredColumns.length&&(t.filteredColumns=u),n(u)};return{onDragStart:r=>{r.dataTransfer.setData("text/plain",r.currentTarget.dataset.index)},onDragOver:r=>{r.preventDefault()},onDrop:r=>{r.preventDefault();const c=r.dataTransfer.getData("text/plain"),d=r.target.parentNode.dataset.index;i(c,d),e("change-column-order",{column:t.orderedColumns[d],columns:t.updatedColumns}),e("change-column-info",{type:"order",columns:t.updatedColumns})}}},cS={name:"EvGrid",directives:{clickoutside:Yi,observeVisibility:Qs,resize:Gn},components:{Toolbar:g0,GridPagination:Vr,GridSummary:Xr,ColumnSetting:Nr,FilterSetting:H0,GridSortButton:Pr,GridOptionButton:Fo},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array],default:()=>[]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},uncheckable:{type:[Array],default:()=>[]},expanded:{type:[Array],default:()=>[]},disabledRows:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})}},emits:{"update:selected":null,"update:checked":null,"update:expanded":null,"check-row":null,"check-all":null,"click-row":null,"dblclick-row":null,"page-change":null,"sort-column":null,"expand-row":null,"resize-column":({column:t,columns:e})=>({column:t,columns:e}),"change-column-order":({column:t,columns:e})=>({column:t,columns:e}),"change-column-status":({columns:t})=>({columns:t}),"change-column-info":({type:t,columns:e})=>({type:t,columns:e})},setup(t){var oc,lc,ac,rc,cc,dc,hc,uc,fc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=Q0(),u=o.ref(null),f=o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useGridSetting)==null?void 0:ie.use)||!1}),m=o.computed(()=>t.option.showHeader??!0),g=o.computed(()=>{var F;return((F=t.option)==null?void 0:F.useSummary)||!1}),p=o.computed(()=>{var F;return((F=t.option.style)==null?void 0:F.stripe)||!1}),y=o.computed(()=>{var F;return((F=t.option.style)==null?void 0:F.border)||""}),C=o.computed(()=>{var F;return((F=t.option.style)==null?void 0:F.highlight)??-1}),b=o.computed(()=>t.option.emptyText??"No records"),w=t.option.rowMinHeight||35,T=o.ref(0),k=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),M=o.reactive({isSearch:!1,searchWord:"",isFiltering:o.computed(()=>t.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),V=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((lc=(oc=t.option)==null?void 0:oc.useGridSetting)==null?void 0:lc.columnMenuText)??"Column List",search:((rc=(ac=t.option)==null?void 0:ac.useGridSetting)==null?void 0:rc.searchText)??"Search",empty:((dc=(cc=t.option)==null?void 0:cc.useGridSetting)==null?void 0:dc.emptyText)??"No records",ok:((uc=(hc=t.option)==null?void 0:hc.useGridSetting)==null?void 0:uc.okBtnText)??"OK"}}),x=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const F=M.isFiltering?x.filterStore:x.originStore;return M.isSearch?x.searchStore:F}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>t.columns.map((F,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,...F,width:isFinite(F.width)?F.width:void 0,sortOption:{sortType:((Le=F==null?void 0:F.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const F=x.movedColumns.length?x.movedColumns:x.originColumns;return x.filteredColumns.length?x.filteredColumns:F}),updatedColumns:o.computed(()=>us(x))}),S=o.reactive({usePage:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.use)||!1}),useClient:((fc=t.option.page)==null?void 0:fc.useClient)||!1,isInfinite:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var F,ie;return(F=t.option.page)!=null&&F.useClient?x.store.length:(ie=t.option.page)==null?void 0:ie.total}),perPage:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.perPage)||20}),visiblePage:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.visiblePage)||8}),order:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.order)||"center"}),showPageInfo:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.showPageInfo)||!1}),isClientPaging:o.computed(()=>S.useClient&&S.usePage&&!S.isInfinite),isHighlight:!1,highlightPage:0}),L=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:t.checked,useCheckbox:o.computed(()=>t.option.useCheckbox||{})}),I=o.reactive({expandedRows:t.expanded,useRowDetail:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var F,ie;return(ie=(F=t.option)==null?void 0:F.rowDetail)==null?void 0:ie.detailRowHeight})}),R=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),v=o.reactive({contextmenuInfo:t.contextmenuInfo,selectedRow:t.selected,useSelect:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useSelection)==null?void 0:ie.multiple)??!1})}),G=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:t.option.customAscFunction??{}}),W=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:t.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:t.option.columnMenuText||{},hiddenColumnMenuItem:t.option.hiddenColumnMenuItem||{},customContextMenu:t.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),E=o.reactive({minWidth:40,rendererMinWidth:80,iconWidth:42,showResizeLine:!1,adjust:t.option.adjust||!1,columnWidth:t.option.columnWidth||80,scrollWidth:t.option.scrollWidth||17,rowHeight:o.computed(()=>t.option.rowHeight>w?t.option.rowHeight:w),gridWidth:o.computed(()=>t.width?h(t.width):"100%"),gridHeight:o.computed(()=>t.height?h(t.height):"100%")}),X=()=>{L.checkedRows=[],L.isHeaderChecked=!1,L.isHeaderIndeterminate=!1,x.store.forEach(F=>{F[1]=!1})},Z=()=>{v.selectedRow=[],x.store.forEach(F=>{F[3]=!1})},N=()=>{x.store.forEach(F=>{F[4]=!1}),I.expandedRows=[]},{getPagingData:P,updatePagingInfo:B,changePage:Y}=aS({stores:x,pageInfo:S,sortInfo:G,filterInfo:M,elementInfo:k,clearCheckInfo:X}),H=o.ref(0),{updateVScroll:_,updateHScroll:D,onScroll:z}=$0({scrollInfo:R,stores:x,elementInfo:k,resizeInfo:E,pageInfo:S,summaryScroll:H,expandedInfo:I,getPagingData:P,updatePagingInfo:B}),{onCheck:A,onCheckAll:j}=tS({checkInfo:L,stores:x,pageInfo:S,getPagingData:P}),{onExpanded:J}=nS({expandedInfo:I}),{onSort:q,getSortTarget:U,setSort:ne,setSortInfo:$,hasSortTarget:ee}=iS({sortInfo:G,stores:x,updatePagingInfo:B}),{onSearch:Q,setFilter:he,setHeaderCheckboxByFilter:me}=sS({columnSettingInfo:V,filterInfo:M,stores:x,checkInfo:L,pageInfo:S,getConvertValue:c,updateVScroll:_,getPagingData:P,updatePagingInfo:B,getColumnIndex:d}),{setStore:ae}=lS({selectInfo:v,checkInfo:L,stores:x,sortInfo:G,elementInfo:k,filterInfo:M,expandedInfo:I,setSort:ne,setSortInfo:$,updateVScroll:_,setFilter:he}),{calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re}=q0({resizeInfo:E,elementInfo:k,checkInfo:L,expandedInfo:I,stores:x,isRenderer:a,updateVScroll:_,updateHScroll:D,contextInfo:W}),{setPositionColumnSetting:pe,initColumnSettingInfo:Ie,onApplyColumn:Ve,setColumnHidden:kt}=Dr({stores:x,columnSettingInfo:V,contextInfo:W,onSearch:Q,onResize:be}),{setContextMenu:Vt,onContextMenu:$o,onColumnContextMenu:qo,onGridSettingContextMenu:gs}=oS({contextInfo:W,stores:x,selectInfo:v,useGridSetting:f,filterInfo:M,columnSettingInfo:V,setColumnHidden:kt,onSort:q}),{onRowClick:bs,onRowDblClick:ys}=eS({selectInfo:v,stores:x}),{onDragStart:xs,onDragOver:Ss,onDrop:Cs}=rS({stores:x}),ks=F=>{W.gridSettingContextMenuItems.length=0,W.customGridSettingContextMenu.length?gs(F):V.isShowColumnSetting=!0},on=F=>{var ie,Le,wt,ln,ki,Et,ot,ws,Is,mc;F.type==="wheel"&&((ie=W.menu)==null||ie.hide(F)),F.type==="scroll"&&!((Le=F.target.classList)!=null&&Le.contains("table-body"))&&!((ln=(wt=F.target.offsetParent)==null?void 0:wt.classList)!=null&&ln.contains("ev-select-dropbox"))&&!((Et=(ki=F.target.offsetParent)==null?void 0:ki.classList)!=null&&Et.contains("ev-grid-column-setting"))&&!((ws=(ot=F.target.offsetParent)==null?void 0:ot.classList)!=null&&ws.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,V.isShowColumnSetting=!1,W.isShowMenuOnClick=!1,(Is=W.columnMenu)==null||Is.hide(F),(mc=W.gridSettingMenu)==null||mc.hide())};o.onMounted(()=>{xe(),ae({rows:t.rows,isInit:!0}),document.addEventListener("wheel",on,{capture:!1}),document.addEventListener("scroll",on,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",on,{capture:!1}),document.removeEventListener("scroll",on,{capture:!0})}),o.onActivated(()=>{be()}),o.onUpdated(()=>{var F;T.value=((F=k["grid-wrapper"])==null?void 0:F.offsetWidth)/1.5||0}),o.watch(()=>V.isShowColumnSetting,F=>{var ie;if(!F){(ie=W.gridSettingMenu)==null||ie.hide();return}pe(u.value)}),o.watch(()=>t.columns,()=>{ee()?$(U()):($(U()),ne()),M.filteringColumn=null,M.filteringItemsByColumn={},x.filterStore=[],ae({rows:[],isMakeIndex:!1}),Ie(),x.movedColumns.length=0},{deep:!0}),o.watch(()=>G.isSorting,F=>{F&&(ae({rows:x.originStore,isMakeIndex:!1}),G.isSorting=!F,S.isClientPaging&&(S.currentPage=1,x.pagingStore=P(),X()))}),o.watch(()=>t.rows,F=>{ae({rows:F}),M.isSearch&&Q(M.searchWord),be()},{deep:!0}),o.watch(()=>t.uncheckable,()=>{ae({rows:t.rows})},{deep:!0}),o.watch(()=>t.checked,F=>{L.checkedRows=F}),o.watch(()=>t.disabledRows,()=>{x.store.length&&x.store.forEach(F=>{F[6]=t.disabledRows.includes(F[2])})},{deep:!0}),o.watch(()=>L.checkedRows,F=>{L.isHeaderChecked=!1;let ie=x.store;S.isClientPaging&&(ie=P()),ie.length&&(ie.forEach(Le=>{Le[1]=F.includes(Le[2])}),L.isHeaderChecked=F.length===ie.length),_()}),o.watch(()=>t.selected,F=>{v.useSelect&&(v.selectedRow=F)}),o.watch(()=>v.selectedRow,F=>{v.useSelect&&(x.store.forEach(ie=>{ie[3]=F.includes(ie[2])&&!t.disabledRows.includes(ie[2])}),_())}),o.watch(()=>C.value,async F=>{if(await o.nextTick(),F>=0){if(S.usePage&&!S.isInfinite&&(S.highlightPage=Math.ceil(F/S.perPage)||1,S.highlightPage!==S.currentPage)){S.currentPage=S.highlightPage,S.isHighlight=!0;return}k.body.scrollTop=E.rowHeight*C.value}}),o.watch(()=>L.useCheckbox.mode,()=>{X()}),o.watch(()=>v.useSelect,()=>{Z()}),o.watch(()=>v.multiple,()=>{Z()}),o.watch(()=>t.checked.length,F=>{F||X()}),o.watch(()=>t.expanded.length,F=>{F||N(),_()}),o.watch(()=>[t.option.columnWidth,E.gridWidth],async()=>{await o.nextTick(),E.columnWidth=t.option.columnWidth;const F=k["grid-wrapper"];F.style.width=E.gridWidth,F.style.height=E.gridHeight,x.orderedColumns.map(ie=>{var wt;const Le=ie;return!((wt=t.columns[ie.index])!=null&&wt.width)&&!Le.resized&&(Le.width=0),Le}),be()}),o.watch(()=>t.option.searchValue,F=>{F!==void 0&&(Q((F==null?void 0:F.value)??F),S.isClientPaging&&(X(),Z()))},{immediate:!0}),o.watch(()=>{var F;return(F=t.option.page)==null?void 0:F.currentPage},F=>{var Le;const ie=F||1;S.currentPage=(Le=t.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>S.currentPage,(F,ie)=>{o.nextTick(()=>{Y(ie),S.isClientPaging&&F!==ie&&(X(),Z()),_(),F===S.highlightPage&&S.isHighlight&&(k.body.scrollTop=E.rowHeight*C.value,S.isHighlight=!S.isHighlight)})});const Ln=o.reactive({boxTop:0,boxLeft:0}),K=o.ref(null),se=o.ref(!1),fe=o.ref(!1),ke=o.ref(null),Re=o.ref({}),ze=o.reactive({caption:"",field:""}),Qe=o.ref([]),mk=[{name:"AND",value:"and"},{name:"OR",value:"or"}],el=o.ref(0),pk=({caption:F,field:ie},Le)=>{if(ze.caption=F,ze.field=ie,Qe.value=Le,(Le==null?void 0:Le.length)>1){se.value=!0;const wt=K.value.getBoundingClientRect().left,ln=window.pageYOffset+K.value.getBoundingClientRect().top+K.value.getBoundingClientRect().height;Ln.boxTop=`${ln}px`,Ln.boxLeft=`${wt}px`}},gk=()=>{x.filterStore=[],ae({rows:[],isMakeIndex:!1})},tl=async F=>{var ln,ki;F&&fe.value&&(el.value=0);const ie=(ln=K.value)==null?void 0:ln.getElementsByClassName("filtering-items__item"),Le=[];let wt=0;if(ie){for(let Et=0;Et<ie.length;Et++){const ot=ie[Et];ot.classList.remove("non-display");const ws=(ki=K.value.getBoundingClientRect())==null?void 0:ki.width,{width:Is}=ot.getBoundingClientRect();wt+=Is+10,ws-150<=wt&&!ot.classList.contains("filtering-items__item--count")?(el.value++,Le.push(ot),Re.value={...Re.value,[ot.dataset.field]:Ze(M.filteringItemsByColumn[ot.dataset.field])}):delete Re.value[ot.dataset.field]}ie.forEach(Et=>{const ot=Le.includes(Et);Et.classList.toggle("non-display",ot)})}},bk=async(F,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[F]=ie,fe.value=!0):(delete Re.value[F],delete M.filteringItemsByColumn[F]),await o.nextTick(),tl(!0),M.isShowFilterSetting=!1,x.filterStore=[],ae({rows:[],isMakeIndex:!1}),me(x.filterStore)};let nl=null;const yk=()=>{nl&&clearTimeout(nl),nl=setTimeout(()=>{fe.value=!fe.value,tl(fe.value)},150)},xk=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Re.value={},x.filterStore=[],ae({rows:[],isMakeIndex:!1})},Sk=o.computed(()=>{var F;return{width:`${T.value}px`,top:`${((F=K.value)==null?void 0:F.getBoundingClientRect().height)||0}px`}}),Ck=F=>{const ie=M.filteringItemsByColumn[F];return ie==null?void 0:ie[ie.length-1]},kk=()=>{const F=document.createElement("div");F.id="ev-grid-filtering-items-modal",F.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(F)};return o.onBeforeMount(()=>kk()),{idColIndex:o.computed(()=>{var F;return(F=x.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:F.index}),summaryScroll:H,showHeader:m,stripeStyle:p,borderStyle:y,highlightIdx:C,useSummary:g,useGridSetting:f,toolbarRef:u,stores:x,emptyText:b,...o.toRefs(k),...o.toRefs(x),...o.toRefs(M),...o.toRefs(R),...o.toRefs(S),...o.toRefs(E),...o.toRefs(v),...o.toRefs(L),...o.toRefs(I),...o.toRefs(G),...o.toRefs(W),...o.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:_,updateHScroll:D,onScroll:z,calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re,onRowClick:bs,onRowDblClick:ys,onCheck:A,onCheckAll:j,onExpanded:J,onSort:q,setSort:ne,setStore:ae,setContextMenu:Vt,onContextMenu:$o,onSearch:Q,setGridSetting:ks,onApplyColumn:Ve,onColumnContextMenu:qo,filteringItemsWidth:T,isShowColumnFilteringItems:fe,operatorItems:mk,selectedFilteringItems:Qe,selectedFilteringColumn:ze,filteringItemsRef:K,isShowFilteringItemsBox:se,filteringItemsStyle:Sk,hiddenFilteringItemsCount:el,...o.toRefs(Ln),hiddenFilteringItemsRef:ke,hiddenFilteringItemsByColumn:Re,removeAllFiltering:xk,onExpandFilteringItems:yk,setColumnFilteringItems:tl,onChangeOperator:gk,onApplyFilter:bk,onClickFilteringItem:pk,getFilteringItemByField:Ck,onDragStart:xs,onDragOver:Ss,onDrop:Cs,ROW_DISABLED_INDEX:6}}},dS={key:0,class:"filtering-items filtering-items--used"},hS={key:1,ref:"filteringItemsRef",class:"filtering-items"},uS=["data-field","onClick"],fS={class:"filtering-items__item--title"},mS=["title"],pS={key:1,class:"filtering-items__item--value"},gS=["onClick"],bS={class:"filtering-items__item--title"},yS=["title"],xS={key:1,class:"filtering-items__item--value"},SS={class:"column-list"},CS=["data-index"],kS=["title","onClick"],wS=["onClick"],IS=["onMousedown"],LS={ref:"table"},TS=["data-index","disabled","onClick","onContextmenu","onDblclick"],MS=["data-name","data-index","disabled"],vS={key:0},RS=["title"],VS=["disabled"],ES=["disabled"],GS={key:0},WS=["colspan"],ZS={key:0},XS={class:"is-empty"},NS={ref:"resizeLine",class:"table-resize-line"};function PS(t,e,n,i,s,l){var T;const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("grid-option-button"),d=o.resolveComponent("toolbar"),h=o.resolveComponent("ev-checkbox"),u=o.resolveComponent("grid-sort-button"),f=o.resolveComponent("ev-context-menu"),m=o.resolveComponent("grid-summary"),g=o.resolveComponent("grid-pagination"),p=o.resolveComponent("filter-setting"),y=o.resolveComponent("column-setting"),C=o.resolveDirective("clickoutside"),b=o.resolveDirective("resize"),w=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[t.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${t.gridWidth};`)},[o.createVNode(d,null,{toolbarWrapper:o.withCtx(()=>[o.createElementVNode("div",{class:"filtering",style:o.normalizeStyle({width:`${i.filteringItemsWidth}px`})},[t.isFiltering&&!Object.keys(t.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",dS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),e[18]||(e[18]=o.createElementVNode("span",null,"Filter",-1))])):o.createCommentVNode("",!0),t.isFiltering&&Object.keys(t.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",hS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(t.filteringItemsByColumn),(k,M)=>{var V,x,S,L;return o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[M===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:e[0]||(e[0]=o.withModifiers((...I)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...I),["stop"]))},[o.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),o.createElementVNode("span",null," Filter ("+o.toDisplayString(Object.keys(t.filteringItemsByColumn).length)+") ",1),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:o.withModifiers(i.removeAllFiltering,["stop"])},null,8,["onClick"])])):o.createCommentVNode("",!0),M===1?(o.openBlock(),o.createBlock(r,{key:1,modelValue:t.columnOperator,"onUpdate:modelValue":e[1]||(e[1]=I=>t.columnOperator=I),items:i.operatorItems,class:"filtering-items__item--operator",onChange:i.onChangeOperator},null,8,["modelValue","items","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"filtering-items__item non-display","data-field":k,onClick:o.withModifiers(I=>{var R;return i.onClickFilteringItem({caption:(R=i.getFilteringItemByField(k))==null?void 0:R.caption,field:k},t.filteringItemsByColumn[k])},["stop"])},[o.createElementVNode("span",fS,o.toDisplayString((V=i.getFilteringItemByField(k))==null?void 0:V.caption)+" "+o.toDisplayString((x=i.getFilteringItemByField(k))==null?void 0:x.comparison),1),t.filteringItemsByColumn[k].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=i.getFilteringItemByField(k))==null?void 0:S.value},o.toDisplayString((L=i.getFilteringItemByField(k))==null?void 0:L.value),9,mS)):(o.openBlock(),o.createElementBlock("span",pS," + "+o.toDisplayString(t.filteringItemsByColumn[k].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:I=>i.onApplyFilter(k,[])},null,8,["onClick"])],8,uS)],64)}),128)),i.isShowColumnFilteringItems&&Object.keys(t.filteringItemsByColumn).length&&i.hiddenFilteringItemsCount>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:e[2]||(e[2]=(...k)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...k))}," + "+o.toDisplayString(i.hiddenFilteringItemsCount),1)):o.createCommentVNode("",!0)],512)):o.createCommentVNode("",!0),!i.isShowColumnFilteringItems&&Object.keys(i.hiddenFilteringItemsByColumn).length?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:o.normalizeStyle(i.filteringItemsStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(i.hiddenFilteringItemsByColumn),(k,M)=>{var V,x,S,L;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(I=>{var R;return i.onClickFilteringItem({caption:(R=i.getFilteringItemByField(k))==null?void 0:R.caption,field:k},i.hiddenFilteringItemsByColumn[k])},["stop"])},[o.createElementVNode("span",bS,o.toDisplayString((V=i.getFilteringItemByField(k))==null?void 0:V.caption)+" "+o.toDisplayString((x=i.getFilteringItemByField(k))==null?void 0:x.comparison),1),i.hiddenFilteringItemsByColumn[k].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=i.getFilteringItemByField(k))==null?void 0:S.value},o.toDisplayString((L=i.getFilteringItemByField(k))==null?void 0:L.value),9,yS)):(o.openBlock(),o.createElementBlock("span",xS," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[k].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:I=>i.onApplyFilter(k,[],!0)},null,8,["onClick"])],8,gS)}),128))],4)),[[C,()=>{i.isShowColumnFilteringItems||i.onExpandFilteringItems()}]]):o.createCommentVNode("",!0)],4),i.useGridSetting?(o.openBlock(),o.createBlock(c,{key:0,class:"grid-setting__icon",onClick:e[3]||(e[3]=k=>i.setGridSetting(k))})):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({ref:"grid-wrapper"},t.$attrs,{class:"grid-wrapper",style:`width: ${t.gridWidth}; height: ${t.gridHeight};`}),[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass({table:!0,adjust:t.adjust,"ev-grid":!0,"non-header":!i.showHeader,"ev-grid--empty":!t.viewStore.length})},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass({"table-header":!0,"non-border":!!i.borderStyle})},[o.createElementVNode("ul",SS,[t.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${t.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[t.useCheckbox.use&&t.useCheckbox.headerCheck&&t.useCheckbox.mode!=="single"?(o.openBlock(),o.createBlock(h,{key:0,modelValue:t.isHeaderChecked,"onUpdate:modelValue":e[4]||(e[4]=k=>t.isHeaderChecked=k),disabled:t.isHeaderUncheckable,indeterminate:t.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),t.useRowDetail?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${t.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(k,M)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[!k.hide&&!k.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":M,class:o.normalizeClass({column:!0,render:i.isRenderer(k),"non-border":!!i.borderStyle,[k.field]:k.field}),style:o.normalizeStyle({width:`${k.width}px`,"min-width":`${i.isRenderer(k)?t.rendererMinWidth:t.minWidth}px`,"margin-right":t.orderedColumns.length-1===M&&(t.hasVerticalScrollBar||t.hasHorizontalScrollBar)?`${t.scrollWidth}px`:"0px","border-right":t.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:e[6]||(e[6]=(...V)=>i.onDragStart&&i.onDragStart(...V)),onDragover:e[7]||(e[7]=(...V)=>i.onDragOver&&i.onDragOver(...V)),onDrop:e[8]||(e[8]=(...V)=>i.onDrop&&i.onDrop(...V))},[k.customHeader&&t.$slots.customHeader?o.renderSlot(t.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:k.caption,class:"column-name",onClick:[V=>i.onColumnContextMenu(V,k),e[5]||(e[5]=o.withModifiers((...V)=>t.columnMenu.show&&t.columnMenu.show(...V),["prevent"]))]},[o.createTextVNode(o.toDisplayString(k.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(V=>i.onSort(k),["stop"])},[t.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[k.sortable===void 0||k.sortable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),t.sortField===k.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":t.sortOrder==="asc","column-sort__icon--desc":t.sortOrder==="desc"}]),style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,`sortIcon_${t.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[k.sortable===void 0||k.sortable?(o.openBlock(),o.createBlock(u,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),t.sortField===k.field?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":t.sortOrder==="asc","column-sort__icon--desc":t.sortOrder==="desc"}]),icon:t.sortOrder,style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,visibility:t.sortOrder?k.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,wS)],8,kS)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(V=>i.onColumnResize(M,V),["stop","left"])},null,40,IS)],46,CS)):o.createCommentVNode("",!0)],64))),128)),(T=t.$props.option.customContextMenu)!=null&&T.length?(o.openBlock(),o.createElementBlock("li",{key:2,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":t.hasVerticalScrollBar||t.hasHorizontalScrollBar?`${t.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,i.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass({stripe:i.stripeStyle,"table-body":!0,"bottom-border":!!t.viewStore.length,"non-border":!!i.borderStyle}),onScroll:e[11]||(e[11]=(...k)=>i.onScroll&&i.onScroll(...k)),onContextmenu:e[12]||(e[12]=k=>i.onContextMenu(k))},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",LS,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.viewStore,(k,M)=>{var V,x;return o.openBlock(),o.createElementBlock(o.Fragment,{key:i.idColIndex!=null?k[2][i.idColIndex]:M},[o.createElementVNode("tr",{"data-index":k[0],class:o.normalizeClass({row:!0,selected:k[3],highlight:k[0]===i.highlightIdx,"non-border":!!i.borderStyle&&i.borderStyle!=="rows"}),disabled:k[i.ROW_DISABLED_INDEX],onClick:S=>i.onRowClick(S,k),onContextmenu:S=>i.onRowClick(S,k,!0),onDblclick:S=>i.onRowDblClick(S,k)},[t.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${t.minWidth}px`,height:`${t.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(h,{modelValue:k[1],"onUpdate:modelValue":S=>k[1]=S,class:"row-checkbox-input",disabled:k[5]||k[i.ROW_DISABLED_INDEX],onChange:S=>i.onCheck(S,k)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):o.createCommentVNode("",!0),t.useRowDetail?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!i.borderStyle,"row-detail-toggle--expanded":k[4]}),style:o.normalizeStyle({width:`${t.minWidth}px`,height:`${t.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:k[4],"onUpdate:modelValue":S=>k[4]=S,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(S=>i.onExpanded(S,k),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(S,L)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?k[2][i.idColIndex]:M}-${L}`},[!S.hide&&!S.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":S.field,"data-index":S.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(S),[S.type]:S.type,[S.align]:S.align,[S.field]:S.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${S.width}px`,height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,"min-width":`${i.isRenderer(S)?t.rendererMinWidth:t.minWidth}px`,"border-right":t.orderedColumns.length-1===L?"none":"1px solid #CFCFCF"}),disabled:k[i.ROW_DISABLED_INDEX]},[t.$slots[S.field]?(o.openBlock(),o.createElementBlock("div",vS,[o.renderSlot(t.$slots,S.field,{item:{row:k,column:S},disabled:k[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(S,k[2][S.index])},o.toDisplayString(i.getConvertValue(S,k[2][S.index])),9,RS))],14,MS)):o.createCommentVNode("",!0)],64))),128)),(V=t.$props.option.customContextMenu)!=null&&V.length?(o.openBlock(),o.createElementBlock("td",{key:2,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${t.rowHeight}px`,"min-width":"30px","line-height":`${t.rowHeight}px`}),disabled:k[i.ROW_DISABLED_INDEX]},[t.$slots.contextmenuIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:k[i.ROW_DISABLED_INDEX],onClick:e[9]||(e[9]=S=>i.onContextMenu(S))},[o.renderSlot(t.$slots,"contextmenuIcon",{},void 0,!0)],8,ES)):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:k[i.ROW_DISABLED_INDEX],onClick:e[10]||(e[10]=S=>i.onContextMenu(S))},null,8,["disabled"]))],14,VS)):o.createCommentVNode("",!0)],42,TS),t.useRowDetail&&((x=t.$slots)!=null&&x.rowDetail)&&k[4]?(o.openBlock(),o.createElementBlock("tr",GS,[o.createElementVNode("td",{colspan:k.length},[o.createElementVNode("div",{style:o.normalizeStyle({width:"100%",height:`${t.detailRowHeight}px`,"min-height":`${t.detailRowHeight}px`,"max-height":`${t.detailRowHeight}px`})},[o.renderSlot(t.$slots,"rowDetail",{item:{row:k}},void 0,!0)],4)],8,WS)])):o.createCommentVNode("",!0)],64)}),128)),t.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",ZS,[o.createElementVNode("td",XS,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(f,{ref:"menu","custom-class":t.contextMenuClass,items:t.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(f,{ref:"columnMenu",items:t.columnMenuItems},null,8,["items"]),o.createVNode(f,{ref:"gridSettingMenu",items:t.gridSettingContextMenuItems,"is-show-menu-on-click":t.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",NS,null,512),[[o.vShow,t.showResizeLine]])],2)],16)),[[b,i.onResize],[w,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(m,{key:1,"ordered-columns":t.orderedColumns,stores:i.stores,"use-checkbox":t.useCheckbox.use,"style-option":{borderStyle:i.borderStyle,minWidth:t.minWidth,rowHeight:t.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),t.usePage&&!t.isInfinite?(o.openBlock(),o.createBlock(g,{key:2,modelValue:t.currentPage,"onUpdate:modelValue":e[13]||(e[13]=k=>t.currentPage=k),total:t.pageTotal,"per-page":t.perPage,"visible-page":t.visiblePage,"show-page-info":t.showPageInfo,order:t.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(p,{"is-show":t.isShowFilterSetting,"onUpdate:isShow":e[14]||(e[14]=k=>t.isShowFilterSetting=k),items:t.filteringItemsByColumn,"onUpdate:items":e[15]||(e[15]=k=>t.filteringItemsByColumn=k),column:t.filteringColumn,position:t.filterSettingPosition,onApplyFiltering:i.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),o.createVNode(y,{"is-show":t.isShowColumnSetting,"onUpdate:isShow":e[16]||(e[16]=k=>t.isShowColumnSetting=k),"is-show-menu-on-click":t.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":e[17]||(e[17]=k=>t.isShowMenuOnClick=k),columns:t.updatedColumns,"hidden-column":t.hiddenColumn,position:t.columnSettingPosition,"text-info":t.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const hi=ce(cS,[["render",PS],["__scopeId","data-v-22cd2bf6"]]);hi.install=t=>{t.component(hi.name,hi)};let ui=null;function DS(){return ui||(typeof document<"u"?ui=document.createElement("canvas").getContext("2d"):typeof OffscreenCanvas<"u"&&(ui=new OffscreenCanvas(1,1).getContext("2d")),ui)}const fi=new Map,BS=512,O={hexToRgb(t){if(!t)return!1;const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),n=parseInt(e[1],16),i=parseInt(e[2],16),s=parseInt(e[3],16);return`${n},${i},${s}`},getColorStringType(t){if(!t)return"";const e=t.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(e),i=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(e),s=/^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(e);let l="";return n?l="HEX":i?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(t,e=1){const n=`${t}|${e}`,i=fi.get(n);if(i!==void 0)return i;const s=t.replace(/ /g,""),l=this.getColorStringType(s);let a="";switch(l){case"HEX":a=`rgba(${this.hexToRgb(s)},${e})`;break;case"RGB":a=s.replace(")",`, ${e})`).replace("rgb","rgba");break;case"RGBA":{const r=s.replace(/^.*,(.+)\)/,"$1");a=s.replace(`${r})`,`${e})`);break}default:a=`rgba(0, 0, 0, ${e})`;break}return fi.size>=BS&&fi.delete(fi.keys().next().value),fi.set(n,a),a},getOpacity(t){const e=t==null?void 0:t.replace(/ /g,"");return this.getColorStringType(e)==="RGBA"?e.replace(/^.*,(.+)\)/,"$1"):"1"},calculateMagnitude(t){return Math.floor(Math.log(t)/Math.LN10)},aliasPixel(t){return t%2===0?0:.5},coordinateKey(t,e){return`${t}|${e}`},getLabelStyle(t){const{fontStyle:e="normal",fontWeight:n="normal",fontSize:i="12",fontFamily:s="Roboto"}=t;return`${e} normal ${n} ${i}px ${s}`},labelSignFormat(t,e=null){const n=Nh(1),i=Xh(1),s=Zh(1),l=Wh(1),a=1e3;let r;if(!yt(t))return t;const c=t<0,d=Math.abs(t),h=(u,f,m)=>{let g;return u%f===0?g=Yt(e)?`${u/f}${m}`:`${(u/f).toFixed(e)}${m}`:g=`${(u/f).toFixed(1)}${m}`,c?`-${g}`:g};if(d>=n)r=h(d,n,"P");else if(d>=i)r=h(d,i,"T");else if(d>=s)r=h(d,s,"G");else if(d>=l)r=h(d,l,"M");else if(d>=a)r=h(d,1e3,"K");else{const u=Yt(e)?d:d.toFixed(e);r=c?`-${u}`:`${u}`}return r},calcTextSize(t,e,n=0){const i=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${e}; padding: 0 ${n}px`;i.setAttribute("style",s),i.style.font=e,i.textContent=t,document.body.appendChild(i);const l=i.getBoundingClientRect(),a=l.width||2,r=l.height||2;return i.remove(),{width:a,height:r}},calcTextSizeCanvas(t,e){if(!t)return{width:2,height:2};const n=DS();n.save(),n.font=e;const i=n.measureText(t),s=e.match(/(\d+(?:\.\d+)?)px/),a=(s?Number(s[1]):14)*1.2;return n.restore(),{width:Math.max(Math.ceil(i.width),2),height:Math.max(Math.ceil(a),2)}},getStringMinMax(t){const e={min:t[0],max:t[0]};return t.forEach(n=>{var i,s;((i=e==null?void 0:e.max)==null?void 0:i.length)<(n==null?void 0:n.length)&&(e.max=n),((s=e==null?void 0:e.min)==null?void 0:s.length)>(n==null?void 0:n.length)&&(e.min=n)}),e},truncateLabelWithEllipsis(t,e,n,i="right"){if(!t)return"";if(!e)return t;const s="…",l=n.measureText(s).width;let a=t,r=n.measureText(a).width;if(r<=e||r<=l)return t;let c=a.length;for(;r>=e-l&&c-- >0;)a=i==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return i==="right"?a+s:s+a},showLabelTip(t){const{ctx:e,width:n,height:i,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=t,u=s-n/2,f=s+n/2,m=l-i,g=l;e.beginPath(),e.save(),e.fillStyle=d||"#E96E2C",e.strokeStyle=d||"#E96E2C",e.shadowBlur=0,e.moveTo(u+r,m),e.quadraticCurveTo(u,m,u,m+r),e.lineTo(u,g-r),e.quadraticCurveTo(u,g,u+r,g),e.lineTo(f-r,g),e.quadraticCurveTo(f,g,f,g-r),e.lineTo(f,m+r),e.quadraticCurveTo(f,m,f-r,m),e.lineTo(s-a,m),e.lineTo(s,m-a),e.lineTo(s+a,m),e.lineTo(u+r,m),e.closePath(),e.fill(),e.restore(),e.save(),e.font="normal normal bold 12px Roboto",e.fillStyle=h||"#FFF",e.textBaseline="middle",e.textAlign="center",e.fillText(`${c}`,s,m+i/2),e.restore(),e.beginPath()},isPieType(t){return t==="pie"||t==="doughnut"||t==="sunburst"},isDoughnutHole(t){return t==="doughnut"||t==="sunburst"},setDOMStyle(t,e){var n;!t||!e||(n=Object.keys(e))==null||n.forEach(i=>{t.style[i]=e[i]})},checkSafeInteger(t){return t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER},htmlToElement(t){const e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild},isNullOrUndefined(t){return t==null},rgbaAdjustHalfOpacity(t){const e=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(e.test(t)){const[,i,s,l]=t.match(e);return`rgba(${i}, ${s}, ${l}, 0.5)`}if(n.test(t)){const[,i,s,l,a]=t.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${i}, ${s}, ${l}, ${r})`}return t.startsWith("#")&&t.length>7?t:`${t}80`},calcBoxDistance(t,e,n){if(t.w!==null&&t.w!==void 0&&t.h!==null&&t.h!==void 0){const i=t.xp,s=t.yp,l=Math.min(i,i+t.w),a=Math.max(i,i+t.w),r=Math.min(s,s+t.h),c=Math.max(s,s+t.h),d=Math.max(0,l-e,e-a),h=Math.max(0,r-n,n-c);return d*d+h*h}return(t.xp-e)**2+(t.yp-n)**2}};function YS(t){const e=(String(t).split(".")[1]??"").length;return t.toFixed(e+1)}var OS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function HS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Br={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(OS,function(){var n=1e3,i=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",u="month",f="quarter",m="year",g="date",p="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(G){var W=["th","st","nd","rd"],E=G%100;return"["+G+(W[(E-20)%10]||W[E]||W[0])+"]"}},w=function(G,W,E){var X=String(G);return!X||X.length>=W?G:""+Array(W+1-X.length).join(E)+G},T={s:w,z:function(G){var W=-G.utcOffset(),E=Math.abs(W),X=Math.floor(E/60),Z=E%60;return(W<=0?"+":"-")+w(X,2,"0")+":"+w(Z,2,"0")},m:function G(W,E){if(W.date()<E.date())return-G(E,W);var X=12*(E.year()-W.year())+(E.month()-W.month()),Z=W.clone().add(X,u),N=E-Z<0,P=W.clone().add(X+(N?-1:1),u);return+(-(X+(E-Z)/(N?Z-P:P-Z))||0)},a:function(G){return G<0?Math.ceil(G)||0:Math.floor(G)},p:function(G){return{M:u,y:m,w:h,d,D:g,h:c,m:r,s:a,ms:l,Q:f}[G]||String(G||"").toLowerCase().replace(/s$/,"")},u:function(G){return G===void 0}},k="en",M={};M[k]=b;var V="$isDayjsObject",x=function(G){return G instanceof R||!(!G||!G[V])},S=function G(W,E,X){var Z;if(!W)return k;if(typeof W=="string"){var N=W.toLowerCase();M[N]&&(Z=N),E&&(M[N]=E,Z=N);var P=W.split("-");if(!Z&&P.length>1)return G(P[0])}else{var B=W.name;M[B]=W,Z=B}return!X&&Z&&(k=Z),Z||!X&&k},L=function(G,W){if(x(G))return G.clone();var E=typeof W=="object"?W:{};return E.date=G,E.args=arguments,new R(E)},I=T;I.l=S,I.i=x,I.w=function(G,W){return L(G,{locale:W.$L,utc:W.$u,x:W.$x,$offset:W.$offset})};var R=function(){function G(E){this.$L=S(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[V]=!0}var W=G.prototype;return W.parse=function(E){this.$d=function(X){var Z=X.date,N=X.utc;if(Z===null)return new Date(NaN);if(I.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var P=Z.match(y);if(P){var B=P[2]-1||0,Y=(P[7]||"0").substring(0,3);return N?new Date(Date.UTC(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,Y)):new Date(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,Y)}}return new Date(Z)}(E),this.init()},W.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},W.$utils=function(){return I},W.isValid=function(){return this.$d.toString()!==p},W.isSame=function(E,X){var Z=L(E);return this.startOf(X)<=Z&&Z<=this.endOf(X)},W.isAfter=function(E,X){return L(E)<this.startOf(X)},W.isBefore=function(E,X){return this.endOf(X)<L(E)},W.$g=function(E,X,Z){return I.u(E)?this[X]:this.set(Z,E)},W.unix=function(){return Math.floor(this.valueOf()/1e3)},W.valueOf=function(){return this.$d.getTime()},W.startOf=function(E,X){var Z=this,N=!!I.u(X)||X,P=I.p(E),B=function(J,q){var U=I.w(Z.$u?Date.UTC(Z.$y,q,J):new Date(Z.$y,q,J),Z);return N?U:U.endOf(d)},Y=function(J,q){return I.w(Z.toDate()[J].apply(Z.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(q)),Z)},H=this.$W,_=this.$M,D=this.$D,z="set"+(this.$u?"UTC":"");switch(P){case m:return N?B(1,0):B(31,11);case u:return N?B(1,_):B(0,_+1);case h:var A=this.$locale().weekStart||0,j=(H<A?H+7:H)-A;return B(N?D-j:D+(6-j),_);case d:case g:return Y(z+"Hours",0);case c:return Y(z+"Minutes",1);case r:return Y(z+"Seconds",2);case a:return Y(z+"Milliseconds",3);default:return this.clone()}},W.endOf=function(E){return this.startOf(E,!1)},W.$set=function(E,X){var Z,N=I.p(E),P="set"+(this.$u?"UTC":""),B=(Z={},Z[d]=P+"Date",Z[g]=P+"Date",Z[u]=P+"Month",Z[m]=P+"FullYear",Z[c]=P+"Hours",Z[r]=P+"Minutes",Z[a]=P+"Seconds",Z[l]=P+"Milliseconds",Z)[N],Y=N===d?this.$D+(X-this.$W):X;if(N===u||N===m){var H=this.clone().set(g,1);H.$d[B](Y),H.init(),this.$d=H.set(g,Math.min(this.$D,H.daysInMonth())).$d}else B&&this.$d[B](Y);return this.init(),this},W.set=function(E,X){return this.clone().$set(E,X)},W.get=function(E){return this[I.p(E)]()},W.add=function(E,X){var Z,N=this;E=Number(E);var P=I.p(X),B=function(_){var D=L(N);return I.w(D.date(D.date()+Math.round(_*E)),N)};if(P===u)return this.set(u,this.$M+E);if(P===m)return this.set(m,this.$y+E);if(P===d)return B(1);if(P===h)return B(7);var Y=(Z={},Z[r]=i,Z[c]=s,Z[a]=n,Z)[P]||1,H=this.$d.getTime()+E*Y;return I.w(H,this)},W.subtract=function(E,X){return this.add(-1*E,X)},W.format=function(E){var X=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||p;var N=E||"YYYY-MM-DDTHH:mm:ssZ",P=I.z(this),B=this.$H,Y=this.$m,H=this.$M,_=Z.weekdays,D=Z.months,z=Z.meridiem,A=function(q,U,ne,$){return q&&(q[U]||q(X,N))||ne[U].slice(0,$)},j=function(q){return I.s(B%12||12,q,"0")},J=z||function(q,U,ne){var $=q<12?"AM":"PM";return ne?$.toLowerCase():$};return N.replace(C,function(q,U){return U||function(ne){switch(ne){case"YY":return String(X.$y).slice(-2);case"YYYY":return I.s(X.$y,4,"0");case"M":return H+1;case"MM":return I.s(H+1,2,"0");case"MMM":return A(Z.monthsShort,H,D,3);case"MMMM":return A(D,H);case"D":return X.$D;case"DD":return I.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return A(Z.weekdaysMin,X.$W,_,2);case"ddd":return A(Z.weekdaysShort,X.$W,_,3);case"dddd":return _[X.$W];case"H":return String(B);case"HH":return I.s(B,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return J(B,Y,!0);case"A":return J(B,Y,!1);case"m":return String(Y);case"mm":return I.s(Y,2,"0");case"s":return String(X.$s);case"ss":return I.s(X.$s,2,"0");case"SSS":return I.s(X.$ms,3,"0");case"Z":return P}return null}(q)||P.replace(":","")})},W.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},W.diff=function(E,X,Z){var N,P=this,B=I.p(X),Y=L(E),H=(Y.utcOffset()-this.utcOffset())*i,_=this-Y,D=function(){return I.m(P,Y)};switch(B){case m:N=D()/12;break;case u:N=D();break;case f:N=D()/3;break;case h:N=(_-H)/6048e5;break;case d:N=(_-H)/864e5;break;case c:N=_/s;break;case r:N=_/i;break;case a:N=_/n;break;default:N=_}return Z?N:I.a(N)},W.daysInMonth=function(){return this.endOf(u).$D},W.$locale=function(){return M[this.$L]},W.locale=function(E,X){if(!E)return this.$L;var Z=this.clone(),N=S(E,X,!0);return N&&(Z.$L=N),Z},W.clone=function(){return I.w(this.$d,this)},W.toDate=function(){return new Date(this.valueOf())},W.toJSON=function(){return this.isValid()?this.toISOString():null},W.toISOString=function(){return this.$d.toISOString()},W.toString=function(){return this.$d.toUTCString()},G}(),v=R.prototype;return L.prototype=v,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",m],["$D",g]].forEach(function(G){v[G[1]]=function(W){return this.$g(W,G[0],G[1])}}),L.extend=function(G,W){return G.$i||(G(W,R,L),G.$i=!0),L},L.locale=S,L.isDayjs=x,L.unix=function(G){return L(1e3*G)},L.en=M[k],L.Ls=M,L.p={},L})})(Br);var FS=Br.exports;const Ne=HS(FS),zS={createDataSet(t,e){var n;this._dataEpoch=(this._dataEpoch??0)+1,Object.keys(this.seriesInfo.charts).forEach(i=>{var l;const s=this.seriesInfo.charts[i];if(s.length)if(i==="pie")this.options.sunburst?this.createSunburstDataSet(t):this.createPieDataSet(t,s);else if(i==="scatter")s.forEach(a=>{const r=this.seriesList[a],c=t[a],d=r==null?void 0:r.passingValue;r&&c&&(r.data=this.addSeriesDSforScatter(c),r.minMax=this.getSeriesMinMax(r.data,d))});else if(i==="heatMap")s.forEach(a=>{const r=this.seriesList[a],c=r==null?void 0:r.passingValue,d=t[a];r&&d&&(r.labels=e,r.data=this.addSeriesDSForHeatMap(d),r.minMax=this.getSeriesMinMax(r.data,c),r.valueOpt=this.getSeriesValueOptForHeatMap(r))});else{const a=s[0],r=(l=this.seriesList[a])==null?void 0:l.passingValue,c=new Map;for(let d=0;d<s.length;d++){const h=s[d],u=this.seriesList[h];if(u&&u.show!==!1){const f=t==null?void 0:t[h],{passingValue:m,interpolation:g}=u,p=g==="zero"||m!=null&&m!==void 0;let y=!1,C;if(!f)C=f;else if(!p)C=f;else{C=new Array(f.length);for(let b=0;b<f.length;b++){const w=f[b];g==="zero"&&!w?C[b]=0:w===m?(y=!0,C[b]=null):C[b]=w}}if(u.hasPassingValueInData=y,C){const b=u.isExistGrp&&!u.isOverlapping;let w=null;b&&(w=c.get(u.groupIndex),w||(w={pos:[],neg:[]},c.set(u.groupIndex,w))),b&&u.stackIndex?u.data=this.addSeriesStackDS(C,e,u.stackIndex,w,u.data):u.data=this.addSeriesDS(C,e,u.isExistGrp,r,u.data),u.minMax=this.getSeriesMinMax(u.data,u.passingValue),b&&this.updateStackTops(w,u)}}}}}),(n=this.buildLabelValidMask)==null||n.call(this)},createRealTimeScatterDataSet(t){var i,s,l,a;const e=Object.keys(t),n={maxY:-1/0,minY:1/0,fromTime:0,toTime:0};for(let r=0;r<e.length;r++){const c=e[r],d=t[c],h=d==null?void 0:d.length;if(!this.isInit||this.updateSeries||!this.dataSet[c]){const v={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0};this.dataSet[c]={...v,...this.dataSet[c]}}const u=this.dataSet[c],f=u.dataGroup,m=this.options.realTimeScatter.range||300,g=u.length!==m;u.length=m;const p=u.length;let y=0;for(let v=0;v<h;v++){const G=d[v];G&&y<G.x&&(y=G.x)}y=y?Math.floor(y/1e3)*1e3:0;const C=((l=(s=(i=f.at(-1))==null?void 0:i.data)==null?void 0:s.at(-1))==null?void 0:l.x)||Date.now(),b=Math.floor(C/1e3)*1e3,w=u.toTime||b,T=y||w,k=v=>{v.data.length=0,v.dataKeys?v.dataKeys.clear():v.dataKeys=new Set,v.max=0,v.min=1/0};if(u.endIndex==null||g){u.startIndex=0,u.endIndex=p-1,f.length=p;for(let v=0;v<p;v++)f[v]=f[v]||{data:[],dataKeys:new Set,max:0,min:1/0},k(f[v]);u.toTime=T,u.fromTime=u.toTime-p*1e3}const M=(T-w)/1e3,V=Number.isFinite(M)?Math.max(0,Math.floor(M)):0;if(u.toTime=T,u.fromTime=u.toTime-p*1e3,y&&(u.toTime-y)/1e3>p&&c==="")return;for(let v=0;v<p;v++)f[v]?f[v].data?f[v].dataKeys||(f[v].dataKeys=new Set):(f[v].data=[],f[v].dataKeys=new Set,f[v].max=0,f[v].min=1/0):f[v]={data:[],dataKeys:new Set,max:0,min:1/0};if(V>0)if(V>=p){for(let v=0;v<p;v++)k(f[v]);u.startIndex=0,u.endIndex=p-1}else{let v=u.startIndex,G=u.endIndex;for(let W=0;W<V;W++)k(f[v]),v=(v+1)%p,G=(G+1)%p;u.startIndex=v,u.endIndex=G}const x=this.options.coordinateDedupe!==!1;let S=-1;for(let v=0;v<h;v++){const G=d[v];if(G){const W=Math.floor(G.x/1e3)*1e3;if(u.fromTime<=W){let E=u.endIndex-(u.toTime-W)/1e3;E<0&&(E=p+E);const X=f[E],Z=O.coordinateKey(G.x,G.y);if(!(x&&X.dataKeys.has(Z))){x&&X.dataKeys.add(Z),X.data.push({x:G.x,y:G.y,o:G.value??G.y,color:G.color,k:x&&this.seriesInfo.charts.scatter.length>1?Z:void 0}),X.max=Math.max(X.max,G.y),X.min=Math.min(X.min,G.y);const P=(u.toTime-W)/1e3;P>S&&(S=P)}}}}u.lastTick={seq:(((a=u.lastTick)==null?void 0:a.seq)??0)+1,gapCount:V,prevToTime:w,toTime:u.toTime,length:p,startIndex:u.startIndex,endIndex:u.endIndex,maxDirtyAge:S};const L=1e3,I={maxY:-1/0,minY:1/0};for(let v=0;v<p;v++){const G=f[v];for(let W=0;W<G.data.length;W++){const E=G.data[W],X=Math.floor(E.x/L)*L;X>=u.fromTime&&X<=u.toTime&&Number.isFinite(E.y)&&(E.y>I.maxY&&(I.maxY=E.y),E.y<I.minY&&(I.minY=E.y))}}Number.isFinite(I.minY)&&(n.maxY=Math.max(n.maxY,I.maxY),n.minY=Math.min(n.minY,I.minY)),n.fromTime=u.fromTime,n.toTime=u.toTime}Number.isFinite(n.minY)||(n.minY=0,n.maxY=0),this.seriesInfo.charts.scatter.forEach(r=>{const c=this.seriesList[r];c.data=this.dataSet,c.minMax={minX:Ne(n.fromTime),minY:n.minY,maxX:Ne(n.toTime),maxY:n.maxY}})},createSunburstDataSet(t){this.pieDataSet=[];const e=this.pieDataSet,n=[];for(let i=0;i<t.length;i++){const s=t[i],l=this.seriesList[s.id];let a=!1;if(e[0]||(e[0]={ir:0,or:0,total:0,data:[]}),l.show){if(e[0].total+=s.value||0,e[0].data.push({parent:"$ev-root",id:s.id,value:s.value,sa:0,ea:0}),s.children)for(let r=0;r<s.children.length;r++)this.seriesList[s.children[r].id].show&&(a=!0),n.push({parent:s.id,data:s.children[r],depth:1});else{const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}if(!a){const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}}}for(e[0].data.sort((i,s)=>s.value-i.value);n.length;){const i=n.shift(),s=i.parent,l=i.data,a=i.depth;let r=!1;e[a]||(e[a]={ir:0,or:0,total:{},data:[]}),e[a].total[s]||(e[a].total[s]=0);const c=this.seriesList[l.id];if(l.id==="dummy")e[a].data.push({parent:s,id:"dummy",value:l.value,sa:0,ea:0}),e[a].total[s]+=l.value;else if(c&&c.show){if(e[a].data.push({parent:s,id:l.id,value:l.value,sa:0,ea:0}),e[a].total[s]+=l.value,l.children)for(let d=0;d<l.children.length;d++)this.seriesList[l.children[d].id].show&&(r=!0),n.push({parent:l.id,data:l.children[d],depth:a+1});else{const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}if(!r){const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}}e[a].data.sort((d,h)=>h.value-d.value)}},createPieDataSet(t,e){this.pieDataSet=[];const n=this.pieDataSet;n[0]={data:[],ir:0,or:0,total:0},e.forEach(i=>{if(this.seriesList[i].show){const s=t[i][0]??0;n[0].total+=s,n[0].data.push({id:i,value:s,sa:0,ea:0})}}),n.forEach(i=>{i.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(t,e,n=0,i=null,s){const l=this.options.horizontal,a=[],r=i==null?void 0:i.pos,c=i==null?void 0:i.neg,d=Array.isArray(s)?s:null;return t.forEach((h,u)=>{let f=(h>=0?r==null?void 0:r[u]:c==null?void 0:c[u])??0,m=h,g=e[u],p=h;if(f!=null&&g!=null){p&&typeof p=="object"&&("x"in p||"y"in p)&&(m=l?h.x:h.y,g=l?h.y:h.x);const y=(m==null?void 0:m.value)??m;n>0?y!=null?p=f+y:p=m:(f=0,p=y);const C=d&&d[a.length];a.push(this.addData(p,g,m,f,C||null))}}),a},updateStackTops(t,e){if(!e.show)return;const n=this.options.horizontal,i=e.passingValue,s=!O.isNullOrUndefined(i),l=e.data,a=t.pos,r=t.neg;for(let c=0;c<l.length;c++){const d=l[c],h=n?d.x:d.y,u=d.o,f=s&&u===i;h!=null&&!f&&(u>=0?a[c]=h:r[c]=h)}},addSeriesDS(t,e,n,i,s){const l=this.options.horizontal,a=[],r=n&&!O.isNullOrUndefined(i),c=Array.isArray(s)?s:null;for(let d=0;d<t.length;d++){let h=t[d],u=e[d];if(h&&typeof h=="object"&&(h.x||h.y)&&(h=l?h.x:h.y,u=l?t[d].y:t[d].x),u!==null){const f=r&&h===i?0:h;if(f!==null&&typeof f=="object"||h!==null&&typeof h=="object")a.push(this.addData(f,u,h));else{const m=f??null,g=h??null,p=c&&c[a.length];p&&typeof p=="object"?(p.x=l?m:u,p.y=l?u:m,p.o=g,p.b=null,p.xp=null,p.yp=null,p.w=null,p.h=null,p.dataColor=null,p.dataTextColor=null,a.push(p)):a.push(l?{x:m,y:u,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null}:{x:u,y:m,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null})}}}return a},addSeriesDSforScatter(t){return t.map(e=>{const n=e.x,i={value:e.y,color:(e==null?void 0:e.color)||null};return this.addData(i,n,i)})},addSeriesDSForHeatMap(t){return t.map(({x:e,y:n,value:i,color:s=null})=>({x:e,y:n,o:i,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(t,e,n=null,i=null,s=null){let l=null,a=null,r=null,c=null,d=null;t!==null&&typeof t=="object"?(l=t.value,r=t.color,d=t.textColor):l=t??null,n!==null&&typeof n=="object"?(a=n.value,c=n.color):a=n??null;const h=s||{};return this.options.horizontal?(h.x=l,h.y=e):(h.x=e,h.y=l),h.o=a,h.b=i,h.xp=null,h.yp=null,h.w=null,h.h=null,h.dataColor=r??c,h.dataTextColor=d,h},getSeriesMinMax(t,e){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},i=this.options.horizontal;if(t.length){const s=!O.isNullOrUndefined(e),l={minX:t[0].x,minY:t[0].y,maxX:t[0].x,maxY:t[0].y,maxDomain:i?t[0].y:t[0].x,maxDomainIndex:0};for(let a=0;a<t.length;a++){const r=t[a],c=r.x,d=r.y,h=r.o;(!s||h!==e)&&(c<=l.minX&&(l.minX=c===null?0:c),d<=l.minY&&(l.minY=d===null?0:d),c>=l.maxX&&(l.maxX=c===null?0:c,i&&c!==null&&(l.maxDomain=d,l.maxDomainIndex=a)),d>=l.maxY&&(l.maxY=d===null?0:d,!i&&d!==null&&(l.maxDomain=c,l.maxDomainIndex=a)))}return l}return n},getVisibleWindowMaxSeries(t,e){var l;if(!Number.isFinite(t)||!Number.isFinite(e)||e<t)return null;const n=this.options.horizontal;let i=null;const s=Object.keys(this.seriesList);for(let a=0;a<s.length;a+=1){const r=this.seriesList[s[a]];if(r!=null&&r.show&&((l=r.data)!=null&&l.length)){const c=Math.max(0,t),d=Math.min(r.data.length-1,e);for(let h=c;h<=d;h+=1){const u=r.data[h],f=n?u==null?void 0:u.x:u==null?void 0:u.y;Number.isFinite(f)&&(!i||f>i.value)&&(i={sId:r.sId,value:f,index:h,domain:n?u==null?void 0:u.y:u==null?void 0:u.x})}}}return i},getSeriesValueOptForHeatMap(t){const{data:e,colorState:n,isGradient:i}=t,s=this.options.heatMapColor,l=s.colorsByRange.length||s.rangeCount,a=s.decimalPoint;let r,c=0,d=!1;e.forEach(({o:u})=>{c<u&&(c=Math.max(c,u)),u<0?d=!0:r===void 0?r=u:r=Math.min(r,u)}),d&&!i&&n.length===l&&n.push({id:`color#${l}`,color:s.error,state:"normal",label:"Error",show:!0});let h=c>r?Math.floor((c-r)/l):1;return c-r<=l&&(a>0?h=+((c-r)/l).toFixed(a):h=1),{min:r,max:c,interval:h,existError:d,decimalPoint:a}},getItemByLabelIndex(t){if(t<0)return!1;const e=Object.keys(this.seriesList),n=!!this.options.horizontal;let i=null,s=null,l=null,a="",r=0,c=!1,d=!1;if(t>-1){for(let h=0;h<e.length;h++){const u=e[h],f=this.seriesList[u],m=f.data[t];if(m&&f.show&&f.showLegend){const g=n?m.y:m.x,p=n?m.yp:m.xp;if(g!=null){const y=n?m.o||m.x:m.o||m.y;f.stackIndex?(r+=isNaN(m.o)?0:m.o,c=!0):r+=m.y,(l===null||l<=y)&&(l=y,a=u,i=g,s=p)}}}d={label:i,pos:s,value:l===null?0:l,sId:a,acc:r,useStack:c,maxIndex:t}}return d},getItem(t,e=!1){const{seriesID:n,dataIndex:i}=t;let s;if("seriesID"in t){const l=this.getDataByValues(n,i);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getHitItemByPosition([l.xp,l.yp],e,i,!0)]}else{const l=Object.entries(this.seriesList);let a;for(let r=0;r<l.length;r++){const[c,d]=l[r];if(d.show){a=c;break}}s=i==null?void 0:i.map(r=>{var h,u;const c=this.getDataByValues(a,r);if(!c)return null;const d=this.getHitItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],e,r,!0);return d&&!d.sId&&(d.sId=a,d.label=((u=(h=this.data)==null?void 0:h.labels)==null?void 0:u[r])??d.label,d.dataIndex=r),d})}return s},getDataByValues(t,e){const n=this.seriesList[t];return!n||isNaN(e)||e<0||(n==null?void 0:n.data.length)<=e?!1:n.data[e]},getHitItemByPosition(t,e=!1,n,i=!1,s=!1){var R;const l=Object.keys(this.seriesList),a=!!this.options.horizontal,[r,c]=t;let d=n;if(d===void 0&&!e){const v=l.find(G=>{var E;const W=this.seriesList[G];return(W==null?void 0:W.show)&&((E=W==null?void 0:W.data)==null?void 0:E.length)>0});if(v){const G=this.seriesList[v].data,W=a?t[1]:t[0];let E=1/0,X=-1;for(let Z=0;Z<G.length;Z++){const N=s||l.some(B=>{var H,_,D,z;const Y=this.seriesList[B];return(Y==null?void 0:Y.show)&&((_=(H=Y.data)==null?void 0:H[Z])==null?void 0:_.o)!==null&&((z=(D=Y.data)==null?void 0:D[Z])==null?void 0:z.o)!==void 0}),P=G[Z];if(N&&P){let B;if(a?B=P.h?P.yp+P.h/2:P.yp:B=P.w?P.xp+P.w/2:P.xp,B!=null){const Y=Math.abs(W-B);Y<E&&(E=Y,X=Z)}}}X!==-1&&(d=X)}}let h=null,u=null,f=null,m=null,g="",p=null,y=1/0,C=!1,b=null,w=null,T=null,k=null,M="",V=null,x=1/0,S=0,L=!1;for(let v=0;v<l.length;v++){const G=l[v],W=this.seriesList[G],E=e?W.findApproximateData:W.findGraphData;if(E){const X=E.call(W,t,a,d,i),Z=X.data,N=X.index;if(Z)if(O.isPieType(X.type))h=X.type,u=G,g=G,f=(Z.ea-Z.sa)/2,m=Z.o,p=Z.index;else{const P=a?Z.y:Z.x,B=a?Z.yp:Z.xp;if(P!=null){const Y=a?Z.o||Z.x:Z.o||Z.y;W.stackIndex!=null?(S+=isNaN(Z.o)?0:Z.o,L=!0):S+=Z.y;const H=Y!=null&&!Number.isNaN(Y),_=Z.xp!==null&&Z.xp!==void 0&&Z.yp!==null&&Z.yp!==void 0;if(H&&_){const D=O.calcBoxDistance(Z,r,c);(M===""||D<x)&&(x=D,b=W.type,w=P,T=B,k=Y,M=G,V=N)}else H&&M===""&&(b=W.type,w=P,T=B,k=Y,M=G,V=N);if(X.hit&&Z.xp!==void 0&&Z.yp!==void 0){const D=(Z.xp-t[0])**2+(Z.yp-t[1])**2;X.directHit?((!C||D<y)&&(y=D,h=W.type,u=P,f=B,m=Y,g=G,p=N),C=!0):C||D<y&&(y=D,h=W.type,u=P,f=B,m=Y,g=G,p=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const v=l.find(W=>{var X;const E=this.seriesList[W];return(E==null?void 0:E.show)&&((X=E==null?void 0:E.data)==null?void 0:X.length)>0}),G=v?(R=this.seriesList[v].data)==null?void 0:R[d]:null;G&&(w=a?G.y:G.x,V=d)}const I=g!=="";return{type:I?h:b,label:I?u:w,pos:I?f:T,value:I?m:k,sId:I?g:M,acc:S,useStack:L,dataIndex:I?p:V}},getLabelInfoByPosition(t,e){var p,y,C;const[n,i]=t,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=this.data.series,a=((p=Object.values(l).sort((b,w)=>w.pointSize??0-b.pointSize??0)[0])==null?void 0:p.pointSize)??3,{horizontal:r,selectLabel:c}=this.options;let d,h;e==="xAxis"?(d=this.axesX[0],h=this.scrollbar.x):e==="yAxis"?(d=this.axesY[0],h=this.scrollbar.y):(d=r?this.axesY[0]:this.axesX[0],h=r?this.scrollbar.y:this.scrollbar.x);const u=s[d.units.rectStart],f=s[d.units.rectEnd];let m,g;if(h!=null&&h.use&&((y=d==null?void 0:d.labels)!=null&&y.length)){const{type:b,range:w,interval:T=1}=h,[k,M]=w??[0,d.labels.length],V=Math.floor((+M-+k)/T)+1,x=(f-u)/V,L=Math.floor(((e==="yAxis"||r?i:n)-u)/x);b==="step"?m=k+L:m=(d==null?void 0:d.labels.findIndex(R=>R===+k))+L}else if((C=d==null?void 0:d.labels)!=null&&C.length){const b=(f-u)/d.labels.length,T=Math.floor(((e==="yAxis"?i:n)-u)/b);m=d.labels.length>T?T:-1}else{let b,w;n<u-a?(b=u,w=0):n>f+a?(b=f,w=this.data.labels.length-1):b=n,g=this.getHitItemByPosition([b,i],c==null?void 0:c.useApproximateValue,w,!0,!0),m=g.dataIndex??-1}return{labelIndex:m,hitInfo:g}},getCurMouseLabelVal(t,e,n){const{type:i,horizontal:s}=this.options,l=t==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let u="";switch(i){case"bar":case"line":{u=s&&!l||!s&&l?this.data.labels[n]:"";break}case"heatMap":{u=this.data.labels[a][n];break}}return u},h=()=>{let u="";const f={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},{steps:m,interval:g,graphMin:p}=this.axesSteps[a][0],{width:y,height:C}=this.axesRange[a][0].size,b=l?this.axesX:this.axesY,w=f[b[0].units.rectStart],T=f[b[0].units.rectEnd],k=Math.abs(e[l?0:1]-w),M=(l?y:C)/2,V=Math.abs(w-T)/m,x=Math.floor((k+M)/V);return V*x+M>k&&V*x-M<k&&(u=x*g+p),u};return typeof n=="number"&&(r=d(),c=n),r||(r=h(),c=-1),{labelVal:r,labelIdx:c}},getStoreMinMax(){const t=Object.keys(this.seriesList),e=this.options.horizontal,n={x:[{min:null,max:null}],y:[{min:null,max:null}]};return t.length?t.reduce((i,s)=>{const l=i,a=this.seriesList[s],r=a.minMax,c=a.xAxisIndex,d=a.yAxisIndex;if(l.x[c]||(l.x[c]={min:null,max:null,maxSID:null}),l.y[d]||(l.y[d]={min:null,max:null,maxSID:null}),r&&a.show){e?((l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY));const h=this.seriesList[s].isExistGrp,u=l.x[c].max<0;(h&&u||!l.x[c].max||r.maxX>=l.x[c].max)&&(l.x[c].max=r.maxX,l.x[c].maxSID=s);const f=l.y[d].max<0;(h&&f||!l.y[d].max||r.maxY>=l.y[d].max)&&(l.y[d].max=r.maxY,l.y[d].maxSID=s)}return l},{x:[{min:null,max:null,maxSID:null}],y:[{min:null,max:null,maxSID:null}]}):n},calculateAngle(){const t=this.pieDataSet;let e,n,i,s,l,a,r,c,d;const h=[],u={"$ev-root":1.5*Math.PI};for(let f=0;f<t.length;f++){const m=t[f];d=!0;for(let g=0;g<m.data.length;g++)if(e=m.data[g],n=e.value,d&&(d=e.id==="dummy"),!f)a=u["$ev-root"],l=2*Math.PI*(n/m.total),r=a+l,e.sa=a,e.ea=r,u["$ev-root"]+=l;else{if(i=this.getParentInfo(f-1,e.parent),!i)break;u[e.parent]||(u[e.parent]=i.sa),a=u[e.parent],c=i.ea-i.sa,s=m.total[e.parent]||0,l=c*(n/s),r=a+l,e.sa=a,e.ea=r,u[e.parent]+=l}d&&h.push(f)}for(let f=0;f<h.length;f++)this.pieDataSet.splice(h,1);this.options.reverse&&(this.pieDataSet=cb(this.pieDataSet))},getParentInfo(t,e){for(let n=t;n>=0;n--){const i=this.pieDataSet[n];for(let s=0;s<i.data.length;s++)if(i.data[s].id===e)return i.data[s]}return null},getAggregations(){const t=this.data.data,e=this.data.series,n={},i=Object.keys(e);return i==null||i.forEach(s=>{const l=t[s].map(f=>f!=null&&f.value?f.value:f),a=l[l.length-1],r=l.filter(f=>f!=null),c=Math.min(...r),d=Math.max(...r),h=r.reduce((f,m)=>f+m,0),u=h/r.length||0;(!O.checkSafeInteger(c)||!O.checkSafeInteger(d)||!O.checkSafeInteger(u)||!O.checkSafeInteger(h)||!O.checkSafeInteger(a))&&console.warn("[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991."),n[s]={min:c,max:d,avg:u,total:h,last:a}}),n}},AS={x:{rectStart:"x1",rectEnd:"x2",rectOffsetCounter:t=>t==="top"?"y2":"y1",rectOffset:t=>t==="top"?"y1":"y2"},y:{rectStart:"y2",rectEnd:"y1",rectOffsetCounter:t=>t==="left"?"x2":"x1",rectOffset:t=>t==="left"?"x1":"x2"}},Ht=["#2b99f0","#8ac449","#00C4C5","#ffde00","#ff7781","#8470ff","#75cd8e","#48d1cc","#fec64f","#fe984f","#0052ff","#00a48c","#83cfde","#dfe32d","#ff7d40","#99c7ff","#a5fee3","#0379c9","#eef093","#ffa891","#00c5cd","#009bc7","#cacaff","#ffc125","#df6264"],mi={show:!0,highlight:{defaultSize:4,maxSize:6,maxShadowSize:10,maxShadowOpacity:.4},xAxisIndex:0,yAxisIndex:0,point:!0,pointHighlight:!0,pointSize:3,pointStyle:"",lineWidth:2,fill:!1,fillOpacity:.4,showLegend:!0,passingValue:null,interpolation:"none"},KS={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},_S={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},Yr={min:null,max:null,autoScaleRatio:null,startToZero:!1,showAxis:!0,axisLineColor:"#C9CFDC",axisLineWidth:1,showGrid:!0,gridLineColor:"#C9CFDC",showAxisTick:!0,showIndicator:!1,timeFormat:"mm:ss",range:null,interval:null,decimalPoint:"auto",fixedSteps:!1,scaleChange:!1,labelStyle:{show:!0,fontSize:12,color:"#25262E",fontFamily:"Roboto",fontWeight:400,fitWidth:!1,fitDir:"right",alignToGridLine:!1,padding:0,fixWidth:void 0},showLastLabel:!1,lastLabelFontStyle:null,firstLabelFontStyle:null,title:{use:!1,text:null,fontWeight:400,fontSize:12,fontFamily:"Roboto",textAlign:"right",fontStyle:"normal",color:"#808080"},scrollbar:{use:!1,width:14,height:14,background:"#F2F2F2",showButton:!0,thumbStyle:{background:"#929292",radius:0}}},Or={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null,text:null,borderRadius:0,gap:null,padding:null,pointer:{show:!1,color:null},position:"outside",showValue:!1,responsive:{valueOnlyBelow:null,hideBelow:null},showTextOnHover:{use:!1,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:null,borderRadius:4,fontSize:12,fontWeight:400,fontFamily:"Roboto",useShadow:!1,shadowOpacity:.25,padding:{top:4,right:8,bottom:4,left:8}}},Ao={color:"#FF0000",lineWidth:1,label:Or},Ko={color:"#FAE59D",border:null},US={show:!0,xAxisIndex:0,yAxisIndex:0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:0},highlight:{stroke:{use:!1,color:null,width:1,radius:0},shadow:{use:!0,offsetX:0,offsetY:0,blur:4,color:"#959494"}}},Ct={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:26784e5,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},JS=Object.freeze([1,2,5]),Hr=["cross","crossRot","star","line"],te={calculateX(t,e,n,i,s=0){if(t==null||t>n||t<e)return null;const l=i/(n-e);return Math.ceil(s+l*(t-e))},calculateSubX(t,e,n,i,s=0){if(t==null)return null;const l=i/(n-e);return Math.ceil(s+l*(t-e))},calculateY(t,e,n,i,s=0){let l;if(t==null||t>n||t<e)return null;const a=i/(n-e);return s?l=s-a*(t-(e||0)):l=-(a*(t-(e||0))),Math.floor(l)},drawPoint(t,e,n,i,s){if(!(isNaN(n)||n<=0)){if(e==="rect"){const l=1/Math.SQRT2*n;t.fillRect(i-l,s-l,2*l,2*l),t.strokeRect(i-l,s-l,2*l,2*l);return}t.beginPath(),this._appendPointPath(t,e,n,i,s),Hr.includes(e)||t.fill(),t.stroke()}},_appendPointPath(t,e,n,i,s){let l,a,r,c,d,h,u,f,m;switch(e){case"triangle":l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,t.moveTo(i-l/2,s+c/3),t.lineTo(i+l/2,s+c/3),t.lineTo(i,s-2*c/3),t.closePath();break;case"rectRounded":h=n/Math.SQRT2,u=i-h,f=s-h,m=Math.SQRT2*n,this.roundedRect(t,u,f,m,m,n/2),t.closePath();break;case"rectRot":d=1/Math.SQRT2*n,t.moveTo(i-d,s),t.lineTo(i,s+d),t.lineTo(i+d,s),t.lineTo(i,s-d),t.closePath();break;case"cross":t.moveTo(i,s+n),t.lineTo(i,s-n),t.moveTo(i-n,s),t.lineTo(i+n,s),t.closePath();break;case"crossRot":a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i-a,s+r),t.lineTo(i+a,s-r),t.closePath();break;case"star":t.moveTo(i,s+n),t.lineTo(i,s-n),t.moveTo(i-n,s),t.lineTo(i+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i-a,s+r),t.lineTo(i+a,s-r),t.closePath();break;case"line":t.moveTo(i-n,s),t.lineTo(i+n,s),t.closePath();break;default:t.moveTo(i+n,s),t.arc(i,s,n,0,Math.PI*2);break}},drawPointBatch(t,e,n,i){if(!(isNaN(n)||n<=0||!i||!i.length)){if(e==="rect"){const s=1/Math.SQRT2*n;for(let l=0;l<i.length;l++)t.fillRect(i[l].xp-s,i[l].yp-s,2*s,2*s),t.strokeRect(i[l].xp-s,i[l].yp-s,2*s,2*s);return}t.beginPath();for(let s=0;s<i.length;s++)this._appendPointPath(t,e,n,i[s].xp,i[s].yp);Hr.includes(e)||t.fill(),t.stroke()}},roundedRect(t,e,n,i,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,i/2),d=e+c,h=n+c,u=e+i-c,f=n+s-c;t.moveTo(e,h),d<u&&h<f?(t.arc(d,h,c,-a,-r),t.arc(u,h,c,-r,0),t.arc(u,f,c,0,r),t.arc(d,f,c,r,a)):d<u?(t.moveTo(d,n),t.arc(u,h,c,-r,r),t.arc(d,h,c,r,a+r)):h<f?(t.arc(d,h,c,-a,0),t.arc(d,f,c,0,a)):t.arc(d,h,c,-a,a),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,s)},createGradient(t,e,n,i,s,l){const{x:a,y:r,w:c,h:d}=n;let h;e?h=t.createLinearGradient(a,0,a+c,0):h=t.createLinearGradient(0,r,0,r+d);for(let u=0;u<i.length;u++){const f=i[u][0]??0,m=i[u][1]??"rgba(255, 255, 255, 0)",g=m.includes("rgba")?O.getOpacity(m):1,p=s?l:g;h.addColorStop(f,O.colorStringToRgba(m,p))}return h}},jS=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),Fr=Math.PI*2;class QS{constructor(e,n,i){const s=He({},n,mi);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:Ht[i%Ht.length])}),this.type="line",this.sId=e,this.extent={downplay:{opacity:.3,lineWidth:1},normal:{opacity:1,lineWidth:1},highlight:{opacity:1,lineWidth:2}},this.data=[],this.beforeMouseXp=0,this.beforeMouseYp=0,this.beforeFindItemIndex=-1,this.size={comboOffset:0}}useLinearInterpolation(){return this.interpolation==="linear"||this.interpolation==="none"&&!!this.passingValue&&this.hasPassingValueInData}_getValidGData(){const e=this.data,n=this._validGDataCache;if(n&&n.src===e&&n.length===e.length)return n.value;const i=e.filter(s=>!O.isNullOrUndefined(s.x));return this._validGDataCache={src:e,length:e.length,value:i},i}computeGeometry(e){if(!this.show)return;const n=e.scaleVersion!=null&&e.dataEpoch!=null;if(n&&this._lastDataEpoch===e.dataEpoch&&this._lastScaleVersion===e.scaleVersion&&this._lastGeomData===this.data)return;const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=e,r=this.useLinearInterpolation();let c=0;const d=l.x[this.xAxisIndex],h=l.y[this.yAxisIndex];let u=i.chartWidth-(s.left+s.right);const f=i.chartHeight-(s.top+s.bottom);this.combo&&(c=u/(this.data.length||1),u-=c,this.size.comboOffset=c);const m=i.x1+s.left+c/2,g=i.y2-s.bottom,p=d.graphMin,y=d.graphMax,C=h.graphMin,b=h.graphMax,w=u/(y-p),T=f/(b-C),k=C||0,M=x=>x==null||x<p||x>y?null:Math.ceil(m+w*(x-p)),V=x=>{const S=a&&x>b?b:x;return S==null||S<C||S>b?null:Math.floor(g?g-T*(S-k):-(T*(S-k)))};for(let x=0;x<this.data.length;x++){const S=this.data[x];let L=M(S.x),I=V(S.y);this.isExistGrp&&r&&S.o===null&&(I=V(S.b??0)),L!==null&&(L+=O.aliasPixel(L)),S.xp=L,S.yp=I}n&&(this._lastDataEpoch=e.dataEpoch,this._lastScaleVersion=e.scaleVersion,this._lastGeomData=this.data)}hasRenderableValue(){return this.data.some(e=>e.o!==null&&e.o!==void 0)}draw(e){var Y,H,_,D,z,A,j,J,q;if(!this.show)return;const{ctx:n,chartRect:i,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h,displayOverflow:u}=e;if(this.computeGeometry(e),!this.hasRenderableValue()&&!this.isExistGrp)return;const f=a==null?void 0:a.option,m=(f==null?void 0:f.use)&&(f==null?void 0:f.useSeriesOpacity),g=((Y=a==null?void 0:a.selected)==null?void 0:Y.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((H=r==null?void 0:r.option)!=null&&H.use&&((D=(_=r==null?void 0:r.selected)==null?void 0:_.seriesId)!=null&&D.length)){const U=(A=(z=r==null?void 0:r.selected)==null?void 0:z.seriesId)==null?void 0:A.includes(this.sId);p=this.extent[U?"highlight":"downplay"]}else m&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const y=U=>U!=null&&U.includes("rgba")?O.getOpacity(U):p.opacity,C=this.color,b=y(C),w=this.pointFill,T=y(w),k=this.extent.downplay?this.fillOpacity*p.opacity:this.fillOpacity,M=this.lineWidth*p.lineWidth,V=this._rgbaCache||(this._rgbaCache={}),x=(U,ne,$)=>{const ee=V[U];if(ee!==void 0&&ee.s===ne&&ee.o===$)return ee.v;const Q=O.colorStringToRgba(ne,$);return V[U]={s:ne,o:$,v:Q},Q};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=x("stroke",C,b),this.segments&&n.setLineDash(this.segments);const S=this.useLinearInterpolation();let L=0;const I=l.x[this.xAxisIndex],R=l.y[this.yAxisIndex];let v=i.chartWidth-(s.left+s.right);const G=i.chartHeight-(s.top+s.bottom);this.combo&&(L=v/(this.data.length||1),v-=L,this.size.comboOffset=L);const W=i.x1+s.left+L/2,E=i.y2-s.bottom,X=U=>te.calculateX(U,I.graphMin,I.graphMax,v,W),Z=U=>te.calculateY(u&&U>R.graphMax?R.graphMax:U,R.graphMin,R.graphMax,G,E);let N,P=null,B=null;for(let U=0;U<this.data.length;U++){const ne=this.data[U],$=ne.xp,ee=ne.yp;S&&ne.o===null||($===null||ee===null?N=void 0:(Yt(N==null?void 0:N.y)&&!this.isExistGrp||!S&&(Yt(N==null?void 0:N.y)||Yt(ne.o))?(n.moveTo($,ee),P=$,B=ee):($!==P||ee!==B)&&(n.lineTo($,ee),P=$,B=ee),N=ne))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const U=this.data.some(ae=>ae.o<0),ne=U?Z(0):i.y2-s.bottom,$=x("fill",this.fillColor||C,k);if((j=this.fill)!=null&&j.gradient){let ae=this.data[0].yp,xe=this.data[0].y;this.data.forEach(re=>{re.yp&&re.yp<=ae?ae=re.yp:re.y&&re.y>=xe&&(xe=re.y)});const be=n.createLinearGradient(0,i.y2,0,ae),oe=p.opacity<1?$:C;be.addColorStop(0,U?oe:$),be.addColorStop(.5,$),be.addColorStop(1,oe),n.fillStyle=be}else n.fillStyle=$;let ee=null,Q=null;const he=[],me=this.data.length;for(let ae=0;ae<me+1;ae++){const xe=(J=this.data[ae])==null?void 0:J.o;if(S&&lb(xe)||!S&&Yt(xe)){if(ee!==null&&Q!==null){let be=ee-1;for(let oe=ae-1;oe>=ee;oe--){const re=(q=this.data[oe])==null?void 0:q.o;if(!Yt(re)&&re!==null){be=oe;break}}he.push([ee,be]),ee=null,Q=null}}else S&&xe===null||(ee=ee===null?ae:ee),Q=ae}he.forEach(([ae,xe])=>{if(ae===xe){const oe=this.data[ae];if(oe.xp===null||oe.yp===null)return;n.moveTo(oe.xp-M,oe.yp),n.lineTo(oe.xp+M,oe.yp),n.lineTo(oe.xp+M,Z(oe.b)??ne);return}let be=!1;for(let oe=ae;oe<=xe;oe++){const re=this.data[oe];if(re.xp!==null&&re.yp!==null&&(be?re.o!==null&&n.lineTo(re.xp,re.yp):(n.moveTo(re.xp,re.yp),be=!0)),oe===xe)for(let Ie=xe;Ie>=ae;Ie--){const Ve=this.data[Ie],kt=X(Ve.x);if(kt!==null&&Ve.o!==null){const Vt=Z(Ve.b)??Z(0);n.lineTo(kt,Vt)}}}}),n.fill()}if(!d){n.strokeStyle=x("stroke",C,b);const U=x("focus",w,1),ne=x("blur",w,T);let $=!1;if(this.interpolation==="linear"){let oe=0;for(let re=0;re<this.data.length&&!(this.data[re].o!==null&&(oe++,oe>1));re++);$=oe===1}const ee=g.length?new Set(g):null,Q=this.pointSize,he=this.pointStyle,me=this.data,ae=me.length,xe=!jS.has(he),be=oe=>{const re=me[oe];if(re.xp===null||re.yp===null||re.o===null)return 0;let pe;if($)pe=!0;else if(S)pe=!1;else{const Ve=oe>0?me[oe-1].o:null,kt=oe+1<ae?me[oe+1].o:null;pe=Ve==null&&kt==null}const Ie=ee?ee.has(oe):!1;return this.point||pe||Ie?Ie&&!c?2:1:0};if(xe){let oe=!1,re=null;for(let pe=0;pe<ae;pe++){const Ie=be(pe);if(Ie!==0){const Ve=me[pe];Ie===2?(re===null&&(re=[]),re.push(Ve)):(oe||(n.beginPath(),oe=!0),n.moveTo(Ve.xp+Q,Ve.yp),n.arc(Ve.xp,Ve.yp,Q,0,Fr))}}if(oe&&(n.fillStyle=ne,n.fill(),n.stroke()),re!==null){n.beginPath();for(let pe=0;pe<re.length;pe++){const Ie=re[pe];n.moveTo(Ie.xp+Q,Ie.yp),n.arc(Ie.xp,Ie.yp,Q,0,Fr)}n.fillStyle=U,n.fill(),n.stroke()}}else{let oe=null,re=null;for(let pe=0;pe<ae;pe++){const Ie=be(pe);if(Ie!==0){const Ve=me[pe];Ie===2?(re===null&&(re=[]),re.push(Ve)):(oe===null&&(oe=[]),oe.push(Ve))}}oe!==null&&(n.fillStyle=ne,te.drawPointBatch(n,he,Q,oe)),re!==null&&(n.fillStyle=U,te.drawPointBatch(n,he,Q,re))}}n.restore()}itemHighlight(e,n){const i=e.data,s=n,{xp:l,yp:a,o:r}=i;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=O.colorStringToRgba(this.color,0),s.fillStyle=O.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),te.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,te.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",te.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(e,n,i,s){var f;const l=e[0],a=e[1],r={data:null,hit:!1,color:this.color},c=this._getValidGData(),d=this.useLinearInterpolation(),h=Math.max((this.pointSize??mi.pointSize)+mi.pointSize,mi.highlight.maxSize),u=m=>{if(!m||m.xp===void 0||m.yp===void 0)return!1;const g=l-m.xp,p=a-m.yp;return g*g+p*p<=h*h};if(c!=null&&c.length)if(typeof i=="number"&&this.show){if(r.data=c[i],r.index=i,r.data){const m=c[i];m.o!==null&&m.o!==void 0&&m.yp!==null&&m.yp!==void 0&&(Math.abs(a-m.yp)<=15&&(r.hit=!0),u(m)&&(r.hit=!0,r.directHit=!0))}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let m=1/0,g=-1;const p=[];c.forEach((w,T)=>{w.xp!==null&&w.yp!==null&&w.o!==null&&p.push({...w,originalIndex:T})}),p.length===0&&c.forEach((w,T)=>{p.push({...w,originalIndex:T})});let y=0,C=p.length-1;for(;y<=C;){const w=Math.floor((y+C)/2),T=p[w],k=Math.abs(l-T.xp);if(k<m&&(m=k,g=T.originalIndex),T.xp<l){if(y=w+1,y<p.length){const M=Math.abs(l-p[y].xp);M<m&&(m=M,g=p[y].originalIndex)}}else if(T.xp>l){if(C=w-1,C>=0){const M=Math.abs(l-p[C].xp);M<m&&(m=M,g=p[C].originalIndex)}}else break}const b=p.findIndex(w=>w.originalIndex===g);if(b!==-1)for(let w=Math.max(0,b-2);w<=Math.min(p.length-1,b+2);w++){const T=p[w],k=Math.abs(l-T.xp);k<m&&(m=k,g=T.originalIndex)}if(g!==-1){let w=50;if(c.length>1){const k=[];for(let M=1;M<c.length;M++)c[M].xp!==null&&c[M-1].xp!==null&&k.push(Math.abs(c[M].xp-c[M-1].xp));k.length>0&&(w=k.reduce((M,V)=>M+V,0)/k.length)}const T=Math.max(w,1);if(m<=T)r.data=c[g],r.index=g;else{let k=!1,M=d?1/0:T;const V=d?p:c;for(let x=0;x<V.length;x++){const S=Math.abs(l-V[x].xp);S<=M&&(k=!0,M=S,g=d?V[x].originalIndex:x)}k&&(r.data=c[g],r.index=g)}if(r.data){const k=c[g];Math.abs(a-k.yp)<=15&&(r.hit=!0),u(k)&&(r.hit=!0,r.directHit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((f=r==null?void 0:r.data)==null?void 0:f.o)===null&&(r.data=null),r}findApproximateData(e){var f,m;const n=e[0],i=e[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(g=>!O.isNullOrUndefined(g.x));if(!l.length)return s;const a=l.length>1?Math.abs(((f=l[1])==null?void 0:f.xp)-((m=l[0])==null?void 0:m.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,u=1/0;for(;c<=d;){const g=Math.floor((c+d)/2),p=l[g].xp;if(p-r<=n&&n<=p+r){const y=Math.max(0,g-2),C=Math.min(l.length-1,g+2);for(let b=y;b<=C;b++)if(l[b].xp!==null&&l[b].yp!==null){const w=Math.sqrt((n-l[b].xp)**2+(i-l[b].yp)**2);w<u&&(u=w,h=b)}return h!==-1&&(s.data=l[h],s.index=h,u<5&&(s.hit=!0)),s}else if(p+r<n){if(g<d&&n<l[g+1].xp){const y=Math.abs(l[g].xp-n),C=Math.abs(l[g+1].xp-n);s.data=y>C?l[g+1]:l[g],s.index=y>C?g+1:g;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}c=g+1}else{if(g>0&&n>l[g-1].xp){const y=Math.abs(l[g-1].xp-n),C=Math.abs(l[g].xp-n);s.data=y>C?l[g]:l[g-1],s.index=y>C?g:g-1;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}d=g-1}}return s}findItems({xsp:e,width:n}){const i=e+n;return this.data.filter(s=>e-1<=s.xp&&s.xp<=i+1)}}class $S{constructor(e,n,i,s=!1){const l=vo({},mi,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=Ht[i%Ht.length])}),this.sId=e,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(e,n){const i=`${e}_${n}`;if(this._colorCache.has(i))return this._colorCache.get(i);const s=O.colorStringToRgba(e,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(i,s),s}draw(e){this.show&&(this.computeGeometry(e),this.realTimeScatter?this.realTimeScatterDraw(e):this.defaultScatterDraw(e))}computeGeometry(e){this.show&&(this.realTimeScatter?this.computeRealTimeGeometry(e):this.computeDefaultGeometry(e))}computeDefaultGeometry(e){const{duple:n,legendHitInfo:i,coordinateDedupe:s}=e,l=new Set,a=s!==!1;for(let r=0;r<this.data.length;r++){const c=this.data[r],d=O.coordinateKey(c.x,c.y);let h;i?h=i.sId===this.sId:a?h=n.get(d)===this.sId&&!l.has(d):h=!0,h&&(this.calcItem(c,e),c.xp!==null&&c.yp!==null&&a&&!i&&l.add(d))}}computeRealTimeGeometry(e){var r,c,d,h,u,f;const{duple:n,legendHitInfo:i,coordinateDedupe:s}=e,l=s!==!1;let a=0;for(let m=0;m<((c=(r=this.data[this.sId])==null?void 0:r.dataGroup)==null?void 0:c.length);m++)for(let g=0;g<((h=(d=this.data[this.sId])==null?void 0:d.dataGroup[m])==null?void 0:h.data.length);g++){const p=(f=(u=this.data[this.sId])==null?void 0:u.dataGroup[m])==null?void 0:f.data[g];a++;let y;i?y=i.sId===this.sId:l?y=n.get(O.coordinateKey(p.x,p.y))===this.sId:y=!0,y&&this.calcItem(p,e)}this._rtTotalCount=a}getOpacity(e,n,i){const s=n.includes("rgba")?O.getOpacity(n):1;let l=!1;const{selectInfo:a,legendHitInfo:r,unSelectedOpacity:c}=e;return r?l=r.sId!==this.sId:a&&(l=(a==null?void 0:a.seriesID)!==this.sId||(a==null?void 0:a.dataIndex)!==i),l?c:s}calcItem(e,n){const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=n;let r;const c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex],h=i.chartWidth-(s.left+s.right),u=i.chartHeight-(s.top+s.bottom),f=i.x1+s.left,m=i.y2-s.bottom;let g=te.calculateX(e.x,c.graphMin,c.graphMax,h,f);const p=te.calculateY(a&&e.y>d.graphMax?d.graphMax:e.y,d.graphMin,d.graphMax,u,m);g!==null&&(r=O.aliasPixel(g),g+=r),e.xp=g,e.yp=p}defaultScatterDraw(e){const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=e,r=i.y[this.yAxisIndex],c=new Set,d=a!==!1,h=d&&!l,u=h?new Map:null;for(let f=0;f<this.data.length;f++){const m=this.data[f],g=f,p=O.coordinateKey(m.x,m.y);let y;if(l?y=l.sId===this.sId:d?y=s.get(p)===this.sId&&!c.has(p):y=!0,y&&m.xp!==null&&m.yp!==null){const b=m.y>r.graphMax&&this.overflowColor||m.dataColor||this.color,w=this.getOpacity(e,b,g),T=this.getCachedColor(b,w),k=m.dataColor||this.pointFill,M=this.getOpacity(e,k,g),V=this.getCachedColor(k,M);if(h){const x=`${T} ${V}`;let S=u.get(x);S||(S={strokeStyle:T,fillStyle:V,points:[]},u.set(x,S)),S.points.push(m),c.add(p)}else n.strokeStyle=T,n.fillStyle=V,te.drawPoint(n,this.pointStyle,this.pointSize,m.xp,m.yp)}}h&&u.forEach(f=>{n.strokeStyle=f.strokeStyle,n.fillStyle=f.fillStyle,te.drawPointBatch(n,this.pointStyle,this.pointSize,f.points)})}realTimeScatterDraw(e){var g,p,y,C,b,w;const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=e,r=i.y[this.yAxisIndex],c=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,d=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;let h=0;const u=a!==!1,f=u&&!l,m=f?new Map:null;for(let T=0;T<((p=(g=this.data[this.sId])==null?void 0:g.dataGroup)==null?void 0:p.length);T++)for(let k=0;k<((C=(y=this.data[this.sId])==null?void 0:y.dataGroup[T])==null?void 0:C.data.length);k++){const M=(w=(b=this.data[this.sId])==null?void 0:b.dataGroup[T])==null?void 0:w.data[k];h++;let V;if(l?V=l.sId===this.sId:u?V=s.get(M.k??O.coordinateKey(M.x,M.y))===this.sId:V=!0,V&&M.xp!==null&&M.yp!==null){const x=M.y>r.graphMax&&this.overflowColor,S=x||M.color||this.color,L=x||M.color||this.pointFill||this.color,I=this.getOpacity(e,S,k),R=this.getOpacity(e,L,k),v=this.getCachedColor(S,I),G=this.getCachedColor(L,R);if(f){const W=`${v} ${G}`;let E=m.get(W);E||(E={strokeStyle:v,fillStyle:G,points:[]},m.set(W,E)),E.points.push(M)}else n.strokeStyle=v,n.fillStyle=G,te.drawPoint(n,c,d,M.xp,M.yp)}}f&&m.forEach(T=>{n.strokeStyle=T.strokeStyle,n.fillStyle=T.fillStyle,te.drawPointBatch(n,c,d,T.points)}),this._rtTotalCount=h}realTimeScatterDrawStrip(e,n,i){var u;if(!this.show)return;const s=(u=this.data[this.sId])==null?void 0:u.dataGroup;if(!s)return;const{duple:l,coordinateDedupe:a}=i,r=a!==!1&&!!l,c=i.axesSteps.y[this.yAxisIndex],d=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,h=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;for(let f=0;f<n.length;f++){const m=s[n[f]];if(m!=null&&m.data)for(let g=0;g<m.data.length;g++){const p=m.data[g];if(!(r&&l.get(p.k??O.coordinateKey(p.x,p.y))!==this.sId)&&(this.calcItem(p,i),p.xp!==null&&p.yp!==null)){const y=p.y>c.graphMax&&this.overflowColor,C=y||p.color||this.color,b=y||p.color||this.pointFill||this.color,w=this.getOpacity(i,C,g),T=this.getOpacity(i,b,g);e.strokeStyle=this.getCachedColor(C,w),e.fillStyle=this.getCachedColor(b,T),te.drawPoint(e,d,h,p.xp,p.yp)}}}}refreshRtHitCoords(e){var i,s;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let l=0;l<n.length;l++){const a=(s=n[l])==null?void 0:s.data;if(a)for(let r=0;r<a.length;r++)this.calcItem(a[r],e)}}refreshRtTotalCount(){var i,s,l;let e=0;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let a=0;a<n.length;a++)e+=((l=(s=n[a])==null?void 0:s.data)==null?void 0:l.length)??0;return this._rtTotalCount=e,e}findItemsInRange(e,n,i,s,l){return e.filter(a=>n-1<=a.xp&&a.xp<=s+1&&i-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(e,n,i,s,l){return this.findItemsInRange(e,n,i,s,l)}realTimeScatterFindItems(e,n,i,s,l){const a=[];for(let r=0;r<e[this.sId].dataGroup.length;r++){const c=e[this.sId].dataGroup[r];a.push(...this.findItemsInRange(c.data,n,i,s,l))}return a}findItems({xsp:e,ysp:n,width:i,height:s}){const l=this.data,a=e+i,r=n+s;let c=[];return this.realTimeScatter?c=this.realTimeScatterFindItems(l,e,n,a,r):c=this.defaultScatterFindItems(l,e,n,a,r),c}itemHighlight(e,n){const i=e.data,s=n,l=i.xp,a=i.yp;if(s.save(),l!==null&&a!==null){const r=i.dataColor||this.color,c=i.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),te.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,te.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",te.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(e){var c;const n=e[0],i=e[1],s={data:null,hit:!1,color:this.color,index:null},l=this.pointSize;if(this.realTimeScatter){const d=(c=this.data[this.sId])==null?void 0:c.dataGroup;if(!d)return s;let u=this._rtTotalCount-1;for(let f=d.length-1;f>=0;f--){const m=d[f];if(m!=null&&m.data)for(let g=m.data.length-1;g>=0;g--){const p=m.data[g];if(p.xp!==null&&p.yp!==null){const y=p.xp,C=p.yp;if(y-l<=n&&n<=y+l&&C-l<=i&&i<=C+l)return s.data=p,s.index=u,s.hit=!0,s}u--}}return s}const a=this.data,r=a.findIndex(d=>{const h=d.xp,u=d.yp;return h-l<=n&&n<=h+l&&u-l<=i&&i<=u+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class zr{constructor(e,n,i,s){const l=He({},n,KS);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Ht[i%Ht.length]),this.type="bar",this.sId=e,this.data=[],this.isHorizontal=s,this.size={cat:0,bar:0,cPad:0,bPad:0,w:0,h:0,ix:0}}computeGeometry(e){if(!this.show)return;const n=e.scaleVersion!=null&&e.dataEpoch!=null,i=e.showIndex??0,s=e.showSeriesCount??0;if(n&&this._lastDataEpoch===e.dataEpoch&&this._lastScaleVersion===e.scaleVersion&&this._lastShowIndex===i&&this._lastShowSeriesCount===s&&this._lastGeomData===this.data)return;const l=e.chartRect,a=e.labelOffset,r=e.axesSteps,c=e.showIndex,d=e.thickness,h=e.showSeriesCount;this.isHorizontal=e.isHorizontal;const{isHorizontal:u}=this;let f,m;const g=r.x[this.xAxisIndex],p=r.y[this.yAxisIndex];let y=this.data.length;const[C,b]=u?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex];ve(C)&&ve(b)&&(y=b-C+1);const w=l.chartWidth-(a.left+a.right),T=l.chartHeight-(a.top+a.bottom),k=l.x1+a.left,M=l.y2-a.bottom,V=te.calculateX(0,g.graphMin,g.graphMax,w),x=te.calculateY(0,p.graphMin,p.graphMax,T),S=u?k+V:k,L=u?M:M+x,I=u?T:w,R=I/(y||1);let v;e.cPadRatio>=1||e.cPadRatio<=0?v=2:v=Math.max(I*(e.cPadRatio/2)/y,2);let W,E,X;W=R>v*2?R-v*2:R,W=this.isExistGrp?W:W/h;const Z=this.calculateBarSize(d,W);E=u?null:Z,X=u?Z:null;const N=u?(W-X)/2:(W-E)/2,P=this.isExistGrp?1:c+1;this.size.cat=R,this.size.bar=W,this.size.cPad=v,this.size.bPad=N,this.size.w=E,this.size.h=X,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=e.borderRadius,this.filteredCount=y;const B=ve(C)?C:0,Y=ve(b)?b:this.data.length-1;this.visibleStartIndex=B;for(let H=B;H<=Y;H++){const _=H-B,D=this.data[H];if(D){const z=u?L-R*_-v:S+R*_+v;if(u?(f=S,m=Math.round(z-(W*P-(X+N)))):(f=Math.round(z+(W*P-(E+N))),m=L),u){const A=D.b?D.o:D.x,j=e.displayOverflow&&A>g.graphMax?g.graphMax:A;E=te.calculateX(j,g.graphMin,g.graphMax,w,-V),D.b&&(f=te.calculateX(D.b,g.graphMin,g.graphMax,w,S-V));const J=A>0?-1:1;E=A&&E!==null&&Math.abs(E)===0?J:E}else{const A=D.b?D.o:D.y,j=e.displayOverflow&&A>p.graphMax?p.graphMax:A;X=te.calculateY(j,p.graphMin,p.graphMax,T,-x),D.b&&(m=te.calculateY(D.b,p.graphMin,p.graphMax,T,L-x));const J=A>0?-1:1;X=A&&X!==null&&Math.abs(X)===0?J:X}D.xp=f,D.yp=m,D.w=E,D.h=u?-X:X,D.index=H}}n&&(this._lastDataEpoch=e.dataEpoch,this._lastScaleVersion=e.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(e){var _,D,z,A,j;if(!this.show)return;this.computeGeometry(e);const n=e.ctx,i=e.chartRect,s=e.labelOffset,l=e.axesSteps,a=e.showIndex,r=e.thickness,c=e.showSeriesCount,d=e.displayOverflow;this.isHorizontal=e.isHorizontal;const{isHorizontal:h,showValue:u}=this;let f,m;const g=l.x[this.xAxisIndex],p=l.y[this.yAxisIndex],[y,C]=h?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex],b=ve(y)&&ve(C),w=b?y:0,T=b?C:this.data.length-1,k=T-w+1,M=i.chartWidth-(s.left+s.right),V=i.chartHeight-(s.top+s.bottom),x=i.x1+s.left,S=i.y2-s.bottom,L=te.calculateX(0,g.graphMin,g.graphMax,M),I=te.calculateY(0,p.graphMin,p.graphMax,V),R=h?x+L:x,v=h?S:S+I,G=h?V:M,W=G/(k||1);let E;e.cPadRatio>=1||e.cPadRatio<=0?E=2:E=Math.max(G*(e.cPadRatio/2)/k,2);let Z,N,P;Z=W>E*2?W-E*2:W,Z=this.isExistGrp?Z:Z/c;const B=this.calculateBarSize(r,Z);N=h?null:B,P=h?B:null;const Y=h?(Z-P)/2:(Z-N)/2,H=this.isExistGrp?1:a+1;this.size.cat=W,this.size.bar=Z,this.size.cPad=E,this.size.bPad=Y,this.size.w=N,this.size.h=P,this.size.ix=H,this.chartRect=i,this.labelOffset=s,this.borderRadius=e.borderRadius,this.filteredCount=k,this.visibleStartIndex=w;for(let J=w;J<=T;J++){const q=J-w,U=this.data[J];if(U){const ne=h?v-W*q-E:R+W*q+E;if(h?(f=R,m=Math.round(ne-(Z*H-(P+Y)))):(f=Math.round(ne+(Z*H-(N+Y))),m=v),h){const oe=U.b?U.o:U.x,re=d&&oe>g.graphMax?g.graphMax:oe;N=te.calculateX(re,g.graphMin,g.graphMax,M,-L),U.b&&(f=te.calculateX(U.b,g.graphMin,g.graphMax,M,R-L));const pe=oe>0?-1:1;N=oe&&N!==null&&Math.abs(N)===0?pe:N}else{const oe=U.b?U.o:U.y,re=d&&oe>p.graphMax?p.graphMax:oe;P=te.calculateY(re,p.graphMin,p.graphMax,V,-I),U.b&&(m=te.calculateY(U.b,p.graphMin,p.graphMax,V,v-I));const pe=oe>0?-1:1;P=oe&&P!==null&&Math.abs(P)===0?pe:P}const $=U.dataColor||this.color,ee=e==null?void 0:e.legendHitInfo,Q=(_=e==null?void 0:e.selectLabel)==null?void 0:_.option,he=(D=e==null?void 0:e.selectItem)==null?void 0:D.option,me=((A=(z=e==null?void 0:e.selectLabel)==null?void 0:z.selected)==null?void 0:A.dataIndex)??[],{dataIndex:ae,seriesID:xe}=((j=e==null?void 0:e.selectItem)==null?void 0:j.selected)??{};let be=!1;if(ee?be=(ee==null?void 0:ee.sId)!==this.sId:Q!=null&&Q.use&&(Q!=null&&Q.useSeriesOpacity)?be=me.length&&!me.includes(J):yt(ae)&&(he!=null&&he.useSeriesOpacity)&&(this.isExistGrp?be=ae!==J:be=ae!==J||xe!==this.sId),typeof $!="string")n.fillStyle=te.createGradient(n,h,{x:f,y:m,w:N,h:P},$,be,e.unSelectedOpacity);else{const oe=$.includes("rgba")?O.getOpacity($):1,re=be?e.unSelectedOpacity:oe;n.fillStyle=O.colorStringToRgba($,re)}this.drawBar({ctx:n,positions:{x:f,y:m,w:N,h:P}}),u.use&&this.drawValueLabels({context:n,data:U,positions:{x:f,y:m,h:P,w:N},isHighlight:!1,textColor:U.dataTextColor,index:J})}}}itemHighlight(e,n,i,s){const l=this.showValue,a=e.data,r=n,c=a.xp,d=a.yp,h=a.w,u=a.h;r.save(),r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=4;const f=e.data.dataColor||this.color;if(typeof f!="string"){const m=te.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:u},f,!1,s);r.fillStyle=m,r.shadowColor=f[f.length-1][1]}else r.fillStyle=f,r.shadowColor=f;r.beginPath(),this.drawBar({ctx:r,positions:{x:c,y:d,w:h,h:this.isHorizontal?-u:u}}),l.use&&this.drawValueLabels({context:r,data:a,positions:{x:c,y:d,h:u,w:h},isHighlight:!0,textColor:e.data.dataTextColor||e.dataTextColor,index:i}),r.restore()}findGraphData(e,n,i,s){if(typeof i=="number"&&this.show&&s){const l=this.data,a={data:null,hit:!1,color:this.color},r=this.visibleStartIndex??0,c=r+(this.filteredCount??l.length)-1,d=Math.max(r,Math.min(i,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(e,l[d]),a.directHit=a.hit),a}return n?this.findGraphRangeCount(e):this.findGraphRange(e)}binarySearchBar(e,n){const[i,s]=e,l={data:null,hit:!1,color:this.color},a=this.data,r=this.visibleStartIndex??0,c=this.filteredCount??a.length;let d=r,h=Math.min(r+c-1,a.length-1);for(;d<=h;){const u=Math.floor((d+h)/2),f=a[u];if(!f){console.warn(`[EVUI][Bar] binarySearchBar: gdata[${u}] is falsy`);break}const{xp:m,yp:g,w:p,h:y}=f,C=m+p,b=g+y;if(n?b<=s&&s<=g:m<=i&&i<=C)return l.data=f,l.index=f.index,l.hit=this.isPointInBar(e,f),l.directHit=l.hit,l;(n?!(b<s):m+4<i)?d=u+1:h=u-1}return l}findGraphRange(e){return this.binarySearchBar(e,!1)}findGraphRangeCount(e){return this.binarySearchBar(e,!0)}drawValueLabels({context:e,data:n,positions:i,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:u,decimalPoint:f}=this.showValue,{x:m,y:g,w:p,h:y}=i,C=e;C.save(),C.beginPath(),C.font=`normal normal normal ${c}px Roboto`,C.fillStyle=l||d,C.lineWidth=1,C.textBaseline="middle",C.textAlign=r&&h!=="center"?"left":"center";let b;const w=yt(this.stackIndex);w?b=n.o:b=(r?n.x:n.y)??"";let T;u&&(T=u(b,{label:r?n.y:n.x,index:a})),(!u||typeof T!="string")&&(T=O.labelSignFormat(b,f)??"");const k=b<0,M=Math.round(C.measureText(T).width),V=c,x=r&&h!=="end"?10:4,S=k?m-x:m+x,L=k?g+x:g-x,I=m+p/2,R=s?g+y/2:g-y/2,v=r?R+c*.1:R,G=Math.abs(p),W=Math.abs(y),E=G-x,X=W-x,Z=M<=G&&G>=V;switch(h){case"start":{if(r){if(M<E&&V<W){const N=k?S-M:S;C.fillText(T,N,v)}}else if(Z&&V+x<=W){const N=k?g+V/2+x:g-V/2-x;C.fillText(T,I,N)}break}case"center":{r?M<E&&V<W&&C.fillText(T,I,v):Z&&V<X&&C.fillText(T,I,g+y/2);break}case"out":{if(w){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const N=this.chartRect.x1+this.labelOffset.left,P=this.chartRect.x2-this.labelOffset.right;if(V<this.size.bar)if(k){const B=m-x+p-M;B>N&&C.fillText(T,B,v)}else{const B=m+x+p;B+M<P&&C.fillText(T,B,v)}}else{const N=this.chartRect.y1+this.labelOffset.top,P=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(k){const B=g+y+x+V/2;B+V/2<=P&&C.fillText(T,I,B)}else{const B=g+y-x-V/2;B-V/2>=N&&C.fillText(T,I,B)}}break}default:case"end":{if(r){if(M<E&&V<W){const N=k?m+p+x:m+p-M-x;C.fillText(T,N,v)}}else if(k){const N=g+y-V/2-x;N>L&&Z&&V+x<=W&&C.fillText(T,I,N)}else Z&&V+x<=W&&C.fillText(T,I,g+y+V/2+x);break}}C.restore()}calculateBarSize(e,n){return typeof e=="string"&&/[0-9]+px/.test(e)?Math.min(n,Number(e.replace("px",""))):typeof e=="number"&&e<=1&&e>=0?Math.ceil(n*e):n}drawBar({ctx:e,positions:n}){const{isHorizontal:i,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=i?-n.h:n.h;if(!(d===0||h===0)){if(e.save(),a&&!l)try{this.drawRoundedRect(e,n)}catch{e.fillRect(r,c,d,h)}else e.fillRect(r,c,d,h);e.restore()}}isPointInBar(e,n){const[i,s]=e,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=i&&i<=d&&h<=s&&s<=a}drawRoundedRect(e,n){const{chartRect:i,labelOffset:s,isHorizontal:l,borderRadius:a}=this,{x:r,y:c}=n;let{w:d,h}=n,u=a;const f=new Path2D;f.rect(i.x1+s.left,i.y1,i.chartWidth-s.right,i.chartHeight-s.bottom),e.clip(f),e.beginPath(),e.moveTo(r,c),Math.abs(d)<u*2&&(u=Math.abs(d)/2),Math.abs(h)<u*2&&(u=Math.abs(h)/2),l?d<0?(d+=u,e.lineTo(r+d,c),e.arcTo(r+d-u,c,r+d-u,c-u,u),e.arcTo(r+d-u,c-h,r+d,c-h,u),e.lineTo(r,c-h),e.lineTo(r,c)):(d-=u,e.lineTo(r+d,c),e.arcTo(r+d+u,c,r+d+u,c-u,u),e.arcTo(r+d+u,c-h,r+d,c-h,u),e.lineTo(r,c-h),e.lineTo(r,c)):h>0?(h-=u,e.lineTo(r+d,c),e.lineTo(r+d,c+h),e.arcTo(r+d,c+h+u,r-d+u,c+h+u,u),e.arcTo(r,c+h+u,r,c+h,u),e.lineTo(r,c)):(h+=u,e.lineTo(r+d,c),e.lineTo(r+d,c+h),e.arcTo(r+d,c+h-u,r+d-u,c+h-u,u),e.arcTo(r,c+h-u,r,c+h,u),e.lineTo(r,c)),e.fill(),e.closePath()}}class qS extends zr{computeGeometry(e){if(!this.show)return;const n=e.chartRect,i=e.labelOffset,s=e.axesSteps,l=e.showIndex,a=e.isHorizontal,r=e.thickness,c=e.showSeriesCount;let d,h;const u=s.x[this.xAxisIndex],f=s.y[this.yAxisIndex],m=n.chartWidth-(i.left+i.right),g=n.chartHeight-(i.top+i.bottom),p=n.x1+i.left,y=n.y2-i.bottom,C=n.x2-i.right,w=(a?g:m)/(this.data.length||1),T=2;let k;this.isExistGrp?k=w-T*2:k=(w-T*2)/c;const V=typeof r=="string"&&/[0-9]+px/.test(r)?Math.min(k,Number(r.replace("px",""))):typeof r=="number"&&r<=1&&r>=0?Math.ceil(k*r):k;let x=a?null:V,S=a?null:V,L=a?V:null;const I=a?(k-L)/2:(k-x)/2,R=this.isExistGrp?1:l+1;this.size.cat=w,this.size.bar=k,this.size.cPad=T,this.size.bPad=I,this.size.w=x,this.size.ix=R,this.chartRect=n,this.labelOffset=i,this.borderRadius=e.borderRadius,this.data.forEach(v=>{a?(d=p,h=te.calculateY(v.y,f.graphMin,f.graphMax,g,y)):(d=te.calculateSubX(v.x,u.graphMin,u.graphMax,m,p),d<p?(S-=p-d,d=d+x<p?null:p):d+x>C&&(S-=S-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(k*R)-Math.round(x+I)),h=y),a?v.b?(x=te.calculateX(v.x-v.b,u.graphMin,u.graphMax,m),d=te.calculateX(v.b,u.graphMin,u.graphMax,m,p)):x=te.calculateX(v.x,u.graphMin,u.graphMax,m):v.b?(L=te.calculateY(v.y-v.b,f.graphMin,f.graphMax,g),h=te.calculateY(v.b,f.graphMin,f.graphMax,g,y)):L=te.calculateY(v.y,f.graphMin,f.graphMax,g),d!==null&&h!==null&&typeof(v.dataColor||this.color)!="string"&&(x=x!==S?S:x),S=x,v.xp=d,v.yp=h,v.w=x,v.h=a?-L:L})}draw(e){if(!this.show)return;this.computeGeometry(e);const n=e.ctx,i=e.chartRect,s=e.labelOffset,l=e.axesSteps,a=e.showIndex,r=e.isHorizontal,c=e.thickness,d=e.showSeriesCount;let h,u;const f=l.x[this.xAxisIndex],m=l.y[this.yAxisIndex],g=i.chartWidth-(s.left+s.right),p=i.chartHeight-(s.top+s.bottom),y=i.x1+s.left,C=i.y2-s.bottom,b=i.x2-s.right,T=(r?p:g)/(this.data.length||1),k=2;let M;this.isExistGrp?M=T-k*2:M=(T-k*2)/d;const x=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(M,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(M*c):M;let S=r?null:x,L=r?null:x,I=r?x:null;const R=r?(M-I)/2:(M-S)/2,v=this.isExistGrp?1:a+1;this.size.cat=T,this.size.bar=M,this.size.cPad=k,this.size.bPad=R,this.size.w=S,this.size.ix=v,this.chartRect=i,this.labelOffset=s,this.borderRadius=e.borderRadius,this.data.forEach((G,W)=>{if(n.beginPath(),r?(h=y,u=te.calculateY(G.y,m.graphMin,m.graphMax,p,C)):(h=te.calculateSubX(G.x,f.graphMin,f.graphMax,g,y),h<y?(L-=y-h,h=h+S<y?null:y):h+S>b&&(L-=L-(b-h)),h>=b&&(h=null),h!==null&&(h+=Math.ceil(M*v)-Math.round(S+R)),u=C),r?G.b?(S=te.calculateX(G.x-G.b,f.graphMin,f.graphMax,g),h=te.calculateX(G.b,f.graphMin,f.graphMax,g,y)):S=te.calculateX(G.x,f.graphMin,f.graphMax,g):G.b?(I=te.calculateY(G.y-G.b,m.graphMin,m.graphMax,p),u=te.calculateY(G.b,m.graphMin,m.graphMax,p,C)):I=te.calculateY(G.y,m.graphMin,m.graphMax,p),h!==null&&u!==null){const E=G.dataColor||this.color,X=E.includes("rgba")?O.getOpacity(E):1,Z=this.state==="downplay"?e.unSelectedOpacity:X;typeof E!="string"?(S=S!==L?L:S,n.fillStyle=te.createGradient(n,r,{x:h,y:u,w:S,h:I},E,this.state==="downplay",e.unSelectedOpacity)):n.fillStyle=O.colorStringToRgba(E,Z),this.drawBar({ctx:n,positions:{x:h,y:u,w:S,h:I}}),this.showValue.use&&this.drawValueLabels({context:n,data:G,positions:{x:h,y:u,h:I,w:S},isHighlight:!1,index:W})}L=S})}}class eC{constructor(e,n,i){const s=vo({},_S,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Ht[i%Ht.length]),this.sId=e,this.show=!0,this.data=[],this.type="pie",this.centerX=0,this.centerY=0,this.radius=0,this.doughnutHoleSize=0,this.startAngle=0,this.endAngle=0,this.ctx=null,this.isSelect=!1}draw(e,n,i){var h;const s=e??this.ctx,l=new Path2D,a=this.isSelect?this.radius+5:this.radius,r=this.color,c=r.includes("rgba")?O.getOpacity(r):1,d=this.isDownplay?i:c;s.beginPath(),l.moveTo(this.centerX,this.centerY),l.arc(this.centerX,this.centerY,a,this.startAngle,this.endAngle),l.lineTo(this.centerX,this.centerY),s.fillStyle=O.colorStringToRgba(r,d),s.fill(l),n.use&&(s.lineCap="round",s.lineWidth=n==null?void 0:n.lineWidth,s.strokeStyle=n==null?void 0:n.color,s.stroke(l)),(h=this.showValue)!=null&&h.use&&this.drawValueLabels(s),s.closePath(),this.ctx=s}findGraphData([e,n]){const i={data:null,hit:!1,color:null,index:-1},{radius:s,startAngle:l,endAngle:a,centerX:r,centerY:c}=this,d=Math.sqrt((e-r)**2+(n-c)**2),h=2.5*Math.PI-Math.atan2(e-r,n-c),u=s>d&&h>=l&&h<=a;return this.show&&u&&(i.type=this.type,i.data=this.data,i.hit=!0,i.color=this.color,i.index=0),i}itemHighlight(e,n){var a,r;const i=n,s=this.isSelect?this.radius+5:this.radius;i.save(),i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=4;const l=((a=e==null?void 0:e.data)==null?void 0:a.dataColor)||this.color;i.fillStyle=l,i.shadowColor=l,i.beginPath(),i.moveTo(this.centerX,this.centerY),i.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),i.lineTo(this.centerX,this.centerY),i.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(i),i.closePath(),i.restore()}drawValueLabels(e){const n=e,i=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:i,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=O.labelSignFormat(i));const c=1.8,d=this.radius-this.doughnutHoleSize,h=(this.endAngle-this.startAngle)*180/Math.PI,u=s+4,f=Math.round(n.measureText(r).width);if(h>=f*c&&h>=u*c&&d>=f*c&&d>=u*c){n.save(),n.beginPath();const m=l.includes("rgba")?O.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:m;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=O.colorStringToRgba(l,g),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const p=d/2+this.doughnutHoleSize,y=(this.endAngle-this.startAngle)/2+this.startAngle,C=p*Math.cos(y)+this.centerX,b=p*Math.sin(y)+this.centerY;n.fillText(r,C,b),n.restore()}}}class tC{constructor(e,n,i,s,l){const a=vo({},US,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(i),this.sId=e,this.data=[],this.labels={x:[],y:[]},this.valueOpt={},this.size={w:0,h:0},this.type="heatMap",this.currentLabelInfo={x:{steps:0,min:0,max:0},y:{steps:0,min:0,max:0}}}createColorState(e){const n=[],i=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=e,h=s.includes("#")?O.hexToRgb(s):s.replace(i,""),u=l.includes("#")?O.hexToRgb(l):l.replace(i,""),[f,m,g]=h.split(","),[p,y,C]=u.split(",");if(this.isGradient)n.push({minColor:{minR:f,minG:m,minB:g},maxColor:{maxR:p,maxG:y,maxB:C},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:b,label:w},T)=>{n.push({id:`color#${T}`,color:b,label:w,state:"normal",show:!0})});else{const b=Math.floor((f-p)/(a-1)),w=Math.floor((m-y)/(a-1)),T=Math.floor((g-C)/(a-1));for(let k=0;k<a;k++){const M=+f-b*k,V=+m-w*k,x=+g-T*k;n.push({id:`color#${k}`,color:`rgb(${M},${V},${x})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(e){const{minColor:n,maxColor:i}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=i,h=+s-Math.floor((s-r)*e/100),u=+l-Math.floor((l-c)*e/100),f=+a-Math.floor((a-d)*e/100);return`rgb(${h},${u},${f})`}getColorIndexByValue(e){const{existError:n,min:i,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&e<0)return a;const r=Math.floor(+(e-i).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(e){const{min:n,max:i}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=Je(e-n,i-n),{start:a,end:r,selectedValue:c}=this.colorState[0];(e<0||a<=l&&l<=r)&&(s.show=!0,s.isHighlight=c!==null&&Math.floor(e)===Math.floor(n+(i-n)*(c/100)),s.dataColor=e<0?this.errorColor:this.getColorForGradient(l))}else{const l=this.getColorIndexByValue(e),{show:a,state:r,color:c,id:d}=this.colorState[l];s.show=a,s.opacity=r==="downplay"?.1:1,s.dataColor=e<0?this.errorColor:c,s.id=d}return s}drawItem(e,n,i,s,l,a){if(e.beginPath(),!(s<0||l<0)){if(a.show){const{radius:r}=a;if(r>0){const c=Math.min(s,l);let d=r;d>c/2&&(d=Math.floor(c/2)),e.moveTo(n+d,i),e.arcTo(n+s,i,n+s,i+l,d),e.arcTo(n+s,i+l,n,i+l,d),e.arcTo(n,i+l,n,i,d),e.arcTo(n,i,n+s,i,d),e.stroke(),e.fill()}else e.strokeRect(n,i,s,l),e.fillRect(n,i,s,l)}else{const r=O.aliasPixel(1);e.fillRect(n,i-r,s+r,l+r)}e.closePath()}}calculateXY(e,n,i,s){let l=null;if(this.labels[e]&&this.labels[e].length){let a=this.labels[e].findIndex(f=>f===n);a===-1&&(a=this.labels[e].findIndex(f=>+f==+n));const{minIndex:r,maxIndex:c,graphMin:d,graphMax:h}=s;if(ve(c)&&a>c||ve(r)&&a<r||no(r)&&no(c)&&(n<d||n>h))return null;const u=r??this.labels[e].findIndex(f=>+f==+d);a>-1&&(a-=u>-1?u:0,l=e==="x"?i+this.size.w*a:i-this.size.h*(a+1))}return l}computeGeometry(e){if(!this.show)return;const{chartRect:n,labelOffset:i,selectItem:s,axesSteps:l}=e,a=n.chartWidth-(i.left+i.right),r=n.chartHeight-(i.top+i.bottom),c=n.x1+i.left,d=n.y2-i.bottom,h=l.x[this.xAxisIndex],u=l.y[this.yAxisIndex];this.size.w=a/h.oriSteps,this.size.h=r/u.oriSteps,this.currentLabelInfo={x:{steps:h.oriSteps,min:h.graphMin,max:h.graphMax},y:{steps:u.oriSteps,min:u.graphMin,max:u.graphMax}},this.data.forEach((f,m)=>{var T;let p=this.calculateXY("x",f.x,c,h),y=this.calculateXY("y",f.y,d,u),C=this.size.w,b=this.size.h;const w=f.o;if(p!==null&&y!==null&&w!==null&&w!==void 0){const{show:k,dataColor:M,id:V}=this.getItemInfo(w);if(f.dataColor||(f.dataColor=M),f.cId=V,k){let x=this.stroke;const S=s==null?void 0:s.option,L=(S==null?void 0:S.use)&&(S==null?void 0:S.showBorder),I=m===((T=s==null?void 0:s.selected)==null?void 0:T.dataIndex);if(L&&I&&(x={show:S==null?void 0:S.showBorder,...S==null?void 0:S.borderStyle}),x.show&&x.lineWidth>0){const{lineWidth:R}=x,v=R*2;v<Math.floor(C)&&v<Math.floor(b)&&(p+=R,y+=R,C-=v,b-=v)}p+=1,f.xp=p,f.yp=y,f.w=C,f.h=b}}})}draw(e){if(!this.show)return;this.computeGeometry(e);const{ctx:n,chartRect:i,labelOffset:s,selectLabel:l,legendHitInfo:a,selectItem:r,axesSteps:c}=e,d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=i.x1+s.left,f=i.y2-s.bottom,m=c.x[this.xAxisIndex],g=c.y[this.yAxisIndex];this.size.w=d/m.oriSteps,this.size.h=h/g.oriSteps,this.currentLabelInfo={x:{steps:m.oriSteps,min:m.graphMin,max:m.graphMax},y:{steps:g.oriSteps,min:g.graphMin,max:g.graphMax}};const p=(y,C,b)=>{var w,T;if(!a){let k;const{option:M,selected:V}=r,{option:x,selected:S}=l,L=yt(V==null?void 0:V.dataIndex)&&(V==null?void 0:V.dataIndex)>-1,I=((w=S==null?void 0:S.label)==null?void 0:w.length)>0;return L?k=M.useSeriesOpacity?b!==(V==null?void 0:V.dataIndex):!1:I&&(k=x.useSeriesOpacity?!((T=S==null?void 0:S.label)!=null&&T.includes(this.getItemLabel(l,y))):!1),k?.1:C}return C};this.data.forEach((y,C)=>{var x;let w=this.calculateXY("x",y.x,u,m),T=this.calculateXY("y",y.y,f,g),k=this.size.w,M=this.size.h;const V=y.o;if(w!==null&&T!==null&&V!==null&&V!==void 0){const{show:S,opacity:L,dataColor:I,id:R}=this.getItemInfo(V);let v=L;L===1&&O.getColorStringType(y.dataColor)==="RGBA"&&(v=O.getOpacity(y.dataColor));const G=p(y,v,C);if(y.dataColor||(y.dataColor=I),y.cId=R,n.save(),S){n.fillStyle=O.colorStringToRgba(y.dataColor,G);let W=this.stroke;const E=r==null?void 0:r.option,X=(E==null?void 0:E.use)&&(E==null?void 0:E.showBorder),Z=C===((x=r==null?void 0:r.selected)==null?void 0:x.dataIndex);X&&Z&&(W={show:E==null?void 0:E.showBorder,...E==null?void 0:E.borderStyle});let N=!1;if(W.show&&W.lineWidth>0){const{color:P,lineWidth:B,opacity:Y}=W,H=B*2;N=H<Math.floor(k)&&H<Math.floor(M),n.strokeStyle=N?O.colorStringToRgba(P,G===1?Y:G):void 0,N?(n.lineWidth=B,w+=B,T+=B,k-=H,M-=H):n.lineWidth=0}w+=1,this.drawItem(n,w,T,k,M,{...W,show:N}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:y})}}})}drawOverlay(e){if(!this.show)return;const{overlayCtx:n,chartRect:i,labelOffset:s,axesSteps:l}=e;if(!n)return;const a=i.x1+s.left,r=i.y2-s.bottom,c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex];this.data.forEach(h=>{const u=this.calculateXY("x",h.x,a,c),f=this.calculateXY("y",h.y,r,d),m=h.o;if(u!==null&&f!==null&&m!==null&&m!==void 0){const{show:g,isHighlight:p}=this.getItemInfo(m);g&&p&&this.itemHighlight({data:h},n)}})}drawValueLabels({context:e,data:n}){const{fontSize:i,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:u,o:f}=n,m=e;m.save(),m.beginPath(),m.font=`normal normal normal ${i}px Roboto`,m.fillStyle=s,m.lineWidth=1,m.textBaseline="middle",m.textAlign=l!=="center"?"left":"center";let g;a&&(g=a(f)),(!a||typeof g!="string")&&(g=O.labelSignFormat(f,r));const p=Math.round(m.measureText(g).width),y=i,C=c+h/2,b=d+u/2;if(!(p>=h||y>=u||g<0)){switch(l){case"top":{const w=C-p/2,T=b-y/2;m.fillText(g,w,T);break}case"right":{const w=c+h-p;m.fillText(g,w,b);break}case"bottom":{const w=C-p/2,T=b+y/2;m.fillText(g,w,T);break}case"left":m.fillText(g,c,b);break;default:{const w=C-p/2;m.fillText(g,w,b);break}}m.restore()}}getAdjustedBounds({xp:e,yp:n,width:i,height:s}){const a=Math.max(0,i),r=Math.max(0,s);return{xsp:Math.floor(e*100)/100,xep:Math.ceil((e+a)*100)/100,ysp:Math.floor(n*100)/100,yep:Math.ceil((n+r)*100)/100}}findItems(e){const n=this.data,{xsp:i,xep:s,ysp:l,yep:a}=this.getAdjustedBounds({xp:e.xsp,yp:e.ysp,width:e.width,height:e.height});return n.filter(({xp:r,yp:c,w:d,h})=>{const{xsp:u,xep:f,ysp:m,yep:g}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return u>=i&&f<=s&&m>=l&&g<=a})}itemHighlight(e,n){var p;const i=e.data,s=n,{stroke:l,shadow:a}=this.highlight,r=i.xp,c=i.yp,d=i.w,h=i.h,u=i.cId;let f;if(this.isGradient){const{min:y,max:C}=this.valueOpt,b=Je(i.o-y,C-y),{start:w,end:T}=this.colorState[0];f=w<=b&&b<=T||i.o===-1}else f=(p=this.colorState.find(({id:y})=>y===u))==null?void 0:p.show;if(r===null||c===null||!f)return;s.save();const m=O.getColorStringType(i.dataColor)==="RGBA"?e.dataColor:O.colorStringToRgba(i.dataColor,1);s.fillStyle=m,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const g={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:y,width:C,radius:b}=l;g.show=!0,g.radius=b,s.lineWidth=C,g.lineWidth=C,s.strokeStyle=y||m,g.color=y||m}else g.show=!1,s.strokeStyle=m,g.color=m;this.drawItem(s,r-.5,c-.5,d+1,h+1,g),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:i})}findGraphData(e){const n=e[0],i=e[1],s={data:null,hit:!1,color:null,dataColor:null,name:null},l=this.data,a=l.findIndex(r=>{const{xp:c,yp:d,w:h,h:u}=r;return c<=n&&n<=c+h&&d<=i&&i<=d+u});if(a>-1){const r=l[a];s.data=r,s.color=r.dataColor,s.dataColor=r.dataColor,s.index=a,s.hit=!0}return s}findBlockRange({xcp:e,xep:n,ycp:i,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(e,n),ysp:Math.min(i,s),width:Math.ceil(Math.abs(n-e)),height:Math.ceil(Math.abs(s-i))};if(a.x.length&&a.y.length){const d=this.currentLabelInfo.x.steps||a.x.length,h=this.currentLabelInfo.y.steps||a.y.length,{x1:u,x2:f,y1:m,y2:g}=l,p=(f-u)/d,y=(g-m)/h,C={xsp:e,xep:n,ysp:i,yep:s},b=(w,T,k)=>{let M,V,x;w==="x"?(V=p,x=u+r):(V=y,x=m),a[w].findIndex((L,I)=>(M=x+V*I,M<=T&&T<=M+V))>-1?C[k]=["xsp","ysp"].includes(k)?M:M+V:T<x&&(C[k]=x)};b("x",Math.min(e,n),"xsp"),b("x",Math.max(e,n),"xep"),b("y",Math.min(i,s),"ysp"),b("y",Math.max(i,s),"yep"),c.xsp=Math.min(C.xsp,C.xep),c.ysp=Math.min(C.ysp,C.yep),c.width=Math.abs(C.xep-C.xsp),c.height=Math.abs(C.yep-C.ysp)}return c}getFilteredLabel(e,n,i,s){return e.length!==n?e.filter(l=>i<=l&&l<=s):e}findSelectionRange(e){const{xsp:n,ysp:i,width:s,height:l,range:a}=e;let r=null;const{x1:c,x2:d,y1:h,y2:u}=a,{x:f,y:m}=this.labels;if(f.length&&m.length){const{x:{steps:g,min:p,max:y},y:{steps:C,min:b,max:w}}=this.currentLabelInfo,T=g||f.length,k=C||m.length,M=(d-c)/T,V=(u-h)/k,x=n+s,S=i+l,L={min:Math.floor((n-c)/M),max:Math.floor((x-c-M)/M)},I=k-1,R={min:I-Math.round((S-h-V)/V),max:I-Math.round((i-h)/V)},v=this.getFilteredLabel(f,T,p,y),G=this.getFilteredLabel(m,k,b,w);r={xMin:v[L.min],xMax:v[L.max],yMin:G[R.min],yMax:G[R.max]}}return r}getItemLabel(e,n){const{option:i,selected:s}=e;let l=this.isHorizontal?n.y:n.x;return i!=null&&i.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const Ar={Store:zS,Series:{createSeriesSet(t,e,n,i){let s=Object.keys(t);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(t,e,i)),s.forEach((l,a)=>{const r=t[l].type||e;this.seriesList[l]=this.addSeries({type:r,id:l,opt:t[l],index:a,isHorizontal:n})})},reconcileSeriesSet(t,e,n,i,s){let l=Object.keys(t);this.options.overlapping.use&&(l=this.getOverlappingSeriesKeys(t,e,i));const a=s||{},r={};for(let c=0;c<l.length;c++){const d=l[c],h=t[d],u=h.type||e,f=a[d];f&&this.canReuseSeries(f,u,h,n)?(this.seriesInfo.charts[u].push(d),f.show=f._freshShow,this.resetSeriesGroupMeta(f),r[d]=f):r[d]=this.addSeries({type:u,id:d,opt:h,index:c,isHorizontal:n})}this.seriesList=r},computeReconcileKey(t,e,n){var i,s;return{type:t,isHorizontal:n,timeMode:t==="bar"&&!!e.timeMode,realTime:t==="scatter"&&!!((i=this.options.realTimeScatter)!=null&&i.use),heatMapColor:t==="heatMap"?this.options.heatMapColor:null,isGradient:t==="heatMap"&&((s=this.options.legend)==null?void 0:s.type)==="gradient"}},canReuseSeries(t,e,n,i){const s=t._reconcileKey;if(!s||t._optSnapshot===void 0)return!1;const l=this.computeReconcileKey(e,n,i);return s.type!==l.type||s.isHorizontal!==l.isHorizontal||s.timeMode!==l.timeMode||s.realTime!==l.realTime||s.heatMapColor!==l.heatMapColor||s.isGradient!==l.isGradient?!1:Fe(t._optSnapshot,n)},resetSeriesGroupMeta(t){t.isExistGrp=!1,t.stackIndex=0,t.groupIndex=null,t.bsId=null,t.bsIds=[],t.isOverlapping=!1},getOverlappingSeriesKeys(t,e,n){const i=[],s=[],l=n.flat();return Object.keys(t).forEach(a=>{if((t[a].type||e)==="bar"&&l.length){const d=l.findIndex(h=>h===a);i.push({key:a,overlappingIdx:d})}else s.push({key:a})}),i.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...i,...s].map(({key:a})=>a)},addSeries(t){var r;const{type:e,id:n,opt:i,index:s,isHorizontal:l}=t;let a=!1;if(e==="line")this.seriesInfo.charts.line.push(n),a=new QS(n,i,s);else if(e==="scatter")this.seriesInfo.charts.scatter.push(n),a=new $S(n,i,s,(r=this.options.realTimeScatter)==null?void 0:r.use);else if(e==="bar")this.seriesInfo.charts.bar.push(n),i.timeMode?a=new qS(n,i,s,l):a=new zr(n,i,s,l);else if(e==="pie")this.seriesInfo.charts.pie.push(n),a=new eC(n,i,s);else if(e==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:c,legend:d}=this.options,h=d.type==="gradient";a=new tC(n,i,c,l,h)}return a&&(a._reconcileKey=this.computeReconcileKey(e,i,l),a._optSnapshot=i,a._freshShow=a.show),a},addGroupInfo(t){t.forEach((e,n)=>{let i=0;e.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+i,r.groupIndex=n,r.isExistGrp=!0,r.bsId=s,r.bsIds=e.filter((c,d)=>c!==l&&a>d),r.isOverlapping=this.options.overlapping.use,r.show||i--,r.show?l:s},e[0])})}}};class pi{constructor(e,n,i,s){const l=He({},n,Yr);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=e,this.ctx=i,this.units=AS[this.type],this.options=s,this.position||(this.position=e==="x"?"bottom":"left")}calculateLabelRange(e,n,i,s){let l,a,r;e==="x"?(l=n.chartWidth,r=Math.floor(s*1.2),a=[i.left,i.right]):(l=n.chartHeight,a=[i.top,i.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r),1);return{min:d,max:h}}calculateScaleRange(e,n){var d;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+e.max?+e.max:a[1],s=a[0]<+e.min?+e.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(e.min,e.max):(i=e.max,s=e.min),this.autoScaleRatio&&(i=Math.ceil(i*(this.autoScaleRatio+1))),this.startToZero&&(s=0),i===s&&(i+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:r,maxLabel:c,size:O.calcTextSizeCanvas(c,O.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(e,n,i=[]){const s=O.getLabelStyle(this.labelStyle);return[...(e??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=O.calcTextSizeCanvas(c,s))==null?void 0:h.width)??0;return Math.max(r,d)},0)}calculateSteps(e){const{maxValue:n,minValue:i}=e;let{maxSteps:s}=e,l=this.getInterval(e),a=i,r;for(;a<n;)a+=l;const c=a,d=i,h=c-d;if(r=Math.round(h/l),n===1&&(this.decimalPoint?s>2?(l=.2,r=5,s=5):(l=.5,r=2,s=2):(l=1,r=1,s=1)),this.fixedSteps)return{steps:r,interval:l,graphMin:d,graphMax:c};for(;r>s;)l*=2,r=Math.round(h/l),l=Math.ceil(h/r);return c-d>r*l&&(l=Math.ceil((c-d)/r)),{steps:r,interval:l,graphMin:d,graphMax:c}}drawAxisTitle(e,n){const i=this.title;if(!(i!=null&&i.use)||isNaN(i.fontSize))return;const s=this.ctx;s.save(),s.font=O.getLabelStyle(i),s.fillStyle=i.color,s.textAlign=i.textAlign;const l={xLeft:e.x1+n.left,xRight:e.x2-n.right,yTop:e.y1};let a,r;const c=10;this.type==="x"?(a=l.xRight,r=e.y2+i.fontSize+c):(r=l.yTop-i.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(i.text,a,r),s.restore()}draw(e,n,i,s,l,a){var T,k,M,V,x,S,L,I,R,v,G,W,E,X,Z,N,P,B;const r=this.ctx,c=this.options,d={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},h=i.steps,u=i.graphMin,f=i.graphMax,m=i.interval,g=d[this.units.rectStart],p=d[this.units.rectEnd],y=d[this.units.rectOffset(this.position)],C=d[this.units.rectOffsetCounter(this.position)],b=5;let w;if(this.drawAxisTitle(e,n),r.font=O.getLabelStyle(this.labelStyle),r.fillStyle=this.labelStyle.color,this.type==="x"?(r.textAlign="center",r.textBaseline=this.position==="top"?"bottom":"top"):(r.textAlign=this.position==="left"?"right":"left",r.textBaseline="middle"),this.showAxis&&(r.lineWidth=this.axisLineWidth,w=O.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(g,y+w),r.lineTo(p,y+w)):(r.moveTo(y+w,g),r.lineTo(y+w,p)),r.stroke(),r.closePath()),!(h===0||u===null)){if((T=this.labelStyle)!=null&&T.show){const Y=p-g,H=Y/h,_=[],D=i.interval;let z=null,A=null,j=g,J=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const U=Math.floor(u/D)*D;U!==+u&&(J=U+D,j+=Y/(f-u)*(J-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,w=O.aliasPixel(r.lineWidth);let q;for(let U=0;U<=h;U++)if(z=Math.round(j+H*U),z<=p||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),_[U]=J+U*m,_[U]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,A=z+w,q=this.getLabelFormat(Math.min(f,_[U]),{prev:_[U-1]??""});const $=((M=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:M.use)&&((x=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:x.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((S=l==null?void 0:l.dataIndex)==null?void 0:S.length)&&!(l!=null&&l.label.map(me=>this.getLabelFormat(Math.min(f,me),{prev:_[U-1]??""})).includes(q));let ee;U===h&&this.lastLabelFontStyle?(r.font=O.getLabelStyle(this.lastLabelFontStyle),ee=this.lastLabelFontStyle.color):U===0&&this.firstLabelFontStyle?(r.font=O.getLabelStyle(this.firstLabelFontStyle),ee=this.firstLabelFontStyle.color):(r.font=O.getLabelStyle(this.labelStyle),ee=this.labelStyle.color);let Q=1;O.getColorStringType(ee)==="RGBA"&&(Q=O.getOpacity(ee)),r.fillStyle=O.colorStringToRgba(ee,$?(L=this.options)==null?void 0:L.unSelectedOpacity:Q);let he;if(this.type==="x"){if(he=this.position==="top"?y-10:y+10,((I=c==null?void 0:c.brush)!=null&&I.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(q),z,he),!$&&((R=c==null?void 0:c.selectItem)!=null&&R.showLabelTip)&&(s!=null&&s.label)&&!((v=this.options)!=null&&v.horizontal)){const me=this.getLabelFormat(Math.min(f,s.label+0*m));if(me===q){const ae=Math.round(r.measureText((G=this.labelStyle)==null?void 0:G.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(me).width)+10,height:ae,x:z,y:he+(ae-2),borderRadius:2,arrowSize:3,text:q,backgroundColor:(E=(W=c==null?void 0:c.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:E.backgroundColor,textColor:(Z=(X=c==null?void 0:c.selectItem)==null?void 0:X.labelTipStyle)==null?void 0:Z.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(A,y),r.lineTo(A,y+b),r.stroke(),r.closePath()),(U!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(A,y),r.lineTo(A,C),r.stroke(),r.closePath())}else he=this.position==="left"?y-10:y+10,((N=c==null?void 0:c.brush)!=null&&N.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(q),he,z),U===h&&(A-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(y+(this.axisLineWidth??1),A),r.lineTo(y-b,A),r.stroke(),r.closePath()),U!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(y,A),r.lineTo(C,A),r.stroke(),r.closePath())}}((P=this.plotBands)!=null&&P.length||(B=this.plotLines)!=null&&B.length)&&(this._plotGeom={aPos:d,axisMin:u,axisMax:f,aliasPixel:w,chartRect:e,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:e,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=e.x1,u=e.x2+d,f=e.y1-d,m=e.y2,g={minX:h,maxX:u,minY:f,maxY:m};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(w=>{const T=He({},w,Ko),{from:k,to:M,label:V,border:x}=T,S=O.isNullOrUndefined(k)?n:Math.max(k,n),L=O.isNullOrUndefined(M)?i:Math.min(M,i);let I,R;if(this.type==="x"){if(I=te.calculateX(S,n,i,r,h),R=te.calculateX(L,n,i,r,h),I===null||R===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(I,R,h,u,f,m,x)}else{if(I=te.calculateY(S,n,i,c,m),R=te.calculateY(L,n,i,c,m),I===null||R===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(I,R,h,u,f,m,x)}this.drawPlotBandLabel(I,R,V,g,l,S,L)}),(b=this.plotLines)==null||b.forEach(w=>{if(!Number.isFinite(+w.value))return;const T=He({},w,Ao),{value:k,label:M}=T;let V;if(this.type==="x"){if(V=te.calculateX(k,n,i,r,h),V===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(V,h,u,f,m)}else{if(V=te.calculateY(k,n,i,c,m),V===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(V,h,u,f,m)}this.drawPlotLineLabel(V,M,g,l,k)})}setPlotLineStyle(e){const n=this.ctx,{color:i,lineWidth:s}=e;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=i,n.setLineDash(e.segments??[])}setPlotBandStyle(e){const n=this.ctx,{color:i}=e;n.beginPath(),n.save(),n.fillStyle=i}drawXPlotBand(e,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(e)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(e,l),c.lineTo(e,a),c.lineTo(n,a),c.lineTo(n,l),c.lineTo(e,l),c.fill(),this.drawPlotBandBorder(r,[[e,l,e,a],[n,l,n,a]]),c.restore(),c.closePath()}drawXPlotLine(e,n,i,s,l){const a=this.ctx;if(!Number.isFinite(e)||e<n||e>i){a.closePath(),a.restore();return}let r=e;r+=O.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(e,n,i,s,l){const a=this.ctx;if(!Number.isFinite(e)||e>l||e<s){a.closePath(),a.restore();return}let r=e;r+=O.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(i,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(e,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(e)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(i,e),c.lineTo(i,n),c.lineTo(s,n),c.lineTo(s,e),c.lineTo(i,e),c.fill(),this.drawPlotBandBorder(r,[[i,e,s,e],[i,n,s,n]]),c.restore(),c.closePath()}drawPlotBandBorder(e,n){if(!e||!(e.width>0))return;const i=this.ctx;i.save(),i.beginPath(),i.strokeStyle=e.color??"#000000",i.lineWidth=e.width,i.setLineDash(e.segments??[]),n.forEach(([s,l,a,r])=>{i.moveTo(s,l),i.lineTo(a,r)}),i.stroke(),i.restore()}getNormalizedLabelOptions(e,n,i=null){const s=He({},n,Or),l=this.ctx,{maxWidth:a,responsive:r}=s,c=s.fontSize>20?20:s.fontSize,d=e.chartWidth,h=r==null?void 0:r.valueOnlyBelow,u=r==null?void 0:r.hideBelow,f=!O.isNullOrUndefined(u)&&d<u,m=!f&&!O.isNullOrUndefined(h)&&d<h,g=s.text!=null?String(s.text):"",p=!O.isNullOrUndefined(i)&&Number.isFinite(+i),y=s.showValue&&p?String(this.getLabelFormat(i)):"";let C;s.showValue?C=m?y:[g,y].filter(I=>I).join(" "):C=g,l.save(),l.font=O.getLabelStyle({...s,fontSize:c});let b=C,w=a??l.measureText(b).width;const T=this.type==="y"?e.width-e.chartWidth:a??e.width;s.position==="outside"&&T<l.measureText(b).width&&s.textOverflow==="ellipsis"&&(b=O.truncateLabelWithEllipsis(C,T,l),w=l.measureText(b).width),l.restore();const k=c/4,M=s.padding;let V=k,x=k,S=k,L=k;return typeof M=="number"?(V=M,x=M,S=M,L=M):M&&typeof M=="object"&&(V=M.top??k,x=M.right??k,S=M.bottom??k,L=M.left??k),{...s,label:b,fontSize:c,labelWidth:w,padTop:V,padRight:x,padBottom:S,padLeft:L,lineGap:s.gap!=null?s.gap:k+2,borderRadius:Math.max(0,s.borderRadius??0),hidden:f,valueOnly:m,hoverText:g}}getPlotBandLabelPosition(e,n,i,s){const{fontSize:l,labelWidth:a,padTop:r,padRight:c,padBottom:d,padLeft:h,position:u}=i,{maxX:f}=s;if(l<=0)return null;const m=(e+n)/2;if(this.type==="x")return this.computeTopLabelBox(m,i,s);if(u==="innerStart"||u==="innerEnd")return this.computeInnerLabelBox(m,i,s);const g=a+h+c,p=l+r+d,y=f+h,C=y+g;let b;switch(i.verticalAlign){case"top":b=n;break;case"bottom":b=e;break;case"middle":default:b=(e+n)/2;break}const w=b-p/2,T=b+p/2;return{textX:y+h+a/2,textY:w+r+l/2,textAlign:"center",textBaseline:"middle",box:{left:y,top:w,right:C,bottom:T},pointerEdge:"left"}}getPlotLineLabelPosition(e,n,i){const{fontSize:s,labelWidth:l,padTop:a,padRight:r,padBottom:c,padLeft:d,position:h}=n,{maxX:u}=i;if(s<=0)return null;if(this.type==="x")return this.computeTopLabelBox(e,n,i);if(h==="innerStart"||h==="innerEnd")return this.computeInnerLabelBox(e,n,i);const f=l+d+r,m=s+a+c,g=u+d,p=g+f;let y,C;switch(n.verticalAlign){case"top":C=e,y=C-m;break;case"bottom":y=e,C=y+m;break;case"middle":default:y=e-m/2,C=e+m/2;break}return{textX:g+d+l/2,textY:y+a+s/2,textAlign:"center",textBaseline:"middle",box:{left:g,top:y,right:p,bottom:C},pointerEdge:"left"}}computeTopLabelBox(e,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,textAlign:h}=n,{minY:u}=i,f=s+d+r,m=l+a+c,g=n.gap!=null?n.gap:2,p=u-g,y=p-m,C=0;let b,w;switch(h){case"left":w=e-C,b=w-f;break;case"right":b=e+C,w=b+f;break;default:b=e-f/2,w=e+f/2;break}return{textX:b+d+s/2,textY:y+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:b,top:y,right:w,bottom:p},pointerEdge:"bottom",pointerTipX:e}}computeInnerLabelBox(e,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,lineGap:h,position:u,verticalAlign:f,textAlign:m}=n,{minX:g,maxX:p,minY:y,maxY:C}=i,b=s+d+r,w=l+a+c;let T,k,M,V;if(this.type==="x")switch(u==="innerEnd"?(V=C-h,k=V-w):(k=y+h,V=k+w),m){case"left":T=e+h,M=T+b;break;case"right":M=e-h,T=M-b;break;default:T=e-b/2,M=e+b/2;break}else switch(u==="innerEnd"?(M=p-h,T=M-b):(T=g+h,M=T+b),f){case"top":V=e-h,k=V-w;break;case"bottom":k=e+h,V=k+w;break;default:k=e-w/2,V=e+w/2;break}let x;return this.type==="x"?x=u==="innerEnd"?"top":"bottom":f==="top"?x="bottom":f==="bottom"?x="top":x=null,{textX:T+d+s/2,textY:k+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:T,top:k,right:M,bottom:V},pointerEdge:x}}drawPlotLabel(e,n){var k,M;if(!n)return;const{textX:i,textY:s,textAlign:l="left",textBaseline:a="alphabetic",box:r}=n,{label:c,fontSize:d,fontColor:h,fillColor:u,lineColor:f,lineWidth:m,borderRadius:g=0}=e;if(d<=0||!r)return;const{left:p,top:y,right:C,bottom:b}=r,w=this.ctx;w.save(),w.beginPath(),w.font=O.getLabelStyle(e),w.setLineDash([]),w.fillStyle=u,w.strokeStyle=f,w.lineWidth=m;const T=Math.min(g,Math.abs(C-p)/2,Math.abs(b-y)/2);T>0?(w.moveTo(p+T,y),w.lineTo(C-T,y),w.arcTo(C,y,C,y+T,T),w.lineTo(C,b-T),w.arcTo(C,b,C-T,b,T),w.lineTo(p+T,b),w.arcTo(p,b,p,b-T,T),w.lineTo(p,y+T),w.arcTo(p,y,p+T,y,T),w.closePath()):(w.moveTo(p,b),w.lineTo(p,y),w.lineTo(C,y),w.lineTo(C,b),w.lineTo(p,b)),w.fill(),m>0&&w.stroke(),(k=e.pointer)!=null&&k.show&&n.pointerEdge&&this.drawLabelPointer(r,n.pointerEdge,e.pointer.color??u,f,m,n.pointerTipX,T),w.fillStyle=h,w.textAlign=l,w.textBaseline=a,w.fillText(c,i,s),w.closePath(),w.restore(),e.valueOnly&&((M=e.showTextOnHover)!=null&&M.use)&&e.hoverText&&(this.plotLabelHitRegions||(this.plotLabelHitRegions=[]),this.plotLabelHitRegions.push({x:Math.min(p,C),y:Math.min(y,b),width:Math.abs(C-p),height:Math.abs(b-y),text:e.hoverText,style:e.showTextOnHover}))}drawLabelPointer(e,n,i,s,l,a,r=0){const c=this.ctx,d=4,h=4,u=(e.left+e.right)/2,f=(e.top+e.bottom)/2,m=Math.min(r+h,(e.right-e.left)/2),g=Math.min(r+h,(e.bottom-e.top)/2),p=a??u,y=Math.max(e.left+m,Math.min(e.right-m,p)),C=Math.max(e.top+g,Math.min(e.bottom-g,f));let b,w,T,k,M,V;switch(n){case"top":b=y-h,w=e.top,T=y+h,k=e.top,M=p,V=e.top-d;break;case"left":b=e.left,w=C-h,T=e.left,k=C+h,M=e.left-d,V=C;break;case"right":b=e.right,w=C-h,T=e.right,k=C+h,M=e.right+d,V=C;break;case"bottom":default:b=y-h,w=e.bottom,T=y+h,k=e.bottom,M=p,V=e.bottom+d;break}c.beginPath(),c.moveTo(b,w),c.lineTo(M,V),c.lineTo(T,k),c.closePath(),c.fillStyle=i,c.fill(),l>0&&(c.beginPath(),c.moveTo(b,w),c.lineTo(M,V),c.lineTo(T,k),c.strokeStyle=s,c.lineWidth=l,c.stroke())}drawPlotLineLabel(e,n,i,s,l=null){if(!(n!=null&&n.show))return;const a=this.getNormalizedLabelOptions(s,n,l);if(a.hidden)return;const r=this.getPlotLineLabelPosition(e,a,i);this.drawPlotLabel(a,r)}drawPlotBandLabel(e,n,i,s,l,a,r){if(!(i!=null&&i.show))return;if(i.showValue){const h=a<=r,u=this.type==="x"?{textAlign:h?"left":"right"}:{verticalAlign:h?"bottom":"top"},f=this.type==="x"?{textAlign:h?"right":"left"}:{verticalAlign:h?"top":"bottom"};this.drawPlotLineLabel(e,{...i,...u},s,l,a),this.drawPlotLineLabel(n,{...i,...f},s,l,r);return}const c=this.getNormalizedLabelOptions(l,i,null);if(c.hidden)return;const d=this.getPlotBandLabelPosition(e,n,c,s);this.drawPlotLabel(c,d)}checkFixWidth(e){const{fixWidth:n,fitDir:i}=this.labelStyle;return ve(n)&&n>0?O.truncateLabelWithEllipsis(e,n,this.ctx,i):e}}function nC(t){if(typeof t=="string"&&Ct[t])return{ms:Ct[t].size,unit:t,time:1};if(typeof t=="object"&&t!==null&&t.unit&&t.time>0){const e=Ct[t.unit];return e?{ms:t.time*e.size,unit:t.unit,time:t.time}:null}return typeof t=="number"&&t>0&&Number.isFinite(t)?{ms:t,unit:null,time:null}:null}function iC(t,e){if(!e.unit)return Ne(t.valueOf()+e.ms);const n=e.time||1;switch(e.unit){case"month":return t.add(n,"month");case"quarter":return t.add(n*3,"month");case"year":return t.add(n,"year");case"week":return t.add(n*7,"day");default:return Ne(t.valueOf()+e.ms)}}function sC(t,e){return e.unit?iC(Ne(t),e).valueOf():t+e.ms}function oC(t,e){if(!e.unit)return Math.ceil(t/e.ms)*e.ms;const n=e.time||1,i=Ne(t);if(["millisecond","second","minute","hour"].includes(e.unit)){const s=i.startOf("day").valueOf(),l=Ct[e.unit].size*n,a=t-s;return s+Math.ceil(a/l)*l}if(e.unit==="day"){const s=i.startOf("year").valueOf(),l=Ct.day.size*n,a=t-s;return s+Math.ceil(a/l)*l}if(e.unit==="week"){let s=i.startOf("year");const l=s.day();s=s.subtract((l+6)%7,"day");const a=s.valueOf(),r=Ct.week.size*n,c=t-a;return a+Math.ceil(c/r)*r}if(e.unit==="month"){const s=i.startOf("year"),l=i.startOf("month"),a=i.month(),r=l.valueOf()>=t?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"month").valueOf()}if(e.unit==="quarter"){const s=i.startOf("year"),l=Math.floor(i.month()/3),r=i.month(l*3).startOf("month").valueOf()>=t?l:l+1,c=Math.ceil(r/n)*n;return s.add(c*3,"month").valueOf()}if(e.unit==="year"){const s=i.startOf("year"),l=2e3,a=s.valueOf()>=t?i.year()-l:i.year()+1-l,r=Math.ceil(a/n)*n;return Ne(`${l+r}-01-01`).startOf("day").valueOf()}return t}function lC(t,e,n){const i=[];let s=oC(t,n);const l=1e4;for(;s<=e&&i.length<l;)i.push(s),s=sC(s,n);return i}const _o=864e5,aC=["millisecond","second","minute","hour"],Uo=new Map;function rC(t){if(Uo.has(t))return Uo.get(t);const e=[],n=[];for(let s=1;s*s<=t;s+=1)t%s===0&&(e.push(s),s!==t/s&&n.push(t/s));const i=e.concat(n.reverse());return Uo.set(t,i),i}function Kr(t,e,n){const i=Math.ceil(e/t.ms);let s=i>n?Math.max(1,Math.floor(i/n)):1,l=t.ms*s;const a=s+1e4;for(;s<=a&&Math.floor(e/l)+1>n;)s+=1,l=t.ms*s;return t.unit?{ms:l,unit:t.unit,time:(t.time||1)*s}:{ms:l,unit:null,time:null}}function cC(t,e,n){const i=s=>Math.floor(e/s)+1<=n;if(i(t.ms))return t;if(t.unit&&aC.includes(t.unit)&&_o%t.ms===0){const s=rC(_o/t.ms);for(let l=0;l<s.length;l+=1){const a=t.ms*s[l];if(i(a))return{ms:a,unit:t.unit,time:(t.time||1)*s[l]}}return Kr({ms:_o,unit:"day",time:1},e,n)}return Kr(t,e,n)}function _r(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;const e=Ne(t).valueOf();return Number.isFinite(e)?e:null}class dC extends pi{normalizeTimeValue(e){return _r(e)}calculateScaleRange(e,n){const i=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(i)||typeof i=="function")&&((e==null?void 0:e.min)==null||(e==null?void 0:e.max)==null))return{min:null,max:null,minLabel:"",maxLabel:"",size:O.calcTextSizeCanvas("",O.getLabelStyle(this.labelStyle))};let l=i;Array.isArray(i)&&i.length===2?l=[this.normalizeTimeValue(i[0]),this.normalizeTimeValue(i[1])]:typeof i=="function"&&(l=(...h)=>{const[u,f]=i(...h);return[this.normalizeTimeValue(u),this.normalizeTimeValue(f)]});const a=this.range,r=n!=null&&n.use?{...n,range:l}:n,c={...e,min:this.normalizeTimeValue(e==null?void 0:e.min),max:this.normalizeTimeValue(e==null?void 0:e.max)};let d;try{n!=null&&n.use||(this.range=l),d=super.calculateScaleRange(c,r)}finally{this.range=a}return{...d,min:this.normalizeTimeValue(d.min),max:this.normalizeTimeValue(d.max)}}getLabelFormat(e,n={}){if(this.formatter){const i=this.formatter(e,n);if(typeof i=="string")return i}return Ne(e).format(this.timeFormat)}getInterval(e){const n=this.normalizeTimeValue(e.maxValue),i=this.normalizeTimeValue(e.minValue),s=e.maxSteps;if(this.interval){let l;if(typeof this.interval=="string"?l=Ct[this.interval].size:typeof this.interval=="object"?l=this.interval.time*Ct[this.interval.unit].size:typeof this.interval=="number"&&(l=this.interval),l>0&&Number.isFinite(l))return l}return Math.ceil((n-i)/s)}calculateSteps(e){const n=this.normalizeTimeValue(e.minValue),i=this.normalizeTimeValue(e.maxValue),s=Math.max(1,e.maxSteps??1);if(n==null||i==null)return{steps:0,interval:0,baseInterval:0,graphMin:null,graphMax:null,ticks:[]};const l=+n,a=+i;if(l>=a)return{steps:0,interval:0,baseInterval:0,graphMin:l,graphMax:a,ticks:[]};const r=nC(this.interval);let c;r?c=r:c={ms:Math.max(1,Math.ceil((a-l)/Math.max(1,s))),unit:null,time:null};const d=a-l,h=this.fixedSteps?c:cC(c,d,s),u=h.ms,f=lC(l,a,h);return{steps:Math.max(0,f.length-1),interval:u,baseInterval:c.ms,graphMin:l,graphMax:a,ticks:f}}draw(e,n,i,s,l){var b,w,T,k,M,V,x,S,L,I,R,v,G,W,E,X,Z,N;const a=this.ctx,r=this.options,c={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},d=i.graphMin,h=i.graphMax,u=i.ticks,f=c[this.units.rectStart],m=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=5;let C=0;if(this.drawAxisTitle(e,n),a.font=O.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),this.showAxis&&(a.lineWidth=this.axisLineWidth,C=O.aliasPixel(a.lineWidth),a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+C),a.lineTo(m,g+C)):(a.moveTo(g+C,f),a.lineTo(g+C,m)),a.stroke(),a.closePath()),!(!(u!=null&&u.length)||d===null)){if((b=this.labelStyle)!=null&&b.show){const P=c.x2-c.x1,B=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=O.aliasPixel(a.lineWidth);let Y;for(let H=0;H<u.length;H++){const _=u[H];let D;if(this.type==="x"?D=te.calculateX(_,d,h,P,c.x1):D=te.calculateY(_,d,h,B,c.y2),D===null)continue;_===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const A=D+C;Y=this.getLabelFormat(_,{prev:u[H-1]??""});const j=((T=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:T.use)&&((M=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:M.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((V=l==null?void 0:l.dataIndex)==null?void 0:V.length)&&!(l!=null&&l.label.map(ne=>this.getLabelFormat(ne,{prev:u[H-1]??""})).includes(Y));let J;H===u.length-1&&this.lastLabelFontStyle?(a.font=O.getLabelStyle(this.lastLabelFontStyle),J=this.lastLabelFontStyle.color):H===0&&this.firstLabelFontStyle?(a.font=O.getLabelStyle(this.firstLabelFontStyle),J=this.firstLabelFontStyle.color):(a.font=O.getLabelStyle(this.labelStyle),J=this.labelStyle.color);let q=1;O.getColorStringType(J)==="RGBA"&&(q=O.getOpacity(J)),a.fillStyle=O.colorStringToRgba(J,j?(x=this.options)==null?void 0:x.unSelectedOpacity:q);let U;if(this.type==="x"){if(U=this.position==="top"?g-10:g+10,((S=r==null?void 0:r.brush)!=null&&S.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(Y),D,U),!j&&((L=r==null?void 0:r.selectItem)!=null&&L.showLabelTip)&&(s!=null&&s.label)&&!((I=this.options)!=null&&I.horizontal)){const ne=this.getLabelFormat(s.label);if(ne===Y){const $=Math.round(a.measureText((R=this.labelStyle)==null?void 0:R.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ne).width)+10,height:$,x:D,y:U+($-2),borderRadius:2,arrowSize:3,text:Y,backgroundColor:(G=(v=r==null?void 0:r.selectItem)==null?void 0:v.labelTipStyle)==null?void 0:G.backgroundColor,textColor:(E=(W=r==null?void 0:r.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:E.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(A,g),a.lineTo(A,g+y),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(A,g),a.lineTo(A,p),a.stroke(),a.closePath())}else{U=this.position==="left"?g-10:g+10,((X=r==null?void 0:r.brush)!=null&&X.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(Y),U,D);let ne=A;H===u.length-1&&(ne-=1),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),ne),a.lineTo(g-y,ne),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,ne),a.lineTo(p,ne),a.stroke(),a.closePath())}}}((Z=this.plotBands)!=null&&Z.length||(N=this.plotLines)!=null&&N.length)&&(this._plotGeom={aPos:c,axisMin:d,axisMax:h,aliasPixel:C,chartRect:e,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:e,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=e.x1,u=e.x2+d,f=e.y1-d,m=e.y2,g={minX:h,maxX:u,minY:f,maxY:m};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(w=>{const T=He({},w,Ko),{from:k,to:M,label:V,border:x}=T,S=O.isNullOrUndefined(k)?n:Math.max(k,n),L=O.isNullOrUndefined(M)?i:Math.min(M,i);let I,R;if(this.type==="x"){if(I=te.calculateX(S,n,i,r,h),R=te.calculateX(L,n,i,r,h),I===null||R===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(I,R,h,u,f,m,x)}else{if(I=te.calculateY(S,n,i,c,m),R=te.calculateY(L,n,i,c,m),I===null||R===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(I,R,h,u,f,m,x)}this.drawPlotBandLabel(I,R,V,g,l,S,L)}),(b=this.plotLines)==null||b.forEach(w=>{if(!Number.isFinite(+w.value))return;const T=He({},w,Ao),{value:k,label:M}=T;let V;if(this.type==="x"){if(V=te.calculateX(k,n,i,r,h),V===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(V,h,u,f,m)}else{if(V=te.calculateY(k,n,i,c,m),V===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(V,h,u,f,m)}this.drawPlotLineLabel(V,M,g,l,k)})}}class hC extends pi{getTruthyValue(e){const n=this.adjustedDecimalPoint??this.decimalPoint;return ve(e)?Number(e.toFixed(n)):e}getLabelFormat(e,n={}){if(this.formatter){const s=this.getTruthyValue(e),l=this.formatter(s,{...n,prevOriginalValue:n==null?void 0:n.prev,prevDecimalPointValue:this.getTruthyValue(n==null?void 0:n.prev),currentOriginalValue:e,currentDecimalPointValue:s});if(typeof l=="string")return l}const i=this.adjustedDecimalPoint??this.decimalPoint;return O.labelSignFormat(e,i)}getInterval(e){if(this.interval)return this.interval;let n=0;const i=e.maxValue,s=e.minValue,l=e.maxSteps;if(!l||l<=0)return 0;if(this.startToZero&&s<0){const a=Math.abs(s)+Math.abs(i),r=Math.abs(s)/a,c=Math.abs(i)/a;let d=Math.max(1,Math.round(r*l)),h=Math.max(1,l-d);d+h>l&&(r>c?d-=1:h-=1),n=Math.max(Math.abs(s)/(d||1),Math.abs(i)/(h||1))}else n=(i-s)/l;return this.decimalPoint?n:Math.ceil(n)}getExactInterval(e,n){if(!Number.isFinite(e)||e<=0)return{interval:1,steps:1};const i=Math.max(1,n);let s=null,l=0,a=1/0;for(let r=i;r>=1;r--){const c=e/r;let d=1;for(let h=0;h<=12;h++,d*=10){const u=c*d;if(Math.abs(u-Math.round(u))<1e-6){h<a&&c<e&&(a=h,s=Math.round(u)/d,l=r);break}}if(a===0)break}return l>0?{interval:s,steps:l}:{interval:parseFloat((e/i).toFixed(12)),steps:i}}getStepsWithNiceScale({max:e,min:n,maxSteps:i}){const s=e-n;if(!Number.isFinite(s)||s<=0)return{max:n+1,min:n,interval:1,steps:1};const l=s/i,a=Math.floor(Math.log10(l)),r=Math.ceil(Math.log10(s));let c=e,d=n,h=0,u=0,f=1/0;for(let m=a;m<=r;m++){const g=10**m;for(const p of JS){const y=p*g;if(y>=l){const C=y*1e-10,b=Math.floor((n+C)/y)*y,w=Math.ceil((e-b-C)/y),T=b+y*w;if(w<=i&&T>=e-C){const k=n-b+(T-e);k<f&&(c=T,d=b,h=y,u=w,f=k)}}}}if(!(h>0)||u<=0){const m=Math.max(1,i),g=s/m||1;return{max:e,min:n,interval:g,steps:m}}return{max:c,min:d,interval:h,steps:u}}getDecimalPointFromInterval(e){if(!Number.isFinite(e)||e===0)return 0;const n=Math.abs(e),i=10,s=1e-10,l=(c,d=0)=>{const h=10**d;return Math.round((c+Number.EPSILON)*h)/h},a=(c,d)=>{const h=l(c,d);return Math.abs(c-h)<s};if(n>=1&&a(n,0))return 0;const r=n>=1?0:Math.max(0,Math.ceil(-Math.log10(n)));for(let c=r;c<=i;c+=1)if(a(n,c))return c;return i}getLegacyOneMaxScale(e){return this.decimalPoint?e>2?{interval:.2,steps:5}:{interval:.5,steps:2}:{interval:1,steps:1}}calculateSteps(e){const{minValue:n,maxValue:i}=e,s=Math.max(1,e.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(e):null,c=r!=null&&r>0&&Number.isFinite(r),d=l?+this.range[0]:null,h=l?+this.range[1]:null,u=1e-10,f=b=>{if(this.decimalPoint==="auto"){const w=this.getDecimalPointFromInterval(b);w!=null&&!Number.isNaN(w)?this.adjustedDecimalPoint=w:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(b):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},m=(b,w)=>Math.max(1,Math.round(b/w+u)),g=({min:b,max:w,interval:T})=>{let k=0,M=0;return b>=0?(k=+b,M=Math.ceil(w/T)*T):w>=0?(k=Math.floor(b/T)*T,M=Math.ceil(w/T)*T):(M=+w,k=Math.floor(b/T)*T),{graphMin:k,graphMax:M}};if(l&&c){const b=d,w=h,T=r,M=(w-b)/T;if(Math.abs(M-Math.round(M))<u&&M<=s||this.fixedSteps){const x=Math.round(M);return f(T),{steps:x,interval:T,graphMin:b,graphMax:w}}}if(l){const b=d,w=h,T=w-b,{interval:k,steps:M}=this.getExactInterval(T,s);return f(k),{steps:M,interval:k,graphMin:b,graphMax:w}}if(c){let b=r,w=0,T=0,k=0,M=0;for({graphMin:w,graphMax:T}=g({min:n,max:i,interval:b}),k=T-w,M=m(k,b);M>s;)b+=r,{graphMin:w,graphMax:T}=g({min:n,max:i,interval:b}),k=T-w,M=m(k,b);return f(b),{steps:M,interval:b,graphMin:w,graphMax:T}}const p=this.startToZero&&n>=0?0:n,y=this.startToZero&&i<=0?0:i;if(p===0&&y===1){const b=this.getLegacyOneMaxScale(s);return f(b.interval),{steps:b.steps,interval:b.interval,graphMin:p,graphMax:y}}const C=this.getStepsWithNiceScale({min:p,max:y,maxSteps:s});return f(C.interval),{steps:C.steps,interval:C.interval,graphMin:C.min,graphMax:C.max}}calculateScaleRange(e,n){var u;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(a)||typeof a=="function")&&((e==null?void 0:e.min)==null||(e==null?void 0:e.max)==null)){const f=this.getLabelFormat(0),m=this.getLabelFormat(1,{isMaxValueSameAsMin:!0});return{min:0,max:1,minLabel:f,maxLabel:m,size:O.calcTextSizeCanvas(m,O.getLabelStyle(this.labelStyle))}}Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+e.max?+e.max:a[1],s=a[0]<+e.min?+e.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(e.min,e.max):(i=e.max,s=e.min);const c=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!c){const f=i,m=i*(this.autoScaleRatio+1);if(i=this.decimalPoint?m:Math.ceil(m),i>0&&s<0){const g=f-i;s+=g}else if(i<0&&s<0){const g=s*(this.autoScaleRatio+1);s=this.decimalPoint?g:Math.ceil(g)}}this.startToZero&&!c&&(s>0&&(s=0),i<0&&(i=0)),i===s&&(i+=1,l=!0);const d=this.getLabelFormat(s),h=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:d,maxLabel:h,size:O.calcTextSizeCanvas(h,O.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class uC extends pi{calculateScaleRange(e){let n,i,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],i=this.range[0]):typeof range=="function"?[i,n]=this.range(e.min,e.max):(n=e.max,i=e.min);const l=O.calculateMagnitude(n-i);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(i=0),n===i&&(n+=1,s=!0);const a=this.getLabelFormat(i),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:i,max:n,minLabel:a,maxLabel:r,size:O.calcTextSizeCanvas(r,O.getLabelStyle(this.labelStyle))}}calculateSteps(e,n){const i=e.maxValue,s=e.minValue,l=e.maxSteps,a=O.calculateMagnitude(i-s);let r=this.getInterval(e),c;const d=i,h=s,u=d-h;for(c=Math.round(u/r),i===1&&(r=.2,c=5);(c>l||c*2<l)&&!n;)if(c>l)r*=2,c=Math.ceil(u/r);else if(a>=0)if(r/2%1===0)r/=2,c=Math.ceil(u/r);else break;else r/=2,c=Math.ceil(u/r);return{steps:c,interval:r,graphMin:h,graphMax:Math.ceil(h+c*r)}}getLabelFormat(e,n={}){if(this.formatter){const i=this.formatter(e,n);if(typeof i=="string")return i}return O.labelSignFormat(e,this.decimalPoint)}getInterval(e){const n=e.maxValue,i=e.minValue;return 10**O.calculateMagnitude(n-i)}}const Jo=new WeakMap;class fC extends pi{constructor(e,n,i,s,l){super(e,n,i,l),this.labels=s}getMaxWidth(e,n){var s;const i=(s=this.labelStyle)==null?void 0:s.maxWidth;if(i==null)return n;if(typeof i=="string"){const l=i.trim();if(l.includes("%")){const r=Number.parseFloat(l.replace("%",""));return Number.isNaN(r)?n:e.chartWidth*(r/100)}const a=Number.parseFloat(l);return Number.isNaN(a)?n:a}return i}getStepMinMax(e,n){return this.labelStyle.alignToGridLine?e:n!=null&&n.use?(Jo.has(this.labels)||Jo.set(this.labels,O.getStringMinMax(this.labels)),Jo.get(this.labels)):O.getStringMinMax(this.labels)}calculateScaleRange(e,n,i){const s=this.getStepMinMax(e,n);let l=s.max,a=s.min,r=0,c=this.labels.length-1,d=this.labels.length;const h=n!=null&&n.use?n==null?void 0:n.range:this.range;if(Array.isArray(h)&&(h!=null&&h.length)){const[f,m]=h;ve(f)&&ve(m)&&(r=f<r?r:f,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[f,m]=h(a,l);r=f<r?r:f,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1}const u=this.getMaxWidth(i,i.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,u),maxLabel:this.getLabelFormat(l,u),size:O.calcTextSizeCanvas(this.getLabelFormat(l,u),O.getLabelStyle(this.labelStyle))}}getIndexInterval(e){const n=e.maxSteps;return this.interval?this.interval:Math.ceil(this.labels.length/n)}calculateSteps(e){const{minValue:n,maxValue:i,minIndex:s,maxIndex:l}=e,a=l-s+1;let r=1;const c=this.labels.every(d=>!isNaN(d));return this.labelStyle.alignToGridLine&&c&&(r=this.getIndexInterval(e)),{oriSteps:a,steps:a,indexInterval:r,graphMin:n,graphMax:i,minIndex:s,maxIndex:l}}draw(e,n,i,s,l){var b,w,T,k,M,V,x,S,L;const a=this.ctx,r=this.labels,c={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},d=i.steps,h=i.indexInterval,u=i.minIndex,f=c[this.units.rectStart],m=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=this.getMaxWidth(e,e.chartWidth/(d+2)),C=5;if(this.drawAxisTitle(e,n),(b=this.labelStyle)!=null&&b.show){a.font=O.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const I=O.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+I),a.lineTo(m,g+I)):(a.moveTo(g+I,f),a.lineTo(g+I,m)),a.stroke(),d===0)return;const R=(m-f)/d,v=this.labelStyle.alignToGridLine;let G=null,W=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let E,X,Z;for(Z=0;Z<d;Z+=h){const N=u+Z,P=this.labels[N];G=Math.round(f+R*Z),W=G+I,E=this.getLabelFormat(P,y);const{selectLabel:B,selectItem:Y,horizontal:H}=this.options;let _;l!=null&&l.targetAxis?_=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":_=H?"y":"x";const D=(B==null?void 0:B.use)&&(B==null?void 0:B.useLabelOpacity)&&_===this.type&&((w=l==null?void 0:l.dataIndex)==null?void 0:w.length)&&!((T=l==null?void 0:l.dataIndex)!=null&&T.includes(N));let z;Z===d-1&&this.lastLabelFontStyle?(a.font=O.getLabelStyle(this.lastLabelFontStyle),z=this.lastLabelFontStyle.color):Z===0&&this.firstLabelFontStyle?(a.font=O.getLabelStyle(this.firstLabelFontStyle),z=this.firstLabelFontStyle.color):(a.font=O.getLabelStyle(this.labelStyle),z=this.labelStyle.color);let A=1;if(O.getColorStringType(z)==="RGBA"&&(A=O.getOpacity(z)),a.fillStyle=O.colorStringToRgba(z,D?(k=this.options)==null?void 0:k.unSelectedOpacity:A),this.type==="x"){X=this.position==="top"?g-10:g+10;const j=v?G:G+R/2;if(a.fillText(this.checkFixWidth(E),j,X),!D&&(Y!=null&&Y.showLabelTip)&&(s!=null&&s.label)&&!H){const J=s.label;if(J===E){const q=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(J).width)+10,height:q,x:G+R/2,y:X+(q-2),borderRadius:2,arrowSize:3,text:E,backgroundColor:(V=Y==null?void 0:Y.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(x=Y==null?void 0:Y.labelTipStyle)==null?void 0:x.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(G+R/2,g),a.lineTo(G+R/2,g+C),a.stroke(),a.closePath()),Z>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(W,g),a.lineTo(W,p),a.stroke(),a.closePath())}else{X=this.position==="left"?g-10:g+10;const j=v?G:G+R/2;a.fillText(this.checkFixWidth(E),X,j),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),j),a.lineTo(g-C,j),a.stroke(),a.closePath()),Z>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,W),a.lineTo(p,W),a.stroke(),a.closePath())}a.stroke()}if(this.showLastLabel){const N=u+d-1;if(u+Math.floor((d-1)/h)*h!==N){const B=Math.round(f+R*(d-1)),Y=v?B:B+R/2,H=this.getLabelFormat(r[N],y);a.font=this.lastLabelFontStyle?O.getLabelStyle(this.lastLabelFontStyle):O.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(H),Y,X):a.fillText(this.checkFixWidth(H),X,Y),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(Y,g),a.lineTo(Y,g+C)):(a.moveTo(g+(this.axisLineWidth??1),Y),a.lineTo(g-C,Y)),a.stroke(),a.closePath())}}if(v&&!this.showLastLabel){const N=C0(+r[1],+r[0]),P=Ho(+r[r.length-1],N);if(isNaN(P))return;G=Math.round(f+R*this.labels.length),W=G+I;const B=this.getLabelFormat(`${P}`,y),Y=G+R/2;a.font=O.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),G,X):a.fillText(this.checkFixWidth(B),X,G),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(Y,g),a.lineTo(Y,g+C)):(a.moveTo(g+(this.axisLineWidth??1),W),a.lineTo(g-C,W)),a.stroke(),a.closePath())}a.closePath()}((S=this.plotBands)!=null&&S.length||(L=this.plotLines)!=null&&L.length)&&(this._plotGeom={aPos:c,startPoint:f,endPoint:m,chartRect:e,aliasPixel:O.aliasPixel(a.lineWidth)})}drawPlots(){var g,p,y,C;if(!((g=this.plotBands)!=null&&g.length||(p=this.plotLines)!=null&&p.length)||!this._plotGeom)return;const e=this.labels,{aPos:n,startPoint:i,endPoint:s,chartRect:l,aliasPixel:a}=this._plotGeom,r=a+1,c=n.x1+r,d=n.x2,h=n.y1+r,u=n.y2,f=(s-i)/(this.labelStyle.show?e.length:1),m={minX:c,maxX:d,minY:h,maxY:u};this.plotLabelHitRegions=[],(y=this.plotBands)==null||y.forEach(b=>{if(O.isNullOrUndefined(b.from)&&O.isNullOrUndefined(b.to))return;const w=He({},b,Ko),{from:T=0,to:k=e.length,label:M,border:V}=w,x=Math.round(i+f*T),S=Math.round(i+f*k);this.setPlotBandStyle(w),this.type==="x"?this.drawXPlotBand(x,S,c,d,h,u,V):this.drawYPlotBand(x,S,c,d,h,u,V),this.drawPlotBandLabel(x,S,M,m,l,T,k)}),(C=this.plotLines)==null||C.forEach(b=>{if(O.isNullOrUndefined(b.value))return;const w=He({},b,Ao),{value:T,label:k}=w,M=Math.round(i+f*T)+f/2;this.setPlotLineStyle(w),this.type==="x"?this.drawXPlotLine(M,c,d,h,u):this.drawYPlotLine(M,c,d,h,u),this.drawPlotLineLabel(M,k,m,l,T)})}getLabelFormat(e,n,i={}){if(this.formatter){const s=this.formatter(e,i);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(e,n):e}fittingString(e,n){const i=this.ctx;i.save(),i.font=O.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return O.truncateLabelWithEllipsis(e,n,i,s)}getLabelWidthHasMaxLength(e,n,i=[]){const s=O.getLabelStyle(this.labelStyle),l=(e==null?void 0:e.length)??0,a=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(l+2));return[...(e??[]).map(d=>this.getLabelFormat(d,a)),...i].reduce((d,h)=>{var f;const u=((f=O.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class mC extends pi{constructor(e,n,i,s,l){super(e,n,i),this.labels=s,this.options=l}getLabelFormat(e,n={}){if(this.formatter){const i=this.formatter(e,n);if(typeof i=="string")return i}return Ne(e).format(this.timeFormat)}calculateScaleRange(e,n,i){const s=super.calculateScaleRange(e,n,i),l=this.labels;if(!(l!=null&&l.length))return{...s,minIndex:0,maxIndex:-1};let a=0,r=l.length-1;const{min:c,max:d}=s;if(Number.isFinite(c)&&Number.isFinite(d)){const h=l.findIndex(f=>f>=c);let u=-1;for(let f=l.length-1;f>=0;f-=1)if(l[f]<=d){u=f;break}h===-1||u===-1||u<h?(a=0,r=-1):(a=h,r=u)}else{const h=n!=null&&n.use?n==null?void 0:n.range:this.range;h!=null&&console.warn("[EVUI][TimeCategoryScale] axis range가 유효한 min/max 숫자로 해석되지 않아 전체 라벨 범위로 폴백합니다. range 설정을 확인하세요:",h)}return{...s,minIndex:a,maxIndex:r}}getInterval(e){const n=e.maxValue,i=e.minValue,s=e.maxSteps;if(this.interval){if(typeof this.interval=="string")return Ct[this.interval].size;if(typeof this.interval=="object")return this.interval.time*Ct[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-i)/s)}calculateSteps(e){const{maxValue:n,minValue:i,maxSteps:s,minIndex:l,maxIndex:a}=e,r=this.getInterval(e);let c=r,d=i,h;for(;d<n;)d+=c;const u=d>n?n:d,f=i,m=u-f;h=Math.round(m/c)+1;const g=h;for(n===1&&(c=.2,h=5);h>s;)c*=2,h=Math.round(m/c),c=Math.ceil(m/h);return u-f>h*c&&(c=Math.ceil((u-f)/h)),{steps:h,oriSteps:g,interval:c,rawInterval:r,graphMin:f,graphMax:u,minIndex:l,maxIndex:a}}draw(e,n,i,s,l){var G,W,E,X,Z,N,P,B,Y,H,_,D,z,A,j,J;const a=this.ctx,r=this.labels,c={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},d=i.steps,h=i.graphMin,u=i.graphMax,f=i.rawInterval,m=i.oriSteps;let g=c[this.units.rectStart];const p=c[this.units.rectEnd],y=c[this.units.rectOffset(this.position)],C=c[this.units.rectOffsetCounter(this.position)],b=5;this.drawAxisTitle(e,n),a.font=O.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const w=O.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(g,y+w),a.lineTo(p,y+w)):(a.moveTo(y+w,g),a.lineTo(y+w,p)),a.stroke(),a.closePath(),d===0||h===null)return;const T=this.labelStyle.alignToGridLine,k=(p-g)/(m||1);this.categoryMode&&!T&&(g+=Math.ceil(k/2)-2);const M=[];let V=null,x=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let S,L,I;const R=d<=2?Math.max(1,m-1):Math.round(m/d),v=R===m?m:m-1;for(I=0;I<=v;I+=R){M[I]=Ne(h).valueOf()+I*f,V=Math.round(g+k*I),x=V+w;let q;for(let ee=0;ee<M.length;ee++)M[ee]!==void 0&&ee!==I&&(q=M[ee]);S=this.getLabelFormat(Math.min(u,M[I]),{prev:q});const U=((W=(G=this.options)==null?void 0:G.selectLabel)==null?void 0:W.use)&&((X=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:X.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((Z=l==null?void 0:l.dataIndex)==null?void 0:Z.length)&&!(l!=null&&l.label.map(ee=>this.getLabelFormat(Math.min(u,ee),{prev:q})).includes(S)),ne=this.labelStyle.color;let $=1;if(O.getColorStringType(ne)==="RGBA"&&($=O.getOpacity(ne)),a.fillStyle=O.colorStringToRgba(ne,U?(N=this.options)==null?void 0:N.unSelectedOpacity:$),this.type==="x"){if(L=this.position==="top"?y-10:y+10,a.fillText(this.checkFixWidth(S),V,L),!U&&((B=(P=this.options)==null?void 0:P.selectItem)!=null&&B.showLabelTip)&&(s!=null&&s.label)&&!((Y=this.options)!=null&&Y.horizontal)){const ee=this.getLabelFormat(Math.min(u,s.label+0*f));if(ee===S){const Q=Math.round(a.measureText((H=this.labelStyle)==null?void 0:H.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ee).width)+10,height:Q,x:V,y:L+(Q-2),borderRadius:2,arrowSize:3,text:S,backgroundColor:(z=(D=(_=this.options)==null?void 0:_.selectItem)==null?void 0:D.labelTipStyle)==null?void 0:z.backgroundColor,textColor:(J=(j=(A=this.options)==null?void 0:A.selectItem)==null?void 0:j.labelTipStyle)==null?void 0:J.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(x,y),a.lineTo(x,y+b),a.stroke(),a.closePath()),I<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(x,y),a.lineTo(x,C),a.stroke(),a.closePath())}else L=this.position==="left"?y-10:y+10,a.fillText(this.checkFixWidth(S),L,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(y+(this.axisLineWidth??1),x),a.lineTo(y-b,x),a.stroke(),a.closePath()),I<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(y,x),a.lineTo(C,x),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&T&&I*R===m){const q=Ne(r[1]).diff(Ne(r[0])),U=this.getLabelFormat(Ne(M[m-1]+q));V=Math.round(g+k*m),x=V+w,this.type==="x"?(a.fillText(this.checkFixWidth(U),V,L),this.showGrid&&(a.moveTo(x,y),a.lineTo(x,C))):(a.fillText(this.checkFixWidth(U),L,V),this.showGrid&&(a.moveTo(y,x),a.lineTo(C,x))),a.stroke()}a.closePath()}}const pC={createTitle(){this.titleDOM=document.createElement("div"),this.titleDOM.className="ev-chart-title",this.wrapperDOM.appendChild(this.titleDOM)},initTitle(){this.isInitTitle||this.createTitle(),this.updateTitle(),this.isInitTitle=!0},showTitle(){this.titleDOM.style.display="block",this.wrapperDOM.style.paddingTop=`${this.options.title.height}px`},hideTitle(){this.titleDOM.style.display="none",this.wrapperDOM.style.paddingTop="0px"},updateTitle(){const t=this.options.title;Object.keys(t.style).forEach(e=>{this.titleDOM.style[e]=t.style[e]}),this.titleDOM.textContent=t.text,this.titleDOM.style.height=`${t.height}px`,this.titleDOM.style.lineHeight=`${t.height}px`}},gC={createLegendLayout(){var t,e;this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",(e=(t=this.options)==null?void 0:t.legend)!=null&&e.allowResize&&(this.resizeDOM=document.createElement("div"),this.resizeDOM.className="ev-chart-resize-bar",this.ghostDOM=document.createElement("div"),this.ghostDOM.className="ev-chart-resize-ghost",this.wrapperDOM.appendChild(this.resizeDOM)),this.useTable?(this.legendTableDOM=document.createElement("table"),this.legendTableDOM.className="ev-chart-legend--table",this.setLegendColumnHeader(),this.legendBoxDOM.appendChild(this.legendTableDOM),this.legendDOM.style.overflow="auto"):(this.legendBoxDOM.style.overflowX="hidden",this.legendBoxDOM.style.overflowY="auto",this.legendBoxDOM.style.height="100%"),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM),this.options.legend.virtualScroll&&!this.useTable&&(this.legendTopSpacer=document.createElement("div"),this.legendTopSpacer.className="ev-chart-legend--top-spacer",this.legendTopSpacer.style.clear="both",this.legendTopSpacer.style.opacity=0,this.legendBottomSpacer=document.createElement("div"),this.legendBottomSpacer.className="ev-chart-legend--bottom-spacer",this.legendBottomSpacer.style.clear="both",this.legendBottomSpacer.style.opacity=0,this.legendBoxDOM.appendChild(this.legendTopSpacer),this.legendBoxDOM.appendChild(this.legendBottomSpacer),this.updateVisibleRowCountFrameId=requestAnimationFrame(()=>{this.updateVisibleRowCount()}))},setLegendColumnHeader(){var i;const t=(i=this.options.legend)==null?void 0:i.table,e=t.columns;["color",...Object.keys(e)].forEach(s=>{var a,r;const l=document.createElement("th");if(l.className="ev-chart-legend--table__column-name",(a=e[s])!=null&&a.use||s==="color"||s==="name"){const c=e[s],d=(c==null?void 0:c.title)??"";l.textContent=d,l.setAttribute("title",d),l.dataset.type=d,O.setDOMStyle(l,(r=t==null?void 0:t.style)==null?void 0:r.header),this.legendTableDOM.append(l)}})},initLegend(){var t,e;this.isHeatMapType=this.options.type==="heatMap",this.useTable=!!((e=(t=this.options.legend)==null?void 0:t.table)!=null&&e.use)&&this.options.type!=="heatmap"&&this.options.type!=="scatter",this.legendItemHeight=18,this.isInitLegend||this.createLegendLayout(),this.isHeatMapType?(this.initEventForColorLegend(),this.addColorLegendList()):(this.initEvent(),this.addLegendList()),this.initResizeEvent(),this.isInitLegend=!0,this.isLegendMove=!1},updateVisibleRowCount(){const t=this.options.legend.position==="right"||this.options.legend.position==="left",e=this.legendBoxDOM.clientHeight,n=this.legendBoxDOM.clientWidth,i=Math.max(this.options.legend.width-8,1),s=Object.values(this.seriesList).filter(l=>l.showLegend!==!1).length;this.itemsPerRow=t?1:Math.floor(n/i),this.totalRowCount=Math.ceil(s/this.itemsPerRow),this.visibleRowCount=e>this.legendItemHeight?Math.round(e/this.legendItemHeight)+1:this.totalRowCount},updateStartEndRowIndex(){var e;const t=Math.max(Math.floor(((e=this.legendBoxDOM)==null?void 0:e.scrollTop)/this.legendItemHeight),0);this.startRowIndex=Math.min(t,Math.max(this.totalRowCount-this.visibleRowCount,0)),this.endRowIndex=this.startRowIndex+this.visibleRowCount+1},renderVisibleLegends(){this.updateStartEndRowIndex();const t=this.legendBoxDOM.querySelectorAll(".ev-chart-legend-container");if(t&&t.length)for(const c of t)c.remove();const e=this.totalRowCount*this.legendItemHeight,n=this.startRowIndex*this.legendItemHeight,i=Math.max(e-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${i}px`;const s=this.startRowIndex*this.itemsPerRow,l=this.endRowIndex*this.itemsPerRow,a=this.data.groups.at(0);let r=[];if(a?r=a.filter(c=>this.seriesList[c].showLegend).map(c=>[c,this.seriesList[c]]):r=Object.entries(this.seriesList).filter(([,c])=>c.showLegend),r&&r.length)for(let c=s;c<l&&c<r.length;c++){const[,d]=r[c];this.addLegend(d)}},addLegendList(){const{groups:t}=this.data,{seriesList:e}=this;this.options.legend.virtualScroll&&!this.useTable?this.renderVisibleLegendsFrameId=requestAnimationFrame(()=>{this.renderVisibleLegends()}):(this.addLegendForGroups(t,e,this.useTable),this.addStandaloneLegends(e,this.useTable))},addLegendForGroups(t,e,n){t==null||t.forEach(i=>{i==null||i.forEach(s=>{const l=e[s];l&&l.showLegend&&this.addLegendBasedOnType(l,n)})})},addStandaloneLegends(t,e){Object.values(t).forEach(n=>{!n.isExistGrp&&n.showLegend&&this.addLegendBasedOnType(n,e)})},addLegendBasedOnType(t,e){e?this.addLegendWithValues(t):this.addLegend(t)},addColorLegendList(){const t=this.seriesList;Object.values(t).forEach(e=>{if(!e.isExistGrp&&e.showLegend){const{colorState:n,valueOpt:i}=e,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=i,d=n.length,h=r?d-2:d-1;for(let u=0;u<d;u++){const{id:f,color:m,label:g=""}=n[u],p=s+a*u;let y=p+a;u<h?y-=.1**c:y=l+.1**c;let C=g;if(!C)if(C=`${p.toFixed(c)} - ${y.toFixed(c)}`,s===void 0||l===void 0)if(u===0)C="0";else break;else{if(p>l)break;a<=1&&c===0&&(C=p)}this.addLegend({cId:f,color:m,name:C,show:!0})}}})},getContainerDOM(t){let e=null;const n=t.target.dataset.type;return n==="container"?e=t.target:["name","color","min","max","avg","total","last"].includes(n)&&(e=t.target.parentElement,e!=null&&e.series||(e=e.parentElement)),e},initEvent(){if(this.isInitLegend)return;const t={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`,value:`ev-chart-legend${this.useTable?"--table__value":"-value"}`},e=(l,a)=>{const r=l==null?void 0:l.getElementsByClassName(t.color)[0],c=l==null?void 0:l.getElementsByClassName(t.name)[0],d=l==null?void 0:l.getElementsByClassName(t.value),h=l==null?void 0:l.series;if(r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a,d&&d.length)for(const u of d)u.style.color=a;h.show=!1,l.dataset.inactive=!0},n=(l,a)=>{var f,m;let r;const c=l==null?void 0:l.getElementsByClassName(t.color)[0],d=l==null?void 0:l.getElementsByClassName(t.name)[0],h=l==null?void 0:l.getElementsByClassName(t.value),u=l==null?void 0:l.series;if(typeof u.color!="string"?r=u.color[u.color.length-1][1]:r=u.color,u.type==="line"&&u.fill?(c.style.height="8px",c.style.backgroundColor=O.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const g of h){const p=(m=(f=this.options.legend.table)==null?void 0:f.columns[g.dataset.type])==null?void 0:m.style;g.style.color=p!=null&&p.color?p.color:a}u.show=!0,l.dataset.inactive=!1},i=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!1})},s=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!0})};this.onLegendBoxClick=l=>{var y;const{legend:a}=this.options;if(a!=null&&a.stopClickEvt)return;const{chartIdx:r}=this.data,c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(t.color)[0],h=c==null?void 0:c.getElementsByClassName(t.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false";if(!d||!h)return;if(a.clickMode==="active"){const C=Array.from(this.legendBoxDOM.getElementsByClassName(t.container));C.every(T=>T.dataset.inactive==="false")?(C.forEach(T=>{e(T,a.inactive)}),i(),n(c,a.color),this.seriesInfo.count=1):u?(e(c,a.inactive),this.seriesInfo.count--):u||(n(c,a.color),this.seriesInfo.count++),C.every(T=>T.dataset.inactive==="true")&&(C.forEach(T=>{n(T,a.color)}),s(),this.seriesInfo.count=C.length)}if(a.clickMode!=="active"){if(u&&this.seriesInfo.count===1)return;u?(e(c,a.inactive),this.seriesInfo.count--):(n(c,a.color),this.seriesInfo.count++)}if(this.brushSeries){const C=[...this.brushSeries.list];C[r]=this.seriesList,this.brushSeries.list=C,this.brushSeries.chartIdx=r}((y=this.options.eventBehavior)==null?void 0:y.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=Object.values(this.seriesList).filter(C=>C.show).map(C=>C.sId),g=m.length===Object.values(this.seriesList).length,p={e:l,data:{seriesIds:g?[]:m,isActiveAll:g}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](p)},this.onLegendBoxLeave=()=>{this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})},this.onLegendBoxOver=l=>{var d;const a=this.getContainerDOM(l);if(!a){this.onLegendBoxLeave();return}const c={sId:(d=a==null?void 0:a.series)==null?void 0:d.sId,type:this.options.type};this.legendHover=c,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:c},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.addEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.addEventListener("scroll",this.renderVisibleLegends.bind(this))),this.initResizeEvent()},initEventForColorLegend(){if(this.isInitLegend)return;const t={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`},e=(l,a)=>{var f;const r=l==null?void 0:l.getElementsByClassName(t.color)[0],c=l==null?void 0:l.getElementsByClassName(t.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a;const u=d.colorState.findIndex(m=>m.id===h);u>-1&&(d.colorState[u].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var f,m;const r=l==null?void 0:l.getElementsByClassName(t.color)[0],c=l==null?void 0:l.getElementsByClassName(t.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=(m=l==null?void 0:l.series)==null?void 0:m.color,c.style.color=a;const u=d.colorState.findIndex(g=>g.id===h);u>-1&&(d.colorState[u].show=!0),l.dataset.inactive=!1},i=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!1})},s=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!0})};this.onLegendBoxClick=l=>{var C;const a=this.options.legend;if(a!=null&&a.stopClickEvt)return;const r=Object.values(this.seriesList)[0],c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(t.color)[0],h=c==null?void 0:c.getElementsByClassName(t.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false",f=r.colorState.filter(b=>b.show).length;if(!d||!h)return;if(a.clickMode==="active"){const b=Array.from(this.legendBoxDOM.getElementsByClassName(t.container));b.every(k=>k.dataset.inactive==="false")?(b.forEach(k=>{e(k,a.inactive)}),i(),n(c,a.color)):u?e(c,a.inactive):u||n(c,a.color),b.every(k=>k.dataset.inactive==="true")&&(b.forEach(k=>{n(k,a.color)}),s())}if(a.clickMode!=="active"){if(u&&f===1)return;u?e(c,a.inactive):n(c,a.color)}((C=this.options.eventBehavior)==null?void 0:C.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=r.colorState.filter(b=>b.show),g=m.map(b=>+b.id.split("#")[1]),p=r.colorState.length===m.length,y={e:l,data:{seriesIndices:p?[]:g,isActiveAll:p}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](y)},this.onLegendBoxLeave=()=>{this.legendHover=null,Object.values(this.seriesList)[0].colorState.forEach(a=>{a.state="normal"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:!0})},this.onLegendBoxOver=l=>{var h,u;const a=(h=Object.values(this.seriesList))==null?void 0:h[0],r=this.getContainerDOM(l);if(!r){this.onLegendBoxLeave();return}const c=(u=r==null?void 0:r.series)==null?void 0:u.cId,d={sId:c,type:this.options.type};this.legendHover=d,a.colorState.forEach(f=>{f.state=f.id===c?"highlight":"downplay"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:d},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.initResizeEvent()},initResizeEvent(){this.onResizeMouseDown=t=>{t.stopPropagation(),t.preventDefault();const e=this.options,n=e.legend.position,i=e.title.show?e.title.height:0,s=this.ghostDOM;this.resizeDOM.style.display="none",this.wrapperDOM.appendChild(s),n==="left"||n==="right"?(s.style.top=`${i}px`,s.style.left=this.resizeDOM.style.left,s.style.right=this.resizeDOM.style.right,s.style.height=this.resizeDOM.style.height):(s.classList.add("horizontal"),n==="top"?s.style.top=this.resizeDOM.style.top:n==="bottom"&&(s.style.bottom=this.resizeDOM.style.bottom)),this.wrapperDOM.addEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.addEventListener("mouseup",this.mouseUp,!1)},this.resizeDOM&&(this.resizeDOM.addEventListener("mousedown",this.onResizeMouseDown),this.mouseMove=this.onMouseMove.bind(this),this.mouseUp=this.onMouseUp.bind(this))},updateLegend(){this.resetLegend(),this.isHeatMapType?this.addColorLegendList():this.addLegendList()},updateLegendTableValues(){var i,s,l,a,r;const t=(l=(s=(i=this.options)==null?void 0:i.legend)==null?void 0:s.table)==null?void 0:l.columns,e=this.getAggregations(),n=(a=this.legendBoxDOM)==null?void 0:a.getElementsByClassName("ev-chart-legend--table__row");if(n&&n.length)for(const c of n){const d=c==null?void 0:c.getElementsByClassName("ev-chart-legend--table__value");if(d&&d.length)for(const h of d){const u=h.dataset.type;if(u!=="name"){const f=c.series.sId,m=(r=e==null?void 0:e[f])==null?void 0:r[u];h.textContent=this.getFormattedValue(t[u],m)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var e,n;const t=this.legendBoxDOM;if(t){if(this.useTable){const i=this.legendTableDOM;for(;i.hasChildNodes();)i.removeChild(i.firstChild);this.setLegendColumnHeader()}else if(this.options.legend.virtualScroll)((n=(e=this.legendDOM)==null?void 0:e.style)==null?void 0:n.display)==="none"?this.legendNeedsUpdate=!0:(this.updateVisibleRowCount(),this.renderVisibleLegends());else for(;t.hasChildNodes();)t.removeChild(t.firstChild);this.seriesInfo.count=0}},destroyLegend(){const t=this.legendDOM;this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),t&&(t.remove(),this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.isInitLegend=!1,this.seriesInfo.count=0)},addLegend(t){const e=this.options.legend,n=document.createElement("div"),i=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!t.show,n.series=t,i.className="ev-chart-legend-color",t.type==="line"&&t.point&&!t.fill&&(i.className+=" ev-chart-legend-color--point-line"),s.className="ev-chart-legend-name";let l;t.show?typeof t.color!="string"?l=t.color[t.color.length-1][1]:l=t.color:l=e.inactive,t.type==="line"&&t.fill?(i.style.height="8px",i.style.backgroundColor=t.show?O.rgbaAdjustHalfOpacity(l):e.inactive,i.style.border=`1px solid ${l}`):i.style.backgroundColor=l,i.dataset.type="color",s.style.color=e.color,s.textContent=t.name,s.setAttribute("title",t.name),s.dataset.type="name",n.appendChild(i),n.appendChild(s),e.position==="top"||e.position==="bottom"?(n.style.width=`${e.width-8}px`,n.style.margin="0 4px"):n.style.width="100%",n.style.height=`${this.legendItemHeight}px`,n.style.display="inline-block",n.style.overflow="hidden",n.dataset.type="container",this.legendBoxDOM.insertBefore(n,this.legendBottomSpacer),t.show&&this.seriesInfo.count++},addLegendWithValues(t){var h,u,f,m,g;const e=this.options.legend,n=(h=e==null?void 0:e.table)==null?void 0:h.columns,i=(u=this.getAggregations())==null?void 0:u[t==null?void 0:t.sId];if(!i||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!t.show,O.setDOMStyle(s,(m=(f=e.table)==null?void 0:f.style)==null?void 0:m.row),s.series=t,s.dataset.type="container";const l=document.createElement("td");l.className="ev-chart-legend--table__color-wrapper",l.dataset.type="color";const a=document.createElement("div");a.className="ev-chart-legend--table__color",a.dataset.type="color";let r;switch(t.show?typeof t.color!="string"?r=t.color[t.color.length-1][1]:r=t.color:r=e.inactive,t.type){case"line":{t.fill?(a.style.backgroundColor=O.rgbaAdjustHalfOpacity(r),a.style.border=`1px solid ${r}`):(t.point&&(a.className+=" ev-chart-legend--table__color--point-line"),a.className+=" ev-chart-legend--table__color--line",a.style.backgroundColor=r);break}case"bar":case"pie":default:{a.style.height="10px",a.style.backgroundColor=r;break}}t.type==="line"&&t.fill?(a.style.height="8px",a.style.backgroundColor=t.show?O.rgbaAdjustHalfOpacity(r):e.inactive,a.style.border=`1px solid ${r}`):a.style.backgroundColor=r,l.appendChild(a),s.appendChild(l);const c=document.createElement("td");c.className="ev-chart-legend--table__name",c.style.color=t.show?e.color:e.inactive,c.textContent=t.name,c.setAttribute("title",t.name),c.dataset.type="name",O.setDOMStyle(c,(g=n==null?void 0:n.name)==null?void 0:g.style),t.show||(c.style.color=e.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(p=>{var y;if(p!=="name"&&n[p].use){const C=this.getFormattedValue(n[p],i[p]),b=document.createElement("td");b.className="ev-chart-legend--table__value",b.style.color=t.show?e.color:e.inactive,b.textContent=C,b.dataset.type=p.toString(),O.setDOMStyle(b,(y=n[p])==null?void 0:y.style),t.show||(b.style.color=e.inactive),s.appendChild(b)}}),this.legendTableDOM.appendChild(s),t.show&&this.seriesInfo.count++},setLegendPosition(){var g,p,y,C,b,w,T,k,M;const t=this.options,e=(g=t==null?void 0:t.legend)==null?void 0:g.position,n=(p=this.wrapperDOM)==null?void 0:p.style,i=(y=this.legendDOM)==null?void 0:y.style,s=(C=this.legendBoxDOM)==null?void 0:C.style,l=(b=this.resizeDOM)==null?void 0:b.style;let a,r;const c=(w=t==null?void 0:t.title)!=null&&w.show?(T=t==null?void 0:t.title)==null?void 0:T.height:0,d=c+((k=t==null?void 0:t.legend)==null?void 0:k.height),{top:h=0,bottom:u=0,left:f=0,right:m=0}=((M=t==null?void 0:t.legend)==null?void 0:M.padding)??{};if(!(!n||!i))switch(s.padding=`${h}px ${m}px ${u}px ${f}px`,e){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${t.legend.height-r}px`,i.top=`${c}px`,i.right="",i.bottom="",i.left="",i.width=`${a.width}px`,i.height=`${t.legend.height+(l?4:0)}px`,l&&(l.top=`${d}px`,l.right="",l.bottom="",l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"right":n.padding=`${c}px ${t.legend.width}px 0 0`,a=this.chartDOM.getBoundingClientRect(),s.width=`${t.legend.width-10}px`,s.maxHeight=`${a.height}px`,i.paddingLeft="10px",i.top=`${c}px`,i.right="0px",i.bottom="",i.left="",i.width=`${t.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right=`${t.legend.width}px`,l.bottom="",l.left="",l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break;case"bottom":n.padding=`${c}px 0 ${t.legend.height}px 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${t.legend.height-r}px`,i.top="",i.right="",i.bottom="0px",i.left="0px",i.width=`${a.width}px`,i.height=`${t.legend.height+(l?4:0)}px`,l&&(l.top="",l.right="",l.bottom=`${t.legend.height}px`,l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"left":n.padding=`${c}px 0 0 ${t.legend.width}px`,a=this.chartDOM.getBoundingClientRect(),s.width=`${t.legend.width}px`,s.maxHeight=`${a.height}px`,s.display="absolute",s.bottom="0px",i.top=`${c}px`,i.right="",i.bottom="",i.left="0px",i.width=`${t.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right="",l.bottom="",l.left=`${t.legend.width}px`,l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break}},updateLegendContainerSize(){var n;if(!this.options||!this.legendBoxDOM)return;const t=(n=this.options)==null?void 0:n.legend,e=this.legendBoxDOM.getElementsByClassName("ev-chart-legend-container");if(e)for(let i=0;i<e.length;i++)t.position==="top"||t.position==="bottom"?(e[i].style.width=`${t.width-8}px`,e[i].style.margin="0 4px"):e[i].style.width="100%"},onMouseMove(t){t.stopPropagation(),t.preventDefault();const e=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,i=this.wrapperDOM.offsetHeight,s=this.options.title.show?this.options.title.height:0,l=this.options.legend.position,a=150,r=70,c=120,d=20;let h;switch(l){case"left":h=t.clientX-e.left,h<c?h=c:h>n-a&&(h=n-a),this.ghostDOM.style.left=`${h}px`;break;case"right":h=t.clientX-e.left,h<a?h=a:h>n-c&&(h=n-c),this.ghostDOM.style.left=`${h}px`;break;case"top":h=t.clientY-e.top,h<d+s?h=d+s:h>i-r&&(h=i-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=t.clientY-e.top,h<r+s?h=r+s:h>i-d&&(h=i-d),this.ghostDOM.style.bottom=`${this.wrapperDOM.offsetHeight-h}px`;break}this.isLegendMove=!0},onMouseUp(t){t.stopPropagation(),t.preventDefault(),this.wrapperDOM.removeEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.removeEventListener("mouseup",this.mouseUp,!1);const e=this.options,n=e.legend.position,i=this.resizeDOM.style,s=this.legendDOM.style,l=this.legendBoxDOM.style,a=this.ghostDOM.style,r=this.wrapperDOM.style,c=e.title.show?e.title.height:0,d=+this.legendDOM.style.paddingLeft.replace("px","");let h;if(this.isLegendMove)switch(n){case"top":i.top=a.top,h=+a.top.replace("px",""),s.height=`${h-c}px`,l.height=`${h-c-4}px`,e.legend.height=h-c-4,r.padding=`${h}px 0 0 0`;break;case"right":i.left=a.left,h=+a.left.replace("px",""),s.width=`${this.wrapperDOM.offsetWidth-h-4}px`,l.width=`${this.wrapperDOM.offsetWidth-h-4-d}px`,e.legend.width=this.wrapperDOM.offsetWidth-h-4,r.padding=`${c}px ${this.wrapperDOM.offsetWidth-h}px 0 0`;break;case"bottom":i.bottom=a.bottom,h=this.wrapperDOM.offsetHeight-+a.bottom.replace("px",""),s.height=`${this.wrapperDOM.offsetHeight-h}px`,l.height=`${h-c-4}px`,e.legend.height=this.wrapperDOM.offsetHeight-h,r.padding=`${c}px 0 ${this.wrapperDOM.offsetHeight-h}px 0`;break;case"left":i.left=a.left,h=+a.left.replace("px",""),s.width=`${h}px`,l.width=`${h}px`,e.legend.width=h,r.padding=`${c}px 0 0 ${h-4}px`;break}i.display="block",this.ghostDOM.remove(),this.isLegendMove&&(this.render(),this.isLegendMove=!1)},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block"),this.legendNeedsUpdate&&this.options.legend.virtualScroll&&!this.useTable&&(this.legendNeedsUpdate=!1,this.updateVisibleRowCount(),this.renderVisibleLegends())},hideLegend(){var l,a,r,c,d;const t=this.options,e=(l=this.wrapperDOM)==null?void 0:l.style,n=(a=this.resizeDOM)==null?void 0:a.style,i=(r=this.legendDOM)==null?void 0:r.style,s=(c=t==null?void 0:t.title)!=null&&c.show?(d=t==null?void 0:t.title)==null?void 0:d.height:0;!i||!e||(n&&(n.display="none"),i.display="none",i.width="0",i.height="0",e.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:t,decimalPoint:e},n){if(n==null)return"Null";let i;return t&&(i=t(+n)),(!t||typeof i!="string")&&(i=O.labelSignFormat(+n,e)),i}},Ur=28,bC={width:70,height:60},yC={createLegendLayout(){this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",this.containerDOM=document.createElement("div"),this.containerDOM.className="ev-chart-legend-container",this.legendBoxDOM.appendChild(this.containerDOM),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM)},initLegend(){this.isInitLegend||(this.createLegendLayout(),this.createLegend()),Object.values(this.seriesList).forEach(t=>{this.setLegendStyle(t)}),this.initEvent(),this.isInitLegend=!0,this.legendDragInfo={dragging:!1,isStart:!0}},initEvent(){this.isInitLegend||(this.onLegendMouseDown=t=>{t.stopPropagation(),t.preventDefault();const e=t.target.dataset.type;let n;if(e==="handle")n=t.target;else if(e==="handle-btn")n=t.target.parentElement;else if(e==="handle-btn-color")n=t.target.parentElement.parentElement;else return;const i=Object.values(this.seriesList);if(!i.length)return;const{colorState:s}=i[0],{start:l,end:a}=s[0];s[0].selectedValue=null,this.clearOverlay(),this.legendDragInfo.dragging=!0,this.legendDragInfo.isStart=l!==a?n.className.includes("start"):this.legendDragInfo.isStart,n.classList.add("dragging"),this.legendBoxDOM.addEventListener("mousemove",this.onLegendMouseMove,!1),this.legendBoxDOM.addEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendMouseMove=t=>{t.stopPropagation(),t.preventDefault();const{dragging:e,isStart:n}=this.legendDragInfo;if(e){let i=this.getSelectedValue(t);i=this.isSide?100-i:i;const s=n?"start":"end",l=Object.values(this.seriesList);if(!l.length)return;const{colorState:a}=l[0],{start:r,end:c}=a[0];if(n&&i>c||!n&&i<r)return;a[0][s]=i,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})}},this.onLegendMouseUp=()=>{this.legendDragInfo.dragging=!1;const t=this.containerDOM.getElementsByClassName("ev-chart-legend-handle dragging")[0];t==null||t.classList.remove("dragging"),this.legendBoxDOM.removeEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendBoxOver=t=>{const e=t.target.dataset.type,n=Object.values(this.seriesList);if(!n.length)return;const{colorState:i,valueOpt:s}=n[0],l=i[0];let a=this.getSelectedValue(t);if(a=this.isSide?100-a:a,["line","thumb","layer","overlay","overlay-item"].includes(e))if(l.start<=a&&a<=l.end)l.selectedValue=a,this.createLegendOverlay(a,s);else return;else if(["handle","handle-btn","handle-btn-color"].includes(e)){const r=t.target.className.includes("start");l.selectedValue=r?l.start:l.end,this.clearOverlay()}else return;this.legendHover={sId:"gradient",type:this.options.type},this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.onLegendBoxLeave=()=>{this.legendDragInfo.dragging=!1,this.legendHover=null,this.clearOverlay();const t=Object.values(this.seriesList);if(!t.length)return;const{colorState:e}=t[0];e[0].selectedValue=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.legendBoxDOM.addEventListener("mousedown",this.onLegendMouseDown),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave))},getSelectedValue(t){const{x:e,y:n,width:i,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?e:n,r=l?i:s;let c=l?t.clientX:t.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+Je(d,r)},updateLegend(){this.resetLegend(),this.createLegend(),Object.values(this.seriesList).forEach(t=>{this.setLegendStyle(t)})},resetLegend(){const t=this.containerDOM;if(t)for(;t.hasChildNodes();)t.removeChild(t.firstChild)},clearOverlay(){const t=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],e=t==null?void 0:t.getElementsByClassName("ev-chart-legend-overlay")[0];if(e){t.removeChild(e);const i=t.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(i&&i.length)for(const s of i)s.style.opacity=1}},createLegendOverlay(t,e){this.clearOverlay();const n=this.legendHandleSize,{min:i,max:s}=e;if(i===void 0||s===void 0)return;const l=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],a=document.createElement("div");a.className="ev-chart-legend-overlay",a.dataset.type="overlay";const r=document.createElement("div");r.className="ev-chart-legend-overlay-tooltip",r.innerText=Math.floor(i+(s-i)*(t/100));const c=document.createElement("span");c.className="ev-chart-legend-overlay-item",c.dataset.type="overlay-item";let d,h;const u=Math.floor(n/2)+14;this.isSide?(h=`top:${100-t}%;left:${u}px;transform:translateY(-50%);`,d=`top:${100-t}%;transform:translateY(-50%);`):(h=`top:-${u}px;left:${t}%;transform:translateX(-50%);`,d=`left:${t}%;transform:translateX(-50%);`),d+=`width:${n-10}px;height:${n-10}px;`,r.style.cssText=h,c.style.cssText=d,a.appendChild(r),a.appendChild(c),l==null||l.appendChild(a);const f=l==null?void 0:l.getElementsByClassName("ev-chart-legend-thumb")[0];if(f){const m=f.children;if(m&&m.length)for(const g of m)g.style.opacity=.2}},createLegendHandle(t){const e=document.createElement("span");e.className=`ev-chart-legend-handle-btn-color ${t}`,e.dataset.type="handle-btn-color";const n=document.createElement("div");n.className=`ev-chart-legend-handle-btn ${t}`,n.dataset.type="handle-btn",n.appendChild(e);const i=document.createElement("div");return i.className=`ev-chart-legend-handle ${t}`,i.dataset.type="handle",i.appendChild(n),i},createLegendLabel(){const t=document.createElement("span");t.className="ev-chart-legend-label-text";const e=document.createElement("div");return e.className="ev-chart-legend-label",e},createLegend(){if(!Object.values(this.seriesList).length)return;const t=this.options.legend;this.isSide=!["top","bottom"].includes(t.position);const e=this.isSide?t.width:t.height;this.legendHandleSize=e>Ur?Ur:e;const n=this.legendHandleSize,i=this.createLegendHandle(this.isSide?"end":"start",n),s=this.createLegendHandle(this.isSide?"start":"end",n),l=document.createElement("div");l.className="ev-chart-legend-line-layer",l.dataset.type="line-layer";const a=document.createElement("div");a.className="ev-chart-legend-thumb",a.dataset.type="thumb",a.appendChild(this.createLegendLabel()),a.appendChild(this.createLegendLabel());const r=document.createElement("div");r.className="ev-chart-legend-line",r.dataset.type="line",r.appendChild(l),r.appendChild(a),this.containerDOM.appendChild(r),this.containerDOM.appendChild(i),this.containerDOM.appendChild(s)},setLegendStyle(t){const e=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:i,colorState:s}=t,{min:l,max:a,decimalPoint:r}=i,{start:c,end:d}=s[0],h=t.getColorForGradient(c),u=t.getColorForGradient(d);let f=`linear-gradient(to ${e}, `;f+=`${h}, ${u})`;const m=Math.floor(n/2)+14;let g=`width:${n}px;height:${n}px;`,p,y,C,b=`background:${f};`;this.isSide?(g+=`margin-top:-${n/2}px;`,p=`left:${m}px;transform:translateY(-50%);top:`,y=`top:${100-d}%;`,C=`top:${100-c}%;`,b+=`top:${100-d}%;height:${d-c}%;`):(g+=`margin-left:-${n/2}px;`,p=`top:-${m}px;transform:translateX(-50%);left:`,y=`left:${c}%;`,C=`left:${d}%;`,b+=`left:${c}%;width:${d-c}%;`);const w=(l+(a-l)*(c/100)).toFixed(r),T=(l+(a-l)*(d/100)).toFixed(r),k=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];k.style.cssText=b;const M=k.getElementsByClassName("ev-chart-legend-label");M[0].style.cssText=`${p}0%;`,M[1].style.cssText=`${p}100%;`,l!==void 0&&a!==void 0&&(M[0].innerText=this.isSide?T:w,M[1].innerText=this.isSide?w:T);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=g+y,V[1].style.cssText=g+C;const x=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");x[0].style.backgroundColor=this.isSide?u:h,x[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var y,C,b,w;const t=this.options,e=(y=t==null?void 0:t.legend)==null?void 0:y.position,{width:n,height:i}=bC,s=this.legendHandleSize,l=(C=t==null?void 0:t.title)!=null&&C.show?(b=t==null?void 0:t.title)==null?void 0:b.height:0,a=l+i,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((w=t==null?void 0:t.legend)==null?void 0:w.padding)??{},u=this.wrapperDOM.style;if(!u)return;let f,m,g,p;switch(e){case"top":u.padding=`${a}px 0 0 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%",m+=`height${i}px;`,f=`width:${p.width}px;`,f+=`height:${i}px;`,f+=`top:${l}px;`;break;case"right":u.padding=`${l}px ${n}px 0 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+=`width:${n}px;`,m+="height:100%;",m+=`max-height:${p.height}px;`,f=`width:${n}px;`,f+=`height:${p.height}px;`,f+=`top:${l}px;right:0px;`;break;case"bottom":u.padding=`${l}px 0 ${i}px 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%;",m+=`height:${i}px;`,f=`width:${p.width}px;`,f+=`height:${i}px;`,f+="bottom:0px;left:0px;";break;case"left":u.padding=`${l}px 0 0 ${n}px`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+="display:absolute;",m+="bottom:0px;",m+=`width:${n}px;`,m+="height:100%;",m+=`maxHeight:${p.height}px;`,f=`width:${n}px;`,f+=`height:${p.height}px;`,f+=`top:${l}px;left:0px`;break}if(["top","bottom"].includes(e)){const T=p.width/2;g=`left:${p.width/2-T/2}px;`,g+=`width:${T}px;`,g+=`height:${s}px;`,g+="padding:4px 0;",g+="margin:0 4px;"}else{const T=p.height/2;g=`top:${p.height/2-T/2}px;`,g+="left:5px;",g+=`width:${s}px;`,g+=`height:${T}px;`,g+="padding:0 4px;",g+="margin:4px 0;"}this.containerDOM.style.cssText=g,this.legendBoxDOM.style.cssText=m,this.legendDOM.style.cssText=f},updateLegendContainerSize(){Object.values(this.seriesList).forEach(t=>{this.setLegendStyle(t)})},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block")},hideLegend(){var s,l,a,r;const t=this.options,e=(s=this.wrapperDOM)==null?void 0:s.style,n=(l=this.legendDOM)==null?void 0:l.style,i=(a=t==null?void 0:t.title)!=null&&a.show?(r=t==null?void 0:t.title)==null?void 0:r.height:0;!n||!e||(n.display="none",n.width="0",n.height="0",e.padding=`${i}px 0 0 0`)}},xC={initScrollbar(){var t,e,n,i,s,l;(n=(e=(t=this.options.axesX)==null?void 0:t[0])==null?void 0:e.scrollbar)!=null&&n.use&&this.initScrollbarInfo(this.options.axesX,"x"),(l=(s=(i=this.options.axesY)==null?void 0:i[0])==null?void 0:s.scrollbar)!=null&&l.use&&this.initScrollbarInfo(this.options.axesY,"y")},initScrollbarInfo(t,e){var s,l,a,r,c,d;const n=this.scrollbar[e],i=He({},(s=t==null?void 0:t[0])==null?void 0:s.scrollbar,Yr.scrollbar);Object.keys(i).forEach(h=>{n[h]=i[h]}),n.resetPosition&&(n.range=(a=(l=t==null?void 0:t[0])==null?void 0:l.range)!=null&&a.length?[...t[0].range]:null,this.updateScrollbarAnchorEdge(e)),n.isInit||(n.type=(r=t==null?void 0:t[0])==null?void 0:r.type,n.range=(d=(c=t==null?void 0:t[0])==null?void 0:c.range)!=null&&d.length?[...t[0].range]:null,this.initScrollbarRange(e),this.updateScrollbarAnchorEdge(e),this.createScrollbarLayout(e),this.createScrollbar(e),this.createScrollEvent(e),n.isInit=!0)},initScrollbarRange(t){var i;const e=this.scrollbar[t],n=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels;if((i=e.range)!=null&&i.length&&n.length){const[s,l]=e.range;if(ve(s)&&ve(l)){const a=this.getScrollbarLimits(t);if(!a)return;const{limitMin:r,limitMax:c}=a,d=l-s,h=c-r;if(d>=h)e.range[0]=r,e.range[1]=c;else{let u=+s<r?r:+s,f=u+d;f>c&&(f=c,u=f-d,u<r&&(u=r)),e.range[0]=u,e.range[1]=f}}}},updateScrollbarInfo(t,e){var r,c,d,h,u,f,m,g,p,y,C,b,w,T,k;const{axesX:n,axesY:i}=this.options,s=t==="x"?n:i;if(!this.scrollbar[t].isInit&&((c=(r=s==null?void 0:s[0])==null?void 0:r.scrollbar)!=null&&c.use)&&((d=s==null?void 0:s[0])!=null&&d.range)){this.initScrollbarInfo(s,t);return}else if(!((h=s==null?void 0:s[0].scrollbar)!=null&&h.use)||no((u=s==null?void 0:s[0])==null?void 0:u.range)){this.destroyScrollbar(t);return}const l=t==="x"?this.axesX:this.axesY,a=!Fe((f=s==null?void 0:s[0])==null?void 0:f.range,(m=l==null?void 0:l[0])==null?void 0:m.range);if(a||e){const M=t==="x"?(y=(p=(g=this.options.axesX)==null?void 0:g[0])==null?void 0:p.scrollbar)==null?void 0:y.resetPosition:(w=(b=(C=this.options.axesY)==null?void 0:C[0])==null?void 0:b.scrollbar)==null?void 0:w.resetPosition;if(a){const V=(T=s==null?void 0:s[0])==null?void 0:T.range,x=this.scrollbar[t].range;if(!M&&(V!=null&&V.length)&&(x!=null&&x.length)){const S=V[1]-V[0],L=this.scrollbar[t].anchorEdge,I=L?this.getScrollbarLimits(t):null;L==="start"&&I?this.scrollbar[t].range=[I.limitMin,I.limitMin+S]:L==="end"&&I?this.scrollbar[t].range=[I.limitMax-S,I.limitMax]:this.scrollbar[t].range=[x[0],x[0]+S]}else this.scrollbar[t].range=V!=null&&V.length?[...V]:null}this.initScrollbarRange(t),a&&this.updateScrollbarAnchorEdge(t)}this.scrollbar[t].use=!!((k=s==null?void 0:s[0].scrollbar)!=null&&k.use)},updateScrollbarPosition(t){var e,n,i,s;(e=this.scrollbar.x)!=null&&e.use&&((n=this.scrollbar.x)!=null&&n.isInit)&&this.setScrollbarPosition("x",t),(i=this.scrollbar.y)!=null&&i.use&&((s=this.scrollbar.y)!=null&&s.isInit)&&this.setScrollbarPosition("y",t)},createScrollbarLayout(t){const e=this.scrollbar[t];e.dom=document.createElement("div"),e.dom.className="ev-chart-scrollbar",e.dom.dataset.type="scrollbar";const n=document.createElement("div");n.className="ev-chart-scrollbar-container",n.dataset.type=t,e.dom.appendChild(n),this.wrapperDOM.appendChild(e.dom)},createScrollbar(t){const e=this.scrollbar[t],n=e.dom.children[0];this.createScrollbarTrack(n),this.createScrollbarThumb(n),e.showButton&&this.createScrollbarButton(n)},createScrollbarTrack(t){const e=document.createElement("div");e.className="ev-chart-scrollbar-track",e.dataset.type="track",t.appendChild(e)},createScrollbarThumb(t){const e=document.createElement("div");e.className="ev-chart-scrollbar-thumb",e.dataset.type="thumb",t.appendChild(e)},createScrollbarButton(t){const e=document.createElement("div");e.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-up",e.dataset.type="button";const n=document.createElement("i");n.className="ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon",n.dataset.type="button-icon",e.appendChild(n);const i=document.createElement("div");i.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",i.dataset.type="button";const s=document.createElement("i");s.className="ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon",s.dataset.type="button-icon",i.appendChild(s),t.appendChild(e),t.appendChild(i)},setScrollbarPosition(t,e){var V,x;const n=this.scrollbar[t];if(!n.use||!n.range)return;const i=n.dom,s=this.chartRect,l=e??this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(V=this.options.title)!=null&&V.show?(x=this.options.title)==null?void 0:x.height:0,c=t==="x",d=c?n.height:n.width,h=c?a.x2-a.x1:a.y2-a.y1,u=n.showButton?d:0,f=h-u*2,m=this.getScrollbarThumbSize(t,f),g=Math.max(0,f-m.size);m.position=Math.min(Math.max(m.position,0),g);let p="display: block;",y,C,b,w,T=`width:${u}px;height:${u}px;`;c?(p=`top: ${s.y2+r+l.top}px;`,p+=`left: ${a.x1}px;`,p+=`width: ${h}px;`,p+=` height: ${d}px;`,y="top: 0;",y+=`left: ${u}px;`,y+=`width: ${f}px;`,y+="height: 100%;",C=`width: ${m.size}px;`,C+="height: 100%;",C+=`left: ${m.position+u}px`,T+="transform:rotate(90deg);top: 0;",b=`${T}right:0;`,w=`${T}left:0;`):(p=`top: ${a.y1+r}px;`,p+=`left: ${a.x2+10}px;`,p+=`width: ${d}px;`,p+=`height: ${h}px;`,y=`top: ${u}px;`,y+="left: 0;",y+="width: 100%;",y+=`height: ${f}px;`,C="width: 100%;",C+=`height: ${m.size}px;`,C+=`bottom: ${m.position+u}px`,T+="left:0;",b=`${T}top: 0;`,w=`${T}bottom: 0;`),i.style.cssText=p;const k=i.getElementsByClassName("ev-chart-scrollbar-track");k[0].style.cssText=y,k[0].style.backgroundColor=n.background;const M=i.getElementsByClassName("ev-chart-scrollbar-thumb");if(M[0].style.cssText=C,M[0].style.backgroundColor=n.thumbStyle.background,M[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const S=i.getElementsByClassName("ev-chart-scrollbar-button-up"),L=Math.floor(f-m.size),I=Math.floor(m.position)>L?.5:1;S[0].style.cssText=`background-color: ${n.background};${b}`,S[0].style.opacity=I,S[0].children[0].style.display="block";const R=i.getElementsByClassName("ev-chart-scrollbar-button-down");R[0].style.cssText=`background-color: ${n.background};${w}`,R[0].style.opacity=Math.floor(m.position)<0?.5:1,R[0].children[0].style.display="block"}},getScrollbarThumbSize(t,e){var u,f,m,g;const n=this.scrollbar[t],[i,s]=n.range,l=n.type;let a,r,c=1,d=0,h=0;if(l==="step"){const p=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels,y=s-i+1;r=p.length;const C=e/r;a=C*y,h=C*i}else{const p=t==="x"?this.axesX:this.axesY,y=(u=this.minMax[t])==null?void 0:u[0],C=+y.max-+y.min,b=+s-+i;l==="time"&&(c=(g=p==null?void 0:p[0])==null?void 0:g.getInterval({minValue:y.min,maxValue:y.max,maxSteps:(m=(f=this.labelRange[t])==null?void 0:f[0])==null?void 0:m.max})),r=Math.ceil(C/c)+1,d=+y.min;const w=e/r,T=b/c+1,k=+i-d;a=w*T,h=w*(k/c)}return n.startValue=d,n.steps=r,n.interval=c,{size:a,position:h}},getScrollbarContainerDOM(t){const e=["track","thumb","button"],n=t.dataset.type;return e.includes(n)?t.parentElement:n==="button-icon"?t.parentElement.parentElement:n==="scrollbar"?t.getElementsByClassName("ev-chart-scrollbar-container")[0]:t},updateScrollbarRange(t,e){const n=this.scrollbar[t],{startValue:i,range:s,interval:l,steps:a}=n,r=i+l*a,c=t==="x"?this.axesX[0]:this.axesY[0],[d,h]=s??[];(!ve(d)||!ve(h))&&(n.range=(c==null?void 0:c.range)||null);let u,f,m=!1;e?(u=d+l,f=h+l,m=f>=r):(u=d-l,f=h-l,m=u<i),m||(n.range=[u,f],this.updateScrollbarAnchorEdge(t),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:u>1,updateByScrollbar:!0}))},getScrollbarLimits(t){var l,a;const e=this.scrollbar[t];if((e==null?void 0:e.type)==="step"){const r=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels;return r!=null&&r.length?{limitMin:0,limitMax:r.length-1}:null}const n=(a=(l=this.minMax)==null?void 0:l[t])==null?void 0:a[0];if((n==null?void 0:n.min)==null||(n==null?void 0:n.max)==null)return null;const i=+n.min,s=+n.max;return!Number.isFinite(i)||!Number.isFinite(s)?null:{limitMin:i,limitMax:s}},updateScrollbarAnchorEdge(t){const e=this.scrollbar[t];if(!e)return;const n=e.range,i=this.getScrollbarLimits(t);if(!Array.isArray(n)||n.length!==2||!i){e.anchorEdge=null;return}n[0]<=i.limitMin?e.anchorEdge="start":n[1]>=i.limitMax?e.anchorEdge="end":e.anchorEdge=null},createScrollEvent(){var e,n,i;this.onScrollbarClick=s=>{s.preventDefault();const l=s.target.dataset.type,a=this.getScrollbarContainerDOM(s.target),r=["button","button-icon"],c=a.dataset.type;let d;if(r.includes(l)){let h;l==="button"?h=s.target:l==="button-icon"&&(h=s.target.parentElement),d=h.className.includes("up")}else if(l==="track"){const h=a.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:u,y:f}=h[0].getBoundingClientRect(),m=c==="x",g=m?s.clientX:-s.clientY,p=m?u:-f;d=g>p}else return;this.updateScrollbarRange(c,d)},this.onScrollbarDown=s=>{if(s.preventDefault(),s.target.dataset.type!=="thumb")return;const l=this.getScrollbarContainerDOM(s.target),a=l.dataset.type,r=l.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:c,y:d,height:h}=r[0].getBoundingClientRect(),u=this.scrollbar[a];u.scrolling=!0,a==="x"?u.pointInThumb=s.clientX-c:u.pointInThumb=d+h-s.clientY;const f=u.dom;f.addEventListener("mousemove",this.onScrollbarMove),f.addEventListener("mouseup",this.onScrollbarUp)};const t=s=>{this.scrolling(s)};if(this.onScrollbarMove=ns(t,5),this.onScrollbarUp=s=>{s.preventDefault(),this.stopScrolling(s)},this.onScrollbarLeave=s=>{s.preventDefault(),this.scrolling(s),this.stopScrolling(s)},this.onScrollbarWheel=s=>{var h,u,f,m,g,p,y,C;const l=((u=(h=this.tooltipDOM)==null?void 0:h.style)==null?void 0:u.display)==="block",a=this.tooltipBodyDOM||((f=this.tooltipDOM)==null?void 0:f.querySelector(this.options.tooltip.htmlScrollTarget));if(l&&a){const{scrollTop:b,scrollHeight:w,clientHeight:T}=a,k=b<=0,M=Math.ceil(b)+T>=w,V=s.deltaY<0,x=s.deltaY>0;if(!(k&&V||M&&x))return}s.preventDefault();const r=1;if((m=this.scrollbar.x)!=null&&m.use&&s.shiftKey&&Math.abs(s.deltaY)>r){this.updateScrollbarRange("x",s.deltaY>0);return}const c=Math.abs(s.deltaX),d=Math.abs(s.deltaY);if(c>r&&d>r){c>d&&((g=this.scrollbar.x)!=null&&g.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((p=this.scrollbar.y)!=null&&p.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((y=this.scrollbar.x)!=null&&y.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(C=this.scrollbar.y)!=null&&C.use&&d>r&&this.updateScrollbarRange("y",s.deltaY<0)},this.scrollbar.x.use&&!this.scrollbar.x.isInit){const s=this.scrollbar.x.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}if(this.scrollbar.y.use&&!this.scrollbar.y.isInit){const s=this.scrollbar.y.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}((e=this.scrollbar.x)!=null&&e.use||(n=this.scrollbar.y)!=null&&n.use)&&((i=this.overlayCanvas)==null||i.addEventListener("wheel",this.onScrollbarWheel,{passive:!1}))},scrolling(t){const e=this.getScrollbarContainerDOM(t.target),n=e.dataset.type;if(!this.scrollbar[n].scrolling)return;const{steps:i,range:s,pointInThumb:l,startValue:a,interval:r}=this.scrollbar[n],c=e.getElementsByClassName("ev-chart-scrollbar-track"),{x:d,y:h,width:u,height:f}=c[0].getBoundingClientRect(),m=n==="x",g=m?d:h,p=m?u:f,y=p/i,C=a+(i-1)*r;let b=m?t.clientX:t.clientY;b<g?b=g:b>g+p&&(b=g+p);let w;if(m?w=b-g-l:w=g+p-b-l,w<=0)return;let T,k;const M=Math.round(Math.abs(w)/y)*r,[V,x]=s;if(w>0){const S=a+(M-+V);T=+V+S,k=T+(+x-+V)}T<a||k>C||(this.scrollbar[n].range=[T,k],this.updateScrollbarAnchorEdge(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:T>1,updateByScrollbar:!0}))},stopScrolling(t){const n=this.getScrollbarContainerDOM(t.target).dataset.type,i=this.scrollbar[n];if(i.scrolling){i.scrolling=!1;const s=i.dom;s.removeEventListener("mousemove",this.onScrollbarMove,!1),s.removeEventListener("mouseup",this.onScrollbarUp,!1)}},hideScrollbar(t){const e=this.scrollbar[t].dom;if(!e)return;const n=e==null?void 0:e.style;n.display="none",n.width="0",n.height="0"},destroyScrollbar(t){var n,i,s;const e=this.scrollbar[t].dom;e&&(e.remove(),this.scrollbar[t]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((i=this.scrollbar.y)!=null&&i.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function SC(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")}function Jr(t,e,n){let i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;const m=!e&&e!==0&&typeof root.requestAnimationFrame=="function";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0,SC(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Math.max(+n.maxWait||0,e):l,f="trailing"in n?!!n.trailing:f);function g(L){const I=i,R=s;return i=s=void 0,d=L,a=t.apply(R,I),a}function p(L,I){return m?(window.cancelAnimationFrame(r),window.requestAnimationFrame(L)):setTimeout(L,I)}function y(L){if(m)return window.cancelAnimationFrame(L);clearTimeout(L)}function C(L){return d=L,r=p(T,e),h?g(L):a}function b(L){const I=L-c,R=L-d,v=e-I;return u?Math.min(v,l-R):v}function w(L){const I=L-c,R=L-d;return c===void 0||I>=e||I<0||u&&R>=l}function T(){const L=Date.now();if(w(L))return k(L);r=p(T,b(L))}function k(L){return r=void 0,f&&i?g(L):(i=s=void 0,a)}function M(){r!==void 0&&y(r),d=0,i=c=s=r=void 0}function V(){return r===void 0?a:k(Date.now())}function x(){return r!==void 0}function S(...L){const I=Date.now(),R=w(I);if(i=L,s=this,c=I,R){if(r===void 0)return C(c);if(u)return r=p(T,e),g(c)}return r===void 0&&(r=p(T,e)),a}return S.cancel=M,S.flush=V,S.pending=x,S}const CC="Expected a function";function kC(t,e,n){let i=!0,s=!0;if(typeof t!="function")throw new TypeError(CC);return Jr(t,e,{leading:i,maxWait:e,trailing:s})}const wC={createEventFunctions(){var s,l,a,r;this.onMouseMove=c=>{var k,M;if((k=this.dragInfo)!=null&&k.isMove||this.isMobile)return;const d={e:c},{indicator:h,tooltip:u,type:f}=this.options,m=this.getMousePosition(c),g=this.findHitItem(m),p=this.findPlotLabelHitRegion(m);p&&(g.items={},g.hitId=null),!p&&(u!=null&&u.showAllValueInRange)&&(g!=null&&g.items)&&this.addNotHitInfo(g);const y=this.overlayCtx,C=Object.keys(g.items),b=C.length>0;let w="";if(b){w=`h=${g.hitId}`;const V=C.slice().sort();for(let x=0;x<V.length;x++){const S=V[x];w+=`|${S}:${g.items[S].index}`}}const T=w!==""&&w===this._lastHoverSig&&this.tooltipDOM&&this.tooltipDOM.style.display!=="none";if(this.overlayClear(),b){if(u.use&&this.isInitTooltip)if(this.drawItemsHighlight(g,y),typeof(u==null?void 0:u.returnValue)=="function"){const x=[];for(let S=0;S<C.length;S++){const L=C[S],I=g.items[L];x.push({sId:L,data:I.data,color:I.color,name:I.name,dataId:I.id,index:I.index})}this.hideTooltipDOM(),u.returnValue(x,c)}else(M=u==null?void 0:u.formatter)!=null&&M.html?(T||this.drawCustomTooltip(g==null?void 0:g.items),this.setCustomTooltipLayoutPosition(g,c)):(this.setTooltipLayoutPosition(g,c),f==="scatter"?this.drawTooltipForScatter(g,this.tooltipCtx):f==="heatMap"?this.drawToolTipForHeatMap(g,this.tooltipCtx):this.drawTooltip(g,this.tooltipCtx));const V=Object.values(this.seriesList||{}).some(x=>x.type==="line");if(u.use&&(f==="line"||V)){const x=this.drawIndicatorForTooltip(g,h.color),S=x==null?void 0:x.labelValue,L=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:L,mousePosition:[c.clientX,c.clientY],dataLabel:S}}}else u.use&&this.isInitTooltip&&(typeof(u==null?void 0:u.returnValue)=="function"&&u.returnValue([],c),this.hideTooltipDOM());if(this.handlePlotLabelHover(p,c),this._lastHoverSig=w,this.dragInfoBackup&&!this.dragDisplayCanvas&&this.drawSelectionArea(this.dragInfoBackup),!d.hoveredLabel&&!this.isNotUseIndicator()){const V=Object.values(this.seriesList||{}).some(S=>S.type==="line");(f!=="line"&&!V||!u.use||!Object.keys(g.items).length)&&this.drawIndicator(m,h.color);const x=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:x,mousePosition:[c.clientX,c.clientY]}}else d.hoveredLabel||(d.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(f!=="pie"&&(d.curMouseTargetVal=this.getCurMouseTargetVal(m,g)),this.listeners["mouse-move"](d))},this.onMouseLeave=c=>{var u;const{tooltip:d,dragSelection:h}=this.options;d.throttledMove&&this.onMouseMove.cancel(),(!h.use||!h.keepDisplay)&&this.overlayClear(),(u=this.hidePlotLabelTooltip)==null||u.call(this),d.use&&this.isInitTooltip&&(typeof(d==null?void 0:d.returnValue)=="function"&&d.returnValue([],c),this.tooltipClear()),this._lastHoverSig="",this.invalidateClientRectCache(),this.listeners["mouse-leave"]()},this.onDblClick=c=>{const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:f,selectLabel:m,selectSeries:g}=this.options,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),y=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick);p?d.eventTarget="item":y?d.eventTarget="label":C&&(d.eventTarget="series");const b=()=>{var x,S;const k=this.findHitItem(h,!0),M=k.hitId??Object.keys(k.items)[0],V=k.items[M];V&&(d.label=V.label,d.value=(x=V.data)==null?void 0:x.o,d.seriesId=M,d.dataIndex=V.index,d.acc=(S=V.data)==null?void 0:S.acc)},w=k=>{var I,R;const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],x=M.items[V],{labelIndex:S}=this.getLabelInfoByPosition(h,k),{dataIndex:L}=this.regulateSelectedLabelInfo(S,k);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(L,k),x&&(d.label=x.label,d.seriesId=V,d.value=(I=x.data)==null?void 0:I.o,d.acc=(R=x.data)==null?void 0:R.acc,d.dataIndex=x.index)},T=()=>{var x,S,L;const k=this.findHitItem(h,!0),M=k.hitId??Object.keys(k.items)[0],V=k.items[M];if(M!==null){const I=this.updateSelectedSeriesInfo(M,!0);V&&(d.label=V.label,d.value=(x=V.data)==null?void 0:x.o,d.seriesId=(S=I.seriesId)==null?void 0:S.at(0),d.acc=(L=V.data)==null?void 0:L.acc,d.dataIndex=V.index)}};switch(u){case"bar":{y?w(this.options.horizontal?"yAxis":"xAxis"):b();break}case"line":{p?b():y?w():C&&T();break}default:{b();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](d)},this.onClick=c=>{var k;if(this.isMouseMove){this.isMouseMove=!1;return}const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:f,selectLabel:m,selectSeries:g}=this.options,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),y=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick),b=()=>{const M=this.getHitItemByPosition(h,!1,void 0,!1,!0);({label:d.label,value:d.value,sId:d.seriesId,dataIndex:d.dataIndex,acc:d.acc}=M),M!=null&&M.sId&&(d.selected={eventTarget:"item",seriesId:this.isDeselectItem(M)?null:M.sId,dataIndex:this.isDeselectItem(M)?null:M.dataIndex})},w=M=>{var S,L,I,R;const{labelIndex:V}=this.getLabelInfoByPosition(h,M),{dataIndex:x}=this.regulateSelectedLabelInfo(V,M);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(x,M),M&&(this.defaultSelectInfo.targetAxis=x!=null&&x.length?M:null),d.selected={eventTarget:"label",...Ze(this.defaultSelectInfo)},d.label=(L=(S=this.defaultSelectInfo)==null?void 0:S.label)==null?void 0:L.at(0),d.dataIndex=(R=(I=this.defaultSelectInfo)==null?void 0:I.dataIndex)==null?void 0:R.at(0)},T=()=>{const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],x=M.items[V];if(!Yt(V)){const S=this.updateSelectedSeriesInfo(V,!1);this.defaultSelectInfo.seriesId=S.seriesId,d.selected={eventTarget:"series",...Ze(this.defaultSelectInfo)},d.label=x.label,d.dataIndex=x.index}};switch(u){default:case"bar":{p?b():y&&w(this.options.horizontal?"yAxis":"xAxis");break}case"line":{p?b():y?w():C&&T();break}case"heatMap":{const M=!!this.options.horizontal;if(p&&y){const{useBothAxis:V}=m,x=this.getCurMouseLocation(h);if(x==="chartBackground")this.clearSelectedLabelInfo(),d.deselected={eventTarget:"label"},b();else if(x==="yAxis"||x==="xAxis"){if(this.clearSelectedItemInfo(),d.deselected={eventTarget:"item"},!V&&x!==(M?"yAxis":"xAxis"))return;w(x)}}else if(p)b();else if(y){const{useBothAxis:V}=m,x=this.getCurMouseLocation(h);if((x==="yAxis"||x==="xAxis")&&!V&&x!==(M?"yAxis":"xAxis"))return;x!=="canvas"&&w(V?x:null)}break}case"pie":{p&&b();break}case"scatter":{if(p&&b(),(k=this.options.dragSelection)!=null&&k.use&&this.isMobile){let M=this.setTouchInfo(c);this.overlayClear(),this.options.dragSelection.keepDisplay&&(c.layerX<M.range.x1||c.layerY<M.range.y1||c.layerX>M.range.x2||c.layerY>M.range.y2)?this.isTouchOverlay=!1:(M=this.setTouchBoxDimensions(M),this.isTouchOverlay=!0,this.drawSelectionArea(M)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),d.e=c,d.touchInfo=M,d.data=this.findSelectedItems(M),d.range=this.getSelectionRange(M),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](d)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(d))},this.onMouseDown=c=>{const{dragSelection:d,type:h}=this.options;d.use&&(h==="scatter"||h==="line"||h==="heatMap")&&(this.removeSelectionArea(),this.dragStart(c,h))},this.onWheel=c=>{var b,w,T,k;if(!(((w=(b=this.tooltipDOM)==null?void 0:b.style)==null?void 0:w.display)==="block"))return;const h=((T=this.vsState)==null?void 0:T.scrollEl)||(this.options.tooltip.htmlScrollTarget?(k=this.tooltipDOM)==null?void 0:k.querySelector(this.options.tooltip.htmlScrollTarget):null)||this.tooltipBodyDOM;if(!h||h.scrollHeight<=h.clientHeight){this.hideTooltipDOM();return}const{scrollTop:u,scrollHeight:f,clientHeight:m}=h,g=u<=0,p=Math.ceil(u)+m>=f,y=c.deltaY<0,C=c.deltaY>0;c.preventDefault(),!(g&&y)&&!(p&&C)&&(h.scrollTop+=c.deltaY)};const t=(s=this.options)==null?void 0:s.tooltip,e=!!((l=t==null?void 0:t.formatter)!=null&&l.html)&&!!(t!=null&&t.virtualScroll)&&t.virtualScroll.use!==!1;(t!=null&&t.useScrollbar||e)&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(r=(a=this.options)==null?void 0:a.tooltip)!=null&&r.throttledMove&&(this.onMouseMove=kC(this.onMouseMove,30)),this.overlayCanvas.addEventListener("mousemove",this.onMouseMove),this.overlayCanvas.addEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.addEventListener("dblclick",this.onDblClick),this.overlayCanvas.addEventListener("click",this.onClick);const{startArea:n,displayFromStartArea:i}=this.options.dragSelection;this.dragStartTarget=n&&this.target.closest(n)||this.overlayCanvas,this.dragStartTarget.addEventListener("mousedown",this.onMouseDown),i&&this.options.type==="scatter"&&!this.isMobile&&this.dragStartTarget!==this.overlayCanvas&&this.createDragDisplayCanvas(),this.dragTouchSelectionEvent=c=>this.dragTouchSelectionDestroy(c),window.addEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll=()=>this.invalidateClientRectCache(),window.addEventListener("scroll",this.invalidateRectOnScroll,{capture:!0,passive:!0})},dragStart(t,e){this.dragDisplayCanvas&&this.refreshDragDisplayCanvas();let n;this.dragDisplayCanvas&&(n=this.dragStartTarget.style.userSelect,this.dragStartTarget.style.userSelect="none");const[i,s,l,a]=this.getMousePosition(t);let r=i,c=s;const d=this.chartRect,h=this.labelOffset,u={x1:d.x1+h.left,x2:d.x2-h.right,y1:d.y1+h.top,y2:d.y2-h.bottom};r<u.x1&&(r=u.x1),r>u.x2&&(r=u.x2),c<u.y1&&(c=u.y1),c>u.y2&&(c=u.y2),this.dragInfo={xcp:r,ycp:c,range:u};const f=(C,b)=>C>=0&&C<=l&&b>=0&&b<=a;let m=!1;const g=()=>{m||(m=!0,this.removeSelectionArea())};(f(i,s)||this.dragDisplayCanvas)&&g();const p=C=>{const[b,w]=this.getMousePosition(C);if(!m)if(f(b,w))g();else return;C.preventDefault();const T=this.dragInfo,{xcp:k,ycp:M,range:V}=T;let x,S;if(T.isMove=!0,this.isMouseMove=!0,b<V.x1?x=V.x1:b>V.x2?x=V.x2:x=b,w<V.y1?S=u.y1:w>V.y2?S=V.y2:S=w,e==="heatMap"){const L={xcp:k,xep:x,ycp:M,yep:S,range:V},{xsp:I,ysp:R,width:v,height:G}=this.getDragInfoForHeatMap(L);T.xsp=I,T.ysp=R,T.width=v,T.height=G}else T.xsp=Math.min(k,x),T.ysp=e==="scatter"?Math.min(M,S):V.y1,T.width=Math.ceil(Math.abs(x-k)),T.height=e==="scatter"?Math.ceil(Math.abs(S-M)):V.y2-V.y1;this.dragDisplayCanvas&&e==="scatter"&&(T.displayRect={xsp:Math.min(i,b),ysp:Math.min(s,w),width:Math.ceil(Math.abs(b-i)),height:Math.ceil(Math.abs(w-s)),range:V}),this.overlayClear(),this.drawSelectionArea(T)},y=C=>{var w,T;const b=this.dragInfo;if(m&&(b!=null&&b.isMove)&&(b==null?void 0:b.width)>1&&(b==null?void 0:b.height)>1){const k={e:C,data:this.findSelectedItems(b),range:e==="heatMap"?this.getSelectionRangeForHeatMap(b):this.getSelectionRange(b)};if(this.dragInfoBackup=He({},b),typeof this.listeners["drag-select"]=="function"&&!((T=(w=this.options)==null?void 0:w.zoom)!=null&&T.use))this.listeners["drag-select"](k);else{const{xsp:M,range:V,width:x}=b,S=M-V.x1;k.range.dragSelectionInfo={dragXsp:S,dragXep:S+x,exceptAxesYChartWidth:V.x2-V.x1,exceptAxesXChartHeight:V.y2-V.y1,chartRange:V,chartTitle:this.options.title.text},this.options.zoom.getRangeInfo(k)}this.options.dragSelection.keepDisplay||this.removeSelectionArea()}this.dragInfo=null,n!==void 0&&(this.dragStartTarget.style.userSelect=n),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)},drawSelectionArea(t){var h,u;const e=!!this.dragDisplayCanvas,n=e?this.dragDisplayCtx:this.overlayCtx,{fillColor:i,opacity:s}=this.options.dragSelection;let l=0,a=0;e&&(this.dragDisplayClear(),l=((h=this.dragDisplayOffset)==null?void 0:h.x)??0,a=((u=this.dragDisplayOffset)==null?void 0:u.y)??0);const r=this.chartRect,c=this.labelOffset,d={x1:r.x1+c.left,x2:r.x2-c.right,y1:r.y1+c.top,y2:r.y2-c.bottom};if(n.fillStyle=i,n.globalAlpha=s,e&&t.displayRect){const f=t.displayRect,{xsp:m,ysp:g,width:p,height:y,range:C}=t;let b=m,w=g,T=p,k=y;if(!Fe(d,C)){const L=C.x2-C.x1,I=C.y2-C.y1,R=d.x2-d.x1,v=d.y2-d.y1;b=d.x1+R*((m-C.x1)/L),w=d.y1+v*((g-C.y1)/I),T=R*(p/L),k=v*(y/I)}const M=m-f.xsp,V=g-f.ysp,x=f.xsp+f.width-(m+p),S=f.ysp+f.height-(g+y);n.fillRect(b-M+l,w-V+a,T+M+x,k+V+S)}else{const{xsp:f,ysp:m,width:g,height:p,range:y}=t;if(Fe(d,y))n.fillRect(f+l,m+a,g,p);else{const C=y.x2-y.x1,b=y.y2-y.y1,w=d.x2-d.x1,T=d.y2-d.y1,k=(f-y.x1)/C,M=(m-y.y1)/b,V=d.x1+w*k,x=d.y1+T*M,S=g/C,L=p/b,I=w*S,R=T*L;n.fillRect(V+l,x+a,I,R)}}n.globalAlpha=1},createDragDisplayCanvas(){const t=this.dragStartTarget;if(!t||t===this.overlayCanvas)return;window.getComputedStyle(t).position==="static"&&(this.dragStartAreaPrevPosition=t.style.position,t.style.position="relative");const e=document.createElement("canvas");e.className="ev-chart-drag-display-canvas",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex="3",e.style.pointerEvents="none",t.appendChild(e),this.dragDisplayCanvas=e,this.dragDisplayCtx=e.getContext("2d"),this.refreshDragDisplayCanvas()},refreshDragDisplayCanvas(){if(!this.dragDisplayCanvas||!this.dragStartTarget)return;const{width:t,height:e}=this.dragStartTarget.getBoundingClientRect(),n=Math.max(1,Math.round(t)),i=Math.max(1,Math.round(e)),s=n*this.pixelRatio,l=i*this.pixelRatio;(this.dragDisplayCanvas.width!==s||this.dragDisplayCanvas.height!==l)&&(this.dragDisplayCanvas.width=s,this.dragDisplayCanvas.height=l,this.dragDisplayCanvas.style.width=`${n}px`,this.dragDisplayCanvas.style.height=`${i}px`),this.dragDisplayCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.dragDisplayClear();const a=this.overlayCanvas.getBoundingClientRect(),r=this.dragDisplayCanvas.getBoundingClientRect();this.dragDisplayOffset={x:a.left-r.left,y:a.top-r.top}},dragDisplayClear(){if(!this.dragDisplayCtx||!this.dragDisplayCanvas)return;const t=this.pixelRatio<1?this.pixelRatio:1;this.dragDisplayCtx.clearRect(0,0,this.dragDisplayCanvas.width/t,this.dragDisplayCanvas.height/t)},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear(),this.dragDisplayCanvas&&this.dragDisplayClear()},getMousePosition(t){const e=t.originalEvent||t,n=this.getOverlayClientRect();return[e.clientX-n.left,e.clientY-n.top,n.width,n.height]},findPlotLabelHitRegion(t){const e=this.plotLabelHitRegions;if(!(e!=null&&e.length))return null;const[n,i]=t;return e.find(s=>n>=s.x&&n<=s.x+s.width&&i>=s.y&&i<=s.y+s.height)??null},handlePlotLabelHover(t,e){var n;t?this.showPlotLabelTooltip(t,e.originalEvent||e):(n=this.hidePlotLabelTooltip)==null||n.call(this)},getCurMouseTargetVal(t,e){const n=this.getCurMouseLocation(t),i={location:n,labelIdx:-1,labelVal:"",dataIdx:-1,maxDataVal:"",originVal:""};if(n==="chartBackground"){const{maxHighlight:s,items:l}=e;if(s!=null&&s.length){const[a,r]=s;l[a]&&(i.dataIdx=l[a].index,i.maxDataVal=r,i.originVal=e)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{i.labelIdx=d,i.labelVal=c[0].type==="time"?Ne(h).format(c[0].timeFormat):h,i.originVal=c[0].type==="time"?Ne(h):h};(c=>{const{labelIndex:d}=this.getLabelInfoByPosition(t,n),{labelVal:h,labelIdx:u}=this.getCurMouseLabelVal(c,t,d);a(c==="xAxis"?s:l,u,h)})(n)}return i},setTouchInfo(t){let[e,n]=this.getMousePosition(t);const i=this.chartRect,s=this.labelOffset,l={x1:i.x1+s.left,x2:i.x2-s.right,y1:i.y1+s.top,y2:i.y2-s.bottom};return e=Math.max(l.x1,Math.min(e,l.x2)),n=Math.max(l.y1,Math.min(n,l.y2)),{xcp:e,ycp:n,range:l}},setTouchBoxDimensions(t){var h;const e=((h=this.options.dragSelection)==null?void 0:h.size)||50,n=e/2,{xcp:i,ycp:s,range:l}=t;let a=i-n,r=s-n,c=e,d=e;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},i<l.x1+n&&(a=l.x1,c=n-(l.x1-i),this.boxOverflow.x1=!0),i>l.x2-n&&(c=n-(i-l.x2),this.boxOverflow.x2=!0),s<l.y1+n&&(r=l.y1,d=n-(l.y1-s),this.boxOverflow.y1=!0),s>l.y2-n&&(d=n-(s-l.y2),this.boxOverflow.y2=!0),t.xsp=a,t.ysp=r,t.width=c,t.height=d,t},dragTouchSelectionDestroy(t){var e;(e=this.options.dragSelection)!=null&&e.use&&t.target!==this.overlayCanvas&&this.isTouchOverlay&&(this.isTouchOverlay=!1,this.overlayClear())},findHitItem(t,e=!1){var k,M,V,x;(k=this.ensureHitCoordsFresh)==null||k.call(this);const n=Object.keys(this.seriesList),i={},s=!!this.options.horizontal,l=this.tooltipCtx,[a,r]=t;let c=null,d="",h=0,u="",f=null,m=null,g=1/0,p=!1,y=null,C=1/0;const b=this.findClosestDataIndex(t,n,e);if(b===-1&&!this.isNotUseIndicator())return{items:i,hitId:c,maxTip:[d,u],maxHighlight:null};const w=n.every(S=>this.seriesList[S].type==="bar");for(let S=0;S<n.length;S++){const L=n[S],I=this.seriesList[L];if(I.findGraphData&&I.show){const R=I.findGraphData(t,s,b,!w);if(R!=null&&R.data){let v;if(R.data.o===null&&I.interpolation!=="zero"?I.isExistGrp||(v=s?R.data.x:R.data.y):isNaN(R.data.o)||(v=R.data.o),v!=null){const G=this.getFormattedTooltipLabel({dataId:I.id,seriesId:L,seriesName:I.name,itemData:R.data}),W=l?l.measureText(G).width:1;R.id=I.id,R.name=G,R.axis={x:I.xAxisIndex,y:I.yAxisIndex},R.label=s?(M=R.data)==null?void 0:M.y:(V=R.data)==null?void 0:V.x,i[L]=R;const E=this.getFormattedTooltipValue({dataId:I.id,seriesId:L,seriesName:G,value:v,itemData:R.data});if(R.data.formatted=E,h<W&&(d=G,h=W),u.length<=`${E}`.length&&(u=`${E}`),(f===null||f<=v)&&(f=v,m=L),R.hit&&R.data.xp!==void 0&&R.data.yp!==void 0){const X=(R.data.xp-t[0])**2+(R.data.yp-t[1])**2;R.directHit?((!p||X<g)&&(g=X,c=L),p=!0):!p&&X<g&&(g=X,c=L)}if(c===null&&R.data.xp!==void 0&&R.data.yp!==void 0&&R.data.xp!==null&&R.data.yp!==null){const X=O.calcBoxDistance(R.data,a,r);X<C&&(C=X,y=L)}}}}}c===null&&(c=y!==null?y:Object.keys(i)[0]);const T=f!==null?[m,f]:null;if(e&&Object.keys(i).length===0&&b!==-1){const S=n.find(I=>{var v;const R=this.seriesList[I];return(R==null?void 0:R.show)&&((v=R==null?void 0:R.data)==null?void 0:v.length)>0}),L=S?(x=this.seriesList[S].data)==null?void 0:x[b]:null;L&&(i[""]={id:"",name:"",label:s?L.y:L.x,index:b,axis:{x:0,y:0},data:{o:void 0,x:L.x,y:L.y}},c="")}return{items:i,hitId:c,maxTip:[d,u],maxHighlight:T}},buildLabelValidMask(t){var s,l;const e=t??Object.keys(this.seriesList);let n=0;for(let a=0;a<e.length;a++){const r=this.seriesList[e[a]];r!=null&&r.show&&((s=r.data)==null?void 0:s.length)>n&&(n=r.data.length)}const i=new Uint8Array(n);for(let a=0;a<e.length;a++){const r=this.seriesList[e[a]];if(r!=null&&r.show&&r.data){const{data:c}=r;for(let d=0;d<c.length;d++){const h=(l=c[d])==null?void 0:l.o;h!=null&&(i[d]=1)}}}return this.labelValidMask=i,i},findClosestDataIndex(t,e,n=!1){var p;const[i,s]=t,l=!!this.options.horizontal,a=l?s:i,r=e.find(y=>{var b;const C=this.seriesList[y];return(C==null?void 0:C.show)&&((b=C==null?void 0:C.data)==null?void 0:b.length)>0});if(!r||!((p=this.seriesList[r])!=null&&p.data))return-1;const c=this.seriesList[r].data;let d=50;if(c.length>1){const y=[];for(let C=1;C<c.length;C++){const b=c[C-1],w=c[C];if(b&&w){let T,k;l?(T=b.h?b.yp+b.h/2:b.yp,k=w.h?w.yp+w.h/2:w.yp):(T=b.w?b.xp+b.w/2:b.xp,k=w.w?w.xp+w.w/2:w.xp),T!==null&&k!==null&&y.push(Math.abs(k-T))}}y.length>0&&(d=y.reduce((C,b)=>C+b,0)/y.length)}let h=1/0,u=-1,f=this.labelValidMask;!n&&(!f||f.length<c.length)&&(f=this.buildLabelValidMask(e));for(let y=0;y<c.length;y++)if(n||f[y]===1){const b=c[y];if(b){let w;if(l?w=b.h?b.yp+b.h/2:b.yp:w=b.w?b.xp+b.w/2:b.xp,w!==null){const T=Math.abs(a-w);T<h&&(h=T,u=y)}}}if(u===-1)return-1;const g=Math.max(d,6);return h>=g?e.some(C=>{const b=this.seriesList[C];if(b!=null&&b.show){const w=b.passingValue,T=b.interpolation,k=b.hasPassingValueInData;return T==="linear"||T==="none"&&!!w&&k}return!1})?u:-1:u},getFormattedTooltipLabel({dataId:t,seriesId:e,seriesName:n,itemData:i}){var c;const l=this.options.tooltip,a=(c=l==null?void 0:l.formatter)==null?void 0:c.label;let r=n;return a&&(r=a({dataId:t,seriesId:e,seriesName:n,itemData:i})),r},getFormattedTooltipValue({dataId:t,seriesId:e,seriesName:n,value:i,itemData:s}){var u;const l=this.options,a=!!l.horizontal,r=l.tooltip,c=typeof(r==null?void 0:r.formatter)=="function"?r==null?void 0:r.formatter:(u=r==null?void 0:r.formatter)==null?void 0:u.value,d=s!==null&&typeof s=="object"&&c;if(d){this._tooltipValueCache||(this._tooltipValueCache=new WeakMap);const f=this._tooltipValueCache.get(s);if(f!==void 0){const m=f[e];if(m!==void 0)return m}}let h=i;if(c&&(l.type==="pie"?h=c({value:i,name:n,percentage:s==null?void 0:s.percentage,seriesId:e,dataId:t}):l.type==="heatMap"?h=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:i>-1?i:"error",seriesId:e,dataId:t}):h=c({x:a?i:s==null?void 0:s.x,y:a?s==null?void 0:s.y:i,o:s==null?void 0:s.o,name:n,seriesId:e,dataId:t})),i&&(!c||typeof h!="string")&&(l.type==="heatMap"?h=i<0?"error":Qt(i):h=Qt(i)),d){let f=this._tooltipValueCache.get(s);f||(f=Object.create(null),this._tooltipValueCache.set(s,f)),f[e]=h}return h},addNotHitInfo(t){var c,d,h,u,f,m;const e=this.tooltipCtx,n=!!this.options.horizontal,i=Object.keys(t.items)[0],s=n?(h=(d=(c=t.items)==null?void 0:c[i])==null?void 0:d.data)==null?void 0:h.y:(m=(f=(u=t.items)==null?void 0:u[i])==null?void 0:f.data)==null?void 0:m.x;let l="",a="";const r=Object.keys(this.seriesList);for(let g=0;g<r.length;g++){const p=r[g],y=this.seriesList[p];if(y!=null&&y.show){const C=y.data.find(x=>n?(x==null?void 0:x.y)===s:(x==null?void 0:x.x)===s),b=this.getFormattedTooltipLabel({dataId:y.id,seriesId:p,seriesName:y.name,itemData:C}),w=this.getFormattedTooltipValue({dataId:y.id,seriesId:p,seriesName:b,value:C==null?void 0:C.o,itemData:C});if(C&&C.o!==null&&C.o!==void 0&&!t.items[p]){const x={};x.color=y.color,x.hit=!1,x.name=b,x.axis={x:y.xAxisIndex,y:y.yAxisIndex},x.index=n?y.yAxisIndex:y.xAxisIndex,x.data=C,x.data.formatted=w,t.items[p]=x}const T=e?e.measureText(l).width:1,k=e?e.measureText(b).width:1;T<k&&(l=b);const M=e?e.measureText(a).width:1,V=e?e.measureText(`${w}`).width:1;M<V&&(a=`${w}`)}}t.maxTip=[l,a]},selectItemByData(t,e){this.defaultSelectItemInfo=t;let n;e==="pie"?n={type:"pie",sId:t.seriesID}:n=isNaN(t==null?void 0:t.dataIndex)?null:this.getItem(t,!1),this.render(n)},selectLabelByData(t,e){this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(t,e),this.render()},selectSeriesByData(t){const e=t??[],n=this._renderedSelectSeriesIds;n&&n.length===e.length&&n.every((i,s)=>i===e[s])||(this.defaultSelectInfo.seriesId=t,this._renderedSelectSeriesIds=[...e],this.render())},getSelectedLabelInfoWithLabelData(t,e){const{selectLabel:n,type:i,horizontal:s}=this.options,l=Ze(this.defaultSelectInfo);switch(l.dataIndex=t,i){default:case"bar":case"line":{l.dataIndex.splice(n.limit),l.label=l.dataIndex.map(r=>this.data.labels[r]);const a=Object.entries(this.data.data);l.data=l.dataIndex.map(r=>Object.fromEntries(a.map(([c,d])=>[c,d[r]])));break}case"heatMap":{const{limit:a,useBothAxis:r}=this.options.selectLabel;l.dataIndex.splice(a);let c;r?c=e==="yAxis"?"y":"x":c=s?"y":"x",l.label=l.dataIndex.map(h=>this.data.labels[c][h]);const d=Object.values(this.data.data)[0];l.data=d.filter(({x:h,y:u})=>l.label.includes(c==="y"?u:h));break}}return l},regulateSelectedLabelInfo(t,e){var l,a;const n=((l=this.options)==null?void 0:l.selectLabel)??{},i=e===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===e?{...this.defaultSelectInfo,targetAxis:e}:{dataIndex:[],targetAxis:e},s=Ze(i);if(i.dataIndex.includes(t)){const r=i.dataIndex.indexOf(t);s.dataIndex.splice(r,1)}else t>-1&&(s.dataIndex.push(t),n.limit>0&&n.limit<s.dataIndex.length&&(n.useDeselectOverflow?s.dataIndex.splice(0,1):s.dataIndex.pop()));return s},updateSelectedSeriesInfo(t,e){var l;const n=((l=this.options)==null?void 0:l.selectSeries)??{},i=this.defaultSelectInfo??{seriesId:[]};typeof i.seriesId=="string"&&(i.seriesId=[i.seriesId]);const s=Ze(i);if(i.seriesId.includes(t)){if(!e){const a=i.seriesId.indexOf(t);s.seriesId.splice(a,1)}}else t&&(s.seriesId.push(t),n.limit>0&&n.limit<s.seriesId.length&&(n.useDeselectOverflow?s.seriesId.splice(0,1):s.seriesId.pop()));return s},drawIndicatorForTooltip(t,e){var d;if(!(t!=null&&t.items)||!Object.keys(t.items).length)return null;const n=this.overlayCtx,{horizontal:i}=this.options,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=Object.keys(t.items)[0],a=t.items[l];if(!(a!=null&&a.data))return null;const r=i?a.data.y:a.data.x;let c;if(i){const h=a.data.yp+(a.data.h?a.data.h/2:0);c=[s.x1,h]}else c=[a.data.xp+(a.data.w?a.data.w/2:0),s.y1];return n.beginPath(),n.save(),n.strokeStyle=e,n.lineWidth=1,(d=this.options.indicator)!=null&&d.segments&&n.setLineDash(this.options.indicator.segments),i?(n.moveTo(s.x1,c[1]+.5),n.lineTo(s.x2,c[1]+.5)):(n.moveTo(c[0]+.5,s.y1),n.lineTo(c[0]+.5,s.y2)),n.stroke(),n.restore(),n.closePath(),{labelValue:r,position:c}},findSelectedItems(t){var i;(i=this.ensureHitCoordsFresh)==null||i.call(this);const e=[],n=Object.keys(this.seriesList);for(let s=0;s<n.length;s++){const l=n[s],a=this.seriesList[l],r=a.findItems;if(r){const c=r.call(a,t);c&&c.length&&e.push({seriesName:a.name,seriesId:l,items:c})}}return e},getSelectionRange({xsp:t,ysp:e,width:n,height:i,range:s}){var w,T,k,M;const l=this.axesSteps.x.length?this.axesSteps.x[0]:null,a=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!l||!a)return null;const r=t+n,c=e+i,d=l.graphMax-l.graphMin,h=a.graphMax-a.graphMin,u=this.getRatioInRange(s.x1,s.x2,t),f=this.getRatioInRange(s.x1,s.x2,r),m=this.getRatioInRange(s.y1,s.y2,c),g=this.getRatioInRange(s.y1,s.y2,e),p=this.isMobile&&((w=this.boxOverflow)!=null&&w.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*u,l.graphMin),y=this.isMobile&&((T=this.boxOverflow)!=null&&T.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*f,l.graphMax),C=this.isMobile&&((k=this.boxOverflow)!=null&&k.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-m),a.graphMin),b=this.isMobile&&((M=this.boxOverflow)!=null&&M.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-g),a.graphMax);return{xMin:+p.toFixed(3),xMax:+y.toFixed(3),yMin:+C.toFixed(3),yMax:+b.toFixed(3)}},getRatioInRange(t,e,n){const i=e-t;return(n-t)/i},getDragInfoForHeatMap(t){const e=Object.keys(this.seriesList)[0];return this.seriesList[e].findBlockRange(t)},getSelectionRangeForHeatMap(t){const e=this.axesSteps.x.length?this.axesSteps.x[0]:null,n=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!e||!n)return null;const i=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[i].findSelectionRange(t)??{};return{xMin:s??e.graphMin,xMax:l??e.graphMax,yMin:a??n.graphMin,yMax:r??n.graphMax}},isDeselectItem(t){var e,n;return this.options.selectItem.useDeselectItem&&(t==null?void 0:t.dataIndex)===((e=this.defaultSelectItemInfo)==null?void 0:e.dataIndex)&&(t==null?void 0:t.sId)===((n=this.defaultSelectItemInfo)==null?void 0:n.seriesID)&&!isNaN(t==null?void 0:t.dataIndex)},getCurMouseLocation(t){const[e,n]=t,i={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},s=i[this.axesX[0].units.rectStart],l=i[this.axesX[0].units.rectEnd],a=i[this.axesY[0].units.rectStart],r=i[this.axesY[0].units.rectEnd];return St(e,this.chartRect.x1,i.x1)&&St(n,a,r)?"yAxis":St(e,s,l)&&St(n,i.y2,this.chartRect.y2)?"xAxis":St(e,i.x1,i.x2)&&St(n,i.y1,i.y2)?"chartBackground":"canvas"},isNotUseIndicator(){return this.options.type==="pie"||this.options.type==="scatter"||this.options.type==="heatMap"},clearSelectedLabelInfo(){this.defaultSelectInfo={dataIndex:[]}},clearSelectedItemInfo(){this.defaultSelectItemInfo=null}},jo=8,fs=50,gi=17,IC=8,LC={createTooltipDOM(){var t,e;this.tooltipDOM=document.createElement("div"),this.tooltipDOM.className="ev-chart-tooltip",this.tooltipHeaderDOM=document.createElement("div"),this.tooltipHeaderDOM.className="ev-chart-tooltip-header",this.tooltipBodyDOM=document.createElement("div"),this.tooltipBodyDOM.className="ev-chart-tooltip-body",this.tooltipCanvas=document.createElement("canvas"),this.tooltipCanvas.className="ev-chart-tooltip-canvas",this.tooltipCtx=this.tooltipCanvas.getContext("2d"),this.tooltipDOM.style.display="none",(e=(t=this.options.tooltip)==null?void 0:t.formatter)!=null&&e.html||this.setDefaultTooltipLayout(),document.body.appendChild(this.tooltipDOM),this.options.tooltip.debouncedHide?this.hideTooltipDOM=Jr(()=>{this.tooltipDOM.style.display="none"},200):this.hideTooltipDOM=()=>{this.tooltipDOM.style.display="none"},this.isInitTooltip=!0},setDefaultTooltipLayout(){this.tooltipBodyDOM.appendChild(this.tooltipCanvas),this.tooltipDOM.appendChild(this.tooltipHeaderDOM),this.tooltipDOM.appendChild(this.tooltipBodyDOM)},createPlotLabelTooltipDOM(){this.plotLabelTooltipDOM=document.createElement("div"),this.plotLabelTooltipDOM.className="ev-chart-plot-label-tooltip",this.plotLabelTooltipDOM.style.position="fixed",this.plotLabelTooltipDOM.style.display="none",this.plotLabelTooltipDOM.style.pointerEvents="none",this.plotLabelTooltipDOM.style.zIndex="1000",this.plotLabelTooltipDOM.style.whiteSpace="nowrap",document.body.appendChild(this.plotLabelTooltipDOM)},showPlotLabelTooltip(t,e){this.plotLabelTooltipDOM||this.createPlotLabelTooltipDOM();const n=this.plotLabelTooltipDOM,i=t.style??{},s=i.padding??{top:4,right:8,bottom:4,left:8},l=i.backgroundColor??"#4C4C4C";n.textContent=t.text,n.style.backgroundColor=l,n.style.color=i.fontColor??"#FFFFFF",n.style.border=`1px solid ${i.borderColor??l}`,n.style.borderRadius=`${i.borderRadius??4}px`,n.style.fontSize=`${i.fontSize??12}px`,n.style.fontWeight=`${i.fontWeight??400}`,n.style.fontFamily=i.fontFamily??"Roboto",n.style.padding=`${s.top}px ${s.right}px ${s.bottom}px ${s.left}px`,n.style.boxShadow=i.useShadow?`2px 2px 4px rgba(0, 0, 0, ${i.shadowOpacity??.25})`:"none",n.style.left=`${e.clientX+10}px`,n.style.top=`${e.clientY+10}px`,n.style.display="block"},hidePlotLabelTooltip(){this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.style.display="none")},getFontStyle(t){var s,l;const e=(s=this.options)==null?void 0:s.tooltip,n=((l=e==null?void 0:e.fontSize)==null?void 0:l[t])??14,i=(e==null?void 0:e.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${i}`},getTextHeight(){var t,e,n;return(((n=(e=(t=this.options)==null?void 0:t.tooltip)==null?void 0:e.fontSize)==null?void 0:n.contents)??14)+6},getColorMargin(){var t,e,n;return(((n=(e=(t=this.options)==null?void 0:t.tooltip)==null?void 0:e.fontSize)==null?void 0:n.contents)??14)+2},getBoxPadding(){var s,l;const{top:t=0,right:e=20,bottom:n=3,left:i=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t,l:i,b:n,r:e}},setTooltipLayoutPosition(t,e){var H,_,D,z,A,j,J;const n=this.tooltipCtx,i=e.pageX,s=e.pageY,l=t.items,[a,r]=t.maxTip,d=Object.keys(l).length,h=this.getBoxPadding(),u=this.options.tooltip,f=this.getColorMargin(),m=t.hitId,g=l[m].data,p=l[m].axis,y=(H=u.formatter)==null?void 0:H.title;this.axesX.length&&this.axesY.length&&u.showHeader&&(y?this.tooltipHeaderDOM.textContent=y({x:g.x,y:g.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[p.y].getLabelFormat(g.y):this.axesX[p.x].getLabelFormat(g.x)),u.textOverflow&&this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${u.textOverflow}`),this.tooltipHeaderDOM.style.visibility="hidden",n.save(),n.font=this.getFontStyle("contents");const b=!!this.options.horizontal?(D=(_=l[t.hitId])==null?void 0:_.data)==null?void 0:D.y:(A=(z=l[t.hitId])==null?void 0:z.data)==null?void 0:A.x,w=(b==null?void 0:b.length)>a.length?b:a,T=Math.round(n.measureText(w).width),k=Math.round(n.measureText(r).width),M=T+k+h.l+h.r+f+fs+gi,V=M>u.maxWidth?u.maxWidth:M;let x=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const q=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+f+fs+gi);Object.values(l).map(ne=>ne.name).forEach(ne=>{if(n.measureText(ne).width>q){let $="";for(let ee=0;ee<ne.length;ee++){const Q=ne[ee],he=`${$}${Q}`;n.measureText(he).width>q?($=Q,x+=1):$=he}}x+=1}),n.restore()}const S=h.t+x*this.getTextHeight()+d*jo+h.b;let L;u.useScrollbar&&S>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",L=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",L=S),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=S*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${S}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${L+6}px`,this.tooltipDOM.style.display="block";const I=document.body.clientWidth,R=document.body.clientHeight,v=20,G=((j=this.tooltipDOM)==null?void 0:j.offsetHeight)||((J=this.tooltipHeaderDOM)==null?void 0:J.offsetHeight)+L+IC,W=I-V-v,E=R-G-v,X=i+v,Z=s+v,N=i-V-v,P=s-G-v,B=X>W?N:X,Y=Z>E?P:Z;this.tooltipDOM.style.transform=`translate3d(${B}px, ${Y}px, 0)`},drawSeriesColorShape(t,e,n){var a,r;const i=(r=(a=this.options.tooltip)==null?void 0:a.fontSize)==null?void 0:r.contents,{x:s,y:l}=n;if(e==="circle"){t.beginPath();const c=i/2;t.arc(s,l-c/2,c,0,2*Math.PI),t.fill()}else{const c=i;t.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(t,e){const n=e,i=t.items,[,s]=t.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.horizontal,c=this.options.tooltip,d=this.getTextHeight(),h=this.getColorMargin();this.axesX.length&&this.axesY.length&&c.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let u=2,f=2;u+=O.aliasPixel(u),f+=O.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=gi),u+=a.l,f+=a.t,n.font=this.getFontStyle("contents");const m=[];l.forEach(y=>{m.push({id:y,data:i[y].data,color:i[y].color,name:i[y].name,dataId:i[y].id})}),c.sortByValue&&m.sort((y,C)=>{let b=y.data.o,w=C.data.o;return b==null&&(b=r?y.data.x:y.data.y),w==null&&(w=r?C.data.x:C.data.y),w-b}),this.setTooltipDOMStyle(c);const g=this.tooltipDOM.offsetWidth;let p=1;for(let y=0;y<m.length;y++){const C=m[y].data,b=m[y].color,w=m[y].name,T=C.formatted;let k=u+4,M=f+p*d;k+=O.aliasPixel(k),M+=O.aliasPixel(M),n.beginPath(),typeof b!="string"?n.fillStyle=te.createGradient(n,r,{x:k-4,y:M,w:12,h:-12},b):n.fillStyle=b;const V={id:m[y].id,name:m[y].name,value:T,dataId:m[y].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:k,y:M}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(V):c.fontColor.label??c.fontColor;const x=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-fs,S=k+h,L=M;if(x>n.measureText(w).width)n.fillText(w,S,L);else if(c.textOverflow==="wrap"){let I="",R=L;for(let v=0;v<w.length;v++){const G=w[v],W=`${I}${G}`;n.measureText(W).width>x?(n.fillText(I,S,R),I=G,p+=1,R+=d):I=W}n.fillText(I,S,R)}else{const I=O.truncateLabelWithEllipsis(w,x,n);n.fillText(I,S,L)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(V):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(T,g-a.r,M),n.restore(),n.closePath(),f+=jo,p+=1}n.restore()},drawToolTipForHeatMap(t,e){const n=e,i=t.items,s=t.hitId,l=i[s].data,a=i[s].axis,r=i[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,u=Object.values(this.seriesList)[0],f=this.getTextHeight(),m=this.getColorMargin();let g=!1,p=l.formatted;const{colorState:y,isGradient:C}=u;if(C){const{min:M,max:V}=u.valueOpt,x=Je(l.o-M,V-M),{start:S,end:L}=y[0];g=S<=x&&x<=L||l.o===-1}else{const M=y.find(({id:V})=>V===l.cId);g=M==null?void 0:M.show,p=(M==null?void 0:M.label)??p}if(!g){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h);const b=this.tooltipDOM.offsetWidth;n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=gi);const w=c.l+2,T=c.t+f+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=te.createGradient(n,d,{x:w,y:T,w:12,h:-12},r):n.fillStyle=r;const k={id:t.hitId,name:l.y,value:p,dataId:i[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:w,y:T}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(k):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),w+m,T),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(k):h.fontColor.value??h.fontColor,n.fillText(p,b-c.r,T),n.closePath()},drawTooltipForScatter(t,e){const n=e,i=t.items,[,s]=t.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.tooltip,c=this.getTextHeight(),d=this.getColorMargin();this.axesX.length&&this.axesY.length&&r.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let h=2,u=2;h+=O.aliasPixel(h),u+=O.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=gi),h+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const f=[];l.forEach(p=>{f.push({data:i[p].data,color:i[p].color,name:i[p].name})}),r.sortByValue&&f.sort((p,y)=>{let C=p.data.o,b=y.data.o;return C==null&&(C=p.data.y),b==null&&(b=y.data.y),b-C}),this.setTooltipDOMStyle(r);const m=this.tooltipDOM.offsetWidth;let g=1;for(let p=0;p<f.length;p++){const y=f[p].data,C=f[p].color,b=f[p].name,w=y.formatted;let T=h+4,k=u+g*c;T+=O.aliasPixel(T),k+=O.aliasPixel(k),n.beginPath(),typeof C!="string"?n.fillStyle=te.createGradient(n,!1,{x:T-4,y:k,w:12,h:-12},C):n.fillStyle=C;const M={id:t.hitId,name:f[p].name,value:w,dataId:f[p].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:T,y:k}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(M):r.fontColor.label??r.fontColor;const V=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-fs,x=T+d,S=k;if(V>n.measureText(b).width)n.fillText(b,x,S);else if(r.textOverflow==="wrap"){let L="",I=S;for(let R=0;R<b.length;R++){const v=b[R],G=`${L}${v}`;n.measureText(G).width>V?(n.fillText(L,x,I),L=v,g+=1,I+=c):L=G}n.fillText(L,x,I)}else{const L=O.truncateLabelWithEllipsis(b,V,n);n.fillText(L,x,S)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(M):r.fontColor.value??r.fontColor,n.fillText(w,m-a.r,k),n.restore(),n.closePath(),u+=jo,g+=1}n.restore()},setCustomTooltipLayoutPosition(t,e){var w;const n=e.pageX,i=e.pageY;if(!this.tooltipDOM)return;let s=this.tooltipDOM.firstElementChild;if(!s&&(t!=null&&t.items)&&Object.keys(t.items).length&&(this.drawCustomTooltip(t.items),s=this.tooltipDOM.firstElementChild),!s)return;this.tooltipDOM.style.display="block";const l=s.offsetWidth,a=s.offsetHeight;this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${a+6}px`;const r=document.body.clientWidth,c=document.body.clientHeight,d=(w=this.tooltipDOM)==null?void 0:w.getBoundingClientRect(),h=20,u=r-l-h,f=c-(d==null?void 0:d.height)-h,m=n+h,g=i+h,p=n-l-h,y=i-(d==null?void 0:d.height)-h,C=m>u?p:m,b=g>f?y:g;this.tooltipDOM.style.transform=`translate3d(${C}px, ${b}px, 0)`},drawCustomTooltip(t){var l,a,r,c,d;const e=(l=this.options)==null?void 0:l.tooltip;if(!((a=e==null?void 0:e.formatter)!=null&&a.html))return;const n=Object.keys(t).length;if((r=this._shouldVirtualizeCustomTooltip)!=null&&r.call(this,n)&&this.drawCustomTooltipVirtual(t))return;(c=this._teardownCustomTooltipVirtualScroll)==null||c.call(this),this.tooltipDOM.innerHTML="";const i=[];Object.keys(t).forEach(h=>{i.push({sId:h,data:t[h].data,color:t[h].color,name:t[h].name,dataId:t[h].id,index:t[h].index})});const s=O.htmlToElement(e.formatter.html(i));s&&this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((d=e.fontColor)==null?void 0:d.title)??e.fontColor},setTooltipDOMStyle(t){var e;if(this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((e=t.fontColor)==null?void 0:e.title)??t.fontColor,this.tooltipHeaderDOM.style.fontSize=`${t.fontSize.title}px`,this.tooltipHeaderDOM.style.fontFamily=this.getFontStyle("title"),t.useShadow){const n=`rgba(0, 0, 0, ${t.shadowOpacity})`;this.tooltipDOM.style.boxShadow=`2px 2px 2px ${n}`}this.tooltipDOM.style.display="block"},drawItemsHighlight(t,e){Object.keys(t.items).forEach(n=>{var s;const i=this.seriesList[n];i.itemHighlight(t.items[n],e,t.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),O.isDoughnutHole(i.type)&&this.drawDoughnutHole(e)})},drawIndicator(t,e){var d;const n=this.overlayCtx,[i,s]=t,l={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},a=15,r=15,c=this.options;i>=l.x1-a&&i<=l.x2+a&&s>=l.y1-r&&s<=l.y2+r&&(n.beginPath(),n.save(),n.strokeStyle=e,n.lineWidth=1,(d=c.indicator)!=null&&d.segments&&n.setLineDash(c.indicator.segments),c.horizontal?(n.moveTo(l.x1,s+.5),n.lineTo(l.x2,s+.5)):(n.moveTo(i+.5,l.y1),n.lineTo(i+.5,l.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(t){var u,f,m,g;const e=this.options;if(e.syncHover===!1||!e.horizontal&&!e.axesX.every(({type:p})=>p==="time")||e.horizontal&&!e.axesY.every(({type:p})=>p==="time"))return null;const n=+((u=this.data.labels)==null?void 0:u[0]),i=+((f=this.data.labels)==null?void 0:f[this.data.labels.length-1]);if(n==null||i==null)return null;const[s,l]=t,a={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(e.horizontal?(m=e.axesY)==null?void 0:m.every(p=>p.categoryMode):(g=e.axesX)==null?void 0:g.every(p=>p.categoryMode)){const p=this.data.labels.length;if(!p)return null;let y;if(e.horizontal){const b=a.y2-a.y1;y=(l-a.y1)/b}else{const b=a.x2-a.x1;y=(s-a.x1)/b}const C=Math.min(Math.max(Math.floor(y*p),0),p-1);return+this.data.labels[C]}if(e.horizontal){const p=a.y2-a.y1,C=(l-a.y1)*(i-n)/p+n;return Math.round(C)}const c=a.x2-a.x1,h=(s-a.x1)*(i-n)/c+n;return Math.round(h)},drawSyncedIndicator({horizontal:t,label:e,mousePosition:n,dataLabel:i}){var g,p;if(!this._canDrawSyncedIndicator(t,n))return;if(i){this.drawSyncedIndicatorForTooltip({dataLabel:i,mousePosition:n});return}const s=+((g=this.data.labels)==null?void 0:g[0]),l=+((p=this.data.labels)==null?void 0:p[this.data.labels.length-1]),[a,r]=n,{top:c,bottom:d,left:h,right:u}=this.getChartDOMClientRect();if(St(a,h,u)&&St(r,d,c))return;this.overlayClear();const m={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(t){const C=(m.y2-m.y1)*(e-s)/(l-s)+m.y1;this.drawIndicator([m.x2,C],this.options.indicator.color)}else{const C=(m.x2-m.x1)*(e-s)/(l-s)+m.x1;this.drawIndicator([C,m.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(t,e){return!e||!!t!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(t)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(t){var n,i;return this.options.syncHover===!1||!((i=(n=this.data)==null?void 0:n.labels)!=null&&i.length)?!1:t?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,i;const t=+((n=this.data.labels)==null?void 0:n[0]),e=+((i=this.data.labels)==null?void 0:i[this.data.labels.length-1]);return t!=null&&e!=null},drawSyncedIndicatorForTooltip({dataLabel:t,mousePosition:e}){var u,f,m,g,p,y,C,b,w,T,k,M,V;if(!((u=this.data)!=null&&u.labels)||!t)return;const n=this.data.labels.findIndex(x=>(x==null?void 0:x.valueOf())===(t==null?void 0:t.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:i}=this.options,s=this.getChartDOMClientRect(),[l,a]=e;if(St(l,s.left,s.right)&&St(a,s.bottom,s.top))return;this.overlayClear();const c={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},d=this.data.labels.length;let h;if(i){const x=c.y2-c.y1,S=(f=this.options.axesY)==null?void 0:f.some(R=>R.categoryMode),L=(m=this.options.axesY)==null?void 0:m.some(R=>R.type==="time");let I;if(S)I=c.y1+x*(n+.5)/d;else if(L){const R=(p=(g=this.axesSteps)==null?void 0:g.y)==null?void 0:p[0],v=(R==null?void 0:R.graphMin)??+((y=this.data.labels)==null?void 0:y[0]),G=(R==null?void 0:R.graphMax)??+((C=this.data.labels)==null?void 0:C[this.data.labels.length-1]);I=c.y1+x*(+t-v)/(G-v)}else I=c.y1+x*n/(d-1);h=[c.x2,I]}else{const x=c.x2-c.x1,S=(b=this.options.axesX)==null?void 0:b.some(R=>R.categoryMode),L=(w=this.options.axesX)==null?void 0:w.some(R=>R.type==="time");let I;if(S)I=c.x1+x*(n+.5)/d;else if(L){const R=(k=(T=this.axesSteps)==null?void 0:T.x)==null?void 0:k[0],v=(R==null?void 0:R.graphMin)??+((M=this.data.labels)==null?void 0:M[0]),G=(R==null?void 0:R.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);I=c.x1+x*(+t-v)/(G-v)}else I=c.x1+x*n/(d-1);h=[I,c.y2]}this.drawIndicator(h,this.options.indicator.color)},tooltipClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.tooltipCtx.clearRect(0,0,this.tooltipCanvas.width/this.clearRectRatio,this.tooltipCanvas.height/this.clearRectRatio),this.tooltipDOM.style.display="none"},alignSeriesList(t){const e=this.data.groups,n=this.seriesList,i=[];return e.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&t.includes(l)&&i.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&t.includes(s)&&i.push(s)}),i},tooltipDestroy(){var t;(t=this._teardownCustomTooltipVirtualScroll)==null||t.call(this),this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.remove(),this.plotLabelTooltipDOM=null),this.isInitTooltip=!1}},TC=480,MC=28,vC=5,RC=50,VC={_shouldVirtualizeCustomTooltip(t){var i,s;if(this._vsDetectFailed)return!1;const e=(i=this.options)==null?void 0:i.tooltip;if(!((s=e==null?void 0:e.formatter)!=null&&s.html))return!1;const n=e.virtualScroll;return!n||n.use===!1?!1:n.use===!0?t>0:t>=(n.threshold??RC)},_findCustomTooltipContainer(t,e){if(!t||!t.querySelectorAll)return null;const n=t.querySelectorAll("[data-evui-tooltip-row]");if(n.length===e&&n.length>0){const s=n[0].parentElement;let l=!!s;for(let a=1;a<n.length;a++)if(n[a].parentElement!==s){l=!1;break}if(l)return s}const i=[t];for(;i.length;){const s=i.shift();if(s.children&&s.children.length===e)return s;if(s.children)for(let l=0;l<s.children.length;l++)i.push(s.children[l])}return null},_createVirtualScrollAnatomy(){const t=document.createElement("div");t.className="ev-chart-tooltip-virtual__spacer",t.setAttribute("aria-hidden","true");const e=document.createElement("div");e.className="ev-chart-tooltip-virtual__viewport";const n=document.createElement("div");return n.className="ev-chart-tooltip-virtual__spacer",n.setAttribute("aria-hidden","true"),{topSpacer:t,viewport:e,bottomSpacer:n}},_recomputeCustomTooltipPrefixSums(){const t=this.vsState,e=t.heights.length;t.prefixSums.length!==e+1&&(t.prefixSums=new Array(e+1));let n=0;t.prefixSums[0]=0;for(let i=0;i<e;i++)n+=t.heights[i],t.prefixSums[i+1]=n;t.totalHeight=n},_computeCustomTooltipVisibleRange(){const t=this.vsState,e=t.heights.length;if(!e)return{start:0,end:-1};const n=t.scrollEl.clientHeight||t.maxHeight,i=t.scrollEl.scrollTop;let s=0,l=e;for(;s<l;){const d=s+l>>>1;t.prefixSums[d+1]>i?l=d:s=d+1}const a=Math.max(0,s-t.overscan),r=i+n;for(s=a,l=e;s<l;){const d=s+l>>>1;t.prefixSums[d]>=r?l=d:s=d+1}const c=Math.min(e-1,s+t.overscan);return{start:a,end:c}},_syncCustomTooltipSpacers(){const t=this.vsState,e=t.prefixSums[t.range.start]||0,n=Math.max(0,t.totalHeight-(t.prefixSums[t.range.end+1]||t.totalHeight)),i=`${e}px`,s=`${n}px`;t.topSpacer.style.height!==i&&(t.topSpacer.style.height=i),t.bottomSpacer.style.height!==s&&(t.bottomSpacer.style.height=s)},_renderVisibleCustomTooltipRows(){const t=this.vsState;if(!t||!t.items.length)return;const e=this._computeCustomTooltipVisibleRange();if(t.range.start===e.start&&t.range.end===e.end)t.range=e;else{for(;t.viewport.firstChild;)t.viewport.removeChild(t.viewport.firstChild);const s=document.createDocumentFragment();for(let l=e.start;l<=e.end;l++){const a=t.items[l];a&&s.appendChild(a)}t.viewport.appendChild(s),t.range=e}this._syncCustomTooltipSpacers();let i=!1;for(let s=e.start;s<=e.end;s++)if(!t.measured[s]){i=!0;break}if(i){const s=t.measureDepth||0;if(s<2){t.measureDepth=s+1;try{this._measureVisibleCustomTooltipRows()}finally{t.measureDepth=s}}}},_measureVisibleCustomTooltipRows(){const t=this.vsState;if(!t||!t.viewport)return;const e=t.viewport.children,n=e.length;if(!n)return;const i=t.range.start,s=t.prefixSums[i]||0;let l=!1,a=0,r=0;for(let c=0;c<n;c++){const d=t.range.start+c,h=e[c].offsetHeight;h>0&&(h!==t.heights[d]&&(t.heights[d]=h,l=!0),t.measured[d]=!0),t.isRow[d]&&h>0&&(a+=h,r+=1)}if(r>0){const c=a/r;if(t.learnedAverageHeight=c,c>0&&Math.abs(c-t.estimatedRowHeight)>.5){t.estimatedRowHeight=c;for(let d=0;d<t.heights.length;d++)t.isRow[d]&&!t.measured[d]&&t.heights[d]!==c&&(t.heights[d]=c,l=!0)}}if(l){this._recomputeCustomTooltipPrefixSums();const d=(t.prefixSums[i]||0)-s;d!==0&&(t.suppressScroll=!0,t.scrollEl.scrollTop+=d,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.vsState&&(this.vsState.suppressScroll=!1)})})),this._renderVisibleCustomTooltipRows()}else this._syncCustomTooltipSpacers()},drawCustomTooltipVirtual(t){var b,w,T;const e=(b=this.options)==null?void 0:b.tooltip;if(!((w=e==null?void 0:e.formatter)!=null&&w.html))return!1;const n=[];Object.keys(t).forEach(k=>{n.push({sId:k,data:t[k].data,color:t[k].color,name:t[k].name,dataId:t[k].id,index:t[k].index})});let i;try{i=e.formatter.html(n)}catch(k){return console.warn("[evui] tooltip.formatter.html threw, falling back:",k),!1}const s=O.htmlToElement(i);if(!s||!s.children)return!1;const l=this._findCustomTooltipContainer(s,n.length);if(!l)return this._vsDetectFailed=!0,this._vsWarnedFallback||(this._vsWarnedFallback=!0,console.warn("[evui] tooltip.virtualScroll: formatter.html 반환 구조에서 row를 식별하지 못해 가상 스크롤을 건너뜁니다. 시리즈당 wrapper element에 `data-evui-tooltip-row` 속성을 추가하거나, row 컨테이너 직속 자식이 시리즈 수와 일치하도록 마크업을 정리하세요.")),!1;const a=Array.from(l.children);if(!a.length)return!1;const r=k=>!!(k.hasAttribute&&k.hasAttribute("data-evui-tooltip-row")),c=a.some(r),d=a.map(k=>c?r(k):!0);for(let k=0;k<a.length;k++){const M=a[k];M.parentNode&&M.parentNode.removeChild(M)}for(;l.firstChild;)l.removeChild(l.firstChild);const{topSpacer:h,viewport:u,bottomSpacer:f}=this._createVirtualScrollAnatomy();l.appendChild(h),l.appendChild(u),l.appendChild(f);const m=e.maxHeight||TC;l.style.maxHeight=`${m}px`,l.style.overflowY="auto",l.style.overflowX="hidden",l.style.overflowAnchor="none",this._teardownCustomTooltipVirtualScroll();const g=e.virtualScroll||{},p=this._vsLearnedAverageHeight,y=p??g.estimatedRowHeight??MC;this.vsState={scrollEl:l,topSpacer:h,viewport:u,bottomSpacer:f,items:a,isRow:d,heights:new Array(a.length).fill(y),measured:new Array(a.length).fill(!1),prefixSums:[],totalHeight:0,range:{start:0,end:-1},estimatedRowHeight:y,overscan:g.overscan??vC,maxHeight:m,rafPending:!1,suppressScroll:!1,learnedAverageHeight:p,resizeObserver:null,onScroll:null},this._recomputeCustomTooltipPrefixSums();const C=()=>{this.vsState&&(this.vsState.suppressScroll||this.vsState.rafPending||(this.vsState.rafPending=!0,requestAnimationFrame(()=>{this.vsState&&(this.vsState.rafPending=!1,this._renderVisibleCustomTooltipRows())})))};if(l.addEventListener("scroll",C,{passive:!0}),this.vsState.onScroll=C,typeof ResizeObserver<"u"){let k=l.clientWidth;const M=new ResizeObserver(()=>{if(!this.vsState)return;const V=l.clientWidth;V!==k&&(k=V,this.vsState.measured.fill(!1),this.vsState.heights.fill(this.vsState.estimatedRowHeight),this._recomputeCustomTooltipPrefixSums(),this._renderVisibleCustomTooltipRows())});M.observe(l),this.vsState.resizeObserver=M}for(;this.tooltipDOM.firstChild;)this.tooltipDOM.removeChild(this.tooltipDOM.firstChild);return this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((T=e.fontColor)==null?void 0:T.title)??e.fontColor,this._renderVisibleCustomTooltipRows(),!0},_teardownCustomTooltipVirtualScroll(){const t=this.vsState;t&&(t.scrollEl&&t.onScroll&&t.scrollEl.removeEventListener("scroll",t.onScroll),t.resizeObserver&&t.resizeObserver.disconnect(),t.learnedAverageHeight&&(this._vsLearnedAverageHeight=t.learnedAverageHeight),this.vsState=null)}},EC={pieDataSet:[],drawPie(t,e=this.bufferCtx){var T;const n=this.chartRect,i=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,u,f,m;const g=n.width/2,p=n.height/2,y=g-(l.left+l.right),C=p-(l.bottom+l.top);if(typeof y=="number"&&y<0||typeof C=="number"&&C<0)return;const b=Math.min(y,C)*s.doughnutHoleSize,w=Math.min(y,C);for(let k=0;k<i.length;k++){const M=i[k];if(!M)return;let V=w-(w-b)/i.length*k;if((T=s==null?void 0:s.pieStroke)!=null&&T.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(M.or=V,k<i.length-1?M.ir=w-(w-b)/i.length*(k+1):M.ir=1,M.total){for(let x=0;x<M.data.length;x++)if(r=M.data[x],c=r.value,m=c/M.total*100,d=2*Math.PI*(c/M.total),u=h+d,r.sa=h,r.ea=u,f=this.seriesList[r.id],c){const S={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(S.use=!1,e.lineWidth=s.pieStroke.lineWidth,e.strokeStyle=s.pieStroke.color,e.arc(g,p,V,0,2*Math.PI),e.stroke());const{selectInfo:L,legendHitInfo:I,unSelectedOpacity:R}=t;f.isSelect=(L==null?void 0:L.sId)===r.id,f.isDownplay=I&&I.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=g,f.centerY=p,f.radius=V,f.doughnutHoleSize=V*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:m},f.draw(e,S,R),h+=d}}}},drawSunburst(t,e=this.bufferCtx){var p;const{width:n,height:i}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=i/2,u=d-(a.left+a.right),f=h-(a.bottom+a.top);if(typeof u=="number"&&u<0||typeof f=="number"&&f<0)return;const m=Math.min(u,f)*l.doughnutHoleSize,g=Math.min(u,f);for(let y=0;y<s.length;y++){const C=s[y];if(!C)return;let b=g-(g-m)/s.length*y;if((p=l==null?void 0:l.pieStroke)!=null&&p.use&&(b-=l.pieStroke.lineWidth),b<0)return;C.or=b,y<s.length-1?C.ir=g-(g-m)/s.length*(y+1):C.ir=1;for(let w=0;w<C.data.length;w++)if(r=C.data[w],r.id==="dummy")e.save(),e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle="#fff",e.lineWidth=2,e.strokeStyle="#fff",e.moveTo(d,h),e.arc(d,h,b,r.sa,r.ea),e.stroke(),e.fill(),e.closePath(),e.restore();else if(c=this.seriesList[r.id],r.value){const T={...l.pieStroke};C.data.length===1&&l.pieStroke.use&&(T.use=!1,e.lineWidth=l.pieStroke.lineWidth,e.strokeStyle=l.pieStroke.color,e.arc(d,h,b,0,2*Math.PI),e.stroke());const{selectInfo:k,legendHitInfo:M,unSelectedOpacity:V}=t;c.isSelect=(k==null?void 0:k.sId)===r.id,c.isDownplay=M&&M.sId!==r.id,c.type="sunburst",c.centerX=d,c.centerY=h,c.radius=b,c.doughnutHoleSize=b*(l.doughnutHoleSize??0),c.startAngle=r.sa,c.endAngle=r.ea,c.data={o:r.value},c.draw(e,T,V)}}},drawDoughnutHole(t=this.bufferCtx){var h;const e=this.options,{width:n,height:i}=this.chartRect,s=this.options.padding,l=n/2,a=i/2,r=l-(s.left+s.right),c=a-(s.bottom+s.top);if(typeof r=="number"&&r<0||typeof c=="number"&&c<0)return;const d=Math.min(r,c)*e.doughnutHoleSize;t.save(),t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle="#fff",t.fillOpacity=0,t.arc(l,a,d,0,2*Math.PI),t.fill(),t.strokeStyle="#fff",t.stroke(),t.closePath(),t.restore(),(h=e==null?void 0:e.pieStroke)!=null&&h.use&&(t.beginPath(),t.strokeStyle=e.pieStroke.color,t.lineWidth=e.pieStroke.lineWidth,t.arc(l,a,d,0,Math.PI*2),t.stroke(),t.closePath()),this.pieDataSet[this.pieDataSet.length-1].ir=d}},GC={drawTips(t,e=this.bufferCtx){var u,f,m,g,p,y,C,b;const n=this.options;let i=null;const s=!!n.horizontal,l=n.maxTip,a=n.selectItem,r=n.selectLabel;let c,d;typeof((u=n.tooltip)==null?void 0:u.formatter)=="function"?i=(f=n.tooltip)==null?void 0:f.formatter:typeof((g=(m=n.tooltip)==null?void 0:m.formatter)==null?void 0:g.value)=="function"&&(i=(y=(p=n.tooltip)==null?void 0:p.formatter)==null?void 0:y.value),r.use&&r.showTip&&(d=n.type==="heatMap"?this.drawLabelTipForHeatMap(e):this.drawTipForSelectedLabel(e));const h=w=>{t.forEach(T=>{if(T){const k=this.seriesList[T==null?void 0:T.sId];if(!(k!=null&&k.show))return;const M=this.calculateTipInfo(k,"sel",T);if(M&&M.dp!==null){let V=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(V=!0),w.showTextTip||w.showTip){if(w.tipText==="label"){const x=s?n.axesY[0]:n.axesX[0],S=M.label;M.text=x.type==="time"?Ne(S).format(x.timeFormat):S}else M.text=Qt(M.value);this.drawTextTip({opt:w,tipType:"sel",seriesOpt:k,isSamePos:V,ctx:e,...M})}w.showIndicator&&this.drawFixedIndicator({opt:w,seriesOpt:k,ctx:e,...M})}T&&(T!=null&&T.label)&&(T==null?void 0:T.label)===0&&(this.lastHitInfo=T)}})};if(t&&!d&&(a.use?h(a):r.use&&n.type==="line"&&h(r)),l.use&&!d){const w=s?this.axesSteps.y[0]:this.axesSteps.x[0],T=w==null?void 0:w.minIndex,k=w==null?void 0:w.maxIndex,M=(b=(C=s?this.axesY[0]:this.axesX[0])==null?void 0:C.labels)==null?void 0:b.length,V=Number.isFinite(M)?M-1:k,x=Number.isFinite(T)&&Number.isFinite(k),S=x&&k<T,L=x&&(T>0||k<V);let I,R=null;S?I=void 0:L?(R=this.getVisibleWindowMaxSeries(T,k),I=R==null?void 0:R.sId):I=this.minMax[s?"x":"y"][0].maxSID;const v=I?this.seriesList[I]:null;v&&(c=this.calculateTipInfo(v,"max",R),l.use&&c&&c.dp!==null&&(i?c.text=i({seriesId:v.sId,x:s?c.value:void 0,y:s?void 0:c.value}):c.text=Qt(c.value),this.drawTextTip({opt:l,tipType:"max",seriesOpt:v,ctx:e,...c}),l.showIndicator&&this.drawFixedIndicator({opt:l,seriesOpt:v,ctx:e,...c})))}},calculateTipInfo(t,e,n){if(!t)return!1;const i=!!this.options.horizontal,s=this.lastTip,l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=l.chartHeight-(a.top+a.bottom),d=l.chartWidth-(a.left+a.right),h=this.axesSteps.x[t.xAxisIndex],u=this.axesSteps.y[t.yAxisIndex],f=r.x1,m=r.x2,g=r.y2,{type:p,size:y}=t,{maxDomain:C,maxDomainIndex:b}=t.minMax;if(C===null||b<0)return!1;const w=p==="bar"?n==null?void 0:n.index:n==null?void 0:n.domain,T=e==="max"&&n&&Number.isFinite(w)&&Number.isFinite(n.value);let k;T?k=w:k=p==="bar"?b:C,e==="sel"&&(n&&n.label!==null?(s.pos=p==="bar"?n.dataIndex:n.label,k=s.pos):s.pos!==null&&(k=s.pos));let M;T?M=n.value:M=i?t.minMax.maxX:t.minMax.maxY;let V;if(e==="sel"){if(n&&n.label!==null)V=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=V;else if(s.value!==null)M=s.value,V=s.label;else if(s.pos!==null){const G=p==="bar"?"getItemByLabelIndex":"getItemByLabel";if(typeof this[G]=="function"){const W=this[G](s.pos);M=W.useStack?W.acc:W.value,V=W.label,s.value=M,s.label=V}}}const x=i?h.graphMax:u.graphMax;if((e==="max"||e==="sel")&&M>x&&!this.options.displayOverflow)return!1;let S,L,I;if(p==="bar"){const G=i?this.scrollbar.y:this.scrollbar.x;if(G!=null&&G.use){const[W,E]=(G==null?void 0:G.range)??[];if(k>=W&&k<=E)k-=W??0;else return!1}else{const W=i?u:h,{minIndex:E,maxIndex:X}=W??{};if(Number.isFinite(E)&&Number.isFinite(X))if(k>=E&&k<=X)k-=E;else return!1}i?(L=Math.round(y.h/2),S=g-y.cat*k-y.cPad,I=S-(y.bar*y.ix-(y.h+y.bPad))-L):(L=Math.round(y.w/2),S=f+y.cat*k+y.cPad,I=S+(y.bar*y.ix-(y.w+y.bPad))+L)}else p==="line"?I=te.calculateX(k,h.graphMin,h.graphMax,d-y.comboOffset,f+y.comboOffset/2):p==="scatter"&&(I=te.calculateX(k,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:m,ysp:g},...{dp:I,value:M,label:V,type:p}}},drawFixedIndicator(t){const e=!!this.options.horizontal,n=t.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:u,opt:f,seriesOpt:m}=t;let g=0;h==="line"?g+=3:h==="scatter"&&(g+=(m==null?void 0:m.pointSize)??0);let p;if(f.fixedPosTop)e?p=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r):(p=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),p-=g);else if(e){const y=Math.min(Math.max(u,i.graphMin),i.graphMax);p=te.calculateX(y,i.graphMin,i.graphMax,l,r)}else{const y=Math.min(Math.max(u,s.graphMin),s.graphMax);p=te.calculateY(y,s.graphMin,s.graphMax,a,c),p-=g}d!==null&&(n.beginPath(),n.save(),n.strokeStyle=f.indicatorColor,n.lineWidth=2,e?(n.moveTo(r,d),n.lineTo(p,d)):(n.moveTo(d,c),n.lineTo(d,p)),n.stroke(),n.restore(),n.closePath())},drawTipForSelectedLabel(t=this.bufferCtx){var c,d;const e=this.options,n=!!e.horizontal,i=e.selectLabel,{dataIndex:s,data:l,label:a}=this.defaultSelectInfo;let r=!1;if(s.length){r=!0;const h=this.chartRect,u=this.labelOffset,f={x1:h.x1+u.left,x2:h.x2-u.right,y1:h.y1+u.top,y2:h.y2-u.bottom},m=n?this.axesY[0]:this.axesX[0],g=n?this.axesX[0]:this.axesY[0],p=n?this.axesSteps.x[0]:this.axesSteps.y[0],y=n?te.calculateX:te.calculateY,C=n?te.calculateY:te.calculateX,b=n?this.scrollbar.y:this.scrollbar.x,w=h.chartWidth-(u.left+u.right),T=h.chartHeight-(u.top+u.bottom),k=n?w:T,M=f[g.units.rectStart];let V=this.options.type==="bar"?4:6;V*=n?1:-1;const x=Object.keys(this.seriesList??{}),S=x.filter(H=>this.seriesList[H].show),L=x.some(H=>this.seriesList[H].isExistGrp&&!this.seriesList[H].isOverlapping),I=((c=this.data.groups)==null?void 0:c[0])??[];let R,v,G,W,E,X,Z,N,P,B=0,Y=(d=m.labels)==null?void 0:d.length;if(m.labels){let H=m.labels.length;if(b!=null&&b.use){const{range:_,interval:D,type:z}=b,[A,j]=_??[];if(ve(A)&&ve(j))H=Math.floor((+j-+A)/D)+1,B=z==="step"?A:m.labels.findIndex(J=>J===+A),Y=z==="step"?j:m.labels.findIndex(J=>J===+j);else{const J=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(J==null?void 0:J.minIndex)&&Number.isFinite(J==null?void 0:J.maxIndex)&&J.minIndex<J.maxIndex&&(B=J.minIndex,Y=J.maxIndex,H=Y-B+1)}}W=f[m.units.rectStart],E=f[m.units.rectEnd],X=(E-W)/H}else Z=this.axesSteps.x[0],N=x.find(H=>{var _;return((_=this.seriesList[H])==null?void 0:_.type)==="line"}),P=this.seriesList[N].size;l.forEach((H,_)=>{var D;if(G=p.graphMax,!i.fixedPosTop){if(L){const z=S==null?void 0:S.reduce((J,q)=>{var U,ne;return I.includes(q)&&(((U=H[q])==null?void 0:U.value)??H[q])>0?J+(((ne=H[q])==null?void 0:ne.value)??H[q]):J},0),A=((D=S==null?void 0:S.filter(J=>!I.includes(J)))==null?void 0:D.map(J=>{var q;return((q=H[J])==null?void 0:q.value)??H[J]}))??[],j=(A==null?void 0:A.length)>0?A.reduce((J,q)=>Math.max(J,q??-1/0),-1/0):-1/0;G=z>0?Math.max(j,z):Math.max(j,0)}else if(S.length){const z=S.map(j=>{var J;return((J=H[j])==null?void 0:J.value)??H[j]}),A=z.length>0?z.reduce((j,J)=>Math.max(j,J??-1/0),-1/0):-1/0;G=A>0||this.options.type!=="bar"?A:0}}if(m.labels){if(s[_]<B||s[_]>Y)return;const z=s[_]-B;R=Math.round(W+X*z)+X/2}else R=C(a[_],Z.graphMin,Z.graphMax,w-P.comboOffset,f.x1+P.comboOffset/2);v=y(G,p.graphMin,p.graphMax,k,M)+V,this.showTip({context:t,x:n?v:R,y:n?R:v,opt:i,isSamePos:!1})})}return r},drawLabelTipForHeatMap(t=this.bufferCtx){const e=this.options,n=!!e.horizontal,i=e.selectLabel,{dataIndex:s}=this.defaultSelectInfo;let l=!1;if(s){l=!0;const a=this.chartRect,r=this.labelOffset,c={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},d=n?this.axesY[0]:this.axesX[0],h=c[d.units.rectStart],f=(c[d.units.rectEnd]-h)/d.labels.length,m=n?this.axesX[0]:this.axesY[0],g=6*(n?1:-1),p=c[m.units.rectEnd]+g;s==null||s.forEach(y=>{const b=Math.round(h+f*y)+f/2;this.showTip({context:t,x:n?p:b,y:n?b:p,opt:i,isSamePos:!1})})}return l},drawTextTip(t){const e=!!this.options.horizontal,n=t.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=t,{dp:h,value:u,text:f,opt:m,type:g,tipType:p,isSamePos:y,seriesOpt:C}=t,b=4,w=4,{fontSize:T,fontFamily:k,fontWeight:M,height:V}=m.tipStyle,x=`normal normal ${M} ${T}px ${k}`;let S=1;g==="line"?S+=6:g==="scatter"?S+=C==null?void 0:C.pointSize:g==="bar"&&(S+=4);let L,I=h;if(m.fixedPosTop)e?(L=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),L+=S):(L=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),L-=S);else if(e){const G=Math.min(Math.max(u,i.graphMin),i.graphMax);L=te.calculateX(G,i.graphMin,i.graphMax,l,r),L=u<0?L-S:L+S}else{const G=g==="bar"&&u<0?0:u,W=Math.min(Math.max(G,s.graphMin),s.graphMax);L=te.calculateY(W,s.graphMin,s.graphMax,a,d),L=G<0?L+S:L-S}let R="center";n.save(),n.font=x;const v=Math.round(Math.max(n.measureText(f).width+12,40));e||(h+v/2>c-10?(R="right",I-=v/2-b*2):h-v/2<r+10&&(R="left",I+=v/2-b*2)),n.restore(),(m.showTextTip||p==="max")&&this.showTextTip({context:n,type:R,width:v,height:V,x:e?L+v/2:I,y:e?I+V/2:L,opt:m,arrowSize:b,borderRadius:w,text:f,textStyle:x,isNegative:u<0}),m.showTip&&p==="sel"&&this.showTip({context:n,x:e?L:h,y:e?h:L,opt:m,isSamePos:y})},showTextTip(t){const e=!!this.options.horizontal,{type:n,width:i,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:u,isNegative:f}=t,m=t.context;let g=l-i/2,p=l+i/2;const y=a-s,C=a;f&&e&&(g=l-i/2-i,p=l-i/2),m.save(),m.font=u,m.fillStyle=h.tipBackground??h.tipStyle.background,m.shadowBlur=0,m.beginPath(),m.moveTo(g+c,y),m.quadraticCurveTo(g,y,g,y+c),m.lineTo(g,C-c),m.quadraticCurveTo(g,C,g+c,C),m.lineTo(p-c,C),m.quadraticCurveTo(p,C,p,C-c),m.lineTo(p,y+c),m.quadraticCurveTo(p,y,p-c,y),m.lineTo(g+c,y),m.closePath(),m.fill(),m.beginPath(),e?(f?(m.moveTo(p,C),m.lineTo(p,y+c+r/2),m.lineTo(p+r,C-s/2),m.lineTo(p,C-c-r/2)):(m.moveTo(g,y),m.lineTo(g,y+c+r/2),m.lineTo(g-r,C-s/2),m.lineTo(g,C-c-r/2)),m.closePath(),m.fill()):(f?n==="left"?(m.lineTo(g+c+r,C+r),m.lineTo(g+c+r*2,C)):n==="right"?(m.lineTo(p-r*2-c,C),m.lineTo(p-r-c,C+r)):(m.lineTo(l-r,C),m.lineTo(l,C+r),m.lineTo(l+r,C)):f||(n==="left"?(m.moveTo(g,y),m.lineTo(g+c+r,C+r),m.lineTo(g+c+r*2,C)):n==="right"?(m.moveTo(p,y),m.lineTo(p-r*2-c,C),m.lineTo(p-r-c,C+r)):(m.lineTo(l-r,C),m.lineTo(l,C+r),m.lineTo(l+r,C))),m.closePath(),m.fill()),m.restore(),m.save(),m.font=u,m.fillStyle=h.tipTextColor??h.tipStyle.textColor,m.textBaseline="middle",m.textAlign="center",m.fillText(`${d}`,g+i/2,y+s/2),m.restore()},showTip(t){const e=!!this.options.horizontal,{x:n,y:i,opt:s,isSamePos:l}=t,a=t.context,c=i-(l?24:0);a.save(),a.fillStyle=s.tipBackground??s.tipStyle.background,a.beginPath(),a.moveTo(n,c),e?(a.lineTo(n+6,c-6),a.lineTo(n+6,c+6)):(a.lineTo(n+6,c-6),a.lineTo(n-6,c-6)),a.lineTo(n,c),a.closePath(),a.fill(),a.restore()}},WC={initBlitState(){var t;this._blitPrev=null,this._blitDiag=null,this.pointsLayerA=null,this.pointsLayerB=null,this.pointsLayerACtx=null,this.pointsLayerBCtx=null,this.curPointsLayer="A",this.pointsLayerValid=!1,this._blitCarry=0,this._framesSinceFullRedraw=0,this._pointsLayerStamp=null,this._pointsLayerOptionsRef=null,this._hitCoordsDirty=!1,(t=this.options.realTimeScatter)!=null&&t.use&&this.createPointsLayers()},createPointsLayers(){this.pointsLayerA||(this.pointsLayerA=document.createElement("canvas"),this.pointsLayerB=document.createElement("canvas"),this.pointsLayerACtx=this.pointsLayerA.getContext("2d"),this.pointsLayerBCtx=this.pointsLayerB.getContext("2d"),this.curPointsLayer="A",this.pointsLayerValid=!1)},getPointsLayers(){const t=this.curPointsLayer==="A";return{src:t?this.pointsLayerA:this.pointsLayerB,srcCtx:t?this.pointsLayerACtx:this.pointsLayerBCtx,dst:t?this.pointsLayerB:this.pointsLayerA,dstCtx:t?this.pointsLayerBCtx:this.pointsLayerACtx,dstName:t?"B":"A"}},pointsLayersSized(){return!this.pointsLayerA||!this.bufferCanvas?!1:this.pointsLayerA.width===this.bufferCanvas.width&&this.pointsLayerA.height===this.bufferCanvas.height&&this.pointsLayerA.width>1&&this.pointsLayerA.height>1},collectStripDuplicatePoints(t,e){var s,l,a;const n=((l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)??[],i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!(c!=null&&c.show))continue;const d=(a=c.data[c.sId])==null?void 0:a.dataGroup;if(d)for(let h=0;h<e.length;h++){const u=d[e[h]];if(u!=null&&u.data)for(let f=0;f<u.data.length;f++){const m=u.data[f];t.set(m.k??O.coordinateKey(m.x,m.y),c.sId)}}}},getBlitScatterSeriesList(){var n,i;const t=((i=(n=this.seriesInfo)==null?void 0:n.charts)==null?void 0:i.scatter)??[],e=[];for(let s=0;s<t.length;s++){const l=this.seriesList[t[s]];l!=null&&l.show&&e.push({sId:t[s],series:l,xi:l.xAxisIndex??0,yi:l.yAxisIndex??0})}return e},getBlitScatterSeries(){return this.getBlitScatterSeriesList()[0]??null},areBlitSeriesAligned(t){var n,i,s,l;if(!t||t.length<1)return!1;const e=(i=(n=this.dataSet)==null?void 0:n[t[0].sId])==null?void 0:i.lastTick;if(!e)return!1;for(let a=1;a<t.length;a++){const r=(l=(s=this.dataSet)==null?void 0:s[t[a].sId])==null?void 0:l.lastTick;if(!r||r.gapCount!==e.gapCount||r.toTime!==e.toTime||r.endIndex!==e.endIndex||r.length!==e.length)return!1}return!0},evaluateBlitGate(t){var p,y,C,b,w,T,k,M,V,x,S,L,I,R,v;const e=this.options,n=this._blitPrev,i=this.isInit===!0&&((p=e.realTimeScatter)==null?void 0:p.use)===!0&&!e.brush&&this.updateSeries!==!0&&!t&&!((C=(y=this.scrollbar)==null?void 0:y.x)!=null&&C.use||(w=(b=this.scrollbar)==null?void 0:b.y)!=null&&w.use),s=this.getBlitScatterSeriesList(),l=this.areBlitSeriesAligned(s),a=!((T=e.selectItem)!=null&&T.use&&(((k=this.defaultSelectItemInfo)==null?void 0:k.dataIndex)!=null||((M=this.lastHitInfo)==null?void 0:M.dataIndex)!=null))&&!((V=e.selectSeries)!=null&&V.use&&this.defaultSelectInfo)&&!this.legendHover,r={modeOk:i,seriesAligned:l,selectionOk:a,scatterOnly:this.hasOnlyVisibleScatter(),hasPrev:!!n,optionsStable:!!n&&n.optionsRef===this.options,yFixed:!1,xWidthStable:!1,xAreaStable:!1,labelOffsetStable:!1,xMonotonic:!1,deviceStable:!1,gapOk:!1};let c=0,d=0,h=0;const u=s[0]??null,f=u?(S=(x=this.axesSteps)==null?void 0:x.x)==null?void 0:S[u.xi]:null,m=u?(I=(L=this.axesSteps)==null?void 0:L.y)==null?void 0:I[u.yi]:null;if(u&&f&&m&&this.chartRect&&this.labelOffset){const G=this.chartRect,W=G.chartWidth-(this.labelOffset.left+this.labelOffset.right);n&&(r.yFixed=m.graphMin===n.graphMinY&&m.graphMax===n.graphMaxY,r.xWidthStable=f.graphMax-f.graphMin===n.graphMaxX-n.graphMinX,r.xAreaStable=W===n.xArea,r.labelOffsetStable=this.labelOffset.left===n.labelOffsetLeft&&this.labelOffset.right===n.labelOffsetRight,c=f.graphMin-n.graphMinX,r.xMonotonic=Number.isFinite(c)&&c>0,r.deviceStable=this.pixelRatio===n.pixelRatio&&G.chartWidth===n.chartWidth&&G.chartHeight===n.chartHeight&&G.x1===n.x1&&G.y2===n.y2);const E=(v=(R=this.dataSet)==null?void 0:R[u.sId])==null?void 0:v.lastTick;E&&(d=E.gapCount??0,h=E.length??0,r.gapOk=d>0&&d<h)}return{ok:r.modeOk&&r.seriesAligned&&r.selectionOk&&r.scatterOnly&&r.hasPrev&&r.optionsStable&&r.yFixed&&r.xWidthStable&&r.xAreaStable&&r.labelOffsetStable&&r.xMonotonic&&r.deviceStable&&r.gapOk,parts:r,shiftMs:c,gapCount:d,length:h,scatterList:s}},hasOnlyVisibleScatter(){var n,i;const t=((n=this.seriesInfo)==null?void 0:n.charts)??{},e=Object.keys(t);for(let s=0;s<e.length;s++){if(e[s]==="scatter")continue;const l=t[e[s]];for(let a=0;a<l.length;a++)if((i=this.seriesList[l[a]])!=null&&i.show)return!1}return!0},snapshotBlitState(){var s,l,a,r,c;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const t=this.getBlitScatterSeries();if(!t)return null;const e=(a=(l=this.axesSteps)==null?void 0:l.x)==null?void 0:a[t.xi],n=(c=(r=this.axesSteps)==null?void 0:r.y)==null?void 0:c[t.yi];if(!e||!n||!this.chartRect||!this.labelOffset)return null;const i=this.chartRect;return{sId:t.sId,graphMinX:e.graphMin,graphMaxX:e.graphMax,graphMinY:n.graphMin,graphMaxY:n.graphMax,xArea:i.chartWidth-(this.labelOffset.left+this.labelOffset.right),labelOffsetLeft:this.labelOffset.left,labelOffsetRight:this.labelOffset.right,pixelRatio:this.pixelRatio,chartWidth:i.chartWidth,chartHeight:i.chartHeight,x1:i.x1,y2:i.y2,optionsRef:this.options}},recordBlitDiag(t,e,n){var s;if(typeof window>"u"||!window.__EVUI_BLIT_DEBUG__)return;(s=this.options.realTimeScatter)!=null&&s.use&&(window.__EVUI_BLIT_CHART__=this),this._blitDiag||(this._blitDiag={ticks:0,eligible:0,blitted:0,fail:{},rate:0,lastShiftMs:0,lastGap:0});const i=this._blitDiag;if(i.ticks++,i.lastShiftMs=t.shiftMs,i.lastGap=t.gapCount,t.ok)i.eligible++;else{const l=Object.keys(t.parts);for(let a=0;a<l.length;a++)t.parts[l[a]]||(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}if(t.ok&&!e&&n){const l=Object.keys(n);for(let a=0;a<l.length;a++)n[l[a]]&&(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}e&&i.blitted++,i.rate=i.blitted/i.ticks,window.__EVUI_BLIT_DIAG__=i},drawChartBlitFastPath(t,e){var H,_,D,z;const n=e.scatterList??this.getBlitScatterSeriesList(),i=n[0]??null,s=(_=(H=this.dataSet)==null?void 0:H[i==null?void 0:i.sId])==null?void 0:_.lastTick;if(!i||!s)return!1;const l=this.pixelRatio,a=this.chartRect,r=this.labelOffset,c=this.axesSteps.x[i.xi],d=a.chartWidth-(r.left+r.right),h=c.graphMax-c.graphMin;if(!(h>0)||!(d>0))return!1;const m=d/h*e.shiftMs*l+this._blitCarry,g=Math.floor(m);if(g<1)return!1;let p=s.maxDirtyAge,y=typeof i.series.pointSize=="number"?i.series.pointSize:i.series.pointSize.value;for(let A=1;A<n.length;A++){const j=(z=(D=this.dataSet)==null?void 0:D[n[A].sId])==null?void 0:z.lastTick;j&&j.maxDirtyAge>p&&(p=j.maxDirtyAge);const J=n[A].series.pointSize,q=typeof J=="number"?J:J.value;q>y&&(y=q)}if(p>s.gapCount+1)return!1;const C=this.bufferCanvas.width,b=this.bufferCanvas.height;if(g>=C)return!1;this._blitCarry=m-g;const{src:w,dst:T,dstCtx:k,dstName:M}=this.getPointsLayers();k.setTransform(1,0,0,1,0,0),k.clearRect(0,0,C,b),k.drawImage(w,g,0,C-g,b,0,0,C-g,b);const V=Math.ceil(y*l)+1,x=(a.x1+r.left+d)*l,S=d/h*1e3*l,{gapCount:L,endIndex:I,length:R}=s,v=V+Math.ceil(4*l),G=Math.max(2,Math.ceil((v+V+2)/Math.max(1e-6,S))),W=Math.min(R,L+G),E=x-W*S,X=Math.max(0,Math.floor(E+v));k.clearRect(X,0,C-X,b);const Z=new Array(W);for(let A=0;A<W;A++){let j=(I-A)%R;j<0&&(j+=R),Z[A]=j}const N=this.options.coordinateDedupe!==!1&&n.length>1,P=N?new Map:null;N&&this.collectStripDuplicatePoints(P,Z);const B={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:P,coordinateDedupe:N};k.save(),k.beginPath(),k.rect(X,0,C-X,b),k.clip(),k.setTransform(l,0,0,l,0,0);const Y=!!this.options.seriesReverse;for(let A=0;A<n.length;A++)(Y?n[n.length-1-A]:n[A]).series.realTimeScatterDrawStrip(k,Z,B);k.restore(),k.setTransform(1,0,0,1,0,0),this.curPointsLayer=M;for(let A=0;A<n.length;A++)n[A].series.refreshRtTotalCount();return this.drawStaticLayer(this.bufferCtx,t),this.compositePointsLayer(T,y),!0},compositePointsLayer(t,e){const n=this.pixelRatio,i=this.chartRect,s=this.labelOffset,l=i.chartWidth-(s.left+s.right),a=i.chartHeight-(s.top+s.bottom),r=i.x1+s.left,c=i.y2-s.bottom,d=c-a,h=r+l,u=(r-e)*n,f=(d-e)*n,m=(h+e)*n,g=(c+e)*n;this.bufferCtx.save(),this.bufferCtx.setTransform(1,0,0,1,0,0),this.bufferCtx.beginPath(),this.bufferCtx.rect(u,f,m-u,g-f),this.bufferCtx.clip(),this.bufferCtx.drawImage(t,0,0),this.bufferCtx.restore()},computePointsLayerStamp(){var s,l,a,r,c,d,h;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const t=this.getBlitScatterSeriesList();if(!t.length||!this.chartRect||!this.labelOffset||!this.axesSteps)return null;const e=this.chartRect,n=this.labelOffset,i=[this.pixelRatio,(l=this.bufferCanvas)==null?void 0:l.width,(a=this.bufferCanvas)==null?void 0:a.height,e.chartWidth,e.chartHeight,e.x1,e.y2,n.left,n.right,n.top,n.bottom];for(let u=0;u<t.length;u++){const{sId:f,xi:m,yi:g}=t[u],p=(c=(r=this.dataSet)==null?void 0:r[f])==null?void 0:c.lastTick,y=(d=this.axesSteps.x)==null?void 0:d[m],C=(h=this.axesSteps.y)==null?void 0:h[g];if(!y||!C)return null;i.push(f,p?`${p.seq}/${p.toTime}/${p.endIndex}/${p.length}`:"nt",y.graphMin,y.graphMax,C.graphMin,C.graphMax)}return i.join("|")},maybeRebuildPointsLayer(t=!1){var n;if(!((n=this.options.realTimeScatter)!=null&&n.use))return!1;const e=this.computePointsLayerStamp();return!t&&e&&this.pointsLayerValid&&this._pointsLayerStamp===e&&this._pointsLayerOptionsRef===this.options?!1:(this.rebuildPointsLayer(),this._pointsLayerStamp=this.pointsLayerValid?e:null,this._pointsLayerOptionsRef=this.pointsLayerValid?this.options:null,this.pointsLayerValid)},canRouteFallbackViaLayer(t){var n,i,s,l,a;const e=this.options;return!((n=e.realTimeScatter)!=null&&n.use)||t||(i=e.selectItem)!=null&&i.use&&(((s=this.defaultSelectItemInfo)==null?void 0:s.dataIndex)!=null||((l=this.lastHitInfo)==null?void 0:l.dataIndex)!=null)||(a=e.selectSeries)!=null&&a.use&&this.defaultSelectInfo||!this.pointsLayersSized()||!this.hasOnlyVisibleScatter()?!1:this.getBlitScatterSeriesList().length>0},ensureHitCoordsFresh(){var n,i,s;if(!this._hitCoordsDirty||!((n=this.options.realTimeScatter)!=null&&n.use)||!this.chartRect||!this.labelOffset||!this.axesSteps)return;const t=this.getBlitScatterSeriesList(),e={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow};for(let l=0;l<t.length;l++)(s=(i=t[l].series).refreshRtHitCoords)==null||s.call(i,e);this._hitCoordsDirty=!1},getMaxVisibleScatterPointSize(){const t=this.getBlitScatterSeriesList();let e=0;for(let n=0;n<t.length;n++){const i=t[n].series.pointSize,s=typeof i=="number"?i:(i==null?void 0:i.value)??0;s>e&&(e=s)}return e},rebuildPointsLayer(){var h,u,f;if(!((h=this.options.realTimeScatter)!=null&&h.use)||!this.pointsLayersSized()){this.pointsLayerValid=!1;return}const t=this.getBlitScatterSeriesList();if(!t.length){this.pointsLayerValid=!1;return}const e=this.pixelRatio,n=this.curPointsLayer==="A",i=n?this.pointsLayerA:this.pointsLayerB,s=n?this.pointsLayerACtx:this.pointsLayerBCtx;s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,i.width,i.height),s.setTransform(e,0,0,e,0,0);const l=((f=(u=this.seriesInfo)==null?void 0:u.charts)==null?void 0:f.scatter)??[],a=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(l),r=new Map;a&&this.collectDuplicatePoints(r,l);const c={ctx:s,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,duple:r,coordinateDedupe:a,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity},d=!!this.options.seriesReverse;for(let m=0;m<t.length;m++){const g=d?t[t.length-1-m]:t[m];g.series.computeGeometry(c),g.series.realTimeScatterDraw(c)}s.setTransform(1,0,0,1,0,0),this.pointsLayerValid=!0}},ZC={selectedSeriesAllLineSafe(){var e;const t=((e=this.defaultSelectInfo)==null?void 0:e.seriesId)??[];for(let n=0;n<t.length;n++){const i=this.seriesList[t[n]];if(!i||i.type!=="line"||i.fill||i.isExistGrp)return!1}return!0},shouldDrawSelectedOnTop(t){var n,i,s,l;const e=this.options;return!((n=e.selectSeries)!=null&&n.use)||e.brush||(i=e.realTimeScatter)!=null&&i.use||e.workerRender||t!=null&&t.legend||this.legendHover||!((l=(s=this.defaultSelectInfo)==null?void 0:s.seriesId)!=null&&l.length)?!1:this.selectedSeriesAllLineSafe()},drawSelectedSeriesOnly(){var d;const{maxTip:t,selectLabel:e,selectItem:n,selectSeries:i,brush:s,displayOverflow:l,unSelectedOpacity:a}=this.options,r={ctx:this.bufferCtx,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:t.background,color:t.color},selectLabel:{option:e,selected:this.defaultSelectInfo},selectSeries:{option:i,selected:this.defaultSelectInfo},selectItem:{option:n,selected:this.defaultSelectItemInfo},isBrush:!!s,displayOverflow:l,unSelectedOpacity:a,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion},c=((d=this.defaultSelectInfo)==null?void 0:d.seriesId)??[];for(let h=0;h<c.length;h++){const u=this.seriesList[c[h]];u&&u.show&&u.draw({...r})}}},jr=2,XC=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],NC=["sId","type","name","show","color","fill","fillColor","fillOpacity","pointFill","point","lineWidth","thickness","pointSize","pointStyle","interpolation","passingValue","hasPassingValueInData","segments","combo","xAxisIndex","yAxisIndex","stackIndex","groupIndex","isExistGrp","showValue"];function st(t){if(t===null)return null;const e=typeof t;if(e==="number"||e==="string"||e==="boolean")return t;if(e==="function"||e==="undefined"||e==="symbol"||e==="bigint")return;if(Array.isArray(t))return t.map(i=>st(i)??null);const n=Object.getPrototypeOf(t);if(n===Object.prototype||n===null){const i={};return Object.keys(t).forEach(s=>{const l=st(t[s]);l!==void 0&&(i[s]=l)}),i}}function Qr(t,e){const n={};return t&&e.forEach(i=>{const s=st(t[i]);s!==void 0&&(n[i]=s)}),n}function $r(t,e){if(e==="time")return _r(t);if(typeof t=="number")return t;if(e==="step"){const n=Number(t);return Number.isFinite(n)?n:null}return null}function PC(t,e={}){const n=t.data??[];if(t.type==="pie")return{value:n.map(d=>typeof(d==null?void 0:d.value)=="number"?d.value:null)};const i=e.x??"linear",s=e.y??"linear",l=new Array(n.length),a=new Array(n.length),r=new Array(n.length),c=new Array(n.length);for(let d=0;d<n.length;d++){const h=n[d]??{};l[d]=$r(h.x,i),a[d]=$r(h.y,s),r[d]=typeof h.o=="number"?h.o:null,c[d]=typeof h.b=="number"?h.b:null}return{x:l,y:a,o:r,b:c}}function DC(t){var s,l,a,r,c,d,h,u;const e=t.options??{},n=t.defaultSelectInfo,i=t.defaultSelectItemInfo;return{selectSeries:{use:!!((s=e.selectSeries)!=null&&s.use),selected:{seriesId:st(n==null?void 0:n.seriesId)??[]}},selectItem:{use:!!((l=e.selectItem)!=null&&l.use),useSeriesOpacity:!!((a=e.selectItem)!=null&&a.useSeriesOpacity),showBorder:!!((r=e.selectItem)!=null&&r.showBorder),borderStyle:st((c=e.selectItem)==null?void 0:c.borderStyle)??null,selected:i?{dataIndex:i.dataIndex??null,seriesID:i.seriesID??null}:null},selectLabel:{use:!!((d=e.selectLabel)!=null&&d.use),useSeriesOpacity:!!((h=e.selectLabel)!=null&&h.useSeriesOpacity),useBothAxis:!!((u=e.selectLabel)!=null&&u.useBothAxis),selected:{dataIndex:st(n==null?void 0:n.dataIndex)??[],label:st(n==null?void 0:n.label)??[],targetAxis:(n==null?void 0:n.targetAxis)??null}}}}function BC(t,e=0){var a,r,c,d,h;const n={},i=t.seriesList??{};Object.keys(i).forEach(u=>{var p,y,C,b,w,T;const f=i[u];if(!f||typeof f.hasRenderableValue=="function"&&!f.isExistGrp&&!f.hasRenderableValue())return;const m=((C=(y=(p=t.options)==null?void 0:p.axesX)==null?void 0:y[f.xAxisIndex??0])==null?void 0:C.type)??"linear",g=((T=(w=(b=t.options)==null?void 0:b.axesY)==null?void 0:w[f.yAxisIndex??0])==null?void 0:T.type)??"linear";n[u]={...Qr(f,NC),data:PC(f,{x:m,y:g})},f.type==="heatMap"&&f.labels&&(n[u].labels=st(f.labels)??{})});const s={},l=((a=t.seriesInfo)==null?void 0:a.charts)??{};return Object.keys(l).forEach(u=>{s[u]=(l[u]??[]).filter(f=>n[f])}),{version:jr,epoch:e,pixelRatio:t.pixelRatio??1,chartRect:st(t.chartRect)??{},labelOffset:st(t.labelOffset)??{},axesSteps:{x:st((r=t.axesSteps)==null?void 0:r.x)??[],y:st((c=t.axesSteps)==null?void 0:c.y)??[]},options:{...Qr(t.options,XC),isGradient:((h=(d=t.options)==null?void 0:d.legend)==null?void 0:h.type)==="gradient"},selection:DC(t),seriesOrder:s,series:n}}function YC(t){const e={},n=[],i=t.series??{};return Object.keys(i).forEach(s=>{const l=i[s].data??{},a={};let r=0;Object.keys(l).forEach(c=>{const d=l[c]??[];r=d.length;const h=new Float64Array(d.length);for(let u=0;u<d.length;u++)h[u]=typeof d[u]=="number"?d[u]:NaN;a[c]=h,n.push(h.buffer)}),a.length=r,e[s]=a}),{columns:e,transferList:n}}const qr="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLFp0PU9iamVjdC5wcm90b3R5cGUsRGU9WnQuaGFzT3duUHJvcGVydHksemU9WnQudG9TdHJpbmcsTXQ9T3Q/T3QudG9TdHJpbmdUYWc6dm9pZCAwO2Z1bmN0aW9uIEVlKGUpe3ZhciB0PURlLmNhbGwoZSxNdCksbj1lW010XTt0cnl7ZVtNdF09dm9pZCAwO3ZhciBzPSEwfWNhdGNoe312YXIgaT16ZS5jYWxsK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cHBvcnRlZCIsdmVyc2lvbjpnc30pO3JldHVybn1pZih0LnR5cGU9PT0icmVuZGVyIil0cnl7SXModCl9Y2F0Y2gobil7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVuZGVyLWVycm9yIixlcG9jaDp0LmVwb2NoLG1lc3NhZ2U6U3RyaW5nKG4mJm4ubWVzc2FnZXx8biksbmFtZTpuJiZuLm5hbWUsc3RhY2s6biYmbi5zdGFja30pfX19fSkoKTsK",OC=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),ec=typeof self<"u"&&self.Blob&&new Blob([OC(qr)],{type:"text/javascript;charset=utf-8"});function HC(t){let e;try{if(e=ec&&(self.URL||self.webkitURL).createObjectURL(ec),!e)throw"";const n=new Worker(e,{name:t==null?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch{return new Worker("data:text/javascript;base64,"+qr,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const mt={IDLE:"idle",INITIALIZING:"initializing",READY:"ready",FAILED:"failed"},FC=3e3,zC=2,AC=3,Ft=()=>{},KC={onInitFailure:Ft,onTimeout:Ft,onRenderException:Ft,onFallback:Ft};function _C(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function UC(t){if(typeof structuredClone!="function")return!1;try{return structuredClone(t),!0}catch{return!1}}function JC(){return new HC}class jC{constructor(e={}){this.state=mt.IDLE,this.worker=null,this.version=e.version??jr,this.initTimeoutMs=e.initTimeoutMs??FC,this.maxInFlight=e.maxInFlight??zC,this.maxRenderErrors=e.maxRenderErrors??AC,this.hooks={...KC,...e.hooks||{}},this._timer=null,this._frameHandler=Ft,this._errorHandler=Ft,this._inFlight=0,this._renderErrorStreak=0,this._isEnabled=e.isEnabled||(()=>!1),this._isSupported=e.isSupported||_C,this._createWorker=e.createWorker||JC}start(){if(this.state!==mt.IDLE)return this.state;if(!this._isEnabled())return this.hooks.onFallback("opt-in-off"),this.state;if(!this._isSupported())return this.hooks.onFallback("unsupported"),this.state;let e;try{e=this._createWorker()}catch(n){return this.state=mt.FAILED,this.hooks.onInitFailure(n),this.hooks.onFallback("worker-create-failed"),this.state}return e?(this.worker=e,this.state=mt.INITIALIZING,e.onmessage=n=>this._handleMessage(n),e.onerror=()=>this._fail("worker-error"),this._timer=setTimeout(()=>this._handleTimeout(),this.initTimeoutMs),e.postMessage({type:"init",version:this.version}),this.state):(this.state=mt.FAILED,this.hooks.onInitFailure("worker-create-failed"),this.hooks.onFallback("worker-create-failed"),this.state)}isReady(){return this.state===mt.READY}shouldRenderOnWorker(e){return this.isReady()&&UC(e)}setFrameHandler(e){this._frameHandler=e||Ft}setErrorHandler(e){this._errorHandler=e||Ft}canAcceptRender(){return this.isReady()&&this._inFlight<this.maxInFlight}render(e,n,i){if(!this.canAcceptRender()||!this.worker)return!1;this._inFlight+=1;try{this.worker.postMessage({type:"render",epoch:e.epoch,snapshot:e,columns:n},i||[])}catch(s){return this._inFlight=0,this.hooks.onRenderException(s),this._fail("post-message-failed"),!1}return!0}destroy(){this._clearTimer(),this.worker&&(this.worker.terminate(),this.worker=null),this.state=mt.IDLE}_handleMessage(e){const n=e&&e.data;if(n)if(n.type==="ready"&&this.state===mt.INITIALIZING){if(n.version!==this.version){this._fail("version-mismatch");return}this._clearTimer(),this.state=mt.READY}else n.type==="unsupported"?this._fail("worker-unsupported"):n.type==="rendered"?(this._inFlight=Math.max(0,this._inFlight-1),this._renderErrorStreak=0,this._frameHandler(n)):n.type==="render-error"&&(this._inFlight=Math.max(0,this._inFlight-1),this.hooks.onRenderException(n),this._errorHandler(n),this._renderErrorStreak+=1,this._renderErrorStreak>=this.maxRenderErrors&&(this._inFlight=0,this._fail("render-error-threshold")))}_handleTimeout(){this.state===mt.INITIALIZING&&(this.hooks.onTimeout("init-timeout"),this._fail("init-timeout"))}_fail(e){this._clearTimer(),this.state=mt.FAILED,this.worker&&(this.worker.terminate(),this.worker=null);const n=this._inFlight>0;this._inFlight=0,this.hooks.onInitFailure(e),this.hooks.onFallback(e),n&&this._errorHandler()}_clearTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}const QC=300;let ms=class{constructor(e,n,i,s,l,a,r){Object.keys(Ar).forEach(d=>Object.assign(this,Ar[d])),i.brush||(Object.assign(this,LC),Object.assign(this,VC),Object.assign(this,wC),Object.assign(this,GC),Object.assign(this,gC),Object.assign(this,EC),Object.assign(this,pC),Object.assign(this,xC)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,yC),this.isMobile=Ph(),this.brushSeries=r,this.target=e,this.data=n,this.options=i,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=i.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=i.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM);const c=i.type==="pie";this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d",{willReadFrequently:c}),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d",{willReadFrequently:c}),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),i.brush||(this.overlayCanvas=document.createElement("canvas"),this.overlayCanvas.setAttribute("style","display: block; z-index: 2;"),this.overlayCanvas.setAttribute("class","overlay-canvas"),this.overlayCtx=this.overlayCanvas.getContext("2d",{willReadFrequently:c}),this.chartDOM.appendChild(this.overlayCanvas),this.overlayCanvas.style.position="absolute",this.overlayCanvas.style.top="0px",this.overlayCanvas.style.left="0px"),this.isInitLegend=!1,this.isInitTitle=!1,this.isInit=!1,this.scrollbar={x:{isInit:!1},y:{isInit:!1}},this.seriesList={},this.lastTip={pos:null,value:null},this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.defaultSelectItemInfo=l,this.defaultSelectInfo=a,this.legendHover=null,this.initBlitState(),this.renderWorkerGate=new jC({isEnabled:()=>!!this.options.workerRender,hooks:{onInitFailure:d=>to.warn("[EvChart] workerRender 비활성화 — main 렌더로 fallback:",d),onRenderException:d=>to.warn("[EvChart] workerRender 렌더 예외 — main 렌더로 fallback:",d),onFallback:d=>{d==="unsupported"&&to.warn("[EvChart] workerRender 미지원 환경 — main 렌더 사용")}}}),this.renderEpoch=0,this.renderWorkerGate.setFrameHandler(d=>this.commitWorkerFrame(d)),this.renderWorkerGate.setErrorHandler(d=>this.drawSeriesLayerFallback(d)),this.renderWorkerGate.start()}init(){var u,f,m,g,p;const{series:e,data:n,labels:i,groups:s}=this.data,{type:l,axesX:a,axesY:r,tooltip:c,horizontal:d,realTimeScatter:h}=this.options;this.createSeriesSet(e,l,d,s),s.length&&this.addGroupInfo(s),h!=null&&h.use?(this.dataSet={},this.createRealTimeScatterDataSet(n)):this.createDataSet(n,i),this.minMax=this.getStoreMinMax(),this.initRect(),this.axesX=this.createAxes("x",a),this.axesY=this.createAxes("y",r),((f=(u=a==null?void 0:a[0])==null?void 0:u.scrollbar)!=null&&f.use||(g=(m=r==null?void 0:r[0])==null?void 0:m.scrollbar)!=null&&g.use)&&this.initScrollbar(),this.initDefaultSelectInfo(),this.drawChart(),c.use&&!this.isInitTooltip&&this.createTooltipDOM(),(p=this.createEventFunctions)==null||p.call(this),this.isInit=!0}_updateSeriesCount(){this.seriesInfo.count=Object.values(this.seriesList).filter(e=>e.show).length}initRect(){const e=this.options;e.title.show&&(this.isInitTitle||this.initTitle(),this.showTitle()),e.legend.show&&!e.legend.external?(this.isInitLegend||this.initLegend(),this.setLegendPosition()):e.legend.show&&e.legend.external&&this._updateSeriesCount(),this.chartRect=this.getChartRect()}drawSyncedIndicator({horizontal:e,label:n,mousePosition:i}){this.drawSyncedIndicator({horizontal:e,label:n,mousePosition:i})}adjustXAndYAxisWidth(){var i,s,l,a;const e=(r,c,d)=>{const{interval:h,graphMin:u,graphMax:f,steps:m=0,minIndex:g,maxIndex:p,indexInterval:y}=r??{};let C=[];if((d==null?void 0:d.type)==="step"&&g!==void 0&&p!==void 0&&y!==void 0){const{labels:b}=this.data,w=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[];C=[];for(let T=g;T<=p;T+=y)w[T]!==void 0&&C.push(w[T])}else if(h)C=Array.from({length:m},(b,w)=>u+w*h),C.push(f);else{const{labels:b}=this.data;C=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[]}return C},n={x:(s=(i=this.axesRange)==null?void 0:i.x)==null?void 0:s.map((r,c)=>{var y,C,b,w;const d=this.axesX[c],h=(y=this.axesSteps)==null?void 0:y.x[c],u=e(h,"x",d),f=ve((C=d==null?void 0:d.labelStyle)==null?void 0:C.fixWidth)?d.labelStyle.fixWidth:0;let m=[];const g=(b=this.axesSteps)==null?void 0:b.x[c];if((d==null?void 0:d.type)==="linear"&&g!=null){const{graphMin:T,graphMax:k}=g;if(typeof T=="number"&&typeof k=="number"){const M=Math.abs(T)>=Math.abs(k)?T:k;m=[YS(M)]}}const p=((w=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:w.call(d,u,this.chartRect,m))??0;return{...r,size:{width:f||Math.max(p,r.size.width),height:r.size.height}}}),y:(a=(l=this.axesRange)==null?void 0:l.y)==null?void 0:a.map((r,c)=>{var g,p,y;const d=this.axesY[c],h=(g=this.axesSteps)==null?void 0:g.y[c],u=e(h,"y",d),f=ve((p=d==null?void 0:d.labelStyle)==null?void 0:p.fixWidth)?d.labelStyle.fixWidth:0,m=((y=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:y.call(d,u,this.chartRect))??0;return{...r,size:{width:f||Math.max(m,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}computeAxesScaleChange(){var r;if(typeof((r=this.listeners)==null?void 0:r["axes-scale-change"])!="function")return null;const e=this._lastEmittedAxesRange,n=this.labelRange,i=(c,d)=>(c==null?void 0:c.min)===(d==null?void 0:d.min)&&(c==null?void 0:c.max)===(d==null?void 0:d.max),s=({min:c,max:d})=>({minSteps:c,maxSteps:d}),l=n.x.every((c,d)=>{var u;return!!!((u=this.options.axesX[d])!=null&&u.scaleChange)||!!e&&i(c,e.x[d])}),a=n.y.every((c,d)=>{var u;return!!!((u=this.options.axesY[d])!=null&&u.scaleChange)||!!e&&i(c,e.y[d])});return l&&a?null:(this._lastEmittedAxesRange=n,{x:n.x.map(s),y:n.y.map(s)})}emitDataMaxChange(){var i;const e=(i=this.listeners)==null?void 0:i["axes-data-max-change"];if(typeof e!="function")return;let n=-1/0;Object.values(this.seriesList).forEach(s=>{if(!(s!=null&&s.show)||!s.minMax)return;const l=s.minMax.maxY;Number.isFinite(l)&&l>n&&(n=l)}),e(Number.isFinite(n)?n:null)}prepareScale(){this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange();const e=this.labelOffset;return this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),{scaleChange:this.computeAxesScaleChange(),scrollbarLabelOffset:e}}drawChart(e,n){var l,a,r,c,d,h;this.renderEpoch+=1,this.initScale();const{scaleChange:i,scrollbarLabelOffset:s}=this.prepareScale();this.computeScaleVersion(),((a=(l=this.scrollbar)==null?void 0:l.x)!=null&&a.use||(c=(r=this.scrollbar)==null?void 0:r.y)!=null&&c.use)&&this.updateScrollbarPosition(s),i&&typeof((d=this.listeners)==null?void 0:d["axes-scale-change"])=="function"&&this.listeners["axes-scale-change"](i),this.emitDataMaxChange(),!(!n&&this.tryDrawSeriesOnWorker(e))&&((h=this.options.realTimeScatter)!=null&&h.use?this.drawAxisAndSeries(e):(this.drawStaticLayer(this.bufferCtx,e),this.drawSeriesLayer(this.bufferCtx,e),this.shouldDrawSelectedOnTop(e)&&this.drawSelectedSeriesOnly()),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}tryDrawSeriesOnWorker(e){var r;if(!((r=this.renderWorkerGate)!=null&&r.canAcceptRender())||!this.canRenderSeriesOnWorker(e).ok)return!1;const n=this.renderEpoch,i=BC(this,n),{columns:s,transferList:l}=YC(i);return this.drawStaticLayer(this.bufferCtx,e),this.computeSeriesGeometry(),this.renderWorkerGate.render(i,s,l)?this.drawSeriesOverlay():(this.drawSeriesLayer(this.bufferCtx,e),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas)),!0}canRenderSeriesOnWorker(e){var a;if(e||this.lastHitInfo)return{ok:!1,reason:"hit-info"};const n=((a=this.seriesInfo)==null?void 0:a.charts)??{},i={line:!0,bar:!0,heatMap:!0},s=Object.keys(n).find(r=>!i[r]&&(n[r]??[]).some(c=>{var d;return((d=this.seriesList[c])==null?void 0:d.show)!==!1}));return s?{ok:!1,reason:`unsupported-type:${s}`}:(n.bar??[]).some(r=>{const c=this.seriesList[r];return(c==null?void 0:c.show)!==!1&&(c==null?void 0:c.timeMode)})?{ok:!1,reason:"time-bar"}:{ok:!0}}commitWorkerFrame(e){const n=e==null?void 0:e.bitmap;if(!n)return;if(e.epoch!==this.renderEpoch){n.close();return}const i=this.displayCtx;this.commitToDisplay(i,this.bufferCanvas),i.drawImage(n,0,0),n.close(),i.save(),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.drawForeground(i),i.restore()}drawSeriesLayerFallback(e){var n;e&&e.epoch!==this.renderEpoch||(this.drawSeriesLayer(this.bufferCtx,void 0),((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}commitToDisplay(e,n){if(this.displayCanvas){const i=this.pixelRatio<1?this.pixelRatio:1;e.clearRect(0,0,this.displayCanvas.width/i,this.displayCanvas.height/i)}n&&(n==null?void 0:n.width)>1&&(n==null?void 0:n.height)>1&&e.drawImage(n,0,0),this._blitPrev=this.snapshotBlitState()}drawAxisAndSeries(e){const n=this.evaluateBlitGate(e),i=typeof window<"u"&&window.__EVUI_BLIT_FORCE_OFF__===!0,s=typeof window<"u"?window.__EVUI_BLIT_REFRESH_INTERVAL__:void 0,l=Number.isFinite(s)?s:this._blitRefreshInterval||QC,a=n.ok&&!i&&this.pointsLayerValid&&this.pointsLayersSized()&&this._framesSinceFullRedraw<l,r={blockedByForceOff:i,blockedByLayerInvalid:!this.pointsLayerValid,blockedByLayerUnsized:!this.pointsLayersSized(),blockedByRefreshDue:this._framesSinceFullRedraw>=l};let c=!1;if(a&&(c=this.drawChartBlitFastPath(e,n)),this.recordBlitDiag(n,c,r),c)this._framesSinceFullRedraw++,this._pointsLayerStamp=this.computePointsLayerStamp(),this._pointsLayerOptionsRef=this.options,this._hitCoordsDirty=!0;else{this.drawStaticLayer(this.bufferCtx,e);let d=!1,h=!1;!i&&this.canRouteFallbackViaLayer(e)?(d=this.maybeRebuildPointsLayer(r.blockedByRefreshDue),this.pointsLayerValid?this.compositePointsLayer(this.getPointsLayers().src,this.getMaxVisibleScatterPointSize()):(this.drawSeriesLayer(this.bufferCtx,e),h=!0)):(this.drawSeriesLayer(this.bufferCtx,e),d=this.maybeRebuildPointsLayer(!1),h=!(e!=null&&e.legend)),(d||h)&&(this._hitCoordsDirty=!1),d&&(this._framesSinceFullRedraw=0,this._blitCarry=0)}}collectDuplicatePoints(e,n){var s,l,a;const i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!!(c!=null&&c.show))if((s=this.options.realTimeScatter)!=null&&s.use){const h=(l=c.data[c.sId])==null?void 0:l.dataGroup;for(let u=0;u<h.length;u++){const f=((a=h[u])==null?void 0:a.data)||[];for(let m=0;m<f.length;m++){const g=f[m];e.set(g.k??O.coordinateKey(g.x,g.y),c.sId)}}}else{const h=this.data.data[n[r]]??[];for(let u=0;u<h.length;u++){const f=h[u];e.set(O.coordinateKey(f.x,f.y),c.sId)}}}}canSkipRealtimeScatterDedupe(e){var i,s;if(!((i=this.options.realTimeScatter)!=null&&i.use))return!1;let n=0;for(let l=0;l<e.length;l++)if((s=this.seriesList[e[l]])!=null&&s.show&&(n++,n>1))return!1;return n===1}computeScaleVersion(){var r,c;const e=this.chartRect??{},n=this.labelOffset??{},i=this.options??{},s=((r=this.axesSteps)==null?void 0:r.x)??[],l=((c=this.axesSteps)==null?void 0:c.y)??[];let a=`${e.x1},${e.x2},${e.y1},${e.y2},${e.chartWidth},${e.chartHeight}|${n.left},${n.right},${n.top},${n.bottom}|${this.pixelRatio}|${i.horizontal?1:0}|${i.thickness},${i.cPadRatio},${i.borderRadius}|`;for(let d=0;d<s.length;d++){const h=s[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a+="|";for(let d=0;d<l.length;d++){const h=l[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a!==this._scaleKey&&(this._scaleKey=a,this._scaleVersion=(this._scaleVersion??0)+1)}computeSeriesGeometry(){const e={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let n=0;this.seriesInfo.charts.bar.forEach(r=>{var c;(c=this.seriesList[r])!=null&&c.show&&n++}),["line","heatMap"].forEach(r=>{this.seriesInfo.charts[r].forEach(c=>{var d,h;(h=(d=this.seriesList[c])==null?void 0:d.computeGeometry)==null||h.call(d,e)})});const{thickness:i,cPadRatio:s,borderRadius:l}=this.options;let a=0;this.seriesInfo.charts.bar.forEach(r=>{var d;const c=this.seriesList[r];c&&((d=c.computeGeometry)==null||d.call(c,{...e,thickness:i,cPadRatio:s,borderRadius:l,showSeriesCount:n,showIndex:a}),c.show&&a++)})}drawSeriesLayer(e,n){var p;const{maxTip:i,selectLabel:s,selectItem:l,selectSeries:a,brush:r,displayOverflow:c,unSelectedOpacity:d}=this.options,h={ctx:e,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:i.background,color:i.color},selectLabel:{option:s,selected:this.defaultSelectInfo},selectSeries:{option:a,selected:this.defaultSelectInfo},selectItem:{option:l,selected:this.defaultSelectItemInfo},isBrush:!!r,displayOverflow:c,unSelectedOpacity:d,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let u=0,f=0;this.seriesInfo.charts.bar.forEach(y=>{this.seriesList[y].show&&f++});const m=new Map,g=Object.keys(this.seriesInfo.charts);for(let y=0;y<g.length;y++){const C=g[y],b=this.seriesInfo.charts[C];let w=!1;C==="scatter"&&(w=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(b),w&&this.collectDuplicatePoints(m,b));for(let T=0;T<b.length;T++){let k=this.seriesList[b[T]];switch(C){case"line":{const M=n==null?void 0:n.legend;k.draw({legendHitInfo:M,...h});break}case"heatMap":{const M=n==null?void 0:n.legend;k.draw({legendHitInfo:M,...h});break}case"bar":{const M=n==null?void 0:n.legend,{thickness:V,cPadRatio:x,borderRadius:S}=this.options;k.draw({thickness:V,cPadRatio:x,borderRadius:S,showSeriesCount:f,showIndex:u,legendHitInfo:M,...h}),k.show&&u++;break}case"pie":{const M=this.lastHitInfo??{sId:(p=this.defaultSelectItemInfo)==null?void 0:p.seriesID},V=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},e):this.drawPie({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},e),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(e);break}case"scatter":{const M=n==null?void 0:n.legend;let V;if(l.use&&l.useSeriesOpacity){const x=this.lastHitInfo,S=this.defaultSelectItemInfo;x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?V={seriesID:x.sId,dataIndex:x.dataIndex}:S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?V={...S}:V=null}this.options.seriesReverse&&(k=this.seriesList[b.at(-1-T)]),k.draw({legendHitInfo:M,selectInfo:V,duple:m,coordinateDedupe:w,...h});break}}}}}drawSeriesOverlay(){var s,l;const e=this.overlayCtx;if(!e)return;const n={overlayCtx:e,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps},i=this.seriesInfo.charts.heatMap;for(let a=0;a<i.length;a++)(l=(s=this.seriesList[i[a]])==null?void 0:s.drawOverlay)==null||l.call(s,n)}drawTip(e){var i;let n;this.lastHitInfo?n=this.lastHitInfo:this.defaultSelectItemInfo?n=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?n=this.getItem(this.defaultSelectInfo,!1):n=null,(i=this.drawTips)==null||i.call(this,n,e)}createAxes(e,n=[]){const i=this.bufferCtx,l=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels,a=this.options;return n.map(r=>{switch(r.type){case"linear":return new hC(e,r,i,a);case"time":return r.categoryMode?new mC(e,r,i,l,a):new dC(e,r,i,a);case"log":return new uC(e,r,i);case"step":return new fC(e,r,i,l,a);default:return!1}})}getAxesRange(){const e=this.axesX.map((i,s)=>i.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((i,s)=>i.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:e,y:n}}drawStaticLayer(e,n){var i;this.axesX.forEach((s,l)=>{s.ctx=e,s.draw(this.chartRect,this.labelOffset,this.axesSteps.x[l],n,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((s,l)=>{s.ctx=e,s.draw(this.chartRect,this.labelOffset,this.axesSteps.y[l],n,this.defaultSelectInfo)}),((i=this.options.plot)==null?void 0:i.aboveSeries)===!1&&this.drawPlotsFront(e)}drawPlotsFront(e=this.bufferCtx){this.plotLabelHitRegions=[],[...this.axesX??[],...this.axesY??[]].forEach(n=>{var i,s;n.ctx=e,(i=n.drawPlots)==null||i.call(n),(s=n.plotLabelHitRegions)!=null&&s.length&&this.plotLabelHitRegions.push(...n.plotLabelHitRegions)})}drawForeground(e=this.bufferCtx){var n;((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(e),this.drawTip(e)}calculateSteps(){const e=this.axesX.map((i,s)=>{const l={minValue:this.axesRange.x[s].min,maxValue:this.axesRange.x[s].max,minIndex:this.axesRange.x[s].minIndex,maxIndex:this.axesRange.x[s].maxIndex,minSteps:this.labelRange.x[s].min,maxSteps:this.labelRange.x[s].max};return i.calculateSteps(l)}),n=this.axesY.map((i,s)=>{const l={minValue:this.axesRange.y[s].min,maxValue:this.axesRange.y[s].max,minIndex:this.axesRange.y[s].minIndex,maxIndex:this.axesRange.y[s].maxIndex,minSteps:this.labelRange.y[s].min,maxSteps:this.labelRange.y[s].max};return i.calculateSteps(l)});return{x:e,y:n}}getAxesLabelRange(){const e=this.axesX.map((i,s)=>{const l=this.axesRange.x[s].size;return i.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((i,s)=>{const l=this.axesRange.y[s].size;return i.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:e,y:n}}computePixelRatio(){const e=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;return e/n}prepareLayout(e){this.pixelRatio=e,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}initScale(){const e=this.computePixelRatio();this.prepareLayout(e),this.overlayCtx&&this.overlayCtx.setTransform(e,0,0,e,0,0)}getChartDOMRect(){var s;const e=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(e==null?void 0:e.width)||10,i=(e==null?void 0:e.height)||10;return this.setWidth(n),this.setHeight(i),{width:n,height:i}}getOverlayClientRect(){return!this.cachedOverlayRect&&this.overlayCanvas&&(this.cachedOverlayRect=this.overlayCanvas.getBoundingClientRect()),this.cachedOverlayRect}getChartDOMClientRect(){return!this.cachedChartDOMRect&&this.chartDOM&&(this.cachedChartDOMRect=this.chartDOM.getBoundingClientRect()),this.cachedChartDOMRect}invalidateClientRectCache(){this.cachedOverlayRect=null,this.cachedChartDOMRect=null}getChartRect(){var k,M,V,x;const{width:e,height:n}=this.getChartDOMRect(),i=this.options.padding,s=(M=(k=this.options.axesX)==null?void 0:k[0])==null?void 0:M.title,l=(x=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:x.title,a=10;let r=0;s!=null&&s.use&&(s!=null&&s.text)&&(r=(isNaN(s==null?void 0:s.fontSize)?12:s==null?void 0:s.fontSize)+a);let c=0;l!=null&&l.use&&(l!=null&&l.text)&&(c=(isNaN(l==null?void 0:l.fontSize)?12:l==null?void 0:l.fontSize)+a);const d=this.scrollbar.x,h=this.scrollbar.y;let u=0;d!=null&&d.use&&(u=d==null?void 0:d.height);let f=0;h!=null&&h.use&&(f=h==null?void 0:h.width);const m=i.left+i.right+f,g=i.top+i.bottom+r+c+u,p=e>m?e-m:e,y=n>g?n-g:n,C=i.left,b=Math.max(e-i.right-f,C+2),w=i.top+c,T=Math.max(n-i.bottom-r-u,w+2);return{x1:C,x2:b,y1:w,y2:T,chartWidth:p,chartHeight:y,width:e,height:n}}setWidth(e){if(!this.displayCanvas)return;const n=e*this.pixelRatio;if(this._deviceWidth!==n&&(this._deviceWidth=n,this.displayCanvas.width=n,this.displayCanvas.style.width=`${e}px`,this.bufferCanvas.width=n,this.bufferCanvas.style.width=`${e}px`,this.overlayCanvas&&(this.overlayCanvas.width=n,this.overlayCanvas.style.width=`${e}px`),this.pointsLayerA)){const i=Math.floor(e*this.pixelRatio);this.pointsLayerA.width!==i&&(this.pointsLayerA.width=i,this.pointsLayerB.width=i,this.pointsLayerValid=!1)}}setHeight(e){if(!this.displayCanvas)return;const n=e*this.pixelRatio;if(this._deviceHeight!==n&&(this._deviceHeight=n,this.displayCanvas.height=n,this.displayCanvas.style.height=`${e}px`,this.bufferCanvas.height=n,this.bufferCanvas.style.height=`${e}px`,this.overlayCanvas&&(this.overlayCanvas.height=n,this.overlayCanvas.style.height=`${e}px`),this.pointsLayerA)){const i=Math.floor(e*this.pixelRatio);this.pointsLayerA.height!==i&&(this.pointsLayerA.height=i,this.pointsLayerB.height=i,this.pointsLayerValid=!1)}}getLabelOffset(e=null){const n=this.axesX,i=this.axesY,s=e??this.axesRange,l={top:2,left:2,right:2,bottom:2},a={width:14,height:4};let r=0,c=0;return n.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.x[h].size.width+a.width,c=s.x[h].size.height+a.height,d.position==="bottom"?c>l.bottom&&(l.bottom=c):d.position==="top"&&c>l.top&&(l.top=c),l.left=r/2>l.left?r/2:l.left,l.right=r/2>l.right?r/2:l.right)}),i.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.y[h].size.width+a.width,d.position==="left"?r>l.left&&(l.left=r):d.position==="right"&&r>l.right&&(l.right=r),l.top=c/2>l.top?c/2:l.top,l.bottom=c/2>l.bottom?c/2:l.bottom)}),l}updateScrollbar(e,n){var c,d,h,u,f,m,g,p,y,C;const i=n||e,s=((h=(d=(c=this.options.axesX)==null?void 0:c[0])==null?void 0:d.scrollbar)==null?void 0:h.use)??!1,l=((m=(f=(u=this.options.axesY)==null?void 0:u[0])==null?void 0:f.scrollbar)==null?void 0:m.use)??!1,a=((p=(g=this.scrollbar)==null?void 0:g.x)==null?void 0:p.use)??!1,r=((C=(y=this.scrollbar)==null?void 0:y.y)==null?void 0:C.use)??!1;(s!==a||s||i&&s)&&this.updateScrollbarInfo("x",e),(l!==r||l||i&&l)&&this.updateScrollbarInfo("y",e)}update(e){var y,C,b,w,T,k,M;const n=this.options,i=this.data.data,s=this.data.labels,l=this.data.groups,a=this.data.series,{updateSeries:r,updateSelTip:c,updateLegend:d,updateData:h,updateTooltip:u,lightUpdate:f,updateByScrollbar:m}=e;if(!this.isInit)return;if((h||r)&&(this._lastHoverSig=""),this.updateScrollbar(h,m),this.resetProps(),this.updateSeries=r,r&&(this.pointsLayerValid=!1),(y=this.options.realTimeScatter)!=null&&y.use&&!this.pointsLayerA&&this.createPointsLayers(),r){const V=this.seriesList;this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.lastTip={pos:null,value:null},this.reconcileSeriesSet(a,n.type,n.horizontal,l,V),this.legendDOM&&!n.legend.external&&this.updateLegend()}if(c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!f)if(l.length&&this.addGroupInfo(l),(C=this.options.realTimeScatter)!=null&&C.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(i)):this.createDataSet(i,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const V=!!((w=(b=n.legend)==null?void 0:b.table)!=null&&w.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():V&&h&&this.updateLegendTableValues():this.initLegend(),this.setLegendPosition(),this.updateLegendContainerSize(),this.showLegend()}else n.legend.show&&n.legend.external?(r||h)&&(this._updateSeriesCount(),this.emitLegendData()):this.isInitLegend&&this.hideLegend();u&&(this.isInitTooltip||this.createTooltipDOM(),this.tooltipDOM.innerHTML="",(k=(T=n.tooltip)==null?void 0:T.formatter)!=null&&k.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let g=e==null?void 0:e.hitInfo;!(g!=null&&g.legend)&&((M=this.legendHover)!=null&&M.sId)&&(g={...g||{},legend:this.legendHover}),this.render(g),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(f?this.drawSelectionArea(this.dragInfoBackup):this.dragInfoBackup=null)}resetProps(){this.axesX[0]=null,this.axesY[0]=null,this.axesX=null,this.axesY=null,this.minMax=null,this.axesRange=null,this.labelOffset=null,this.chartRect=null}overlayClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}clear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.bufferCanvas&&this.bufferCtx.clearRect(0,0,this.bufferCanvas.width/this.clearRectRatio,this.bufferCanvas.height/this.clearRectRatio),this.overlayCanvas&&this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}resize(e){var n,i,s,l,a,r,c;this.invalidateClientRectCache(),this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.pointsLayerValid=!1,((s=(i=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:i.scrollbar)!=null&&s.use||(r=(a=(l=this.options.axesY)==null?void 0:l[0])==null?void 0:a.scrollbar)!=null&&r.use)&&this.initScrollbar(),this.initRect(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(void 0,!0),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),e&&e(!0)}render(e){this.isInit&&(this.invalidateClientRectCache(),this._vsDetectFailed=!1,this.clear(),this.chartRect=this.getChartRect(),this.drawChart(e))}_getLegendSeries(){var n;const e=(n=this.data.groups)==null?void 0:n.at(0);return e?e.filter(i=>{var s;return(s=this.seriesList[i])==null?void 0:s.showLegend}).map(i=>[i,this.seriesList[i]]):Object.entries(this.seriesList).filter(([,i])=>i.showLegend)}_seriesToLegendItem(e){const n=typeof e.color!="string"?e.color[e.color.length-1][1]:e.color;return{sId:e.sId,name:e.name,color:n,type:e.type,show:e.show,fill:e.fill,fillColor:e.fillColor}}buildLegendData(){return this._getLegendSeries().map(([,e])=>this._seriesToLegendItem(e))}emitLegendData(){typeof this.listeners["update:legendData"]=="function"&&this.listeners["update:legendData"](this.buildLegendData())}toggleSeries(e){var d;const n=this.seriesList[e];if(!n)return;const i=this.options.legend,s=this._getLegendSeries();if(i.clickMode==="active")s.every(([,f])=>f.show)?(s.forEach(([,f])=>{f.show=!1}),n.show=!0,this.seriesInfo.count=1):n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++),s.every(([,f])=>!f.show)&&(s.forEach(([,f])=>{f.show=!0}),this.seriesInfo.count=s.length);else{if(n.show&&this.seriesInfo.count===1)return;n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++)}if(this.brushSeries){const{chartIdx:h}=this.data,u=[...this.brushSeries.list];u[h]=this.seriesList,this.brushSeries.list=u,this.brushSeries.chartIdx=h}((d=this.options.eventBehavior)==null?void 0:d.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const a=Object.values(this.seriesList).filter(h=>h.show).map(h=>h.sId),r=a.length===Object.values(this.seriesList).length,c={data:{seriesIds:r?[]:a,isActiveAll:r}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](c),this.options.legend.show&&this.options.legend.external&&this.emitLegendData()}highlightSeries(e){const n={sId:e,type:this.options.type};this.legendHover=n,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:n},lightUpdate:!0})}unhighlightSeries(){this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})}destroy(){var n,i;if(!this.isInit)return;const e=this.target;for(this.options.legend.show&&!this.options.legend.external&&(this.legendBoxDOM&&(this.legendBoxDOM.removeEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.removeEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.removeEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.type==="gradient"&&this.legendBoxDOM.removeEventListener("mousedown",this.onLegendMouseDown),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.removeEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.removeEventListener("scroll",this.renderVisibleLegends))),this.resizeDOM&&this.resizeDOM.removeEventListener("mousedown",this.onResizeMouseDown)),this.overlayCanvas&&(this.overlayCanvas.removeEventListener("mousemove",this.onMouseMove),this.overlayCanvas.removeEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.removeEventListener("dblclick",this.onDblClick),this.overlayCanvas.removeEventListener("click",this.onClick),(n=this.dragStartTarget)==null||n.removeEventListener("mousedown",this.onMouseDown),this.overlayCanvas.removeEventListener("wheel",this.onWheel),window.removeEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll&&window.removeEventListener("scroll",this.invalidateRectOnScroll,{capture:!0}),this.dragDisplayCanvas&&((i=this.dragDisplayCanvas.parentNode)==null||i.removeChild(this.dragDisplayCanvas),this.dragDisplayCanvas=null,this.dragDisplayCtx=null,this.dragDisplayOffset=null),this.dragStartTarget&&this.dragStartAreaPrevPosition!==void 0&&(this.dragStartTarget.style.position=this.dragStartAreaPrevPosition,this.dragStartAreaPrevPosition=void 0)),this.isInitTooltip&&this.tooltipDestroy(),this.renderWorkerGate&&this.renderWorkerGate.destroy(),this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),this.wrapperDOM=null,this.chartDOM=null,this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.ghostDOM=null,this.titleDOM=null,this.displayCanvas=null,this.bufferCanvas=null,this.overlayCanvas=null;e.hasChildNodes();)e.removeChild(e.firstChild)}hideTooltip(){var e;this.options.tooltip.use&&((e=this.tooltipDOM)!=null&&e.style)&&(this.tooltipDOM.style.display="none")}initDefaultSelectInfo(){var s,l;const{type:e,selectLabel:n,selectSeries:i}=this.options;if(n.use){let a=null;e==="heatMap"&&(n!=null&&n.useBothAxis)&&(a=(s=this.defaultSelectInfo)==null?void 0:s.targetAxis),this.defaultSelectInfo=(l=this.defaultSelectInfo)!=null&&l.dataIndex?this.getSelectedLabelInfoWithLabelData(this.defaultSelectInfo.dataIndex,a):{dataIndex:[],label:[],data:[]}}i.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};Object.assign(ms.prototype,WC),Object.assign(ms.prototype,ZC);const $C={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},qC={class:"ev-chart-toolbar"},e1={class:"ev-chart-toolbar__icon"};function t1(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",qC,[o.createElementVNode("div",e1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.$props.toolbar.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${c}-${r.icon}`,class:o.normalizeClass(c),icon:r.icon,size:r.size,title:r.title,onClick:d=>t.$emit("onClickToolbar",d,c)},null,8,["class","icon","size","title","onClick"]))),128))])])}const tc=ce($C,[["render",t1],["__scopeId","data-v-dfbffbab"]]);class n1{constructor(e,n,i,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=e.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=i.zoom;this.setEvChartZoomOptions(c),this.setIcon(s);const d=n.data[0].labels.length-1;this.cloneLabelsLastIdx=d,this.isAnimationFinish=!0,this.zoomAreaMemory={previous:[],current:[[0,d]],latest:[]},r&&(this.emitFunc=r,r.updateZoomStartIdx(0),r.updateZoomEndIdx(d)),c.useWheelMove&&(this.wrapWheelMoveZoomArea=this.wheelMoveZoomArea.bind(this)),this.evChartDomContainers=c.useAnimation?this.drawAnimationCanvas(e.dom):e.dom}setEvChartZoomOptions(e){this.evChartZoomOptions=e}setIcon(e){if(!e)return;const n=e.querySelector(".dragZoom");this.resetIcon=e.querySelector(".reset"),this.previousIcon=e.querySelector(".previous"),this.latestIcon=e.querySelector(".latest"),this.dragZoomIcon=n,this.iconStyle(n,"enable")}drawAnimationCanvas(e){return e.forEach(n=>{const i=document.createElement("canvas");i.setAttribute("style","display: block;"),i.setAttribute("class","animation-canvas"),i.style.position="absolute",n.appendChild(i)}),e}setEventListener(e){const n=e?"addEventListener":"removeEventListener";this.isUseZoomMode=e,this.evChartDomContainers.forEach(i=>{i[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(e){e.preventDefault();const[n,i]=this.zoomAreaMemory.current[0];if(n===i)return;let s,l;if(e.deltaY>0){if(!n)return;s=n-1,l=i-1}else{if(i===this.cloneLabelsLastIdx)return;s=n+1,l=i+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(e){if(!this.zoomAreaMemory[e].length)return;const[n,i]=this.zoomAreaMemory[e].pop();this.isUseToolbar=!0,this.executeZoom(n,i),this.setZoomAreaMemory(n,i,e==="previous"?"latest":"previous")}dragZoom({data:e,range:{dragSelectionInfo:n}}){const{dragXsp:i,dragXep:s,exceptAxesYChartWidth:l,chartTitle:a}=n,{options:r,data:c}=this.evChartProps,d=r.length>1?r.findIndex(h=>{var u;return(((u=h==null?void 0:h.title)==null?void 0:u.text)??"")===a}):0;if(r[d].axesX[0].type==="time"){const h=e[0].items,u=h[0].x,f=h[h.length-1].x,m=c[d].labels,g=this.evChartCloneData[d].labels,[p,y]=this.zoomAreaMemory.current[0];let C=g.findIndex(M=>+M.$d==+u.$d),b=g.findLastIndex(M=>+M.$d==+f.$d);const w=M=>l/(m.length-1)*(M-p);let T=w(C);if(C===b&&(T-i>=s-T?C-=1:b+=1),C===p&&b===y)return;C-b===-1&&(T=w(C));const k=w(b);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,C,b,T,k):(this.executeZoom(C,b),this.setZoomAreaMemory(C,b))}}dragZoomAnimation(e,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=e,d=window.devicePixelRatio||1,h=Array.from(this.evChartDomContainers).map(u=>{const f=u.querySelector(".animation-canvas");return[u.children[0],f]});for(let u=0;u<h.length;u++){const[f,m]=h[u],g=m.getContext("2d");m.style.top=`${a.y1}px`,m.style.left=`${a.x1}px`,m.width=r*d,m.style.width=`${r}px`,m.height=c*d,m.style.height=`${c}px`,m.style.display==="none"&&(m.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(f,g,e,s,l).then(p=>{m.style.display="none",p&&u===h.length-1&&(this.isAnimationFinish=p,this.executeZoom(n,i),this.setZoomAreaMemory(n,i))})}}executeZoom(e,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let i=0;i<this.evChartCloneData.length;i++){const{data:s,labels:l,series:a}=this.evChartCloneData[i],r=this.evChartProps.data[i],c=Object.keys(a);for(let d=0;d<c.length;d++){const h=c[d];r.data[h]=s[h].filter((u,f)=>e<=f&&n>=f)}r.labels=l.filter((d,h)=>e<=h&&n>=h)}!this.brushIdx.isUseButton&&!this.brushIdx.isUseScroll&&(this.brushIdx.start=e,this.brushIdx.end=n),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(e),this.emitFunc.updateZoomEndIdx(n))}setBrushIdx(e,n){this.brushIdx.end=-1;for(let i=0;i<n.value.length;i++){const s=e.data[n.value[i]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(e,n,i,s){const l=e.data[0].labels.length-1;if(this.cloneLabelsLastIdx=l,this.evChartCloneData=e.data,s){const a=this.zoomAreaMemory.current[0];let r=a[0],c=a[1];r===0&&c===-1&&(r=0,c=l,this.zoomAreaMemory={previous:[],current:[[r,c]],latest:[]}),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(r),this.emitFunc.updateZoomEndIdx(c)),this.executeZoom(r,c)}else this.dragZoomIcon&&this.dragZoomIcon.classList.remove("active"),this.zoomAreaMemory={previous:[],current:[[0,l]],latest:[]},this.emitFunc&&(this.emitFunc.updateZoomStartIdx(0),this.emitFunc.updateZoomEndIdx(l)),this.setIconStyle(i),this.setBrushIdx(e,n)}setZoomAreaMemory(e,n,i){if(e<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;i?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[i].push(r)):(e!==r[0]||n!==r[1])&&(r[0]===0&&r[1]===-1?s.push([0,this.cloneLabelsLastIdx]):s.push(r),a.length=0),l.push([e,n]),this.setIconStyle(this.isUseZoomMode)}executeDragZoomAnimation(e,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=i;let d=0,h=s,u=l-s,f=l,m=1;const g=.0015;let p=.5;const y=.1,C=.05,b=50,w=Math.ceil(b*(s/r)),T=Math.ceil(b*((r-l)/r)),k=M=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(e.style.opacity="initial",M(!0)):(p>=y&&(e.style.opacity=p,p-=C),n.globalAlpha=m,n.drawImage(e,a.x1,a.y1,s,c,d,0,s,c),n.drawImage(e,a.x1+s,a.y1,l-s,c,h,0,u,c),n.drawImage(e,a.x1+l,a.y1,r,c,f,0,r,c),m-=g,d-=w,h-=w,u+=w+T,f+=T,requestAnimationFrame(()=>k(M))));return new Promise(M=>k(M))}setIconStyle(e){const n=(i,s)=>{s?this.iconStyle(i,"enable"):this.iconStyle(i,"disable")};if(e&&this.dragZoomIcon.classList.contains("active")){const{previous:i,latest:s}=this.zoomAreaMemory;n(this.previousIcon,i.length),n(this.latestIcon,s.length),this.iconStyle(this.resetIcon,"enable")}else n(this.resetIcon),n(this.previousIcon),n(this.latestIcon)}iconStyle(e,n){if(!e)return;const[i,s]=n==="enable"?[1,"initial"]:[.5,"none"];e.style.opacity=i,e.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[e,n]=this.zoomAreaMemory.current[0],i=this.cloneLabelsLastIdx;(e!==0||n!==i)&&(this.isUseToolbar=!0,this.executeZoom(0,i),this.setZoomAreaMemory(0,i))}}const i1={padding:{top:20,right:2,left:2,bottom:4},border:2,title:{show:!1,height:40,text:"",style:{fontSize:15,color:"#000",fontFamily:"Roboto"}},legend:{show:!0,type:"icon",position:"right",color:"#353740",inactive:"#aaa",width:140,height:24,allowResize:!1,virtualScroll:!1,clickMode:"active",external:!1,table:{use:!1,columns:{name:{title:"Name"},min:{title:"MIN",use:!1},max:{title:"MAX",use:!1},avg:{title:"AVG",use:!1},total:{title:"TOTAL",use:!1},last:{title:"LAST",use:!1}}}},itemHighlight:!0,seriesHighlight:!0,unSelectedOpacity:.3,useSelect:!1,doughnutHoleSize:0,pieStroke:{use:!0,lineWidth:2,color:"#FFFFFF"},reverse:!1,horizontal:!1,displayOverflow:!1,overlapping:{use:!1},width:"100%",height:"100%",thickness:1,cPadRatio:0,borderRadius:0,combo:!1,tooltip:{use:!0,sortByValue:!0,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:"#666666",shadowOpacity:.25,useShadow:!1,throttledMove:!0,debouncedHide:!1,useScrollbar:!1,textOverflow:"wrap",fontFamily:"Roboto",colorShape:"rect",fontSize:{title:16,contents:14},rowPadding:{top:0,bottom:3,right:20,left:16},showHeader:!0,virtualScroll:{use:"auto",threshold:50,estimatedRowHeight:28,overscan:5}},indicator:{use:!0,color:"#EE7F44",segments:null},plot:{aboveSeries:!0},maxTip:{use:!1,fixedPosTop:!1,showIndicator:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400}},selectItem:{use:!1,useClick:!0,showTextTip:!1,tipText:"value",showTip:!1,showIndicator:!1,fixedPosTop:!1,useApproximateValue:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},useSeriesOpacity:!1,useDeselectItem:!1,showBorder:!1,borderStyle:{color:"#FFFFFF",lineWidth:1,opacity:1,radius:0}},selectLabel:{use:!1,useClick:!0,tipText:"value",limit:1,useDeselectOverflow:!1,showTip:!1,useSeriesOpacity:!0,useLabelOpacity:!0,fixedPosTop:!1,useApproximateValue:!1,tipBackground:"#000000",indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},showTextTip:!1,showIndicator:!1,useBothAxis:!1},selectSeries:{use:!1,useClick:!0,limit:1,useDeselectOverflow:!1},dragSelection:{use:!1,keepDisplay:!0,size:50,fillColor:"#38ACEC",opacity:.65,startArea:"",displayFromStartArea:!1},zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}},heatMapColor:{min:"#FFFFFF",max:"#0052FF",rangeCount:1,colorsByRange:[],stroke:{show:!1,color:"#FFFFFF",lineWidth:1,opacity:1,radius:0},error:"#FF0000",decimalPoint:0},seriesReverse:!1,coordinateDedupe:!0,eventBehavior:{legendClick:"update"},workerRender:!1,shallowDataWatch:!1,shallowOptionsWatch:!1},s1={series:{},groups:[],labels:[],data:{}},o1=t=>jg({...t},s1),l1=t=>t instanceof Date||t!==null&&typeof t=="object"&&typeof t.toDate=="function"&&typeof t.format=="function",Qo=t=>ar(t,function e(n){if(l1(n))return n;if(o.isReactive(n))return ar(o.toRaw(n),e)}),a1=()=>{let t=null;const e=200;return{clickEventCallback:s=>{t&&(clearTimeout(t),t=null),t=setTimeout(()=>{s(),t=null},e)},dblClickEventCallback:s=>{t&&(clearTimeout(t),t=null),s()}}},nc=(t,e)=>{var m;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const p=He({},g,i1);return(g.type==="scatter"||g.type==="heatMap")&&!(g!=null&&g.tooltip)&&(p.tooltip.use=!1),g.type==="pie"&&!(g!=null&&g.padding)&&(p.padding={top:2,right:2,left:2,bottom:4}),p},a=o1,r=Ze(i.selectedItem),c=Ze(i.selectedLabel??(t==null?void 0:t.value)),d=Ze(i.selectedSeries),{clickEventCallback:h,dblClickEventCallback:u}=a1(),f={click:async g=>{await o.nextTick(),h(()=>{const{seriesId:p,dataIndex:y,eventTarget:C,targetAxis:b}=(g==null?void 0:g.selected)??{},{eventTarget:w}=(g==null?void 0:g.deselected)??{};switch(C){case"item":{p!==null?(s("update:selectedItem",{seriesID:p,dataIndex:y}),w==="label"&&s("update:selectedLabel",{dataIndex:[]})):s("update:selectedItem",null);break}case"label":{t!=null&&t.value?t.value.dataIndex=y:(s("update:selectedLabel",{dataIndex:y,targetAxis:b}),w==="item"&&s("update:selectedItem",null));break}case"series":{s("update:selectedSeries",{seriesId:p});break}}s("click",g)})},"dbl-click":async g=>{await o.nextTick(),u(()=>{const{eventTarget:p}=g;switch(p){case"series":{s("update:selectedSeries",{seriesId:g.seriesId?[g.seriesId]:[]});break}}s("dbl-click",g)})},"drag-select":async g=>{await o.nextTick(),s("drag-select",g)},"mouse-move":async g=>{e!=null&&e.value&&(e.value=g.hoveredLabel),await o.nextTick(),s("mouse-move",g)},"mouse-leave":()=>{e!=null&&e.value&&(e.value.label=null)},"click-legend":async g=>{await o.nextTick(),s("click-legend",g)},"update:legendData":async g=>{await o.nextTick(),s("update:legendData",g)},"axes-scale-change":g=>{s("axes-scale-change",g)}};return(m=n.vnode.props)!=null&&m.onAxesDataMaxChange&&(f["axes-data-max-change"]=g=>{s("axes-data-max-change",g)}),{eventListeners:f,selectItemInfo:r,selectLabelInfo:c,selectSeriesInfo:d,getNormalizedData:a,getNormalizedOptions:l}},ic=t=>{const e=o.ref(),n=o.computed(()=>{const i=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:i(da(t.width)),height:i(da(t.height))}});return{wrapper:e,wrapperStyle:n}},sc=(t,{wrapper:e,evChartGroupRef:n},i,s)=>{const{props:l,emit:a}=o.getCurrentInstance(),r=o.ref(!1),c=o.ref(!1),d=o.ref(!0),h=o.ref(),u=o.reactive({zoom:t.zoom}),f=o.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let m=null;const g=o.reactive({dom:[],props:{data:[],options:[]}}),p=o.reactive({data:null,options:null}),y=o.ref([]),C=S=>{S.data.length&&S.range&&c.value&&m.dragZoom(S)},b=()=>{g.props.options.forEach((S,L)=>{if(S.zoom={...S.zoom,use:c.value,getRangeInfo:C},c.value)S.dragSelection={...S.dragSelection,use:!0,keepDisplay:!1};else{const{use:I,keepDisplay:R}=p.options[L].dragSelection??{};S.dragSelection={use:!!I,keepDisplay:!!R}}})},w=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:S,options:L},I)=>{S.chartIdx=I,g.props.data.push(S),g.props.options.push(L),y.value.push(I)})):(g.dom=[e.value.querySelector(".ev-chart-container")],g.props.data.push(l.data),g.props.options.push(l.options)),g.props.data.length){p.data=Ze(g.props.data),p.options=Ze(g.props.options);const S={updateZoomStartIdx:L=>a("update:zoomStartIdx",L),updateZoomEndIdx:L=>a("update:zoomEndIdx",L)};m=new n1(g,p,u,h.value,r,f,S)}},T=S=>{p.data[0].labels.length<=1||(c.value=!c.value,S?S.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),b(),m.setIconStyle(c.value),m.setEventListener(c.value))},k=(S,L)=>{if(m.isAnimationFinish)switch(L){case"dragZoom":T(S.target);break;case"reset":m.initZoom();break;case"previous":case"latest":m.clickMoveZoomArea(L);break}};o.onUpdated(()=>{m&&h.value&&m.setIcon(h.value)});const M=S=>{!Fe(S.zoom,u.zoom)&&(u.zoom=S.zoom,m?(!u.zoom.toolbar.show&&c.value&&T(),m.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&w())},V=S=>{d.value?(r.value||(p.data=n?Qo(S):[Qo(S)],u.zoom.keepZoomStatus?d.value=!1:(c.value=!1,b()),m&&m.updateEvChartCloneData(p,y,c.value,u.zoom.keepZoomStatus)),r.value=!1):d.value=!0},x=(S,L)=>{if(m.isUseToolbar){m.isUseToolbar=!1;return}c.value&&(m.executeZoom(S,L),m.setZoomAreaMemory(S,L))};return o.watch(()=>[f.start,f.end],([S,L],[I])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")S>=(I??0)?i.value.dataIndex-=S-(I??0):i.value.dataIndex+=I-S;else for(let R=0;R<i.value.dataIndex.length;R++)S>=(I??0)?i.value.dataIndex[R]-=S-(I??0):i.value.dataIndex[R]+=I-S;(f.isUseButton||f.isUseScroll)&&m.executeZoom(S,L)}),o.watch(()=>[f.isUseButton,f.isUseScroll],([S,L],[I,R])=>{I&&!S?m.setZoomAreaMemory(f.start,f.end):R&&!L&&(m.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:p,brushIdx:f,createEvChartZoom:w,setOptionsForUseZoom:M,setDataForUseZoom:V,controlZoomIdx:x,onClickToolbar:k}},r1={name:"EvChart",components:{EvChartToolbar:tc},directives:{resize:Gn},props:{selectedItem:{type:Object,default:null},selectedLabel:{type:Object,default:null},selectedSeries:{type:Object,default:null},options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},resizeTimeout:{type:Number,default:0},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},realTimeScatterReset:{type:Boolean,default:!1},legendData:{type:Array,default:()=>[]}},emits:["click","dbl-click","drag-select","mouse-move","update:selectedItem","update:selectedLabel","update:selectedSeries","update:zoomStartIdx","update:zoomEndIdx","update:realTimeScatterReset","click-legend","update:legendData","axes-scale-change","axes-data-max-change"],setup(t,{emit:e}){let n=null;const i=o.ref(!1),s=o.inject("isChartGroup",!1),l=o.inject("brushSeries",{list:[],chartIdx:null}),a=o.inject("groupSelectedLabel",null),r=o.inject("groupHoveredLabel",null),c=o.inject("brushIdx",{start:0,end:-1}),d=o.inject("evChartPropsInGroup",[]),h=o.inject("groupInteraction",null),{eventListeners:u,selectItemInfo:f,selectLabelInfo:m,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:y}=nc(a,r),C=p(t.data),b=y(t.options),w=o.computed(()=>t.selectedLabel),T=o.computed(()=>t.selectedItem),{wrapper:k,wrapperStyle:M}=ic(b),{evChartZoomOptions:V,evChartToolbarRef:x,createEvChartZoom:S,setOptionsForUseZoom:L,setDataForUseZoom:I,controlZoomIdx:R,onClickToolbar:v}=s?{}:sc(b,{wrapper:k,evChartGroupRef:null},t.selectedLabel?w:T,d),G=()=>typeof performance<"u"?performance.now():Date.now();let W=null,E=null;const X=D=>{var q;W?(D.updateSeries&&(W.updateSeries=!0),D.updateData&&(W.updateData=!0),D.updateLegend&&(W.updateLegend=!0),D.updateTooltip&&(W.updateTooltip=!0),(q=D.updateSelTip)!=null&&q.update&&(W.updateSelTip??(W.updateSelTip={}),W.updateSelTip.update=!0)):W={...D};const z=()=>{const ne=((h==null?void 0:h.deferUntil)??0)-G();if(ne>0){E=setTimeout(z,ne);return}W&&n&&n.update(W),W=null,E=null};clearTimeout(E);const A=G(),j=(h==null?void 0:h.deferUntil)??0,J=j>A?j-A:0;E=setTimeout(z,J)},Z=()=>{var A;let D;b.selectLabel.use?D=m:b.selectSeries.use&&(D=g);const z=(A=t.options.realTimeScatter)!=null&&A.use?{...t.data,groups:[],labels:[]}:C;n=new ms(k.value,z,b,u,f,D,l)},N=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&S(),b.legend.show&&b.legend.external&&n.emitLegendData())};o.watch(()=>t.options,D=>{var q,U;const z=y(D),A=((U=(q=n.options)==null?void 0:q.legend)==null?void 0:U.show)??!1,j=!Fe(z.legend.table,n.options.legend.table),J=z.tooltip.use&&!Fe(z.tooltip,n.options.tooltip);n.options=z,X({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:j,updateTooltip:J}),z.legend.show&&z.legend.external&&!A&&n.emitLegendData(),s||L(z)},{deep:!b.shallowOptionsWatch,flush:"post"}),o.watch(()=>t.data,D=>{var U,ne;const z=(U=t.options.realTimeScatter)!=null&&U.use?{...D,groups:[],labels:[]}:p(D),A=!Fe(z.series,n.data.series),j=!Fe(z.groups,n.data.groups),J=A||j||t.options.type==="heatMap",q=A||j||!Fe(z.labels,n.data.labels)||!Fe(z.data,n.data.data);n.data=(ne=t.options.realTimeScatter)!=null&&ne.use?z:Qo(z),X({updateSeries:J,updateSelTip:{update:!0,keepDomain:!1},updateData:q}),!s&&q&&I(z)},{deep:!b.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(D,z)=>{if(w!=null&&w.value)for(let A=0;A<w.value.dataIndex.length;A++)D>=(z??0)?w.value.dataIndex[A]-=D-(z??0):w.value.dataIndex[A]+=z-D;else T!=null&&T.value&&(D>=(z??0)?T.value.dataIndex-=D-(z??0):T.value.dataIndex+=z-D)}),o.watch(()=>T.value,D=>{const z=t.options.type;n.selectItemByData(D,z)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??w.value,D=>{D!=null&&D.dataIndex&&n.selectLabelByData(D.dataIndex,D==null?void 0:D.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>t.selectedSeries,D=>{var z;(z=b.selectSeries)!=null&&z.use?D.seriesId&&n.selectSeriesByData(D.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||o.watch(()=>[t.zoomStartIdx,t.zoomEndIdx],([D,z])=>{R(D,z)}),o.watch(()=>t.realTimeScatterReset,D=>{D&&(Object.keys(n.dataSet??{}).forEach(z=>{n.dataSet[z]&&(n.dataSet[z].dataGroup=[])}),e("update:realTimeScatterReset",!1))}),o.watch(()=>{var D;return(D=t.options.realTimeScatter)==null?void 0:D.use},D=>{n.options.realTimeScatter.use=D??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,D=>{D&&t.options.syncHover!==!1&&(D.label==null?n.overlayClear():n.drawSyncedIndicator(D))},{deep:!0,flush:"post"}),o.onMounted(async()=>{d!=null&&d.value&&d.value.push(t),await Z(),await N(),i.value=!0}),o.onBeforeUnmount(()=>{var D;clearTimeout(E),W=null,E=null,n&&"destroy"in n&&n.destroy(),(D=d==null?void 0:d.value)!=null&&D.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const P=D=>{n==null||n.toggleSeries(D)},B=D=>{n==null||n.highlightSeries(D)},Y=()=>{n==null||n.unhighlightSeries()},H=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},_=es(()=>{n&&"resize"in n&&n.resize()},t.resizeTimeout);return o.onActivated(()=>{i.value&&_()}),{wrapper:k,wrapperStyle:M,onResize:_,redraw:H,toggleSeries:P,highlightSeries:B,unhighlightSeries:Y,evChartToolbarRef:x,injectIsChartGroup:s,onClickToolbar:v,normalizedOptions:b,zoomOptions:o.toRef(V??{zoom:{}},"zoom")}}},c1={key:0,ref:"evChartToolbarRef"};function d1(t,e,n,i,s,l){var c;const a=o.resolveComponent("ev-chart-toolbar"),r=o.resolveDirective("resize");return o.openBlock(),o.createElementBlock(o.Fragment,null,[(c=i.zoomOptions.toolbar)!=null&&c.show&&!i.injectIsChartGroup?(o.openBlock(),o.createElementBlock("div",c1,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{ref:"wrapper",style:o.normalizeStyle(i.wrapperStyle),class:"ev-chart"},null,4),[[r,i.onResize]])],64)}const bi=ce(r1,[["render",d1]]);bi.install=t=>{t.component(bi.name,bi)};const h1={zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}}},u1=()=>{const t=o.ref(!1),e=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:a=>He({},a,h1),isExecuteZoom:t,brushSeries:i,evChartGroupRef:e,evChartPropsInGroup:n,groupInteraction:{deferUntil:0}}},f1={name:"EvChartGroup",components:{evChartToolbar:tc},props:{options:{type:Object,default:()=>({})},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},groupSelectedLabel:{type:Object,default:null}},emits:["update:groupSelectedLabel","update:zoomStartIdx","update:zoomEndIdx","update:groupHoveredLabel"],setup(t,{emit:e}){const{getNormalizedOptions:n,isExecuteZoom:i,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a,groupInteraction:r}=u1(),c=n(t.options);o.provide("isExecuteZoom",i),o.provide("isChartGroup",!0),o.provide("brushSeries",s),o.provide("evChartPropsInGroup",a),o.provide("groupInteraction",r);const d=2e3,h=800,u=()=>typeof performance<"u"?performance.now():Date.now(),f=(S=h)=>{const L=Number.isFinite(S)?Math.min(Math.max(S,0),d):h,I=u();r.deferUntil=Math.min(Math.max(r.deferUntil,I+L),I+d)};o.provide("deferPollingRedraw",f);const m=o.computed({get:()=>t.groupSelectedLabel,set:S=>e("update:groupSelectedLabel",S)});o.provide("groupSelectedLabel",m);const g=o.ref(null);o.provide("groupHoveredLabel",g),o.watch(()=>t.options.syncHover,S=>{S?g.value={label:"",horizontal:!1}:g.value=null},{immediate:!0});const{evChartZoomOptions:p,evChartInfo:y,evChartToolbarRef:C,evChartClone:b,brushIdx:w,createEvChartZoom:T,setOptionsForUseZoom:k,setDataForUseZoom:M,controlZoomIdx:V,onClickToolbar:x}=sc(c,{wrapper:null,evChartGroupRef:l},m,a);return o.provide("evChartClone",b),o.provide("evChartInfo",y),o.provide("brushIdx",w),o.onMounted(()=>{T()}),o.watch(()=>y.props.data,S=>{M(S)},{deep:!0}),o.watch(()=>t.options,S=>{const L=n(S);k(L)},{deep:!0}),o.watch(()=>[t.zoomStartIdx,t.zoomEndIdx],([S,L])=>{w.isUseButton||w.isUseScroll||V(S,L)}),{evChartGroupRef:l,evChartToolbarRef:C,zoomOptions:o.toRef(p,"zoom"),onClickToolbar:x,deferPollingRedraw:f}}},m1={key:0,ref:"evChartToolbarRef"},p1={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function g1(t,e,n,i,s,l){const a=o.resolveComponent("ev-chart-toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[i.zoomOptions.toolbar.show?(o.openBlock(),o.createElementBlock("div",m1,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.createElementVNode("div",p1,[o.renderSlot(t.$slots,"default",{},void 0,!0)],512)],64)}const yi=ce(f1,[["render",g1],["__scopeId","data-v-dda98b9e"]]);yi.install=t=>{t.component(yi.name,yi)};const Me={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},De={LEFT:"leftX",RIGHT:"rightX"};let b1=class{constructor(e,n,i,s,l){this.evChart=e,this.evChartBrushOptions=i,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,i.value.useDebounce&&(this.debounceBrushIdx={start:s.start,end:s.end})}init(e){var n;if(this.brushIdx.start>this.brushIdx.end){this.removeBrushCanvas();return}if((n=this.evChartBrushRef)!=null&&n.value){const i=this.evChartBrushRef.value.querySelector(".brush-canvas");if(i)this.drawBrushRect({brushCanvas:i,isResize:e});else{const s=document.createElement("canvas");s.setAttribute("class","brush-canvas"),s.setAttribute("style","display: block; z-index: 1;");const l=this.evChartBrushRef.value.querySelector(".ev-chart-brush-container");l&&(this.brushCanvas=s,l.appendChild(s),this.evChartBrushContainer=l,this.drawBrushRect({brushCanvas:s}),this.addEvent(s))}}}drawBrushRect({brushCanvas:e,isResize:n,isDebounce:i,mode:s,offsetX:l}){const{chartRect:a,labelOffset:r}=this.evChart;if(!a&&!r)return;const c=this.evChartData.value.labels.length-1;this.labelEndIdx=c;const d={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},h=this.setCanvasWidthHeight(d,e);if(!(n&&this.isEqualWidth)&&c>=0){const u=this.setBrushXAndWidth(h,l,i,s);h&&u&&this.drawBrush(h,u,d,e)}}setCanvasWidthHeight(e,n){const s=e.x2-e.x1+6,l=e.y2-e.y1,a=(e.x2-e.x1)/this.labelEndIdx,r=window.devicePixelRatio||1;return this.isEqualWidth=n.width===Math.floor(s*r),{brushButtonWidth:6,brushCanvasHeight:l,brushCanvasWidth:s,axesXInterval:a,pixelRatio:r}}setBrushXAndWidth(e,n=0,i,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=e;!i&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case Me.BUTTON.INCREASE:case Me.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===De.LEFT?(this.brushRectWidth=this.beforeBrushRectWidth?this.beforeBrushRectWidth-n:this.brushRectWidth-n,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=n*c,this.beforeBrushRectX=this.brushRectX)):this.curBrushButtonType===De.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case Me.GRAB.UP:case Me.GRAB.DOWN:this.brushRectX<=0&&s===Me.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===Me.GRAB.UP?this.offsetXAndRectXInterval=null:(this.offsetXAndRectXInterval||(this.offsetXAndRectXInterval=n-this.brushRectX),this.brushRectX=n-this.offsetXAndRectXInterval);break;default:n||(this.brushRectX=d.start*r*c,this.brushRectWidth=(a-(this.labelEndIdx-(d.end-d.start))*r)*c,this.beforeBrushRectX=this.brushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX);break}const h=a*c;return s===Me.BUTTON.INCREASE||s===Me.BUTTON.DECREASE?(this.brushRectX<0&&(this.brushRectWidth+=this.brushRectX,this.brushRectX=0),this.brushRectX+this.brushRectWidth>h&&(this.brushRectWidth=h-this.brushRectX)):this.brushRectX<0?this.brushRectX=0:this.brushRectX+this.brushRectWidth>h&&(this.brushRectX=h-this.brushRectWidth),this.brushRectWidth>h&&(this.brushRectWidth=h),{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(e,n,i,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=e,{brushRectX:h,brushRectWidth:u}=n,{height:f,selection:{fillColor:m,opacity:g}}=this.evChartBrushOptions.value,p=f-i.y1,y=h,C=h+u;s.style.position||(s.style.position="absolute",s.style.top=`${i.y1}px`,s.style.left=`${i.x1-l/2}px`),this.isEqualWidth||(s.width=r*d,s.style.width=`${r}px`,s.height=a*d,s.style.height=`${a}px`);const b=s.getContext("2d");b.clearRect(0,0,r*d,a*d),b.fillStyle=m,b.globalAlpha=g,b.fillRect(h,0,u,p),b.fillRect(y,0,l,p),b.fillRect(C-l,0,l,p),this.brushPosInfo={leftX:y/d,rightX:C/d,buttonWidth:l,axesXInterval:c,...e,...n}}getCanvasOffsetX(e){const n=this.brushCanvas.getBoundingClientRect();return e.clientX-n.left}addEvent(){let e;const n=l=>{if(this.isDragMode){const a=this.getCanvasOffsetX(l);this.mouseDownAndMove({offsetX:a})}};this.onDocumentMouseMove=ns(n,5),this.onDocumentMouseUp=()=>{document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.initEventState()},this.onMouseDown=l=>{l.preventDefault(),e.isInsideButton?this.isDragMode="button":e.isInsideBrush?(this.clickBrushInsideX=l.offsetX,this.isDragMode="grab"):e.isOutsideBrush&&this.teleportBrush(l),this.isDragMode&&(document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp))};const i=l=>{this.isDragMode||(e=this.getMousePosition(l),this.changeCursor(e))};this.onMouseMove=ns(i,5),this.onWheel=l=>{l.preventDefault();const a=l.deltaY>0?Me.WHEEL.DOWN:Me.WHEEL.UP;this.updateBrushIdx(a),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:a}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()};const s=()=>{this.initEventState()};this.onWheelDebounce=es(s,100),this.setEventListener("addEventListener")}getMousePosition(e){const n=d=>Math.abs(this.brushPosInfo[d]-e.offsetX),i=n(De.RIGHT)>n(De.LEFT)?De.LEFT:De.RIGHT,s=d=>e.offsetX>this.brushPosInfo[d],l=d=>e.offsetX<this.brushPosInfo[d],a=l(De.LEFT)||s(De.RIGHT),r=s(De.LEFT)&&l(De.RIGHT),c=e.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[i]&&e.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[i];return this.curBrushButtonType=c&&i,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.brushCanvas=null),this.evChartBrushContainer){const e=this.evChartBrushContainer;for(;e.hasChildNodes();)e.removeChild(e.firstChild)}}setEventListener(e){this.brushCanvas[e]("mousemove",this.onMouseMove),this.brushCanvas[e]("mousedown",this.onMouseDown),this.brushCanvas[e]("mouseup",this.onMouseUp),this.evChartBrushOptions.value.useWheelMove&&(this.brushCanvas[e]("wheel",this.onWheel),this.brushCanvas[e]("wheel",this.onWheelDebounce))}removeBrushWrapper(){if(this.evChartBrushRef.value){const e=this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");e&&this.evChartBrushRef.value.removeChild(e)}}removeBrushCanvas(){if(this.evChartBrushContainer){const e=this.evChartBrushContainer.querySelector(".brush-canvas");e&&this.evChartBrushContainer.removeChild(e)}}teleportBrush(e){const n=this.debounceBrushIdx??this.brushIdx,i=(n.end-n.start)/2;let s,l,a;i>.5?(n.end-n.start)%2===0?(a=Math.round(e.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.ceil(e.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.floor(e.offsetX/this.brushPosInfo.axesXInterval),e.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(i),l=Math.ceil(i)):(s=Math.ceil(i),l=Math.floor(i),i<1&&(a+=1))),a-s<=0?(n.start=0,n.end=l+s):a+l>=this.labelEndIdx?(n.start=this.labelEndIdx-l-s,n.end=this.labelEndIdx):(n.start=a-s,n.end=a+l),this.brushIdx.isUseScroll=!0}changeCursor(e){e.isOutsideBrush?this.brushCanvas.style.cursor="pointer":e.isInsideBrush&&(e.isInsideButton?this.brushCanvas.style.cursor="ew-resize":this.brushCanvas.style.cursor="grab")}mouseDownAndMove(e){const n=this.debounceBrushIdx?0:this.brushPosInfo.axesXInterval/3;let i;e.offsetX>this.beforeMouseXPos?this.isDragMode==="grab"?this.clickBrushInsideX<e.offsetX-n&&(i=Me.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=e.offsetX+n):e.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(i=this.curBrushButtonType===De.LEFT?Me.BUTTON.DECREASE:Me.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):e.offsetX<this.beforeMouseXPos&&(this.isDragMode==="grab"?this.clickBrushInsideX>e.offsetX+n&&(i=Me.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=e.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-e.offsetX>n&&(i=this.curBrushButtonType===De.LEFT?Me.BUTTON.INCREASE:Me.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:i,offsetX:e.offsetX}):this.updateBrushIdx(i),this.beforeMouseXPos=e.offsetX}updateBrushIdx(e){const n=this.debounceBrushIdx??this.brushIdx;switch(e){case Me.WHEEL.UP:case Me.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case Me.WHEEL.DOWN:case Me.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case Me.BUTTON.INCREASE:if(this.curBrushButtonType===De.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case Me.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===De.LEFT?n.start+=1:n.end-=1;break}}updateBrushIdxUseXPos(){if(!this.debounceBrushIdx)return;const e=()=>{let s,l;if(this.brushPosInfo){const{brushRectX:a,brushRectWidth:r,brushCanvasWidth:c,axesXInterval:d}=this.brushPosInfo;if(this.brushIdx.isUseButton||this.isUseBrushGrab){if(s=a/d,l=this.labelEndIdx-(c-(a+r))/d,this.curBrushButtonType===De.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===De.RIGHT?(s=this.brushIdx.start,l=Math.round(l),s===l&&(l+=1)):(s=Math.round(s),l=Math.round(l)),l>this.labelEndIdx){const h=l-this.labelEndIdx;s-=h,l-=h}if(s<0){const h=Math.abs(s);s=0,l+=h}}}return{brushStartIdx:s,brushEndIdx:l}},{brushStartIdx:n,brushEndIdx:i}=e();this.brushIdx.start===n&&this.brushIdx.end===i&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=i??this.debounceBrushIdx.end}initEventState(){if(this.isCleaningUp)return;this.isCleaningUp=!0,new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.isDragMode=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1),this.isCleaningUp=!1})}};const y1={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},x1=()=>({getNormalizedBrushOptions:e=>He({},e,y1)}),S1={name:"EvChartBrush",directives:{resize:Gn},props:{options:{type:Object,default:()=>({})}},setup(t){let e=null,n=null;const i=o.ref(!1),s=o.inject("evChartClone",{data:[]}),l=o.inject("evChartInfo",{props:{options:[]}}),a=o.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=o.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=x1(),d=o.computed(()=>c(t.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:m,getNormalizedData:g,getNormalizedOptions:p}=nc(),y=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var I,R;const S=l.props.options[d.value.chartIdx],L={...S,brush:{use:!0,...d.value},height:d.value.height,zoom:{use:!1},dragSelection:{use:!1},title:{show:!1},tooltip:{use:!1},legend:{show:!1},selectLabel:{use:!1},selectSeries:{use:!1},axesX:[{...(I=S==null?void 0:S.axesX)==null?void 0:I[0],title:{use:!1}}],axesY:[{...(R=S==null?void 0:S.axesY)==null?void 0:R[0],title:{use:!1}}]};return p(L)}),{wrapper:b,wrapperStyle:w}=ic(C.value);o.watch(()=>r.list,()=>{b.value&&r.chartIdx===d.value.chartIdx&&(e.seriesList=r.list[d.value.chartIdx],e.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}}))}),o.watch(C,(S,L)=>{var I;S.brush.chartIdx<=((I=s.data)==null?void 0:I.length)-1?n&&!Fe(L.brush,S.brush)?n.removeBrushWrapper():e&&!Fe(S,L)&&(e.options=Ze(S),e.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(e.data=Ze(y.value),e.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),o.watch(()=>s.data,S=>{if(e){const L=S[d.value.chartIdx];if(L){const I=!Fe(L.series,e.data.series),R=r.list[d.value.chartIdx];typeof R=="object"&&Object.keys(R).length&&Object.keys(L.series).forEach(v=>{var G;"show"in L.series[v]||(L.series[v].show=((G=R[v])==null?void 0:G.show)??!0)}),e.data=Ze(g(L)),e.update({updateSeries:I,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const T=()=>{let S;C.value.selectLabel.use?S=f:C.value.selectSeries.use&&(S=m),e=new ms(b.value,y.value,C.value,h,u,S)},k=()=>{n=new b1(e,y,d,a,b)},M=()=>{e&&e.init()},V=S=>{n&&n.init(S)};o.watch(()=>[a.start,a.end],()=>{var S;b.value&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1&&V()}),o.onMounted(async()=>{d.value.show&&(await T(),await M(),k(),V()),i.value=!0}),o.onUpdated(async()=>{var S;if(d.value.show&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1){const L=r.list[d.value.chartIdx];typeof L=="object"&&Object.keys(L).length&&Object.keys(y.value.series).forEach(I=>{var R;"show"in y.value.series[I]||(y.value.series[I].show=((R=L[I])==null?void 0:R.show)??!0)}),await T(),await M(),k(),V()}}),o.onBeforeUnmount(()=>{e&&"destroy"in e&&e.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{e&&"hideTooltip"in e&&e.hideTooltip()});const x=es(()=>{e&&"resize"in e&&new Promise(L=>e.resize(L)).then(L=>{L&&V(L)})},0);return o.onActivated(()=>{i.value&&x()}),{evChartBrushOptions:d,evChartBrushRef:b,evChartBrushStyle:w,onResize:x}}};function C1(t,e,n,i,s,l){const a=o.resolveDirective("resize");return i.evChartBrushOptions.show?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:o.normalizeStyle(i.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,i.onResize]]):o.createCommentVNode("",!0)}const xi=ce(S1,[["render",C1]]);xi.install=t=>{t.component(xi.name,xi)};const k1={name:"TreeGridNode",components:{GridOptionButton:Fo},props:{dataIndex:{type:Number,default:0},nodeData:{type:Object,default:()=>({})},selectedData:{type:Object,default:()=>({})},useCheckbox:{type:Object,default:()=>({})},orderedColumns:{type:[Array],default:()=>[]},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},parentIcon:{type:String,default:""},childIcon:{type:String,default:""},customContextMenu:{type:[Array],default:()=>[]},menuRef:{type:Object,default:null},rowHeight:{type:Number,default:35},minWidth:{type:Number,default:40},borderStyle:{type:String,default:""},highlightIndex:{type:Number,default:-1}},emits:{"check-tree-data":null,"expand-tree-data":null,"click-tree-data":null,"dbl-click-tree-data":null,"context-menu":null},setup(t,{emit:e}){const n=(b,w)=>{e("check-tree-data",b,w)},i=b=>{e("expand-tree-data",b)},s=(b,w)=>{e("click-tree-data",b,w)},l=(b,w)=>{e("dbl-click-tree-data",b,w)},a=b=>{e("context-menu",b)},r=b=>{const w=t.expandIcon?t.expandIcon:"",T=t.expandIcon?t.collapseIcon:"";return b.expand?T:w},c=o.computed(()=>t.nodeData||{}),d=o.computed(()=>t.parentIcon||"tree-parent-icon"),h=o.computed(()=>t.childIcon||"tree-child-icon"),u=o.computed(()=>d.value!=="none"||h.value!=="none"),f=o.computed(()=>{const b=t.orderedColumns||[],w=b.findIndex(k=>k.expandColumn&&!k.hide&&!k.hiddenDisplay);if(w!==-1)return w;const T=b.findIndex(k=>!k.hide&&!k.hiddenDisplay);return T!==-1?T:0}),m=b=>({row:!0,"tree-row":!0,[`tree-row--level-${b==null?void 0:b.level}`]:!0,highlight:(b==null?void 0:b.index)===t.highlightIndex,selected:b.selected,"non-border":!!t.borderStyle&&t.borderStyle!=="rows"}),g=o.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!t.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:u,checkboxClass:g,expandColumnIdx:f,onCheck:n,onExpand:i,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:m,getColumnClass:(b,w)=>({cell:!0,"tree-td":w===0,[b.type]:b.type,[b.align]:b.align,[b.field]:b.field,"non-border":!!t.borderStyle}),getColumnStyle:(b,w)=>({width:`${b.width}px`,height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,"min-width":`${t.minWidth}px`,"border-right":t.orderedColumns.length-1===w?"none":"1px solid #CFCFCF"}),getDepthStyle:b=>({"margin-left":`${b*13}px`})}}},w1=["data-index"],I1=["data-name","data-index"],L1={class:"td-content__wrapper"},T1=["title"],M1={class:"td-content"};function v1(t,e,n,i,s,l){var d;const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-icon"),c=o.resolveComponent("grid-option-button");return o.openBlock(),o.createElementBlock("tr",{"data-index":i.node.index,class:o.normalizeClass(i.getRowClass(i.node)),onClick:e[7]||(e[7]=h=>i.onClick(h,i.node)),onDblclick:e[8]||(e[8]=h=>i.onDblClick(h,i.node))},[n.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass(i.checkboxClass),style:o.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:i.node.checked,"onUpdate:modelValue":e[0]||(e[0]=h=>i.node.checked=h),disabled:i.node.uncheckable,indeterminate:i.node.indeterminate,class:"row-checkbox-input",onChange:e[1]||(e[1]=h=>i.onCheck(h,i.node))},null,8,["modelValue","disabled","indeterminate"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.orderedColumns,(h,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:u},[!h.hide&&!h.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":h.field,"data-index":i.node.index,class:o.normalizeClass(i.getColumnClass(h,u)),style:o.normalizeStyle(i.getColumnStyle(h,u))},[o.createElementVNode("div",L1,[u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(i.getDepthStyle(i.node.level))},null,4)):o.createCommentVNode("",!0),u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[i.node.hasChild?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.expandIconClasses(i.node)?(o.openBlock(),o.createBlock(r,{key:0,icon:i.expandIconClasses(i.node),style:{display:"block"},onClick:e[2]||(e[2]=f=>i.onExpand(i.node))},null,8,["icon"])):(o.openBlock(),o.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:e[3]||(e[3]=o.withModifiers(f=>i.onExpand(i.node),["stop"]))},[...e[9]||(e[9]=[o.createElementVNode("i",null,null,-1)])]))],64)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),u===i.expandColumnIdx&&i.isDataIcon?(o.openBlock(),o.createElementBlock("span",{key:2,title:i.node[h.field],class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[o.createElementVNode("span",{class:o.normalizeClass(i.node.hasChild?i.parentIconMV:i.childIconMV)},[...e[10]||(e[10]=[o.createElementVNode("i",null,null,-1)])],2)],10,T1)):o.createCommentVNode("",!0),o.createElementVNode("div",M1,[t.$slots[h.field+"Node"]?o.renderSlot(t.$slots,h.field+"Node",{key:0,item:{data:i.node.data}},void 0,!0):o.createCommentVNode("",!0)])])],14,I1)):o.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[t.$slots.contextmenuIconNode?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[e[4]||(e[4]=h=>i.onContextMenu(h)),e[5]||(e[5]=o.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[o.renderSlot(t.$slots,"contextmenuIconNode",{},void 0,!0)])):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[e[6]||(e[6]=h=>i.onContextMenu(h)),o.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):o.createCommentVNode("",!0)],42,w1)}const R1=ce(k1,[["render",v1],["__scopeId","data-v-faab3696"]]),V1={name:"EvTreeGridToolbar"},E1={class:"tree-grid-toolbar"};function G1(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",E1,[o.renderSlot(t.$slots,"toolbarWrapper")])}const W1=ce(V1,[["render",G1]]),Z1=t=>{const{props:e}=o.getCurrentInstance(),{checkInfo:n}=t;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=m=>m.charAt(0).toUpperCase()+m.slice(1),u="Renderer";let f="";if(d.indexOf("_")!==-1){const m=d.split("_");for(let g=0;g<m.length;g++)f+=h(m[g])}else f=h(d);return f+u},getConvertValue:(d,h)=>{let u=d.type==="number"||d.type==="float"?Number(h):h;return d.type==="number"?(u=Qt(h),u=u===!1?h:u):d.type==="float"&&(u=u.toFixed(d.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),u},getColumnIndex:d=>e.columns.findIndex(h=>h.field===d),setPixelUnit:d=>{let h=d;const u=h.toString().indexOf("px")>=0,f=h.toString().indexOf("%")>=0;return!u&&!f&&(h=`${h}px`),h},checkHeader:d=>{n.isHeaderChecked=!!d.length&&d.every(u=>u.checked);const h=d.filter(u=>u.uncheckable);if(h.length){const u=d.filter(m=>m.checked),f=d.every(m=>h.includes(m));n.isHeaderChecked=!f&&h.length+u.length===d.length,n.isHeaderUncheckable=f}n.isHeaderIndeterminate=!!d.length&&d.some(u=>u.checked||u.indeterminate)&&!n.isHeaderChecked}}},ps=t=>{const{originColumns:e,filteredColumns:n}=t;return e.map(i=>{const s=n.find(l=>l.index===i.index)??{};return{...i,...s}})},X1=t=>{const{scrollInfo:e,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=t,d=f=>{let m=n.showTreeStore;l.isClientPaging&&(m=r());const g=i.body;if(g){const p=s.rowHeight,y=g.clientHeight>p?Math.ceil(g.clientHeight/p):m.length,C=m.length*p;let b=Math.floor(g.scrollTop/p);b>m.length-1&&(b=0);const w=b+y+1,T=Math.max(b,0),k=w,M=i.table;n.viewStore=m.slice(T,k),e.hasVerticalScrollBar=y<m.length||g.clientHeight<M.clientHeight,e.vScrollTopHeight=T*p,e.vScrollBottomHeight=C-n.viewStore.length*p-e.vScrollTopHeight,f&&l.isInfinite&&e.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(k/l.perPage)+1,l.startIndex=k,c({onScrollEnd:!0}))}},h=()=>{const f=i.header,m=i.body,g=i.table;f.scrollLeft=m.scrollLeft,a.value=m.scrollLeft,e.hasHorizontalScrollBar=m.clientWidth<g.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const f=i.body,m=f.scrollTop,g=f.scrollLeft,p=e.lastScroll.top,y=e.lastScroll.left,C=g!==y;m!==p&&f.clientHeight&&d(!0),C&&h(),e.lastScroll.top=m,e.lastScroll.left=g}}},N1=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,stores:a,isRenderer:r,updateVScroll:c,updateHScroll:d,contextInfo:h}=t,u=()=>{a.viewStore=a.showTreeStore;const p=a.viewStore;let y=i.columnWidth;i.columnWidth>0&&(y=i.columnWidth),y=i.columnWidth;let C=0;if(i.adjust&&s.body){const b=s.body;let w=b.offsetWidth;const T=b.offsetHeight,k=a.orderedColumns.reduce((M,V)=>(V.hide||V.hiddenDisplay||(V.width?M.totalWidth+=V.width:M.emptyCount++),M),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(i.rowHeight*p.length>T-i.scrollWidth&&(w-=i.scrollWidth),l.useCheckbox.use&&(w-=i.minWidth),y=w-k.totalWidth,y>0){const M=k.emptyCount===0?0:Math.floor(y/k.emptyCount);C=y-M*k.emptyCount,y=k.emptyCount!==0?M:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(a.orderedColumns.forEach(b=>{const w=r(b)?i.rendererMinWidth:i.minWidth;b.width&&b.width<w&&(b.width=w),!b.width&&!b.hide&&(b.width=y)}),C&&a.orderedColumns.length){let b=a.orderedColumns.length-1,w=a.orderedColumns[b];for(;b>0&&w&&(w.hide||w.hiddenDisplay);)b-=1,w=a.orderedColumns[b];w&&(w.width+=C)}i.isResize=!i.isResize},f=()=>{o.nextTick(()=>{var p,y;i.adjust&&a.orderedColumns.forEach(C=>{var w;const b=C;return!((w=e.columns[C.index])!=null&&w.width)&&!b.resized&&(b.width=0),b},void 0),u(),(p=s.body)!=null&&p.clientHeight&&c(),(y=s.body)!=null&&y.clientWidth&&d()})};return{calculatedColumn:u,onResize:f,onShow:p=>{p&&f()},onColumnResize:(p,y)=>{const C=s.header,b=s.body,w=C.getBoundingClientRect().left,T=C.querySelector(`li[data-index="${p}"]`),k=r(a.orderedColumns[p])?i.rendererMinWidth:i.minWidth,M=T.getBoundingClientRect(),V=b.getBoundingClientRect().right-w,x=s.resizeLine,S=M.left-w+k,L=M.right-w,I=y.clientX,R=M.left-w;b.style.overflow="auto",x.style.left=`${L}px`,i.showResizeLine=!0;const v=W=>{const E=W.clientX-I,X=L+E;let Z=Math.max(S,X);Z=Math.min(V,Z),x.style.left=`${Z}px`},G=()=>{const E=parseInt(x.style.left,10)-R;a.orderedColumns[p]&&(a.orderedColumns[p].width=E,a.orderedColumns[p].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",v),f();const X=ps(a);n("resize-column",{column:a.orderedColumns[p],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",v),document.addEventListener("mouseup",G,{once:!0})}}},P1=t=>{const{emit:e}=o.getCurrentInstance(),n=t,i=(r,c)=>{var u;const d=r.target.tagName.toLowerCase();let h={};return r.target.offsetParent&&(d==="td"?h=r.target.dataset:h=((u=r.target.closest("td"))==null?void 0:u.dataset)??{}),{event:r,rowData:c,rowIndex:c.index,cellName:h.name,cellIndex:h.index}};let s=null;return{onRowClick:(r,c)=>{var d,h;return r.target&&r.target.parentElement&&(r.target.parentElement.classList.contains("row-checkbox-input")||(h=(d=r.target.closest("td"))==null?void 0:d.classList)!=null&&h.contains("row-contextmenu"))?!1:(clearTimeout(s),s=setTimeout(()=>{n.useSelect&&(c.selected?(c.selected=!1,n.multiple?r.ctrlKey?n.selectedRow=n.selectedRow.filter(u=>u.index!==c.index):n.selectedRow=[c]:n.selectedRow=[]):(c.selected=!0,r.ctrlKey&&n.multiple&&(!n.limitCount||n.limitCount>n.selectedRow.length)?n.selectedRow.push(c):n.selectedRow=[c]),e("update:selected",n.selectedRow),e("click-row",i(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),e("dblclick-row",i(r,c))}}},D1=t=>{const{checkInfo:e,stores:n,checkHeader:i,pageInfo:s,getPagingData:l}=t,{emit:a}=o.getCurrentInstance(),r=()=>e.useCheckbox.mode==="each",c=m=>{const g=n.treeStore.findIndex(p=>p.index===m.index);g!==-1&&(n.treeStore[g].checked=m.checked)},d=m=>{r()||m.hasChild&&m.children.forEach(g=>{const p=g;m.checked&&!p.checked&&!p.uncheckable&&e.checkedRows.push(p),m.checked||(e.checkedRows=e.checkedRows.filter(y=>y.index!==p.index)),p.checked=m.checked&&!p.uncheckable,p.hasChild&&d(p)})},h=m=>{if(r())return;const g=m.parent;if(g){const p=g.children.every(C=>C.checked);g.checked=p&&!g.uncheckable;const y=g.children.filter(C=>C.uncheckable);if(y.length){const C=g.children.filter(b=>b.checked);y.length+C.length===g.children.length&&(g.checked=!0)}g.indeterminate=!p&&g.children.some(C=>C.checked||C.indeterminate),g.checked?e.checkedRows.push(g):e.checkedRows=e.checkedRows.filter(C=>C.index!==g.index),g.parent&&h(g)}};return{onCheck:(m,g)=>{let p=n.store;s.isClientPaging&&(p=l());const y=()=>e.useCheckbox.mode==="single",C=()=>{e.isHeaderChecked&&(e.isHeaderChecked=!1)},b=()=>{y()&&e.checkedRows.length>0&&(e.prevCheckedRow.checked=!1,c(e.prevCheckedRow))},w=k=>{if(y()){e.checkedRows=[k];return}d(k),h(k),e.checkedRows.push(k),k.indeterminate=!1},T=k=>{if(y()){e.checkedRows=[];return}e.checkedRows=e.checkedRows.filter(M=>M.index!==k.index)};b(),g.checked?(w(g),i(p)):(C(),T(g),d(g),h(g)),e.prevCheckedRow=g,a("update:checked",e.checkedRows),a("check-row",m,g.index,g)},onCheckAll:m=>{var y;const g=e.isHeaderChecked;let p=(y=n.store)==null?void 0:y.filter(C=>C.isFilter);s.isClientPaging&&(p=l()),p.forEach(C=>{C.checked=g&&!C.uncheckable,C.checked?e.checkedRows.find(b=>b.index===C.index)||e.checkedRows.push(C):e.checkedRows=e.checkedRows.filter(b=>b.index!==C.index),C.indeterminate=!1}),e.isHeaderIndeterminate=!1,a("update:checked",e.checkedRows),a("check-all",m,e.checkedRows)}}},B1=t=>{const{emit:e}=o.getCurrentInstance(),{contextInfo:n,stores:i,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=t,d=(m=!0)=>{const g=[];if(m&&n.customContextMenu.length){const p=s.selectedRow,y=n.customContextMenu.map(C=>{const b=C;return b.validate&&(b.disabled=!b.validate(b.itemId,p)),b.selectedRow=p??[],b});g.push(...y)}n.contextMenuItems=g};return{setContextMenu:d,onContextMenu:m=>{var y,C;const p=(C=(y=m.target.closest(".row"))==null?void 0:y.dataset)==null?void 0:C.index;if(p){const b=i.viewStore.findIndex(T=>T.index===Number(p)),w=i.viewStore[b];s.selectedRow=[w],d(),e("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),e("update:selected",[])},onColumnContextMenu:(m,g)=>{var p,y,C,b,w,T;if(m.target.className.includes("column-name")){const k=!!g.sortable;n.columnMenuItems=[{text:((p=n.columnMenuTextInfo)==null?void 0:p.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||i.orderedColumns.length===1||!!g.fixed,hidden:((y=n.hiddenColumnMenuItem)==null?void 0:y.hide)||!l.value,click:()=>{r(g.field),e("change-column-status",{columns:i.updatedColumns}),e("change-column-info",{type:"display",columns:i.updatedColumns})}},{text:((C=n.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!k,hidden:(b=n.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>c(g,"asc")},{text:((w=n.columnMenuTextInfo)==null?void 0:w.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!k,hidden:(T=n.hiddenColumnMenuItem)==null?void 0:T.descending,click:()=>c(g,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:m=>{const{useDefaultColumnSetting:g,columnSettingTextInfo:p}=a,y={text:(p==null?void 0:p.title)??"Column List",isShowMenu:!0,click:()=>{a.isShowColumnSetting=!0,n.isShowMenuOnClick=!0}};n.customGridSettingContextMenu.length&&(n.gridSettingContextMenuItems=[...n.customGridSettingContextMenu]),g&&n.gridSettingContextMenuItems.push(y),n.gridSettingMenu.show(m)}}},Y1=t=>{const{emit:e}=o.getCurrentInstance(),{stores:n,onResize:i}=t,s=()=>{let r=0;const c=[];function d(u){const f={};return Object.keys(u).forEach(m=>{m!=="children"&&(f[m]=u[m])}),f}function h(u){const{node:f,level:m,isShow:g,parent:p,uncheckable:y}=u;f!==null&&typeof f=="object"&&(f.index=r++,f.level=m,Object.hasOwnProperty.call(f,"checked")||(f.checked=!1),Object.hasOwnProperty.call(f,"selected")||(f.selected=!1),Object.hasOwnProperty.call(f,"show")||(f.show=g),Object.hasOwnProperty.call(f,"expand")||(f.expand=!0),Object.hasOwnProperty.call(f,"isFilter")||(f.isFilter=!1),Object.hasOwnProperty.call(f,"uncheckable")||(f.uncheckable=y),Object.hasOwnProperty.call(f,"indeterminate")||(f.indeterminate=!1),Object.hasOwnProperty.call(f,"data")||(f.data=d(f)),c.push(f),Object.hasOwnProperty.call(f,"parent")||(f.parent=p),f.children&&(f.hasChild=!0,f.children.forEach(C=>h({node:C,level:m+1,isShow:f.show&&f.expand,parent:f,uncheckable:f.uncheckable}))))}return n.treeRows.forEach(u=>{h({node:u,level:0,isShow:!0,parent:void 0,uncheckable:!1})}),c},l=(r,c,d)=>{r.forEach(h=>{const u=h;u.show=d&&c?u.isFilter:c,u.hasChild&&l(u.children,u.show&&u.expand,u.isFilter)})};return{setTreeNodeStore:s,handleExpand:r=>{const c=!r.expand,d=r;d.expand=!d.expand,l(d.children,d.expand,d.isFilter),e("toggle-row",{row:d,isExpand:c}),i()}}},O1=t=>{const{stores:e,filterInfo:n,pageInfo:i,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=t,d=m=>{if(!(m!=null&&m.parent))return;const{parent:g}=m;g.show=!0,g.isFilter=!0,d(g)},h=m=>{if(!(m!=null&&m.children))return;const{children:g}=m;g.forEach(p=>{const y=p;y.parent.show&&y.parent.expand?y.show=!0:y.show=!1,y.isFilter=!0,y.hasChild&&h(y)})};let u=null;return{onSearch:m=>{u&&clearTimeout(u),u=setTimeout(()=>{n.isSearch=!1,n.searchWord=m;const g=e.treeStore;g.forEach(p=>{p.show=!1,p.isFilter=!1}),m?(g.filter(y=>{let C=!1;for(let b=0;b<e.orderedColumns.length;b++){const w=e.orderedColumns[b]||{};let T=y[w.field]??null;if(w.type=w.type||"string",T!==null&&!w.hide&&((w==null?void 0:w.searchable)===void 0||w!=null&&w.searchable)&&(T=s(w,T).toString(),C=T.toLowerCase().includes(m.toString().toLowerCase()),C))break}return C}).forEach(y=>{y.show=!0,y.parent&&!y.parent.expand&&(y.show=!1),y.isFilter=!0,d(y),h(y)}),n.isSearch=!0):(g.forEach(p=>{p.show=!0,p.isFilter=!1}),g.forEach(p=>{d(p),h(p)})),!m&&i.isClientPaging&&i.prevPage&&(i.currentPage=1,e.pagingStore=r()),c({onSearch:!0}),a(e.store),l()},500)}}},H1=t=>{const{emit:e}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=t,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.showTreeStore.slice(u,f)},d=u=>{e("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.showTreeStore.length<=i.perPage)n.pagingStore=n.showTreeStore;else{const f=(i.currentPage-1)*i.perPage,m=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.showTreeStore.slice(f,m),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},F1=({sortInfo:t,stores:e})=>{const{emit:n}=o.getCurrentInstance(),i=(u=!0)=>u?["asc","desc","init"]:["asc","desc"];function s(){this.orders=i(),this.dequeue=()=>this.orders.shift(),this.enqueue=u=>this.orders.push(u)}const l=(u,f="init")=>{e.orderedColumns.forEach(m=>{m.index===(u==null?void 0:u.index)&&f?m.sortOption={sortType:f}:m.sortOption={sortType:"init"}})},a=()=>{const u=e.originColumns.filter(f=>f.hiddenDisplay||f.hide);u.length&&u.forEach(f=>{f.sortOption={sortType:"init"}})},r=new s;return{onSort:(u,f)=>{if(u.sortable===void 0?!0:u.sortable){t.sortColumn=u,t.sortField!==(u==null?void 0:u.field)&&(r.orders=i(),t.sortField=u==null?void 0:u.field),f&&(r.orders=i(),f==="desc"&&(t.sortOrder=r.dequeue(),r.enqueue(t.sortOrder))),t.sortOrder=r.dequeue(),r.enqueue(t.sortOrder),a(),l(u,t.sortOrder);const g=ps(e);n("sort-column",{field:t.sortField,order:t.sortOrder,column:t.sortColumn,columns:g}),n("change-column-info",{type:"sort",columns:g})}},setSortInfo:(u,f=!0)=>{const m=u==null?void 0:u.findIndex(y=>{var C;return(y==null?void 0:y.sortable)&&((C=y==null?void 0:y.sortOption)==null?void 0:C.sortType)&&y.sortOption.sortType!=="init"}),g=u[m];m>-1&&(g.index=m);const{sortType:p}=(g==null?void 0:g.sortOption)||{};t.sortColumn=g,t.sortField=g==null?void 0:g.field,t.isSorting=!!p,t.sortOrder=p,l(g,p),f&&n("change-column-info",{type:"sort",columns:ps(e)})},initSortInfo:u=>{t.isSorting=!1,t.sortOrder="init",u.forEach(f=>{var m;(m=f==null?void 0:f.sortOption)!=null&&m.sortType&&f.sortOption.sortType!=="init"&&(f.sortOption.sortType="init")})}}},z1={name:"EvTreeGrid",components:{TreeGridNode:R1,Toolbar:W1,GridPagination:Vr,GridSummary:Xr,ColumnSetting:Nr,GridSortButton:Pr,GridOptionButton:Fo},directives:{observeVisibility:Qs,resize:Gn},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array,Object],default:()=>null},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""}},emits:{"update:selected":null,"update:checked":null,"click-row":null,"dblclick-row":null,"check-row":null,"check-all":null,"page-change":null,"sort-column":null,"toggle-row":null,"resize-column":({column:t,columns:e})=>({column:t,columns:e}),"change-column-status":({columns:t})=>({columns:t}),"change-column-info":({type:t,columns:e})=>({type:t,columns:e})},setup(t){var gs,bs,ys,xs,Ss,Cs,ks,on,Ln;const e=o.ref(null),n=o.computed(()=>{var K,se;return((se=(K=t.option)==null?void 0:K.useGridSetting)==null?void 0:se.use)||!1}),i=o.computed(()=>{var K;return((K=t.option)==null?void 0:K.useSummary)||!1}),s=o.computed(()=>t.option.emptyText??"No records"),l=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=o.reactive({isSearch:!1,searchWord:""}),r=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var K,se;return((se=(K=t.option)==null?void 0:K.useGridSetting)==null?void 0:se.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((bs=(gs=t.option)==null?void 0:gs.useGridSetting)==null?void 0:bs.columnMenuText)??"Column List",search:((xs=(ys=t.option)==null?void 0:ys.useGridSetting)==null?void 0:xs.searchText)??"Search",empty:((Cs=(Ss=t.option)==null?void 0:Ss.useGridSetting)==null?void 0:Cs.emptyText)??"No records",ok:((on=(ks=t.option)==null?void 0:ks.useGridSetting)==null?void 0:on.okBtnText)??"OK"}}),c=o.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:o.computed(()=>c.treeStore.filter(K=>K.show)),searchStore:o.computed(()=>c.treeStore.filter(K=>K.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:t.rows,filteredColumns:[],originColumns:o.computed(()=>t.columns.map((K,se)=>{var fe;return{index:se,hiddenDisplay:!1,...K,width:isFinite(K.width)?K.width:void 0,sortOption:{sortType:((fe=K==null?void 0:K.sortOption)==null?void 0:fe.sortType)||"init"}}})),orderedColumns:o.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:o.computed(()=>ps(c))}),d=o.reactive({usePage:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.use)||!1}),useClient:((Ln=t.option.page)==null?void 0:Ln.useClient)||!1,isInfinite:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.total)||0}),perPage:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.perPage)||20}),visiblePage:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.visiblePage)||8}),order:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.order)||"center"}),showPageInfo:o.computed(()=>{var K;return((K=t.option.page)==null?void 0:K.showPageInfo)||!1}),isClientPaging:o.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:t.checked,useCheckbox:o.computed(()=>t.option.useCheckbox||{})}),{isRenderer:u,getComponentName:f,getConvertValue:m,getColumnIndex:g,setPixelUnit:p,checkHeader:y}=Z1({checkInfo:h}),C=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),b=o.reactive({selectedRow:t.selected,useSelect:o.computed(()=>{var K,se;return((se=(K=t.option)==null?void 0:K.useSelection)==null?void 0:se.use)??!0}),limitCount:o.computed(()=>{var se,fe;let K=(fe=(se=t.option)==null?void 0:se.useSelection)==null?void 0:fe.limitCount;return K=K&&K>=2?K:0,K}),multiple:o.computed(()=>{var K,se;return((se=(K=t.option)==null?void 0:K.useSelection)==null?void 0:se.multiple)??!1})}),w=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:t.option.customAscFunction??{}}),T=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:t.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:t.option.columnMenuText||{},hiddenColumnMenuItem:t.option.hiddenColumnMenuItem||{},customContextMenu:t.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var K,se;return((se=(K=t.option)==null?void 0:K.useGridSetting)==null?void 0:se.customContextMenu)||[]}),isShowMenuOnClick:!1}),k=o.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:t.option.adjust||!1,columnWidth:t.option.columnWidth||80,scrollWidth:t.option.scrollWidth||17,rowHeight:o.computed(()=>t.option.rowHeight||35),gridWidth:o.computed(()=>t.width?p(t.width):"100%"),gridHeight:o.computed(()=>t.height?p(t.height):"100%"),isResize:!1}),M=o.reactive({showHeader:o.computed(()=>t.option.showHeader===void 0?!0:t.option.showHeader),stripeStyle:o.computed(()=>{var K;return((K=t.option.style)==null?void 0:K.stripe)||!1}),borderStyle:o.computed(()=>{var K;return((K=t.option.style)==null?void 0:K.border)||""}),highlightIdx:o.computed(()=>{var K;return((K=t.option.style)==null?void 0:K.highlight)??-1})}),V=()=>{b.selectedRow.length=0,c.store.forEach(K=>{K.selected=!1})},x=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(K=>{K.checked=!1,K.indeterminate=!1})},{getPagingData:S,updatePagingInfo:L,changePage:I}=H1({stores:c,pageInfo:d,sortInfo:w,filterInfo:a,elementInfo:l,clearCheckInfo:x}),R=o.ref(0),{updateVScroll:v,updateHScroll:G,onScroll:W}=X1({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:k,pageInfo:d,summaryScroll:R,getPagingData:S,updatePagingInfo:L}),{onRowClick:E,onRowDblClick:X}=P1(b),{onCheck:Z,onCheckAll:N}=D1({checkInfo:h,stores:c,checkHeader:y,pageInfo:d,getPagingData:S}),{calculatedColumn:P,onResize:B,onShow:Y,onColumnResize:H}=N1({resizeInfo:k,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:v,updateHScroll:G,contextInfo:T}),{setTreeNodeStore:_,handleExpand:D}=Y1({stores:c,onResize:B}),{onSort:z,initSortInfo:A,setSortInfo:j}=F1({sortInfo:w,stores:c}),{onSearch:J}=O1({stores:c,filterInfo:a,pageInfo:d,getConvertValue:m,onResize:B,checkHeader:y,getPagingData:S,updatePagingInfo:L}),{setPositionColumnSetting:q,initColumnSettingInfo:U,onApplyColumn:ne,setColumnHidden:$}=Dr({stores:c,columnSettingInfo:r,contextInfo:T,onSearch:J,onResize:B}),{setContextMenu:ee,onContextMenu:Q,onColumnContextMenu:he,onGridSettingContextMenu:me}=B1({contextInfo:T,stores:c,selectInfo:b,useGridSetting:n,columnSettingInfo:r,setColumnHidden:$,onSort:z}),ae=K=>{T.gridSettingContextMenuItems.length=0,T.customGridSettingContextMenu.length?me(K):r.isShowColumnSetting=!0},xe=K=>{var se,fe,ke,Re,ze,Qe;K.type==="wheel"&&((se=T.menu)==null||se.hide(K)),K.type==="scroll"&&!((fe=K.target.classList)!=null&&fe.contains("table-body"))&&!((Re=(ke=K.target.offsetParent)==null?void 0:ke.classList)!=null&&Re.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,T.isShowMenuOnClick=!1,(ze=T.columnMenu)==null||ze.hide(K),(Qe=T.gridSettingMenu)==null||Qe.hide())};o.onMounted(()=>{var K;if(c.treeStore=_(),c.originStore=Ze(c.treeStore),(K=t.option)!=null&&K.useSort)j(t.columns,!1);else{const se=T.hiddenColumnMenuItem;se.ascending=!0,se.descending=!0}document.addEventListener("wheel",xe,{capture:!1}),document.addEventListener("scroll",xe,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",xe,{capture:!1}),document.removeEventListener("scroll",xe,{capture:!0})}),o.onActivated(()=>{B()}),o.watch(()=>{var K;return(K=t.option)==null?void 0:K.useSort},K=>{const se=t.option.hiddenColumnMenuItem,fe=T.hiddenColumnMenuItem;K?(fe.ascending=(se==null?void 0:se.ascending)??!1,fe.descending=(se==null?void 0:se.descending)??!1,j(t.columns,!1)):(fe.ascending=!0,fe.descending=!0,A(t.columns))}),o.watch(()=>r.isShowColumnSetting,K=>{var se;if(!K){(se=T.gridSettingMenu)==null||se.hide();return}q(e.value)}),o.watch(()=>t.columns,()=>{U()},{deep:!0,immediate:!0}),o.watch(()=>t.checked,K=>{h.checkedRows=K}),o.watch(()=>h.checkedRows,K=>{h.isHeaderChecked=!1;let se=c.store;d.isClientPaging&&(se=S()),se.length&&(se.forEach(fe=>{fe.checked=!!K.find(ke=>ke.index===fe.index)}),y(se)),v()}),o.watch(()=>t.selected,K=>{b.useSelect&&(b.selectedRow=K)}),o.watch(()=>b.selectedRow,K=>{b.useSelect&&(c.store.forEach(se=>{se.selected=!!K.find(fe=>fe.index===se.index)}),v())},{deep:!0}),o.watch(()=>M.highlightIdx,async K=>{await o.nextTick();const se=ke=>{if(!(ke!=null&&ke.children))return;const{children:Re}=ke;Re.forEach(ze=>{const Qe=ze;Qe.parent.show&&Qe.parent.expand?Qe.show=!0:Qe.show=!1,Qe.isFilter=!0,Qe.hasChild&&se(Qe)})},fe=ke=>{if(!(ke!=null&&ke.parent)){se(ke);return}const{parent:Re}=ke;Re.show=!0,Re.isFilter=!0,Re.expand=!0,se(Re),fe(Re)};if(K>=0){const ke=c.store.find(ze=>ze.index===K);if(!ke)return;ke.show=!0,ke.isFilter=!0,fe(ke);const Re=c.showTreeStore.map(ze=>ze.index).indexOf(ke.index);if(d.usePage&&!d.isInfinite){const ze=Math.ceil(Re/d.perPage);if(d.highlightPage=Re===d.perPage?ze+1:ze||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=k.rowHeight*Re}}),o.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),o.watch(()=>b.useSelect,()=>{V()}),o.watch(()=>b.multiple,()=>{V()}),o.watch(()=>t.rows,K=>{c.treeRows=K,c.treeStore=_(),B()},{deep:!0}),o.watch(()=>c.treeStore.length,()=>{y(c.store)}),o.watch(()=>[t.width,t.height,t.option.columnWidth],()=>{t.option.columnWidth!=null&&(k.columnWidth=t.option.columnWidth),c.orderedColumns.map(K=>{var fe;const se=K;return!((fe=t.columns[K.index])!=null&&fe.width)&&!se.resized&&(se.width=0),se}),B()}),o.watch(()=>t.option.searchValue,K=>{o.nextTick(()=>{K!==void 0&&(J((K==null?void 0:K.value)??K),d.isClientPaging&&(x(),V()))})},{immediate:!0}),o.watch(()=>{var K;return(K=t.option.page)==null?void 0:K.currentPage},K=>{var fe;const se=K||1;d.currentPage=(fe=t.option.page)!=null&&fe.isInfinite?1:se},{immediate:!0}),o.watch(()=>d.currentPage,(K,se)=>{o.nextTick(()=>{if(I(se),d.isClientPaging&&K!==se&&(x(),V()),v(),K===d.highlightPage&&d.isHighlight){const fe=c.pagingStore.map(ke=>ke.index).indexOf(M.highlightIdx);l.body.scrollTop=k.rowHeight*fe,d.isHighlight=!d.isHighlight}})});const be=()=>({"column-sort__icon":!0,"column-sort__icon--asc":w.sortOrder==="asc","column-sort__icon--desc":w.sortOrder==="desc"}),oe=o.computed(()=>({width:k.gridWidth,height:k.gridHeight})),re=o.computed(()=>({"table-body":!0,stripe:M.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!M.borderStyle})),pe=o.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:k.adjust,"non-header":!M.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),Ie=o.computed(()=>({"table-header":!0,"non-border":!!M.borderStyle})),Ve=o.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!M.borderStyle})),kt=o.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Vt=K=>({column:!0,render:u(K),"non-border":!!M.borderStyle,[K.field]:K.field}),$o=(K,se)=>{const fe=u(K);return{width:`${K.width}px`,"min-width":fe?`${k.rendererMinWidth}px;`:`${k.minWidth}px`,"margin-right":c.orderedColumns.length-1===se&&C.hasVerticalScrollBar&&C.hasHorizontalScrollBar?`${k.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===se?"none":"1px solid #CFCFCF"}},qo=K=>`${K}Node`;return{summaryScroll:R,gridStyle:oe,gridClass:pe,headerClass:Ie,headerCheckboxClass:Ve,isHeaderCheckbox:kt,bodyStyle:re,useSummary:i,useGridSetting:n,toolbarRef:e,stores:c,emptyText:s,...o.toRefs(M),...o.toRefs(l),...o.toRefs(c),...o.toRefs(a),...o.toRefs(C),...o.toRefs(k),...o.toRefs(b),...o.toRefs(h),...o.toRefs(w),...o.toRefs(T),...o.toRefs(d),...o.toRefs(r),isRenderer:u,getComponentName:f,getConvertValue:m,getColumnIndex:g,setPixelUnit:p,updateVScroll:v,updateHScroll:G,onScroll:W,calculatedColumn:P,onResize:B,onShow:Y,onColumnResize:H,onRowClick:E,onRowDblClick:X,onCheck:Z,onCheckAll:N,setContextMenu:ee,onContextMenu:Q,onSearch:J,handleExpand:D,getColumnClass:Vt,getColumnStyle:$o,getSlotName:qo,setGridSetting:ae,onApplyColumn:ne,onColumnContextMenu:he,onSort:z,sortIconClass:be}}},A1={class:"column-list"},K1=["data-index"],_1=["title","onClick"],U1=["onClick"],J1=["onMousedown"],j1={ref:"table"},Q1=["title"],$1={key:0},q1={class:"is-empty"},ek={ref:"resizeLine",class:"table-resize-line"};function tk(t,e,n,i,s,l){var C;const a=o.resolveComponent("grid-option-button"),r=o.resolveComponent("toolbar"),c=o.resolveComponent("ev-checkbox"),d=o.resolveComponent("grid-sort-button"),h=o.resolveComponent("tree-grid-node"),u=o.resolveComponent("ev-context-menu"),f=o.resolveComponent("grid-summary"),m=o.resolveComponent("grid-pagination"),g=o.resolveComponent("column-setting"),p=o.resolveDirective("resize"),y=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[t.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${t.gridWidth};`)},[o.createVNode(r,null,{toolbarWrapper:o.withCtx(()=>[i.useGridSetting?(o.openBlock(),o.createBlock(a,{key:0,class:"grid-setting__icon",onClick:i.setGridSetting},null,8,["onClick"])):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"grid-wrapper",style:o.normalizeStyle(i.gridStyle)},[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass(i.gridClass)},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass(i.headerClass)},[o.createElementVNode("ul",A1,[t.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(i.headerCheckboxClass),style:o.normalizeStyle({width:`${t.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[i.isHeaderCheckbox?(o.openBlock(),o.createBlock(c,{key:0,modelValue:t.isHeaderChecked,"onUpdate:modelValue":e[0]||(e[0]=b=>t.isHeaderChecked=b),disabled:t.isHeaderUncheckable,indeterminate:t.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(b,w)=>{var T,k;return o.openBlock(),o.createElementBlock(o.Fragment,{key:w},[!b.hide&&!b.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":w,class:o.normalizeClass(i.getColumnClass(b)),style:o.normalizeStyle(i.getColumnStyle(b,w))},[b.customHeader&&t.$slots.customHeader?o.renderSlot(t.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:b.caption,class:o.normalizeClass(["column-name",{"column-name--click":i.useGridSetting}]),onClick:[M=>i.onColumnContextMenu(M,b),e[1]||(e[1]=o.withModifiers((...M)=>t.columnMenu.show&&t.columnMenu.show(...M),["prevent"]))]},[o.createTextVNode(o.toDisplayString(b.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(M=>i.onSort(b),["stop"])},[t.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(T=t.$props.option)!=null&&T.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),t.sortField===b.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(i.sortIconClass(b)),style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,`sortIcon_${t.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(k=t.$props.option)!=null&&k.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),t.sortField===b.field?(o.openBlock(),o.createBlock(d,{key:1,class:o.normalizeClass(i.sortIconClass(b)),icon:t.sortOrder,style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,visibility:t.sortOrder?b.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,U1)],10,_1)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(w,M),["stop","left"])},null,40,J1)],14,K1)):o.createCommentVNode("",!0)],64)}),128)),(C=t.$props.option.customContextMenu)!=null&&C.length?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!t.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":t.hasVerticalScrollBar||t.hasHorizontalScrollBar?`${t.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,t.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass(i.bodyStyle),onScroll:e[2]||(e[2]=(...b)=>i.onScroll&&i.onScroll(...b)),onContextmenu:[e[3]||(e[3]=b=>i.onContextMenu(b)),e[4]||(e[4]=o.withModifiers((...b)=>t.menu.show&&t.menu.show(...b),["prevent"]))]},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",j1,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.viewStore,(b,w)=>(o.openBlock(),o.createBlock(h,{key:w,"selected-data":t.selectedRow,"node-data":b,"use-checkbox":t.useCheckbox,"ordered-columns":t.orderedColumns,"expand-icon":n.option.expandIcon,"collapse-icon":n.option.collapseIcon,"parent-icon":n.option.parentIcon,"child-icon":n.option.childIcon,"custom-context-menu":t.customContextMenu,"menu-ref":t.menu,"is-resize":t.isResize,"row-height":t.rowHeight,"min-width":t.minWidth,"highlight-index":t.highlightIdx,"border-style":t.borderStyle,onCheckTreeData:i.onCheck,onExpandTreeData:i.handleExpand,onClickTreeData:i.onRowClick,onDblClickTreeData:i.onRowDblClick,onContextMenu:i.onContextMenu},o.createSlots({_:2},[o.renderList(t.orderedColumns,(T,k)=>({name:i.getSlotName(T.field),fn:o.withCtx(({item:M})=>[t.$slots[T.field]?o.renderSlot(t.$slots,T.field,{key:0,item:{data:M.data,fieldName:T.field}},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:i.getConvertValue(T,b[T.field])},o.toDisplayString(i.getConvertValue(T,b[T.field])),9,Q1))])})),t.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:o.withCtx(()=>[o.renderSlot(t.$slots,"contextmenuIcon",{},void 0,!0)]),key:"0"}:void 0]),1032,["selected-data","node-data","use-checkbox","ordered-columns","expand-icon","collapse-icon","parent-icon","child-icon","custom-context-menu","menu-ref","is-resize","row-height","min-width","highlight-index","border-style","onCheckTreeData","onExpandTreeData","onClickTreeData","onDblClickTreeData","onContextMenu"]))),128)),t.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",$1,[o.createElementVNode("td",q1,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(u,{ref:"menu","custom-class":t.contextMenuClass,items:t.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(u,{ref:"columnMenu",items:t.columnMenuItems},null,8,["items"]),o.createVNode(u,{ref:"gridSettingMenu",items:t.gridSettingContextMenuItems,"is-show-menu-on-click":t.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",ek,null,512),[[o.vShow,t.showResizeLine]])],2)],4)),[[p,i.onResize],[y,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(f,{key:1,"is-tree":!0,"ordered-columns":t.orderedColumns,stores:i.stores,"use-checkbox":t.useCheckbox.use,"style-option":{borderStyle:t.borderStyle,minWidth:t.minWidth,rowHeight:t.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),t.usePage&&!t.isInfinite?(o.openBlock(),o.createBlock(m,{key:2,modelValue:t.currentPage,"onUpdate:modelValue":e[5]||(e[5]=b=>t.currentPage=b),total:t.showTreeStore.length,"per-page":t.perPage,"visible-page":t.visiblePage,"show-page-info":t.showPageInfo,order:t.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(g,{"is-show":t.isShowColumnSetting,"onUpdate:isShow":e[6]||(e[6]=b=>t.isShowColumnSetting=b),"is-show-menu-on-click":t.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":e[7]||(e[7]=b=>t.isShowMenuOnClick=b),columns:t.updatedColumns,"hidden-column":t.hiddenColumn,position:t.columnSettingPosition,"text-info":t.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const Si=ce(z1,[["render",tk],["__scopeId","data-v-9ed705b7"]]);Si.install=t=>{t.component(Si.name,Si)};const nk={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},ik=["aria-current"];function sk(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("span",o.mergeProps({class:{"is-current":n.page.isCurrent,"is-disabled":n.disabled||n.page.disabled,[n.page.class]:!0}},t.$attrs,{"aria-current":n.page.isCurrent,onClick:e[0]||(e[0]=o.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[o.renderSlot(t.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(n.page.number),1)])],16,ik)}const ok={name:"EvPagination",components:{EvIcon:Cn,pageButton:ce(nk,[["render",sk]])},props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:t=>["left","right","center"].includes(t)},pagePerJump:{type:[Number,void 0],default:void 0}},emits:{"update:modelValue":null,change:null},setup(t,{emit:e}){const n=o.computed(()=>t.visiblePage>7?t.visiblePage:7),i=o.computed(()=>t.modelValue),s=o.computed(()=>t.total===0?1:Math.ceil(t.total/t.perPage)),l=o.computed(()=>i.value>1),a=o.computed(()=>i.value<s.value),r=o.computed(()=>Math.max(i.value-t.pagePerJump,1)),c=o.computed(()=>Math.min(i.value+t.pagePerJump,s.value)),d=o.computed(()=>{const p=i.value*t.perPage-t.perPage+1;return p>=0?p:0}),h=(p,y)=>{i.value===p||p<1||p>s.value||(e("update:modelValue",p),e("change",p),y&&y.target&&o.nextTick(()=>y.target.focus()))},u=(p,y={})=>({number:p,isCurrent:y.isCurrent??i.value===p,click:C=>h(p,C),input:(C,b)=>h(+b,C),disabled:y.disabled||!1,class:y.class||""}),f=(p,y)=>{const C=[],b=p>0?p:1;for(let w=b;w<=y;w++)C.push(u(w));return C},m=o.computed(()=>{const p=parseInt(n.value,10);if(p===0)return[];const y=Math.min(Math.max(0,p)||s.value,s.value);if(s.value<=y)return f(1,s.value);const C=y%2===0?1:0,b=Math.floor(y/2),w=s.value-b+1+C;if(i.value>b&&i.value<w){const k=s.value,M=i.value-b+2,V=i.value+b-2-C,x=M-1===2?2:-1,S=V+1===k-1?V+1:-1;return[u(1),u(x),...f(M,V),u(S),u(s.value)]}else if(i.value===b){const T=i.value+b-1-C;return[...f(1,T),u(-1),u(s.value)]}else if(i.value===w){const T=i.value-b+1;return[u(1),u(-1),...f(T,s.value)]}return[...f(1,b),u(-1),...f(w,s.value)]}),g=o.computed(()=>({"justify-content":t.order,flex:"3 1 0%"}));return o.watch(()=>s.value,p=>{i.value>p&&h(p)}),o.watch(()=>i.value,(p,y)=>{s.value<p&&h(y)}),{pageCount:s,pagesInRange:m,hasPrev:l,hasNext:a,listClasses:g,firstData:d,current:i,changePage:h,getPage:u,prevJumpPage:r,nextJumpPage:c}}},lk={class:"pagination"},ak={key:0,class:"pagination-info"},rk={key:0,class:"pagination-ellipsis"},ck=["onClick"];function dk(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",lk,[n.showPageInfo?(o.openBlock(),o.createElementBlock("small",ak,[n.perPage===1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.firstData)+" / "+o.toDisplayString(n.total),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(i.firstData)+" - "+o.toDisplayString(Math.min(i.current*n.perPage,n.total))+" / "+o.toDisplayString(n.total),1)],64))])):o.createCommentVNode("",!0),o.createElementVNode("ul",{class:"pagination-list",style:o.normalizeStyle(i.listClasses)},[t.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.prevJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.current-1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.pagesInRange,(c,d)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:d},[c.number===-1?(o.openBlock(),o.createElementBlock("li",rk,[...e[0]||(e[0]=[o.createElementVNode("span",null,"…",-1)])])):(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[o.createVNode(r,{page:c},null,8,["page"])],10,ck))],64))),128)),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-next",disabled:!i.hasNext,page:i.getPage(i.current+1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),t.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasNext,page:i.getPage(i.nextJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0)],4)])}const Ci=ce(ok,[["render",dk]]);Ci.install=t=>{t.component(Ci.name,Ci)};const hk="3.13.0",uk=[Wn,Zn,fn,Xn,mn,pn,Nn,Pn,Bn,Yn,On,Fn,Qn,Cn,ei,ti,ni,ii,si,oi,li,ai,ri,ci,hi,bi,yi,xi,ls,rs,cs,Si,Ci],fk={version:hk,install:t=>{t&&uk.forEach(e=>{t.use(e)})}};le.EvButton=fn,le.EvButtonGroup=Xn,le.EvCalendar=ei,le.EvChart=bi,le.EvChartBrush=xi,le.EvChartGroup=yi,le.EvCheckbox=mn,le.EvCheckboxGroup=pn,le.EvContextMenu=ii,le.EvDatePicker=ti,le.EvGrid=hi,le.EvIcon=Cn,le.EvInputNumber=Fn,le.EvLoading=oi,le.EvMenu=ai,le.EvMessage=ls,le.EvMessageBox=cs,le.EvNotification=rs,le.EvPagination=Ci,le.EvProgress=li,le.EvRadio=Nn,le.EvRadioGroup=Pn,le.EvScheduler=ni,le.EvSelect=Bn,le.EvSlider=Qn,le.EvTabPanel=Zn,le.EvTabs=Wn,le.EvTextField=On,le.EvTimePicker=ci,le.EvToggle=Yn,le.EvTree=ri,le.EvTreeGrid=Si,le.EvWindow=si,le.default=fk,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
17
|
+
15.998 11.998C15.998 11.1696 16.6696 10.498 17.498 10.498Z`,fill:"#ADB5BD"},null,-1)])])}const Fo=ce(q0,[["render",tS]]),Rt=0,In=1,ue=2,ui=3,zo=4,nS=()=>{const{props:t}=o.getCurrentInstance();return{isRenderer:(a={})=>{var r;return!!((r=a==null?void 0:a.render)!=null&&r.use)},getComponentName:(a="")=>{const r=h=>h.charAt(0).toUpperCase()+h.slice(1),c="Renderer";let d="";if(a.indexOf("_")!==-1){const h=a.split("_");for(let u=0;u<h.length;u++)d+=r(h[u])}else d=r(a);return d+c},getConvertValue:(a,r)=>{let c=a.type==="number"||a.type==="float"?Number(r):r;return a.type==="number"?(c=Qt(r),c=c===!1?r:c):a.type==="float"&&(c=c.toFixed(a.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),c},getColumnIndex:a=>t.columns.findIndex(r=>r.field===a),setPixelUnit:a=>{let r=a;const c=r.toString().indexOf("px")>=0,d=r.toString().indexOf("%")>=0;return!c&&!d&&(r=`${r}px`),r}}},ms=t=>{var i;const e=((i=t.movedColumns)!=null&&i.length?t.movedColumns:t.originColumns)??[],n=new Map((t.filteredColumns??[]).map(s=>[s.index,s]));return e.map(s=>{const l=n.get(s.index)??{};return{...s,...l}})},iS=t=>{const{scrollInfo:e,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=t,h=g=>{var b,k;const p=i.body,y=s.rowHeight,C=d.detailRowHeight??0;if(p){let T=n.store;l.isClientPaging&&(T=r());const w=((b=d.expandedRows)==null?void 0:b.length)??0,M=((k=d.expandedRows)==null?void 0:k.map(R=>T.findIndex(X=>X[ue]===R)))??[],V=T.length*y+w*C;let x=0,S=0;if(w)for(x=0;S+y<p.scrollTop;x++)M.includes(x)&&(S+=C),S+=y;else x=Math.floor(p.scrollTop/y),S=Math.max(x,0)*y;x>T.length-1&&(x=0);let L=0,I=0;if(w)for(let R=x;I<=p.clientHeight;R++)M.includes(R)&&(I+=C),I+=y,L+=1;else L=p.clientHeight>y?Math.ceil(p.clientHeight/y):T.length,I=L*y;const v=x+L+1,W=Math.max(x,0),E=v,G=i.table;n.viewStore=T.slice(W,E),e.hasVerticalScrollBar=L<T.length||p.clientHeight<G.clientHeight,e.vScrollTopHeight=S,e.vScrollBottomHeight=V-I-e.vScrollTopHeight,g&&l.isInfinite&&e.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(E/l.perPage)+1,l.startIndex=E,c({onScrollEnd:!0}))}},u=g=>{if(d.useRowDetail&&!d.detailRowHeight){let p=n.store;l.isClientPaging&&(p=r()),n.viewStore=[...p],e.vScrollTopHeight=0,e.vScrollBottomHeight=0}else h(g)},f=()=>{const g=i.header,p=i.body,y=i.table;g.scrollLeft=p.scrollLeft,a.value=p.scrollLeft,e.hasHorizontalScrollBar=p.clientWidth<y.clientWidth};return{updateVScroll:u,updateHScroll:f,onScroll:()=>{const g=i.body,p=g.scrollTop,y=g.scrollLeft,C=e.lastScroll.top,b=e.lastScroll.left,k=y!==b;p!==C&&(g!=null&&g.clientHeight)&&u(!0),k&&f(),e.lastScroll.top=p,e.lastScroll.left=y}}},sS=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:u}=t,f=()=>{var b;let y=i.columnWidth,C=0;if(i.adjust){const k=s.body;let T=k.offsetWidth;const w=k.offsetHeight,M=((b=k.querySelector("tr"))==null?void 0:b.offsetHeight)||i.rowHeight,V=T-k.clientWidth,x=r.orderedColumns.reduce((S,L)=>(L.hide||L.hiddenDisplay||(L.width?S.totalWidth+=L.width:S.emptyCount++),S),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*e.rows.length>w&&(T-=V),l.useCheckbox.use&&(T-=i.minWidth),a.useRowDetail&&(T-=i.minWidth),y=T-x.totalWidth,y>0){const S=x.emptyCount===0?0:Math.floor(y/x.emptyCount);C=y-S*x.emptyCount,y=x.emptyCount!==0?S:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(r.orderedColumns.forEach(k=>{const T=c(k)?i.rendererMinWidth:i.minWidth;k.width&&k.width<T&&(k.width=T),!k.width&&!k.hide&&(k.width=y)}),C&&r.orderedColumns.length){let k=r.orderedColumns.length-1,T=r.orderedColumns[k];for(;k>0&&T&&(T.hide||T.hiddenDisplay);)k-=1,T=r.orderedColumns[k];T&&(T.width+=C)}},m=()=>{const y=new Map(e.columns.map(C=>[C.field,C.width]));o.nextTick(()=>{var C,b;i.adjust&&r.orderedColumns.forEach(k=>{const T=k;return T.resized||(T.width=y.get(T.field)??0),T},void 0),f(),(C=s.body)!=null&&C.clientHeight&&d(),(b=s.body)!=null&&b.clientWidth&&h()})};return{calculatedColumn:f,onResize:m,onShow:y=>{y&&m()},onColumnResize:(y,C)=>{C.preventDefault();const b=s.header,k=s.body,T=b.getBoundingClientRect().left,w=b.querySelector(`li[data-index="${y}"]`),M=c(r.orderedColumns[y])?i.rendererMinWidth:i.minWidth,V=w.getBoundingClientRect(),x=s.resizeLine,S=V.left-T+M,L=V.right-T,I=C.clientX,v=V.left-T;k.style.overflow="auto",x.style.left=`${L}px`,i.showResizeLine=!0;const W=G=>{const R=G.clientX-I,X=L+R,Z=Math.max(S,X);x.style.left=`${Z}px`},E=()=>{const R=parseInt(x.style.left,10)-v;r.orderedColumns[y]&&(r.orderedColumns[y].width=R,r.orderedColumns[y].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",W),m();const X=ms(r);n("resize-column",{column:r.orderedColumns[y],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",W),document.addEventListener("mouseup",E,{once:!0})}}},oS=t=>{const{emit:e}=o.getCurrentInstance(),{selectInfo:n,stores:i}=t,s=(d,h)=>{var m;const u=(m=d.target.tagName)==null?void 0:m.toLowerCase();let f={};return u==="td"?f=d.target.dataset:f=d.target.parentNode.dataset,{event:d,rowData:h[ue],rowIndex:h[Rt],cellName:f.name,cellIndex:f.index}};let l=null,a=-1;return{onRowClick:(d,h,u)=>{var g,p,y;if((g=d.target.parentElement.classList)!=null&&g.contains("row-checkbox-input"))return!1;const f=!!((y=(p=d.target.closest("td"))==null?void 0:p.classList)!=null&&y.contains("row-contextmenu")),m=(C,b,k)=>{if(C==="shift"){const T=h[Rt];if(a>-1)for(let w=Math.min(T,a);w<=Math.max(T,a);w++)if(!b)i.originStore[w][ui]=!0,a!==w&&n.selectedRow.push(i.originStore[w][ue]);else{i.originStore[w][ui]=!1;const M=n.selectedRow.indexOf(i.originStore[w][ue]);M>-1&&n.selectedRow.splice(M,1)}}else C==="ctrl"&&(b?n.selectedRow.splice(n.selectedRow.indexOf(h[ue]),1):n.selectedRow.push(k))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const C=h[ue],b=h[ui];h[ui]=!h[ui];let k="";d.shiftKey?k="shift":d.ctrlKey&&(k="ctrl"),n.multiple&&k?m(k,b,C):u||f?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(C)||(n.selectedRow=[C])):b?n.selectedRow=[]:n.selectedRow=[C],a=h[Rt],e("update:selected",n.selectedRow),e("click-row",s(d,h))}},100),!0},onRowDblClick:(d,h)=>{l&&clearTimeout(l),e("dblclick-row",s(d,h))}}},lS=t=>{const{checkInfo:e,stores:n,pageInfo:i,getPagingData:s}=t,{props:l,emit:a}=o.getCurrentInstance(),r=h=>{const u=n.originStore.findIndex(f=>f[ue]===h[ue]);u!==-1&&(n.originStore[u][In]=h[In])};return{onCheck:(h,u)=>{if(e.useCheckbox.mode==="single"&&e.prevCheckedRow.length&&(e.prevCheckedRow=[],r(e.prevCheckedRow)),u[In]){e.useCheckbox.mode==="single"?e.checkedRows=[u[ue]]:e.checkedRows.push(u[ue]);let f=n.store;i.isClientPaging&&(f=s());const m=f.filter(g=>!l.uncheckable.includes(g[ue])).filter(g=>!l.disabledRows.includes(g[ue])).every(g=>g[In]);f.length&&m&&(e.isHeaderChecked=!0),e.isHeaderIndeterminate=f.length&&!m}else e.useCheckbox.mode==="single"?e.checkedRows=[]:e.checkedRows.splice(e.checkedRows.indexOf(u[ue]),1),e.isHeaderChecked=!1,e.isHeaderIndeterminate=!!(n.store.length&&e.checkedRows.length);e.prevCheckedRow=u.slice(),a("update:checked",e.checkedRows),a("check-row",h,u[Rt],u[ue])},onCheckAll:h=>{const u=e.isHeaderChecked;let f=n.store;i.isClientPaging&&(f=s()),f.forEach(m=>{const g=l.uncheckable.includes(m[ue])||l.disabledRows.includes(m[ue]);u?!e.checkedRows.includes(m[ue])&&!g&&e.checkedRows.push(m[ue]):e.checkedRows.splice(e.checkedRows.indexOf(m[ue]),1),g||(m[In]=u)}),e.isHeaderIndeterminate=!1,a("update:checked",e.checkedRows),a("check-all",h,e.checkedRows)}}},aS=t=>{const{expandedInfo:e}=t,{emit:n}=o.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[ue],r=e.expandedRows.indexOf(a);r===-1?e.expandedRows.push(a):e.expandedRows.splice(r,1),l[zo]=!l[zo],n("update:expanded",e.expandedRows),n("expand-row",s,l[ue],l[zo],l[Rt])}}},rS=t=>{const{sortInfo:e,stores:n,updatePagingInfo:i}=t,{emit:s}=o.getCurrentInstance(),l=(p=!0)=>p?["asc","desc","init"]:["asc","desc"];function a(){this.orders=l(),this.dequeue=()=>this.orders.shift(),this.enqueue=p=>this.orders.push(p)}const r=(p,y="init")=>{n.orderedColumns.forEach(C=>{C.index===(p==null?void 0:p.index)&&y?C.sortOption={sortType:y}:C.sortOption={sortType:"init"}})},c=()=>{const p=n.originColumns.filter(y=>y.hiddenDisplay||y.hide);p.length&&p.forEach(y=>{y.sortOption={sortType:"init"}})},d=new a,h=(p,y=!0)=>{const{sortType:C}=(p==null?void 0:p.sortOption)||{};e.sortColumn=p,e.sortField=p==null?void 0:p.field,e.sortOrder=C,e.isSorting=!!C,y&&(r(p,C),s("change-column-info",{type:"sort",columns:ms(n)}))},u=(p,y)=>{if(p.sortable===void 0?!0:p.sortable){e.sortColumn=p,e.sortField!==(p==null?void 0:p.field)&&(d.orders=l(),e.sortField=p==null?void 0:p.field),y&&(d.orders=l(),y==="desc"&&(e.sortOrder=d.dequeue(),d.enqueue(e.sortOrder))),e.sortOrder=d.dequeue(),d.enqueue(e.sortOrder),e.isSorting=!0,i({onSort:!0}),c(),r(p,e.sortOrder);const b=ms(n);s("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:b}),s("change-column-info",{type:"sort",columns:b})}},f=()=>{var L;const{field:p,index:y}=e.sortColumn||{},C=((L=e.sortFunction)==null?void 0:L[p])??null,b=(I,v)=>I>v?-1:1,k=(I,v)=>I<v?-1:1,T=(I,v)=>(I===null)-(v===null)||Number(v)-Number(I),w=(I,v)=>(I===null)-(v===null)||Number(I)-Number(v);if(e.sortOrder==="init"||!e.sortField&&!e.isSorting){n.store.sort((I,v)=>typeof I[Rt]=="number"?k(I[Rt],v[Rt]):0);return}const M=e.sortColumn.type||"string",V=e.sortOrder==="desc"?b:k,x=e.sortOrder==="desc"?T:w,S=(I,v)=>{var G,R;let W=I[ue][y],E=v[ue][y];return I[ue][y]&&typeof I[ue][y]=="object"&&(W=I[ue][y][(G=n.originColumns[y])==null?void 0:G.field],E=v[ue][y][(R=n.originColumns[y])==null?void 0:R.field]),{aCol:W,bCol:E}};if(C){n.store.sort((I,v)=>{const W=I[ue][y],E=v[ue][y],G=C(W,E);return e.sortOrder==="desc"?-G:G});return}switch(M){case"string":n.store.sort((I,v)=>{let{aCol:W,bCol:E}=S(I,v);if((!W||typeof W=="string")&&(!E||typeof E=="string")){W=W||"",E=E||"";const G=W.toLowerCase(),R=E.toLowerCase();if(W!==E&&G===R){const X=Array.from(W).findIndex((Z,N)=>Z!==E[N]);return V(W[X],E[X])}return V(G,R)}return 0});break;case"stringNumber":n.store.sort((I,v)=>{let{aCol:W,bCol:E}=S(I,v);return!W||typeof W=="string"||typeof W=="number"?(W=W===""?null:W,E=E===""?null:E,x(W??null,E??null)):0});break;default:n.store.sort((I,v)=>{const{aCol:W,bCol:E}=S(I,v);return!W||typeof W=="number"||typeof W=="boolean"?x(W??null,E??null):0});break}},m=()=>{var p;return(p=n.orderedColumns)==null?void 0:p.find(y=>(y==null?void 0:y.sortOption)&&l(!1).includes(y.sortOption.sortType))};return{onSort:u,getSortTarget:m,setSort:f,setSortInfo:h,hasSortTarget:()=>!!m()}},cS=t=>{const{props:e}=o.getCurrentInstance(),{columnSettingInfo:n,filterInfo:i,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:u}=t,f=w=>{let M=0;w.forEach(V=>{const x=l.checkedRows.includes(V[ue]);V[In]=x,M+=x?1:0}),w.length&&(l.isHeaderChecked=w.length===M,l.isHeaderIndeterminate=w.length!==M&&M>0,l.isHeaderUncheckable=w.every(V=>e.uncheckable.includes(V[ue])||e.disabledRows.includes(V[ue])))},m=(w,M,V)=>{if(typeof w!="string"||M===null)return!1;const x=M==null?void 0:M.toLowerCase(),S=w==null?void 0:w.toLowerCase();let L=x.includes(S);return V&&(V==="start"?L=x.startsWith(S):V==="end"&&(L=x.endsWith(S))),L},g=(w,M)=>{const V=M.comparison,x=M.value;let S=w[ue][M.index];(S||S===0)&&(S=`${w[ue][M.index]}`);let L;return V==="="?L=(x==null?void 0:x.toLowerCase())===(S==null?void 0:S.toLowerCase()):V==="!="?L=(x==null?void 0:x.toLowerCase())!==(S==null?void 0:S.toLowerCase()):V==="%s%"?L=m(x,S):V==="notLike"?L=!m(x,S):V==="s%"?L=m(x,S,"start"):V==="%s"?L=m(x,S,"end"):V==="isEmpty"?L=S==null||S==="":V==="isNotEmpty"&&(L=!!S),L},p=(w,M,V)=>{const x=M.comparison,S=Number(M.value.replace(/,/g,""));let L=Number(w[ue][M.index]),I;return V==="float"&&(L=Number(L.toFixed(3))),x==="="?I=L===S:x===">"?I=L>S:x==="<"?I=L<S:x==="<="?I=L<=S:x===">="?I=L>=S:x==="!="?I=L!==S:x==="isEmpty"?I=L==null||isNaN(L):x==="isNotEmpty"&&(I=!!L||L===0),I},y=(w,M)=>{const V=M.comparison,x=M.value,S=`${w[ue][M.index]}`;let L;return V==="="&&(L=S===x),L},C=(w,M,V)=>{let x=M==="string"||M==="stringNumber"?g:p;return M==="boolean"&&(x=y),w.filter(S=>x(S,V,M))||[]},b=()=>{const w=i.filteringItemsByColumn,M=Object.keys(w),V=s.originStore;let x=[],S=!1,L=[];M.forEach((I,v)=>{const W=w[I],E=u(I),G=e.columns[E].type,R=i.columnOperator==="or",X=v>0&&i.columnOperator==="and";W.forEach((Z,N)=>{!x.length&&!S?x=C(V,G,{...Z,index:E}):X&&Z.operator==="or"?N>0?x.push(...C(L,G,{...Z,index:E})):x=C(L,G,{...Z,index:E}):N===0&&R||N!==0&&Z.operator==="or"?x.push(...C(V,G,{...Z,index:E})):x=C(x,G,{...Z,index:E}),S=!0}),L=JSON.parse(JSON.stringify(x))}),S?s.filterStore=Sb(x,JSON.stringify):s.filterStore=V};let k=null;return{onSearch:w=>{k&&clearTimeout(k),k=setTimeout(()=>{i.isSearch=!1,i.searchWord=w,w&&(s.searchStore=s.store.filter(M=>{let V=!1;const x=n.isFilteringColumn?M[ue].filter((S,L)=>n.visibleColumnIdx.includes(L)):M[ue];for(let S=0;S<s.orderedColumns.length;S++){const L=s.orderedColumns[S]||{};let I=x[L.index]??null;if(L.type=L.type||"string",I!==null&&(I instanceof Array?I=JSON.stringify(I):typeof I=="object"&&(I=I[L.field]),!L.hide&&((L==null?void 0:L.searchable)===void 0||L!=null&&L.searchable)&&(I=r(L,I).toString(),V=I.toLowerCase().includes(w.toString().toLowerCase()),V)))break}return V}),i.isSearch=!0),f(s.store),!w&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:b,setHeaderCheckboxByFilter:f}},dS=t=>{const{contextInfo:e,stores:n,selectInfo:i,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=t;let d=null;const{emit:h}=o.getCurrentInstance(),u=p=>{d&&clearTimeout(d);const y=[];d=setTimeout(()=>{if(e.customContextMenu.length){const C=e.customContextMenu.map(b=>{const k=b;return k.validate&&(k.disabled=!k.validate(k.itemId,i.selectedRow)),k.selectedRow=i.selectedRow??[],k.contextmenuInfo=i.contextmenuInfo??[],k});y.push(...C)}e.contextMenuItems=y,e.menu.show(p)},200)};return{setContextMenu:u,onContextMenu:p=>{var k,T,w;p.preventDefault();const C=(T=(k=p.target.closest(".row"))==null?void 0:k.dataset)==null?void 0:T.index;let b=null;C&&(b=(w=n.viewStore.find(M=>M[Rt]===+C))==null?void 0:w[ue]),b&&(i.contextmenuInfo=[b],u(p))},onColumnContextMenu:(p,y)=>{var C,b,k,T,w,M,V,x;if(p.target.className==="column-name"){const S=y.sortable===void 0?!0:y.sortable,L=l.isFiltering&&y.filterable===void 0?!0:y.filterable,I=[{text:((C=e.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!S,hidden:(b=e.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>s(y,"asc")},{text:((k=e.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!S,hidden:(T=e.hiddenColumnMenuItem)==null?void 0:T.descending,click:()=>s(y,"desc")},{text:((w=e.columnMenuTextInfo)==null?void 0:w.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const v=document.documentElement.clientWidth,W=e.columnMenu.menuStyle.clientX,E=e.columnMenu.menuStyle.pageX,G=350;v<W+G&&(e.columnMenu.menuStyle.left=`${E-G}px`),l.filterSettingPosition={top:e.columnMenu.menuStyle.top,left:e.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=y,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!L,hidden:((M=e.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((V=e.columnMenuTextInfo)==null?void 0:V.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||y.fixed,hidden:((x=e.hiddenColumnMenuItem)==null?void 0:x.hide)||!a.value,click:()=>{c(y.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(e.columnMenuItems=[],!S&&!L&&!a.value)return;e.columnMenuItems=I.filter(v=>!v.hidden)}},onGridSettingContextMenu:p=>{const{useDefaultColumnSetting:y,columnSettingTextInfo:C}=r,b={text:(C==null?void 0:C.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,e.isShowMenuOnClick=!0}};e.customGridSettingContextMenu.length&&(e.gridSettingContextMenuItems=[...e.customGridSettingContextMenu]),y&&e.gridSettingContextMenuItems.push(b),e.gridSettingMenu.show(p)}}},hS=t=>{const{props:e}=o.getCurrentInstance(),{selectInfo:n,checkInfo:i,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:u,setFilter:f}=t;return{setStore:({rows:g,isMakeIndex:p=!0,isInit:y=!1})=>{var b,k,T;const C=s.orderedColumns.find(w=>(w==null?void 0:w.sortOption)&&["asc","desc"].includes(w.sortOption.sortType));if(p){const w=[];let M=!1;g.forEach((V,x)=>{const S=e.checked.includes(V),L=e.uncheckable.includes(V)||e.disabledRows.includes(V);let I=!1;n.useSelect&&(I=e.selected.includes(V)),!S&&!L&&(M=!0);let v=!1;c.useRowDetail&&(v=e.expanded.includes(V));const W=e.disabledRows.includes(V);w.push([x,S,V,I,v,L,W])}),g.length!==e.checked.length&&(g.length===((b=e.uncheckable)==null?void 0:b.length)||g.length===((k=e.disabledRows)==null?void 0:k.length))&&(M=!0),i.isHeaderChecked=g.length>0?!M:!1,i.isHeaderIndeterminate=M&&!!i.checkedRows.length,i.isHeaderUncheckable=g.every(V=>e.uncheckable.includes(V)||e.disabledRows.includes(V)),s.originStore=w}r.isFiltering&&f(),C&&y&&h(C,!1),l.sortField&&d(),(T=a.body)!=null&&T.clientHeight&&u()}}},uS=t=>{const{emit:e}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=t,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.store.slice(u,f)},d=u=>{e("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.store.length<=i.perPage)n.pagingStore=n.store;else{const f=(i.currentPage-1)*i.perPage,m=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.store.slice(f,m),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},Br=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{stores:i,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=t,c=p=>{var y,C,b;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const k=l.gridSettingContextMenuItems.length-1,T=(b=(C=(y=l.gridSettingMenu)==null?void 0:y.rootMenuList)==null?void 0:C.$el)==null?void 0:b.children[0].children[k].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=T.width,s.columnSettingPosition.top=T.top,s.columnSettingPosition.left=T.right}else{const k=p==null?void 0:p.getBoundingClientRect(),T=k==null?void 0:k.height;s.columnSettingPosition.top=(k==null?void 0:k.top)+T,s.columnSettingPosition.left=k==null?void 0:k.right}},d=()=>{i.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(i.movedColumns)&&i.movedColumns.length?i.movedColumns:i.originColumns||[],u=(p,y)=>{var b;if(!p)return;p.hiddenDisplay=y;const C=(b=i.originColumns)==null?void 0:b.find(k=>k.index===p.index);if(C&&C!==p&&(C.hiddenDisplay=y),Array.isArray(i.movedColumns)){const k=i.movedColumns.find(T=>T.index===p.index);k&&k!==p&&(k.hiddenDisplay=y)}},f=()=>{s.visibleColumnIdx=i.filteredColumns.map(C=>C.index);const p=i.originColumns.filter(C=>!C.hide||C.hiddenDisplay).map(C=>C.index),y=s.visibleColumnIdx;s.isFilteringColumn=y.length!==p.length,e.option.searchValue&&a(e.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:p=>{const y=i.orderedColumns.filter(T=>!T.hide&&!T.hiddenDisplay);if(p.length===y.length&&y.every(T=>p.includes(T.field)))return;const b=h(),k=new Set(p);i.filteredColumns=b.filter(T=>{const w=k.has(T.field)||!T.caption;return u(T,!w),w}),s.hiddenColumn="",f(),n("change-column-status",{columns:i.updatedColumns}),n("change-column-info",{type:"display",columns:i.updatedColumns})},setColumnHidden:p=>{const y=i.orderedColumns.filter(b=>!b.hide&&!b.hiddenDisplay);if(y.length===1)return;i.filteredColumns=y.filter(b=>{const k=b.field===p;return u(b,k),!k}),h().forEach(b=>{b.field===p&&u(b,!0)}),s.hiddenColumn=p,f()}}},fS=({stores:t})=>{const{emit:e}=o.getCurrentInstance(),n=r=>{var u;const c=(u=t.movedColumns)!=null&&u.length?[...t.movedColumns]:[...t.originColumns],d=[...r],h=new Set(d.map(f=>f.index));t.movedColumns=c.map(f=>h.has(f.index)?d.shift():f)},i=(r,c)=>{const d=parseInt(r,10),h=parseInt(c,10);if(!Number.isInteger(d)||!Number.isInteger(h))return;const u=[...t.orderedColumns],f=u[d];u.splice(d,1),u.splice(h,0,f),t.filteredColumns.length&&(t.filteredColumns=u),n(u)};return{onDragStart:r=>{r.dataTransfer.setData("text/plain",r.currentTarget.dataset.index)},onDragOver:r=>{r.preventDefault()},onDrop:r=>{r.preventDefault();const c=r.dataTransfer.getData("text/plain"),d=r.target.parentNode.dataset.index;i(c,d),e("change-column-order",{column:t.orderedColumns[d],columns:t.updatedColumns}),e("change-column-info",{type:"order",columns:t.updatedColumns})}}},mS={name:"EvGrid",directives:{clickoutside:Hi,observeVisibility:qs,resize:Wn},components:{Toolbar:C0,GridPagination:Vr,GridSummary:Xr,ColumnSetting:Nr,FilterSetting:_0,GridSortButton:Pr,GridOptionButton:Fo},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array],default:()=>[]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},uncheckable:{type:[Array],default:()=>[]},expanded:{type:[Array],default:()=>[]},disabledRows:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})}},emits:{"update:selected":null,"update:checked":null,"update:expanded":null,"check-row":null,"check-all":null,"click-row":null,"dblclick-row":null,"page-change":null,"sort-column":null,"expand-row":null,"resize-column":({column:t,columns:e})=>({column:t,columns:e}),"change-column-order":({column:t,columns:e})=>({column:t,columns:e}),"change-column-status":({columns:t})=>({columns:t}),"change-column-info":({type:t,columns:e})=>({type:t,columns:e})},setup(t){var dc,hc,uc,fc,mc,pc,gc,bc,yc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=nS(),u=o.ref(null),f=o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useGridSetting)==null?void 0:ie.use)||!1}),m=o.computed(()=>t.option.showHeader??!0),g=o.computed(()=>{var F;return((F=t.option)==null?void 0:F.useSummary)||!1}),p=o.computed(()=>{var F;return((F=t.option.style)==null?void 0:F.stripe)||!1}),y=o.computed(()=>{var F;return((F=t.option.style)==null?void 0:F.border)||""}),C=o.computed(()=>{var F;return((F=t.option.style)==null?void 0:F.highlight)??-1}),b=o.computed(()=>t.option.emptyText??"No records"),k=t.option.rowMinHeight||35,T=o.ref(0),w=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),M=o.reactive({isSearch:!1,searchWord:"",isFiltering:o.computed(()=>t.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),V=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((hc=(dc=t.option)==null?void 0:dc.useGridSetting)==null?void 0:hc.columnMenuText)??"Column List",search:((fc=(uc=t.option)==null?void 0:uc.useGridSetting)==null?void 0:fc.searchText)??"Search",empty:((pc=(mc=t.option)==null?void 0:mc.useGridSetting)==null?void 0:pc.emptyText)??"No records",ok:((bc=(gc=t.option)==null?void 0:gc.useGridSetting)==null?void 0:bc.okBtnText)??"OK"}}),x=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const F=M.isFiltering?x.filterStore:x.originStore;return M.isSearch?x.searchStore:F}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>t.columns.map((F,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,...F,width:isFinite(F.width)?F.width:void 0,sortOption:{sortType:((Le=F==null?void 0:F.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const F=x.movedColumns.length?x.movedColumns:x.originColumns;return x.filteredColumns.length?x.filteredColumns:F}),updatedColumns:o.computed(()=>ms(x))}),S=o.reactive({usePage:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.use)||!1}),useClient:((yc=t.option.page)==null?void 0:yc.useClient)||!1,isInfinite:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var F,ie;return(F=t.option.page)!=null&&F.useClient?x.store.length:(ie=t.option.page)==null?void 0:ie.total}),perPage:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.perPage)||20}),visiblePage:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.visiblePage)||8}),order:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.order)||"center"}),showPageInfo:o.computed(()=>{var F;return((F=t.option.page)==null?void 0:F.showPageInfo)||!1}),isClientPaging:o.computed(()=>S.useClient&&S.usePage&&!S.isInfinite),isHighlight:!1,highlightPage:0}),L=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:t.checked,useCheckbox:o.computed(()=>t.option.useCheckbox||{})}),I=o.reactive({expandedRows:t.expanded,useRowDetail:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var F,ie;return(ie=(F=t.option)==null?void 0:F.rowDetail)==null?void 0:ie.detailRowHeight})}),v=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),W=o.reactive({contextmenuInfo:t.contextmenuInfo,selectedRow:t.selected,useSelect:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useSelection)==null?void 0:ie.multiple)??!1})}),E=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:t.option.customAscFunction??{}}),G=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:t.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:t.option.columnMenuText||{},hiddenColumnMenuItem:t.option.hiddenColumnMenuItem||{},customContextMenu:t.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var F,ie;return((ie=(F=t.option)==null?void 0:F.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),R=o.reactive({minWidth:40,rendererMinWidth:80,iconWidth:42,showResizeLine:!1,adjust:t.option.adjust||!1,columnWidth:t.option.columnWidth||80,scrollWidth:t.option.scrollWidth||17,rowHeight:o.computed(()=>t.option.rowHeight>k?t.option.rowHeight:k),gridWidth:o.computed(()=>t.width?h(t.width):"100%"),gridHeight:o.computed(()=>t.height?h(t.height):"100%")}),X=()=>{L.checkedRows=[],L.isHeaderChecked=!1,L.isHeaderIndeterminate=!1,x.store.forEach(F=>{F[1]=!1})},Z=()=>{W.selectedRow=[],x.store.forEach(F=>{F[3]=!1})},N=()=>{x.store.forEach(F=>{F[4]=!1}),I.expandedRows=[]},{getPagingData:P,updatePagingInfo:B,changePage:Y}=uS({stores:x,pageInfo:S,sortInfo:E,filterInfo:M,elementInfo:w,clearCheckInfo:X}),H=o.ref(0),{updateVScroll:K,updateHScroll:D,onScroll:z}=iS({scrollInfo:v,stores:x,elementInfo:w,resizeInfo:R,pageInfo:S,summaryScroll:H,expandedInfo:I,getPagingData:P,updatePagingInfo:B}),{onCheck:_,onCheckAll:ee}=lS({checkInfo:L,stores:x,pageInfo:S,getPagingData:P}),{onExpanded:J}=aS({expandedInfo:I}),{onSort:te,getSortTarget:U,setSort:ne,setSortInfo:Q,hasSortTarget:$}=rS({sortInfo:E,stores:x,updatePagingInfo:B}),{onSearch:j,setFilter:he,setHeaderCheckboxByFilter:me}=cS({columnSettingInfo:V,filterInfo:M,stores:x,checkInfo:L,pageInfo:S,getConvertValue:c,updateVScroll:K,getPagingData:P,updatePagingInfo:B,getColumnIndex:d}),{setStore:ae}=hS({selectInfo:W,checkInfo:L,stores:x,sortInfo:E,elementInfo:w,filterInfo:M,expandedInfo:I,setSort:ne,setSortInfo:Q,updateVScroll:K,setFilter:he}),{calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re}=sS({resizeInfo:R,elementInfo:w,checkInfo:L,expandedInfo:I,stores:x,isRenderer:a,updateVScroll:K,updateHScroll:D,contextInfo:G}),{setPositionColumnSetting:pe,initColumnSettingInfo:Ie,onApplyColumn:Ee,setColumnHidden:kt}=Br({stores:x,columnSettingInfo:V,contextInfo:G,onSearch:j,onResize:be}),{setContextMenu:Vt,onContextMenu:$o,onColumnContextMenu:qo,onGridSettingContextMenu:ys}=dS({contextInfo:G,stores:x,selectInfo:W,useGridSetting:f,filterInfo:M,columnSettingInfo:V,setColumnHidden:kt,onSort:te}),{onRowClick:xs,onRowDblClick:Ss}=oS({selectInfo:W,stores:x}),{onDragStart:Cs,onDragOver:ks,onDrop:ws}=fS({stores:x}),Is=F=>{G.gridSettingContextMenuItems.length=0,G.customGridSettingContextMenu.length?ys(F):V.isShowColumnSetting=!0},on=F=>{var ie,Le,wt,ln,Ii,Et,ot,Ls,Ts,xc;F.type==="wheel"&&((ie=G.menu)==null||ie.hide(F)),F.type==="scroll"&&!((Le=F.target.classList)!=null&&Le.contains("table-body"))&&!((ln=(wt=F.target.offsetParent)==null?void 0:wt.classList)!=null&&ln.contains("ev-select-dropbox"))&&!((Et=(Ii=F.target.offsetParent)==null?void 0:Ii.classList)!=null&&Et.contains("ev-grid-column-setting"))&&!((Ls=(ot=F.target.offsetParent)==null?void 0:ot.classList)!=null&&Ls.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,V.isShowColumnSetting=!1,G.isShowMenuOnClick=!1,(Ts=G.columnMenu)==null||Ts.hide(F),(xc=G.gridSettingMenu)==null||xc.hide())};o.onMounted(()=>{xe(),ae({rows:t.rows,isInit:!0}),document.addEventListener("wheel",on,{capture:!1}),document.addEventListener("scroll",on,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",on,{capture:!1}),document.removeEventListener("scroll",on,{capture:!0})}),o.onActivated(()=>{be()}),o.onUpdated(()=>{var F;T.value=((F=w["grid-wrapper"])==null?void 0:F.offsetWidth)/1.5||0}),o.watch(()=>V.isShowColumnSetting,F=>{var ie;if(!F){(ie=G.gridSettingMenu)==null||ie.hide();return}pe(u.value)}),o.watch(()=>t.columns,()=>{$()?Q(U()):(Q(U()),ne()),M.filteringColumn=null,M.filteringItemsByColumn={},x.filterStore=[],ae({rows:[],isMakeIndex:!1}),Ie(),x.movedColumns.length=0},{deep:!0}),o.watch(()=>E.isSorting,F=>{F&&(ae({rows:x.originStore,isMakeIndex:!1}),E.isSorting=!F,S.isClientPaging&&(S.currentPage=1,x.pagingStore=P(),X()))}),o.watch(()=>t.rows,F=>{ae({rows:F}),M.isSearch&&j(M.searchWord),be()},{deep:!0}),o.watch(()=>t.uncheckable,()=>{ae({rows:t.rows})},{deep:!0}),o.watch(()=>t.checked,F=>{L.checkedRows=F}),o.watch(()=>t.disabledRows,()=>{x.store.length&&x.store.forEach(F=>{F[6]=t.disabledRows.includes(F[2])})},{deep:!0}),o.watch(()=>L.checkedRows,F=>{L.isHeaderChecked=!1;let ie=x.store;S.isClientPaging&&(ie=P()),ie.length&&(ie.forEach(Le=>{Le[1]=F.includes(Le[2])}),L.isHeaderChecked=F.length===ie.length),K()}),o.watch(()=>t.selected,F=>{W.useSelect&&(W.selectedRow=F)}),o.watch(()=>W.selectedRow,F=>{W.useSelect&&(x.store.forEach(ie=>{ie[3]=F.includes(ie[2])&&!t.disabledRows.includes(ie[2])}),K())}),o.watch(()=>C.value,async F=>{if(await o.nextTick(),F>=0){if(S.usePage&&!S.isInfinite&&(S.highlightPage=Math.ceil(F/S.perPage)||1,S.highlightPage!==S.currentPage)){S.currentPage=S.highlightPage,S.isHighlight=!0;return}w.body.scrollTop=R.rowHeight*C.value}}),o.watch(()=>L.useCheckbox.mode,()=>{X()}),o.watch(()=>W.useSelect,()=>{Z()}),o.watch(()=>W.multiple,()=>{Z()}),o.watch(()=>t.checked.length,F=>{F||X()}),o.watch(()=>t.expanded.length,F=>{F||N(),K()}),o.watch(()=>[t.option.columnWidth,R.gridWidth],async()=>{await o.nextTick(),R.columnWidth=t.option.columnWidth;const F=w["grid-wrapper"];F.style.width=R.gridWidth,F.style.height=R.gridHeight,x.orderedColumns.map(ie=>{var wt;const Le=ie;return!((wt=t.columns[ie.index])!=null&&wt.width)&&!Le.resized&&(Le.width=0),Le}),be()}),o.watch(()=>t.option.searchValue,F=>{F!==void 0&&(j((F==null?void 0:F.value)??F),S.isClientPaging&&(X(),Z()))},{immediate:!0}),o.watch(()=>{var F;return(F=t.option.page)==null?void 0:F.currentPage},F=>{var Le;const ie=F||1;S.currentPage=(Le=t.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>S.currentPage,(F,ie)=>{o.nextTick(()=>{Y(ie),S.isClientPaging&&F!==ie&&(X(),Z()),K(),F===S.highlightPage&&S.isHighlight&&(w.body.scrollTop=R.rowHeight*C.value,S.isHighlight=!S.isHighlight)})});const Ln=o.reactive({boxTop:0,boxLeft:0}),A=o.ref(null),se=o.ref(!1),fe=o.ref(!1),ke=o.ref(null),Ve=o.ref({}),ze=o.reactive({caption:"",field:""}),Qe=o.ref([]),Jk=[{name:"AND",value:"and"},{name:"OR",value:"or"}],el=o.ref(0),jk=({caption:F,field:ie},Le)=>{if(ze.caption=F,ze.field=ie,Qe.value=Le,(Le==null?void 0:Le.length)>1){se.value=!0;const wt=A.value.getBoundingClientRect().left,ln=window.pageYOffset+A.value.getBoundingClientRect().top+A.value.getBoundingClientRect().height;Ln.boxTop=`${ln}px`,Ln.boxLeft=`${wt}px`}},Qk=()=>{x.filterStore=[],ae({rows:[],isMakeIndex:!1})},tl=async F=>{var ln,Ii;F&&fe.value&&(el.value=0);const ie=(ln=A.value)==null?void 0:ln.getElementsByClassName("filtering-items__item"),Le=[];let wt=0;if(ie){for(let Et=0;Et<ie.length;Et++){const ot=ie[Et];ot.classList.remove("non-display");const Ls=(Ii=A.value.getBoundingClientRect())==null?void 0:Ii.width,{width:Ts}=ot.getBoundingClientRect();wt+=Ts+10,Ls-150<=wt&&!ot.classList.contains("filtering-items__item--count")?(el.value++,Le.push(ot),Ve.value={...Ve.value,[ot.dataset.field]:Re(M.filteringItemsByColumn[ot.dataset.field])}):delete Ve.value[ot.dataset.field]}ie.forEach(Et=>{const ot=Le.includes(Et);Et.classList.toggle("non-display",ot)})}},$k=async(F,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[F]=ie,fe.value=!0):(delete Ve.value[F],delete M.filteringItemsByColumn[F]),await o.nextTick(),tl(!0),M.isShowFilterSetting=!1,x.filterStore=[],ae({rows:[],isMakeIndex:!1}),me(x.filterStore)};let nl=null;const qk=()=>{nl&&clearTimeout(nl),nl=setTimeout(()=>{fe.value=!fe.value,tl(fe.value)},150)},ew=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Ve.value={},x.filterStore=[],ae({rows:[],isMakeIndex:!1})},tw=o.computed(()=>{var F;return{width:`${T.value}px`,top:`${((F=A.value)==null?void 0:F.getBoundingClientRect().height)||0}px`}}),nw=F=>{const ie=M.filteringItemsByColumn[F];return ie==null?void 0:ie[ie.length-1]},iw=()=>{const F=document.createElement("div");F.id="ev-grid-filtering-items-modal",F.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(F)};return o.onBeforeMount(()=>iw()),{idColIndex:o.computed(()=>{var F;return(F=x.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:F.index}),summaryScroll:H,showHeader:m,stripeStyle:p,borderStyle:y,highlightIdx:C,useSummary:g,useGridSetting:f,toolbarRef:u,stores:x,emptyText:b,...o.toRefs(w),...o.toRefs(x),...o.toRefs(M),...o.toRefs(v),...o.toRefs(S),...o.toRefs(R),...o.toRefs(W),...o.toRefs(L),...o.toRefs(I),...o.toRefs(E),...o.toRefs(G),...o.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:K,updateHScroll:D,onScroll:z,calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re,onRowClick:xs,onRowDblClick:Ss,onCheck:_,onCheckAll:ee,onExpanded:J,onSort:te,setSort:ne,setStore:ae,setContextMenu:Vt,onContextMenu:$o,onSearch:j,setGridSetting:Is,onApplyColumn:Ee,onColumnContextMenu:qo,filteringItemsWidth:T,isShowColumnFilteringItems:fe,operatorItems:Jk,selectedFilteringItems:Qe,selectedFilteringColumn:ze,filteringItemsRef:A,isShowFilteringItemsBox:se,filteringItemsStyle:tw,hiddenFilteringItemsCount:el,...o.toRefs(Ln),hiddenFilteringItemsRef:ke,hiddenFilteringItemsByColumn:Ve,removeAllFiltering:ew,onExpandFilteringItems:qk,setColumnFilteringItems:tl,onChangeOperator:Qk,onApplyFilter:$k,onClickFilteringItem:jk,getFilteringItemByField:nw,onDragStart:Cs,onDragOver:ks,onDrop:ws,ROW_DISABLED_INDEX:6}}},pS={key:0,class:"filtering-items filtering-items--used"},gS={key:1,ref:"filteringItemsRef",class:"filtering-items"},bS=["data-field","onClick"],yS={class:"filtering-items__item--title"},xS=["title"],SS={key:1,class:"filtering-items__item--value"},CS=["onClick"],kS={class:"filtering-items__item--title"},wS=["title"],IS={key:1,class:"filtering-items__item--value"},LS={class:"column-list"},TS=["data-index"],MS=["title","onClick"],vS=["onClick"],RS=["onMousedown"],VS={ref:"table"},ES=["data-index","disabled","onClick","onContextmenu","onDblclick"],WS=["data-name","data-index","disabled"],GS={key:0},ZS=["title"],XS=["disabled"],NS=["disabled"],PS={key:0},BS=["colspan"],DS={key:0},YS={class:"is-empty"},OS={ref:"resizeLine",class:"table-resize-line"};function HS(t,e,n,i,s,l){var T;const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("grid-option-button"),d=o.resolveComponent("toolbar"),h=o.resolveComponent("ev-checkbox"),u=o.resolveComponent("grid-sort-button"),f=o.resolveComponent("ev-context-menu"),m=o.resolveComponent("grid-summary"),g=o.resolveComponent("grid-pagination"),p=o.resolveComponent("filter-setting"),y=o.resolveComponent("column-setting"),C=o.resolveDirective("clickoutside"),b=o.resolveDirective("resize"),k=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[t.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${t.gridWidth};`)},[o.createVNode(d,null,{toolbarWrapper:o.withCtx(()=>[o.createElementVNode("div",{class:"filtering",style:o.normalizeStyle({width:`${i.filteringItemsWidth}px`})},[t.isFiltering&&!Object.keys(t.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",pS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),e[18]||(e[18]=o.createElementVNode("span",null,"Filter",-1))])):o.createCommentVNode("",!0),t.isFiltering&&Object.keys(t.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",gS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(t.filteringItemsByColumn),(w,M)=>{var V,x,S,L;return o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[M===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:e[0]||(e[0]=o.withModifiers((...I)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...I),["stop"]))},[o.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),o.createElementVNode("span",null," Filter ("+o.toDisplayString(Object.keys(t.filteringItemsByColumn).length)+") ",1),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:o.withModifiers(i.removeAllFiltering,["stop"])},null,8,["onClick"])])):o.createCommentVNode("",!0),M===1?(o.openBlock(),o.createBlock(r,{key:1,modelValue:t.columnOperator,"onUpdate:modelValue":e[1]||(e[1]=I=>t.columnOperator=I),items:i.operatorItems,class:"filtering-items__item--operator",onChange:i.onChangeOperator},null,8,["modelValue","items","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"filtering-items__item non-display","data-field":w,onClick:o.withModifiers(I=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},t.filteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",yS,o.toDisplayString((V=i.getFilteringItemByField(w))==null?void 0:V.caption)+" "+o.toDisplayString((x=i.getFilteringItemByField(w))==null?void 0:x.comparison),1),t.filteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=i.getFilteringItemByField(w))==null?void 0:S.value},o.toDisplayString((L=i.getFilteringItemByField(w))==null?void 0:L.value),9,xS)):(o.openBlock(),o.createElementBlock("span",SS," + "+o.toDisplayString(t.filteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:I=>i.onApplyFilter(w,[])},null,8,["onClick"])],8,bS)],64)}),128)),i.isShowColumnFilteringItems&&Object.keys(t.filteringItemsByColumn).length&&i.hiddenFilteringItemsCount>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:e[2]||(e[2]=(...w)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...w))}," + "+o.toDisplayString(i.hiddenFilteringItemsCount),1)):o.createCommentVNode("",!0)],512)):o.createCommentVNode("",!0),!i.isShowColumnFilteringItems&&Object.keys(i.hiddenFilteringItemsByColumn).length?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:o.normalizeStyle(i.filteringItemsStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(i.hiddenFilteringItemsByColumn),(w,M)=>{var V,x,S,L;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(I=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},i.hiddenFilteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",kS,o.toDisplayString((V=i.getFilteringItemByField(w))==null?void 0:V.caption)+" "+o.toDisplayString((x=i.getFilteringItemByField(w))==null?void 0:x.comparison),1),i.hiddenFilteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=i.getFilteringItemByField(w))==null?void 0:S.value},o.toDisplayString((L=i.getFilteringItemByField(w))==null?void 0:L.value),9,wS)):(o.openBlock(),o.createElementBlock("span",IS," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:I=>i.onApplyFilter(w,[],!0)},null,8,["onClick"])],8,CS)}),128))],4)),[[C,()=>{i.isShowColumnFilteringItems||i.onExpandFilteringItems()}]]):o.createCommentVNode("",!0)],4),i.useGridSetting?(o.openBlock(),o.createBlock(c,{key:0,class:"grid-setting__icon",onClick:e[3]||(e[3]=w=>i.setGridSetting(w))})):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({ref:"grid-wrapper"},t.$attrs,{class:"grid-wrapper",style:`width: ${t.gridWidth}; height: ${t.gridHeight};`}),[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass({table:!0,adjust:t.adjust,"ev-grid":!0,"non-header":!i.showHeader,"ev-grid--empty":!t.viewStore.length})},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass({"table-header":!0,"non-border":!!i.borderStyle})},[o.createElementVNode("ul",LS,[t.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${t.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[t.useCheckbox.use&&t.useCheckbox.headerCheck&&t.useCheckbox.mode!=="single"?(o.openBlock(),o.createBlock(h,{key:0,modelValue:t.isHeaderChecked,"onUpdate:modelValue":e[4]||(e[4]=w=>t.isHeaderChecked=w),disabled:t.isHeaderUncheckable,indeterminate:t.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),t.useRowDetail?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${t.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(w,M)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[!w.hide&&!w.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":M,class:o.normalizeClass({column:!0,render:i.isRenderer(w),"non-border":!!i.borderStyle,[w.field]:w.field}),style:o.normalizeStyle({width:`${w.width}px`,"min-width":`${i.isRenderer(w)?t.rendererMinWidth:t.minWidth}px`,"margin-right":t.orderedColumns.length-1===M&&(t.hasVerticalScrollBar||t.hasHorizontalScrollBar)?`${t.scrollWidth}px`:"0px","border-right":t.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:e[6]||(e[6]=(...V)=>i.onDragStart&&i.onDragStart(...V)),onDragover:e[7]||(e[7]=(...V)=>i.onDragOver&&i.onDragOver(...V)),onDrop:e[8]||(e[8]=(...V)=>i.onDrop&&i.onDrop(...V))},[w.customHeader&&t.$slots.customHeader?o.renderSlot(t.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:w.caption,class:"column-name",onClick:[V=>i.onColumnContextMenu(V,w),e[5]||(e[5]=o.withModifiers((...V)=>t.columnMenu.show&&t.columnMenu.show(...V),["prevent"]))]},[o.createTextVNode(o.toDisplayString(w.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(V=>i.onSort(w),["stop"])},[t.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[w.sortable===void 0||w.sortable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),t.sortField===w.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":t.sortOrder==="asc","column-sort__icon--desc":t.sortOrder==="desc"}]),style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,`sortIcon_${t.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[w.sortable===void 0||w.sortable?(o.openBlock(),o.createBlock(u,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),t.sortField===w.field?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":t.sortOrder==="asc","column-sort__icon--desc":t.sortOrder==="desc"}]),icon:t.sortOrder,style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,visibility:t.sortOrder?w.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,vS)],8,MS)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(V=>i.onColumnResize(M,V),["stop","left"])},null,40,RS)],46,TS)):o.createCommentVNode("",!0)],64))),128)),(T=t.$props.option.customContextMenu)!=null&&T.length?(o.openBlock(),o.createElementBlock("li",{key:2,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":t.hasVerticalScrollBar||t.hasHorizontalScrollBar?`${t.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,i.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass({stripe:i.stripeStyle,"table-body":!0,"bottom-border":!!t.viewStore.length,"non-border":!!i.borderStyle}),onScroll:e[11]||(e[11]=(...w)=>i.onScroll&&i.onScroll(...w)),onContextmenu:e[12]||(e[12]=w=>i.onContextMenu(w))},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",VS,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.viewStore,(w,M)=>{var V,x;return o.openBlock(),o.createElementBlock(o.Fragment,{key:i.idColIndex!=null?w[2][i.idColIndex]:M},[o.createElementVNode("tr",{"data-index":w[0],class:o.normalizeClass({row:!0,selected:w[3],highlight:w[0]===i.highlightIdx,"non-border":!!i.borderStyle&&i.borderStyle!=="rows"}),disabled:w[i.ROW_DISABLED_INDEX],onClick:S=>i.onRowClick(S,w),onContextmenu:S=>i.onRowClick(S,w,!0),onDblclick:S=>i.onRowDblClick(S,w)},[t.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${t.minWidth}px`,height:`${t.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(h,{modelValue:w[1],"onUpdate:modelValue":S=>w[1]=S,class:"row-checkbox-input",disabled:w[5]||w[i.ROW_DISABLED_INDEX],onChange:S=>i.onCheck(S,w)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):o.createCommentVNode("",!0),t.useRowDetail?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!i.borderStyle,"row-detail-toggle--expanded":w[4]}),style:o.normalizeStyle({width:`${t.minWidth}px`,height:`${t.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:w[4],"onUpdate:modelValue":S=>w[4]=S,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(S=>i.onExpanded(S,w),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(S,L)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?w[2][i.idColIndex]:M}-${L}`},[!S.hide&&!S.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":S.field,"data-index":S.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(S),[S.type]:S.type,[S.align]:S.align,[S.field]:S.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${S.width}px`,height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,"min-width":`${i.isRenderer(S)?t.rendererMinWidth:t.minWidth}px`,"border-right":t.orderedColumns.length-1===L?"none":"1px solid #CFCFCF"}),disabled:w[i.ROW_DISABLED_INDEX]},[t.$slots[S.field]?(o.openBlock(),o.createElementBlock("div",GS,[o.renderSlot(t.$slots,S.field,{item:{row:w,column:S},disabled:w[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(S,w[2][S.index])},o.toDisplayString(i.getConvertValue(S,w[2][S.index])),9,ZS))],14,WS)):o.createCommentVNode("",!0)],64))),128)),(V=t.$props.option.customContextMenu)!=null&&V.length?(o.openBlock(),o.createElementBlock("td",{key:2,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${t.rowHeight}px`,"min-width":"30px","line-height":`${t.rowHeight}px`}),disabled:w[i.ROW_DISABLED_INDEX]},[t.$slots.contextmenuIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:w[i.ROW_DISABLED_INDEX],onClick:e[9]||(e[9]=S=>i.onContextMenu(S))},[o.renderSlot(t.$slots,"contextmenuIcon",{},void 0,!0)],8,NS)):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:w[i.ROW_DISABLED_INDEX],onClick:e[10]||(e[10]=S=>i.onContextMenu(S))},null,8,["disabled"]))],14,XS)):o.createCommentVNode("",!0)],42,ES),t.useRowDetail&&((x=t.$slots)!=null&&x.rowDetail)&&w[4]?(o.openBlock(),o.createElementBlock("tr",PS,[o.createElementVNode("td",{colspan:w.length},[o.createElementVNode("div",{style:o.normalizeStyle({width:"100%",height:`${t.detailRowHeight}px`,"min-height":`${t.detailRowHeight}px`,"max-height":`${t.detailRowHeight}px`})},[o.renderSlot(t.$slots,"rowDetail",{item:{row:w}},void 0,!0)],4)],8,BS)])):o.createCommentVNode("",!0)],64)}),128)),t.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",DS,[o.createElementVNode("td",YS,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(f,{ref:"menu","custom-class":t.contextMenuClass,items:t.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(f,{ref:"columnMenu",items:t.columnMenuItems},null,8,["items"]),o.createVNode(f,{ref:"gridSettingMenu",items:t.gridSettingContextMenuItems,"is-show-menu-on-click":t.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",OS,null,512),[[o.vShow,t.showResizeLine]])],2)],16)),[[b,i.onResize],[k,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(m,{key:1,"ordered-columns":t.orderedColumns,stores:i.stores,"use-checkbox":t.useCheckbox.use,"style-option":{borderStyle:i.borderStyle,minWidth:t.minWidth,rowHeight:t.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),t.usePage&&!t.isInfinite?(o.openBlock(),o.createBlock(g,{key:2,modelValue:t.currentPage,"onUpdate:modelValue":e[13]||(e[13]=w=>t.currentPage=w),total:t.pageTotal,"per-page":t.perPage,"visible-page":t.visiblePage,"show-page-info":t.showPageInfo,order:t.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(p,{"is-show":t.isShowFilterSetting,"onUpdate:isShow":e[14]||(e[14]=w=>t.isShowFilterSetting=w),items:t.filteringItemsByColumn,"onUpdate:items":e[15]||(e[15]=w=>t.filteringItemsByColumn=w),column:t.filteringColumn,position:t.filterSettingPosition,onApplyFiltering:i.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),o.createVNode(y,{"is-show":t.isShowColumnSetting,"onUpdate:isShow":e[16]||(e[16]=w=>t.isShowColumnSetting=w),"is-show-menu-on-click":t.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":e[17]||(e[17]=w=>t.isShowMenuOnClick=w),columns:t.updatedColumns,"hidden-column":t.hiddenColumn,position:t.columnSettingPosition,"text-info":t.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const fi=ce(mS,[["render",HS],["__scopeId","data-v-22cd2bf6"]]);fi.install=t=>{t.component(fi.name,fi)};let mi=null;function FS(){return mi||(typeof document<"u"?mi=document.createElement("canvas").getContext("2d"):typeof OffscreenCanvas<"u"&&(mi=new OffscreenCanvas(1,1).getContext("2d")),mi)}const pi=new Map,zS=512,O={hexToRgb(t){if(!t)return!1;const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),n=parseInt(e[1],16),i=parseInt(e[2],16),s=parseInt(e[3],16);return`${n},${i},${s}`},getColorStringType(t){if(!t)return"";const e=t.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(e),i=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(e),s=/^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(e);let l="";return n?l="HEX":i?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(t,e=1){const n=`${t}|${e}`,i=pi.get(n);if(i!==void 0)return i;const s=t.replace(/ /g,""),l=this.getColorStringType(s);let a="";switch(l){case"HEX":a=`rgba(${this.hexToRgb(s)},${e})`;break;case"RGB":a=s.replace(")",`, ${e})`).replace("rgb","rgba");break;case"RGBA":{const r=s.replace(/^.*,(.+)\)/,"$1");a=s.replace(`${r})`,`${e})`);break}default:a=`rgba(0, 0, 0, ${e})`;break}return pi.size>=zS&&pi.delete(pi.keys().next().value),pi.set(n,a),a},getOpacity(t){const e=t==null?void 0:t.replace(/ /g,"");return this.getColorStringType(e)==="RGBA"?e.replace(/^.*,(.+)\)/,"$1"):"1"},calculateMagnitude(t){return Math.floor(Math.log(t)/Math.LN10)},aliasPixel(t){return t%2===0?0:.5},coordinateKey(t,e){return`${t}|${e}`},getLabelStyle(t){const{fontStyle:e="normal",fontWeight:n="normal",fontSize:i="12",fontFamily:s="Roboto"}=t;return`${e} normal ${n} ${i}px ${s}`},labelSignFormat(t,e=null){const n=Oh(1),i=Yh(1),s=Dh(1),l=Bh(1),a=1e3;let r;if(!yt(t))return t;const c=t<0,d=Math.abs(t),h=(u,f,m)=>{let g;return u%f===0?g=Yt(e)?`${u/f}${m}`:`${(u/f).toFixed(e)}${m}`:g=`${(u/f).toFixed(1)}${m}`,c?`-${g}`:g};if(d>=n)r=h(d,n,"P");else if(d>=i)r=h(d,i,"T");else if(d>=s)r=h(d,s,"G");else if(d>=l)r=h(d,l,"M");else if(d>=a)r=h(d,1e3,"K");else{const u=Yt(e)?d:d.toFixed(e);r=c?`-${u}`:`${u}`}return r},calcTextSize(t,e,n=0){const i=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${e}; padding: 0 ${n}px`;i.setAttribute("style",s),i.style.font=e,i.textContent=t,document.body.appendChild(i);const l=i.getBoundingClientRect(),a=l.width||2,r=l.height||2;return i.remove(),{width:a,height:r}},calcTextSizeCanvas(t,e){if(!t)return{width:2,height:2};const n=FS();n.save(),n.font=e;const i=n.measureText(t),s=e.match(/(\d+(?:\.\d+)?)px/),a=(s?Number(s[1]):14)*1.2;return n.restore(),{width:Math.max(Math.ceil(i.width),2),height:Math.max(Math.ceil(a),2)}},getStringMinMax(t){const e={min:t[0],max:t[0]};return t.forEach(n=>{var i,s;((i=e==null?void 0:e.max)==null?void 0:i.length)<(n==null?void 0:n.length)&&(e.max=n),((s=e==null?void 0:e.min)==null?void 0:s.length)>(n==null?void 0:n.length)&&(e.min=n)}),e},truncateLabelWithEllipsis(t,e,n,i="right"){if(!t)return"";if(!e)return t;const s="…",l=n.measureText(s).width;let a=t,r=n.measureText(a).width;if(r<=e||r<=l)return t;let c=a.length;for(;r>=e-l&&c-- >0;)a=i==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return i==="right"?a+s:s+a},showLabelTip(t){const{ctx:e,width:n,height:i,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=t,u=s-n/2,f=s+n/2,m=l-i,g=l;e.beginPath(),e.save(),e.fillStyle=d||"#E96E2C",e.strokeStyle=d||"#E96E2C",e.shadowBlur=0,e.moveTo(u+r,m),e.quadraticCurveTo(u,m,u,m+r),e.lineTo(u,g-r),e.quadraticCurveTo(u,g,u+r,g),e.lineTo(f-r,g),e.quadraticCurveTo(f,g,f,g-r),e.lineTo(f,m+r),e.quadraticCurveTo(f,m,f-r,m),e.lineTo(s-a,m),e.lineTo(s,m-a),e.lineTo(s+a,m),e.lineTo(u+r,m),e.closePath(),e.fill(),e.restore(),e.save(),e.font="normal normal bold 12px Roboto",e.fillStyle=h||"#FFF",e.textBaseline="middle",e.textAlign="center",e.fillText(`${c}`,s,m+i/2),e.restore(),e.beginPath()},isPieType(t){return t==="pie"||t==="doughnut"||t==="sunburst"},isDoughnutHole(t){return t==="doughnut"||t==="sunburst"},setDOMStyle(t,e){var n;!t||!e||(n=Object.keys(e))==null||n.forEach(i=>{t.style[i]=e[i]})},checkSafeInteger(t){return t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER},htmlToElement(t){const e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild},isNullOrUndefined(t){return t==null},rgbaAdjustHalfOpacity(t){const e=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(e.test(t)){const[,i,s,l]=t.match(e);return`rgba(${i}, ${s}, ${l}, 0.5)`}if(n.test(t)){const[,i,s,l,a]=t.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${i}, ${s}, ${l}, ${r})`}return t.startsWith("#")&&t.length>7?t:`${t}80`},calcBoxDistance(t,e,n){if(t.w!==null&&t.w!==void 0&&t.h!==null&&t.h!==void 0){const i=t.xp,s=t.yp,l=Math.min(i,i+t.w),a=Math.max(i,i+t.w),r=Math.min(s,s+t.h),c=Math.max(s,s+t.h),d=Math.max(0,l-e,e-a),h=Math.max(0,r-n,n-c);return d*d+h*h}return(t.xp-e)**2+(t.yp-n)**2}};function AS(t){const e=(String(t).split(".")[1]??"").length;return t.toFixed(e+1)}var KS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _S(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dr={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(KS,function(){var n=1e3,i=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",u="month",f="quarter",m="year",g="date",p="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var G=["th","st","nd","rd"],R=E%100;return"["+E+(G[(R-20)%10]||G[R]||G[0])+"]"}},k=function(E,G,R){var X=String(E);return!X||X.length>=G?E:""+Array(G+1-X.length).join(R)+E},T={s:k,z:function(E){var G=-E.utcOffset(),R=Math.abs(G),X=Math.floor(R/60),Z=R%60;return(G<=0?"+":"-")+k(X,2,"0")+":"+k(Z,2,"0")},m:function E(G,R){if(G.date()<R.date())return-E(R,G);var X=12*(R.year()-G.year())+(R.month()-G.month()),Z=G.clone().add(X,u),N=R-Z<0,P=G.clone().add(X+(N?-1:1),u);return+(-(X+(R-Z)/(N?Z-P:P-Z))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:u,y:m,w:h,d,D:g,h:c,m:r,s:a,ms:l,Q:f}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},w="en",M={};M[w]=b;var V="$isDayjsObject",x=function(E){return E instanceof v||!(!E||!E[V])},S=function E(G,R,X){var Z;if(!G)return w;if(typeof G=="string"){var N=G.toLowerCase();M[N]&&(Z=N),R&&(M[N]=R,Z=N);var P=G.split("-");if(!Z&&P.length>1)return E(P[0])}else{var B=G.name;M[B]=G,Z=B}return!X&&Z&&(w=Z),Z||!X&&w},L=function(E,G){if(x(E))return E.clone();var R=typeof G=="object"?G:{};return R.date=E,R.args=arguments,new v(R)},I=T;I.l=S,I.i=x,I.w=function(E,G){return L(E,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var v=function(){function E(R){this.$L=S(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[V]=!0}var G=E.prototype;return G.parse=function(R){this.$d=function(X){var Z=X.date,N=X.utc;if(Z===null)return new Date(NaN);if(I.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var P=Z.match(y);if(P){var B=P[2]-1||0,Y=(P[7]||"0").substring(0,3);return N?new Date(Date.UTC(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,Y)):new Date(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,Y)}}return new Date(Z)}(R),this.init()},G.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},G.$utils=function(){return I},G.isValid=function(){return this.$d.toString()!==p},G.isSame=function(R,X){var Z=L(R);return this.startOf(X)<=Z&&Z<=this.endOf(X)},G.isAfter=function(R,X){return L(R)<this.startOf(X)},G.isBefore=function(R,X){return this.endOf(X)<L(R)},G.$g=function(R,X,Z){return I.u(R)?this[X]:this.set(Z,R)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(R,X){var Z=this,N=!!I.u(X)||X,P=I.p(R),B=function(J,te){var U=I.w(Z.$u?Date.UTC(Z.$y,te,J):new Date(Z.$y,te,J),Z);return N?U:U.endOf(d)},Y=function(J,te){return I.w(Z.toDate()[J].apply(Z.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(te)),Z)},H=this.$W,K=this.$M,D=this.$D,z="set"+(this.$u?"UTC":"");switch(P){case m:return N?B(1,0):B(31,11);case u:return N?B(1,K):B(0,K+1);case h:var _=this.$locale().weekStart||0,ee=(H<_?H+7:H)-_;return B(N?D-ee:D+(6-ee),K);case d:case g:return Y(z+"Hours",0);case c:return Y(z+"Minutes",1);case r:return Y(z+"Seconds",2);case a:return Y(z+"Milliseconds",3);default:return this.clone()}},G.endOf=function(R){return this.startOf(R,!1)},G.$set=function(R,X){var Z,N=I.p(R),P="set"+(this.$u?"UTC":""),B=(Z={},Z[d]=P+"Date",Z[g]=P+"Date",Z[u]=P+"Month",Z[m]=P+"FullYear",Z[c]=P+"Hours",Z[r]=P+"Minutes",Z[a]=P+"Seconds",Z[l]=P+"Milliseconds",Z)[N],Y=N===d?this.$D+(X-this.$W):X;if(N===u||N===m){var H=this.clone().set(g,1);H.$d[B](Y),H.init(),this.$d=H.set(g,Math.min(this.$D,H.daysInMonth())).$d}else B&&this.$d[B](Y);return this.init(),this},G.set=function(R,X){return this.clone().$set(R,X)},G.get=function(R){return this[I.p(R)]()},G.add=function(R,X){var Z,N=this;R=Number(R);var P=I.p(X),B=function(K){var D=L(N);return I.w(D.date(D.date()+Math.round(K*R)),N)};if(P===u)return this.set(u,this.$M+R);if(P===m)return this.set(m,this.$y+R);if(P===d)return B(1);if(P===h)return B(7);var Y=(Z={},Z[r]=i,Z[c]=s,Z[a]=n,Z)[P]||1,H=this.$d.getTime()+R*Y;return I.w(H,this)},G.subtract=function(R,X){return this.add(-1*R,X)},G.format=function(R){var X=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||p;var N=R||"YYYY-MM-DDTHH:mm:ssZ",P=I.z(this),B=this.$H,Y=this.$m,H=this.$M,K=Z.weekdays,D=Z.months,z=Z.meridiem,_=function(te,U,ne,Q){return te&&(te[U]||te(X,N))||ne[U].slice(0,Q)},ee=function(te){return I.s(B%12||12,te,"0")},J=z||function(te,U,ne){var Q=te<12?"AM":"PM";return ne?Q.toLowerCase():Q};return N.replace(C,function(te,U){return U||function(ne){switch(ne){case"YY":return String(X.$y).slice(-2);case"YYYY":return I.s(X.$y,4,"0");case"M":return H+1;case"MM":return I.s(H+1,2,"0");case"MMM":return _(Z.monthsShort,H,D,3);case"MMMM":return _(D,H);case"D":return X.$D;case"DD":return I.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return _(Z.weekdaysMin,X.$W,K,2);case"ddd":return _(Z.weekdaysShort,X.$W,K,3);case"dddd":return K[X.$W];case"H":return String(B);case"HH":return I.s(B,2,"0");case"h":return ee(1);case"hh":return ee(2);case"a":return J(B,Y,!0);case"A":return J(B,Y,!1);case"m":return String(Y);case"mm":return I.s(Y,2,"0");case"s":return String(X.$s);case"ss":return I.s(X.$s,2,"0");case"SSS":return I.s(X.$ms,3,"0");case"Z":return P}return null}(te)||P.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(R,X,Z){var N,P=this,B=I.p(X),Y=L(R),H=(Y.utcOffset()-this.utcOffset())*i,K=this-Y,D=function(){return I.m(P,Y)};switch(B){case m:N=D()/12;break;case u:N=D();break;case f:N=D()/3;break;case h:N=(K-H)/6048e5;break;case d:N=(K-H)/864e5;break;case c:N=K/s;break;case r:N=K/i;break;case a:N=K/n;break;default:N=K}return Z?N:I.a(N)},G.daysInMonth=function(){return this.endOf(u).$D},G.$locale=function(){return M[this.$L]},G.locale=function(R,X){if(!R)return this.$L;var Z=this.clone(),N=S(R,X,!0);return N&&(Z.$L=N),Z},G.clone=function(){return I.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},E}(),W=v.prototype;return L.prototype=W,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",m],["$D",g]].forEach(function(E){W[E[1]]=function(G){return this.$g(G,E[0],E[1])}}),L.extend=function(E,G){return E.$i||(E(G,v,L),E.$i=!0),L},L.locale=S,L.isDayjs=x,L.unix=function(E){return L(1e3*E)},L.en=M[w],L.Ls=M,L.p={},L})})(Dr);var US=Dr.exports;const Pe=_S(US),JS={createDataSet(t,e){var n;this._dataEpoch=(this._dataEpoch??0)+1,Object.keys(this.seriesInfo.charts).forEach(i=>{var l;const s=this.seriesInfo.charts[i];if(s.length)if(i==="pie")this.options.sunburst?this.createSunburstDataSet(t):this.createPieDataSet(t,s);else if(i==="scatter")s.forEach(a=>{const r=this.seriesList[a],c=t[a],d=r==null?void 0:r.passingValue;r&&c&&(r.data=this.addSeriesDSforScatter(c),r.minMax=this.getSeriesMinMax(r.data,d))});else if(i==="heatMap")s.forEach(a=>{const r=this.seriesList[a],c=r==null?void 0:r.passingValue,d=t[a];r&&d&&(r.labels=e,r.data=this.addSeriesDSForHeatMap(d),r.minMax=this.getSeriesMinMax(r.data,c),r.valueOpt=this.getSeriesValueOptForHeatMap(r))});else{const a=s[0],r=(l=this.seriesList[a])==null?void 0:l.passingValue,c=new Map;for(let d=0;d<s.length;d++){const h=s[d],u=this.seriesList[h];if(u&&u.show!==!1){const f=t==null?void 0:t[h],{passingValue:m,interpolation:g}=u,p=g==="zero"||m!=null&&m!==void 0;let y=!1,C;if(!f)C=f;else if(!p)C=f;else{C=new Array(f.length);for(let b=0;b<f.length;b++){const k=f[b];g==="zero"&&!k?C[b]=0:k===m?(y=!0,C[b]=null):C[b]=k}}if(u.hasPassingValueInData=y,C){const b=u.isExistGrp&&!u.isOverlapping;let k=null;b&&(k=c.get(u.groupIndex),k||(k={pos:[],neg:[]},c.set(u.groupIndex,k))),b&&u.stackIndex?u.data=this.addSeriesStackDS(C,e,u.stackIndex,k,u.data):u.data=this.addSeriesDS(C,e,u.isExistGrp,r,u.data),u.minMax=this.getSeriesMinMax(u.data,u.passingValue),b&&this.updateStackTops(k,u)}}}}}),(n=this.buildLabelValidMask)==null||n.call(this)},createRealTimeScatterDataSet(t){var s,l,a,r;const e=this.prunedRealTimeScatterSeries,n=e!=null&&e.size?Object.keys(t).filter(c=>!e.has(c)):Object.keys(t),i={maxY:-1/0,minY:1/0,fromTime:0,toTime:0};for(let c=0;c<n.length;c++){const d=n[c],h=t[d],u=h==null?void 0:h.length;if(!this.isInit||this.updateSeries||!this.dataSet[d]){const E={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0};this.dataSet[d]={...E,...this.dataSet[d]}}const f=this.dataSet[d],m=f.dataGroup,g=this.options.realTimeScatter.range||300,p=f.length!==g;f.length=g;const y=f.length;let C=0;for(let E=0;E<u;E++){const G=h[E];G&&C<G.x&&(C=G.x)}C=C?Math.floor(C/1e3)*1e3:0;const b=((a=(l=(s=m.at(-1))==null?void 0:s.data)==null?void 0:l.at(-1))==null?void 0:a.x)||Date.now(),k=Math.floor(b/1e3)*1e3,T=f.toTime||k,w=C||T,M=E=>{E.data.length=0,E.dataKeys?E.dataKeys.clear():E.dataKeys=new Set,E.max=0,E.min=1/0};if(f.endIndex==null||p){f.startIndex=0,f.endIndex=y-1,m.length=y;for(let E=0;E<y;E++)m[E]=m[E]||{data:[],dataKeys:new Set,max:0,min:1/0},M(m[E]);f.toTime=w,f.fromTime=f.toTime-y*1e3}const V=(w-T)/1e3,x=Number.isFinite(V)?Math.max(0,Math.floor(V)):0;if(f.toTime=w,f.fromTime=f.toTime-y*1e3,C&&(f.toTime-C)/1e3>y&&d==="")return;for(let E=0;E<y;E++)m[E]?m[E].data?m[E].dataKeys||(m[E].dataKeys=new Set):(m[E].data=[],m[E].dataKeys=new Set,m[E].max=0,m[E].min=1/0):m[E]={data:[],dataKeys:new Set,max:0,min:1/0};if(x>0)if(x>=y){for(let E=0;E<y;E++)M(m[E]);f.startIndex=0,f.endIndex=y-1}else{let E=f.startIndex,G=f.endIndex;for(let R=0;R<x;R++)M(m[E]),E=(E+1)%y,G=(G+1)%y;f.startIndex=E,f.endIndex=G}const S=this.options.coordinateDedupe!==!1;let L=-1;for(let E=0;E<u;E++){const G=h[E];if(G){const R=Math.floor(G.x/1e3)*1e3;if(f.fromTime<=R){let X=f.endIndex-(f.toTime-R)/1e3;X<0&&(X=y+X);const Z=m[X],N=O.coordinateKey(G.x,G.y);if(!(S&&Z.dataKeys.has(N))){S&&Z.dataKeys.add(N),Z.data.push({x:G.x,y:G.y,o:G.value??G.y,color:G.color,k:S&&this.seriesInfo.charts.scatter.length>1?N:void 0}),Z.max=Math.max(Z.max,G.y),Z.min=Math.min(Z.min,G.y);const B=(f.toTime-R)/1e3;B>L&&(L=B)}}}}f.lastTick={seq:(((r=f.lastTick)==null?void 0:r.seq)??0)+1,gapCount:x,prevToTime:T,toTime:f.toTime,length:y,startIndex:f.startIndex,endIndex:f.endIndex,maxDirtyAge:L};const I=1e3,v={maxY:-1/0,minY:1/0};for(let E=0;E<y;E++){const G=m[E];for(let R=0;R<G.data.length;R++){const X=G.data[R],Z=Math.floor(X.x/I)*I;Z>=f.fromTime&&Z<=f.toTime&&Number.isFinite(X.y)&&(X.y>v.maxY&&(v.maxY=X.y),X.y<v.minY&&(v.minY=X.y))}}Number.isFinite(v.minY)&&(i.maxY=Math.max(i.maxY,v.maxY),i.minY=Math.min(i.minY,v.minY)),f.toTime>i.toTime&&(i.toTime=f.toTime,i.fromTime=f.fromTime)}Number.isFinite(i.minY)||(i.minY=0,i.maxY=0),this.pruneExpiredRealTimeScatterSeries(t),this.seriesInfo.charts.scatter.forEach(c=>{const d=this.seriesList[c];d.data=this.dataSet,d.minMax={minX:Pe(i.fromTime+1e3),minY:i.minY,maxX:Pe(i.toTime),maxY:i.maxY}})},pruneExpiredRealTimeScatterSeries(t){var c,d,h,u;const e=this.dataSet,n=Object.keys(e);if(!n.length)return;let i=0;for(let f=0;f<n.length;f++){const m=e[n[f]].toTime||0;m>i&&(i=m)}const s=((c=this.options.realTimeScatter)==null?void 0:c.range)||300,l=i-s*1e3,a=[];for(let f=0;f<n.length;f++){const m=n[f],p=e[m].toTime<l,y=!((d=t[m])!=null&&d.length);p&&y&&a.push(m)}if(!a.length)return;for(let f=0;f<a.length;f++)this.removeRealTimeScatterSeries(a[f]);const r=this.options.legend;r!=null&&r.show&&(r!=null&&r.external)?(h=this.emitLegendData)==null||h.call(this):r!=null&&r.show&&((u=this.updateLegend)==null||u.call(this))},removeRealTimeScatterSeries(t){var i,s,l,a,r,c;delete this.dataSet[t],(i=this.seriesList)!=null&&i[t]&&delete this.seriesList[t];const e=(l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter;if(Array.isArray(e)){const d=e.indexOf(t);d!==-1&&e.splice(d,1)}(a=this._updateSeriesCount)==null||a.call(this),(this.prunedRealTimeScatterSeries??(this.prunedRealTimeScatterSeries=new Set)).add(t);const n=(r=this.defaultSelectInfo)==null?void 0:r.seriesId;if(Array.isArray(n)){const d=n.indexOf(t);d!==-1&&n.splice(d,1)}((c=this.defaultSelectItemInfo)==null?void 0:c.seriesID)===t&&(this.defaultSelectItemInfo=null)},createSunburstDataSet(t){this.pieDataSet=[];const e=this.pieDataSet,n=[];for(let i=0;i<t.length;i++){const s=t[i],l=this.seriesList[s.id];let a=!1;if(e[0]||(e[0]={ir:0,or:0,total:0,data:[]}),l.show){if(e[0].total+=s.value||0,e[0].data.push({parent:"$ev-root",id:s.id,value:s.value,sa:0,ea:0}),s.children)for(let r=0;r<s.children.length;r++)this.seriesList[s.children[r].id].show&&(a=!0),n.push({parent:s.id,data:s.children[r],depth:1});else{const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}if(!a){const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}}}for(e[0].data.sort((i,s)=>s.value-i.value);n.length;){const i=n.shift(),s=i.parent,l=i.data,a=i.depth;let r=!1;e[a]||(e[a]={ir:0,or:0,total:{},data:[]}),e[a].total[s]||(e[a].total[s]=0);const c=this.seriesList[l.id];if(l.id==="dummy")e[a].data.push({parent:s,id:"dummy",value:l.value,sa:0,ea:0}),e[a].total[s]+=l.value;else if(c&&c.show){if(e[a].data.push({parent:s,id:l.id,value:l.value,sa:0,ea:0}),e[a].total[s]+=l.value,l.children)for(let d=0;d<l.children.length;d++)this.seriesList[l.children[d].id].show&&(r=!0),n.push({parent:l.id,data:l.children[d],depth:a+1});else{const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}if(!r){const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}}e[a].data.sort((d,h)=>h.value-d.value)}},createPieDataSet(t,e){this.pieDataSet=[];const n=this.pieDataSet;n[0]={data:[],ir:0,or:0,total:0},e.forEach(i=>{if(this.seriesList[i].show){const s=t[i][0]??0;n[0].total+=s,n[0].data.push({id:i,value:s,sa:0,ea:0})}}),n.forEach(i=>{i.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(t,e,n=0,i=null,s){const l=this.options.horizontal,a=[],r=i==null?void 0:i.pos,c=i==null?void 0:i.neg,d=Array.isArray(s)?s:null;return t.forEach((h,u)=>{let f=(h>=0?r==null?void 0:r[u]:c==null?void 0:c[u])??0,m=h,g=e[u],p=h;if(f!=null&&g!=null){p&&typeof p=="object"&&("x"in p||"y"in p)&&(m=l?h.x:h.y,g=l?h.y:h.x);const y=(m==null?void 0:m.value)??m;n>0?y!=null?p=f+y:p=m:(f=0,p=y);const C=d&&d[a.length];a.push(this.addData(p,g,m,f,C||null))}}),a},updateStackTops(t,e){if(!e.show)return;const n=this.options.horizontal,i=e.passingValue,s=!O.isNullOrUndefined(i),l=e.data,a=t.pos,r=t.neg;for(let c=0;c<l.length;c++){const d=l[c],h=n?d.x:d.y,u=d.o,f=s&&u===i;h!=null&&!f&&(u>=0?a[c]=h:r[c]=h)}},addSeriesDS(t,e,n,i,s){const l=this.options.horizontal,a=[],r=n&&!O.isNullOrUndefined(i),c=Array.isArray(s)?s:null;for(let d=0;d<t.length;d++){let h=t[d],u=e[d];if(h&&typeof h=="object"&&(h.x||h.y)&&(h=l?h.x:h.y,u=l?t[d].y:t[d].x),u!==null){const f=r&&h===i?0:h;if(f!==null&&typeof f=="object"||h!==null&&typeof h=="object")a.push(this.addData(f,u,h));else{const m=f??null,g=h??null,p=c&&c[a.length];p&&typeof p=="object"?(p.x=l?m:u,p.y=l?u:m,p.o=g,p.b=null,p.xp=null,p.yp=null,p.w=null,p.h=null,p.dataColor=null,p.dataTextColor=null,a.push(p)):a.push(l?{x:m,y:u,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null}:{x:u,y:m,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null})}}}return a},addSeriesDSforScatter(t){return t.map(e=>{const n=e.x,i={value:e.y,color:(e==null?void 0:e.color)||null};return this.addData(i,n,i)})},addSeriesDSForHeatMap(t){return t.map(({x:e,y:n,value:i,color:s=null})=>({x:e,y:n,o:i,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(t,e,n=null,i=null,s=null){let l=null,a=null,r=null,c=null,d=null;t!==null&&typeof t=="object"?(l=t.value,r=t.color,d=t.textColor):l=t??null,n!==null&&typeof n=="object"?(a=n.value,c=n.color):a=n??null;const h=s||{};return this.options.horizontal?(h.x=l,h.y=e):(h.x=e,h.y=l),h.o=a,h.b=i,h.xp=null,h.yp=null,h.w=null,h.h=null,h.dataColor=r??c,h.dataTextColor=d,h},getSeriesMinMax(t,e){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},i=this.options.horizontal;if(t.length){const s=!O.isNullOrUndefined(e),l={minX:t[0].x,minY:t[0].y,maxX:t[0].x,maxY:t[0].y,maxDomain:i?t[0].y:t[0].x,maxDomainIndex:0};for(let a=0;a<t.length;a++){const r=t[a],c=r.x,d=r.y,h=r.o;(!s||h!==e)&&(c<=l.minX&&(l.minX=c===null?0:c),d<=l.minY&&(l.minY=d===null?0:d),c>=l.maxX&&(l.maxX=c===null?0:c,i&&c!==null&&(l.maxDomain=d,l.maxDomainIndex=a)),d>=l.maxY&&(l.maxY=d===null?0:d,!i&&d!==null&&(l.maxDomain=c,l.maxDomainIndex=a)))}return l}return n},getVisibleWindowMaxSeries(t,e){var l;if(!Number.isFinite(t)||!Number.isFinite(e)||e<t)return null;const n=this.options.horizontal;let i=null;const s=Object.keys(this.seriesList);for(let a=0;a<s.length;a+=1){const r=this.seriesList[s[a]];if(r!=null&&r.show&&((l=r.data)!=null&&l.length)){const c=Math.max(0,t),d=Math.min(r.data.length-1,e);for(let h=c;h<=d;h+=1){const u=r.data[h],f=n?u==null?void 0:u.x:u==null?void 0:u.y;Number.isFinite(f)&&(!i||f>i.value)&&(i={sId:r.sId,value:f,index:h,domain:n?u==null?void 0:u.y:u==null?void 0:u.x})}}}return i},getSeriesValueOptForHeatMap(t){const{data:e,colorState:n,isGradient:i}=t,s=this.options.heatMapColor,l=s.colorsByRange.length||s.rangeCount,a=s.decimalPoint;let r,c=0,d=!1;e.forEach(({o:u})=>{c<u&&(c=Math.max(c,u)),u<0?d=!0:r===void 0?r=u:r=Math.min(r,u)}),d&&!i&&n.length===l&&n.push({id:`color#${l}`,color:s.error,state:"normal",label:"Error",show:!0});let h=c>r?Math.floor((c-r)/l):1;return c-r<=l&&(a>0?h=+((c-r)/l).toFixed(a):h=1),{min:r,max:c,interval:h,existError:d,decimalPoint:a}},getItemByLabelIndex(t){if(t<0)return!1;const e=Object.keys(this.seriesList),n=!!this.options.horizontal;let i=null,s=null,l=null,a="",r=0,c=!1,d=!1;if(t>-1){for(let h=0;h<e.length;h++){const u=e[h],f=this.seriesList[u],m=f.data[t];if(m&&f.show&&f.showLegend){const g=n?m.y:m.x,p=n?m.yp:m.xp;if(g!=null){const y=n?m.o||m.x:m.o||m.y;f.stackIndex?(r+=isNaN(m.o)?0:m.o,c=!0):r+=m.y,(l===null||l<=y)&&(l=y,a=u,i=g,s=p)}}}d={label:i,pos:s,value:l===null?0:l,sId:a,acc:r,useStack:c,maxIndex:t}}return d},getItem(t,e=!1){const{seriesID:n,dataIndex:i}=t;let s;if("seriesID"in t){const l=this.getDataByValues(n,i);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getHitItemByPosition([l.xp,l.yp],e,i,!0)]}else{const l=Object.entries(this.seriesList);let a;for(let r=0;r<l.length;r++){const[c,d]=l[r];if(d.show){a=c;break}}s=i==null?void 0:i.map(r=>{var h,u;const c=this.getDataByValues(a,r);if(!c)return null;const d=this.getHitItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],e,r,!0);return d&&!d.sId&&(d.sId=a,d.label=((u=(h=this.data)==null?void 0:h.labels)==null?void 0:u[r])??d.label,d.dataIndex=r),d})}return s},getDataByValues(t,e){const n=this.seriesList[t];return!n||isNaN(e)||e<0||(n==null?void 0:n.data.length)<=e?!1:n.data[e]},getHitItemByPosition(t,e=!1,n,i=!1,s=!1){var v;const l=Object.keys(this.seriesList),a=!!this.options.horizontal,[r,c]=t;let d=n;if(d===void 0&&!e){const W=l.find(E=>{var R;const G=this.seriesList[E];return(G==null?void 0:G.show)&&((R=G==null?void 0:G.data)==null?void 0:R.length)>0});if(W){const E=this.seriesList[W].data,G=a?t[1]:t[0];let R=1/0,X=-1;for(let Z=0;Z<E.length;Z++){const N=s||l.some(B=>{var H,K,D,z;const Y=this.seriesList[B];return(Y==null?void 0:Y.show)&&((K=(H=Y.data)==null?void 0:H[Z])==null?void 0:K.o)!==null&&((z=(D=Y.data)==null?void 0:D[Z])==null?void 0:z.o)!==void 0}),P=E[Z];if(N&&P){let B;if(a?B=P.h?P.yp+P.h/2:P.yp:B=P.w?P.xp+P.w/2:P.xp,B!=null){const Y=Math.abs(G-B);Y<R&&(R=Y,X=Z)}}}X!==-1&&(d=X)}}let h=null,u=null,f=null,m=null,g="",p=null,y=1/0,C=!1,b=null,k=null,T=null,w=null,M="",V=null,x=1/0,S=0,L=!1;for(let W=0;W<l.length;W++){const E=l[W],G=this.seriesList[E],R=e?G.findApproximateData:G.findGraphData;if(R){const X=R.call(G,t,a,d,i),Z=X.data,N=X.index;if(Z)if(O.isPieType(X.type))h=X.type,u=E,g=E,f=(Z.ea-Z.sa)/2,m=Z.o,p=Z.index;else{const P=a?Z.y:Z.x,B=a?Z.yp:Z.xp;if(P!=null){const Y=a?Z.o||Z.x:Z.o||Z.y;G.stackIndex!=null?(S+=isNaN(Z.o)?0:Z.o,L=!0):S+=Z.y;const H=Y!=null&&!Number.isNaN(Y),K=Z.xp!==null&&Z.xp!==void 0&&Z.yp!==null&&Z.yp!==void 0;if(H&&K){const D=O.calcBoxDistance(Z,r,c);(M===""||D<x)&&(x=D,b=G.type,k=P,T=B,w=Y,M=E,V=N)}else H&&M===""&&(b=G.type,k=P,T=B,w=Y,M=E,V=N);if(X.hit&&Z.xp!==void 0&&Z.yp!==void 0){const D=(Z.xp-t[0])**2+(Z.yp-t[1])**2;X.directHit?((!C||D<y)&&(y=D,h=G.type,u=P,f=B,m=Y,g=E,p=N),C=!0):C||D<y&&(y=D,h=G.type,u=P,f=B,m=Y,g=E,p=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const W=l.find(G=>{var X;const R=this.seriesList[G];return(R==null?void 0:R.show)&&((X=R==null?void 0:R.data)==null?void 0:X.length)>0}),E=W?(v=this.seriesList[W].data)==null?void 0:v[d]:null;E&&(k=a?E.y:E.x,V=d)}const I=g!=="";return{type:I?h:b,label:I?u:k,pos:I?f:T,value:I?m:w,sId:I?g:M,acc:S,useStack:L,dataIndex:I?p:V}},getLabelInfoByPosition(t,e){var p,y,C;const[n,i]=t,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=this.data.series,a=((p=Object.values(l).sort((b,k)=>k.pointSize??0-b.pointSize??0)[0])==null?void 0:p.pointSize)??3,{horizontal:r,selectLabel:c}=this.options;let d,h;e==="xAxis"?(d=this.axesX[0],h=this.scrollbar.x):e==="yAxis"?(d=this.axesY[0],h=this.scrollbar.y):(d=r?this.axesY[0]:this.axesX[0],h=r?this.scrollbar.y:this.scrollbar.x);const u=s[d.units.rectStart],f=s[d.units.rectEnd];let m,g;if(h!=null&&h.use&&((y=d==null?void 0:d.labels)!=null&&y.length)){const{type:b,range:k,interval:T=1}=h,[w,M]=k??[0,d.labels.length],V=Math.floor((+M-+w)/T)+1,x=(f-u)/V,L=Math.floor(((e==="yAxis"||r?i:n)-u)/x);b==="step"?m=w+L:m=(d==null?void 0:d.labels.findIndex(v=>v===+w))+L}else if((C=d==null?void 0:d.labels)!=null&&C.length){const b=(f-u)/d.labels.length,T=Math.floor(((e==="yAxis"?i:n)-u)/b);m=d.labels.length>T?T:-1}else{let b,k;n<u-a?(b=u,k=0):n>f+a?(b=f,k=this.data.labels.length-1):b=n,g=this.getHitItemByPosition([b,i],c==null?void 0:c.useApproximateValue,k,!0,!0),m=g.dataIndex??-1}return{labelIndex:m,hitInfo:g}},getCurMouseLabelVal(t,e,n){const{type:i,horizontal:s}=this.options,l=t==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let u="";switch(i){case"bar":case"line":{u=s&&!l||!s&&l?this.data.labels[n]:"";break}case"heatMap":{u=this.data.labels[a][n];break}}return u},h=()=>{let u="";const f={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},{steps:m,interval:g,graphMin:p}=this.axesSteps[a][0],{width:y,height:C}=this.axesRange[a][0].size,b=l?this.axesX:this.axesY,k=f[b[0].units.rectStart],T=f[b[0].units.rectEnd],w=Math.abs(e[l?0:1]-k),M=(l?y:C)/2,V=Math.abs(k-T)/m,x=Math.floor((w+M)/V);return V*x+M>w&&V*x-M<w&&(u=x*g+p),u};return typeof n=="number"&&(r=d(),c=n),r||(r=h(),c=-1),{labelVal:r,labelIdx:c}},getStoreMinMax(){const t=Object.keys(this.seriesList),e=this.options.horizontal,n={x:[{min:null,max:null}],y:[{min:null,max:null}]};return t.length?t.reduce((i,s)=>{const l=i,a=this.seriesList[s],r=a.minMax,c=a.xAxisIndex,d=a.yAxisIndex;if(l.x[c]||(l.x[c]={min:null,max:null,maxSID:null}),l.y[d]||(l.y[d]={min:null,max:null,maxSID:null}),r&&a.show){e?((l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY));const h=this.seriesList[s].isExistGrp,u=l.x[c].max<0;(h&&u||!l.x[c].max||r.maxX>=l.x[c].max)&&(l.x[c].max=r.maxX,l.x[c].maxSID=s);const f=l.y[d].max<0;(h&&f||!l.y[d].max||r.maxY>=l.y[d].max)&&(l.y[d].max=r.maxY,l.y[d].maxSID=s)}return l},{x:[{min:null,max:null,maxSID:null}],y:[{min:null,max:null,maxSID:null}]}):n},calculateAngle(){const t=this.pieDataSet;let e,n,i,s,l,a,r,c,d;const h=[],u={"$ev-root":1.5*Math.PI};for(let f=0;f<t.length;f++){const m=t[f];d=!0;for(let g=0;g<m.data.length;g++)if(e=m.data[g],n=e.value,d&&(d=e.id==="dummy"),!f)a=u["$ev-root"],l=2*Math.PI*(n/m.total),r=a+l,e.sa=a,e.ea=r,u["$ev-root"]+=l;else{if(i=this.getParentInfo(f-1,e.parent),!i)break;u[e.parent]||(u[e.parent]=i.sa),a=u[e.parent],c=i.ea-i.sa,s=m.total[e.parent]||0,l=c*(n/s),r=a+l,e.sa=a,e.ea=r,u[e.parent]+=l}d&&h.push(f)}for(let f=0;f<h.length;f++)this.pieDataSet.splice(h,1);this.options.reverse&&(this.pieDataSet=mb(this.pieDataSet))},getParentInfo(t,e){for(let n=t;n>=0;n--){const i=this.pieDataSet[n];for(let s=0;s<i.data.length;s++)if(i.data[s].id===e)return i.data[s]}return null},getAggregations(){const t=this.data.data,e=this.data.series,n={},i=Object.keys(e);return i==null||i.forEach(s=>{const l=t[s].map(f=>f!=null&&f.value?f.value:f),a=l[l.length-1],r=l.filter(f=>f!=null),c=Math.min(...r),d=Math.max(...r),h=r.reduce((f,m)=>f+m,0),u=h/r.length||0;(!O.checkSafeInteger(c)||!O.checkSafeInteger(d)||!O.checkSafeInteger(u)||!O.checkSafeInteger(h)||!O.checkSafeInteger(a))&&console.warn("[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991."),n[s]={min:c,max:d,avg:u,total:h,last:a}}),n}},jS={x:{rectStart:"x1",rectEnd:"x2",rectOffsetCounter:t=>t==="top"?"y2":"y1",rectOffset:t=>t==="top"?"y1":"y2"},y:{rectStart:"y2",rectEnd:"y1",rectOffsetCounter:t=>t==="left"?"x2":"x1",rectOffset:t=>t==="left"?"x1":"x2"}},Ht=["#2b99f0","#8ac449","#00C4C5","#ffde00","#ff7781","#8470ff","#75cd8e","#48d1cc","#fec64f","#fe984f","#0052ff","#00a48c","#83cfde","#dfe32d","#ff7d40","#99c7ff","#a5fee3","#0379c9","#eef093","#ffa891","#00c5cd","#009bc7","#cacaff","#ffc125","#df6264"],gi={show:!0,highlight:{defaultSize:4,maxSize:6,maxShadowSize:10,maxShadowOpacity:.4},xAxisIndex:0,yAxisIndex:0,point:!0,pointHighlight:!0,pointSize:3,pointStyle:"",lineWidth:2,fill:!1,fillOpacity:.4,showLegend:!0,passingValue:null,interpolation:"none"},QS={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},$S={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},Yr={min:null,max:null,autoScaleRatio:null,startToZero:!1,showAxis:!0,axisLineColor:"#C9CFDC",axisLineWidth:1,showGrid:!0,gridLineColor:"#C9CFDC",showAxisTick:!0,showIndicator:!1,timeFormat:"mm:ss",range:null,interval:null,decimalPoint:"auto",fixedSteps:!1,scaleChange:!1,labelStyle:{show:!0,fontSize:12,color:"#25262E",fontFamily:"Roboto",fontWeight:400,fitWidth:!1,fitDir:"right",alignToGridLine:!1,padding:0,fixWidth:void 0},showLastLabel:!1,lastLabelFontStyle:null,firstLabelFontStyle:null,title:{use:!1,text:null,fontWeight:400,fontSize:12,fontFamily:"Roboto",textAlign:"right",fontStyle:"normal",color:"#808080"},scrollbar:{use:!1,width:14,height:14,background:"#F2F2F2",showButton:!0,thumbStyle:{background:"#929292",radius:0}}},Or={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null,text:null,borderRadius:0,gap:null,padding:null,pointer:{show:!1,color:null},position:"outside",showValue:!1,responsive:{valueOnlyBelow:null,hideBelow:null},showTextOnHover:{use:!1,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:null,borderRadius:4,fontSize:12,fontWeight:400,fontFamily:"Roboto",useShadow:!1,shadowOpacity:.25,padding:{top:4,right:8,bottom:4,left:8}}},Ao={color:"#FF0000",lineWidth:1,label:Or},Ko={color:"#FAE59D",border:null},qS={show:!0,xAxisIndex:0,yAxisIndex:0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:0},highlight:{stroke:{use:!1,color:null,width:1,radius:0},shadow:{use:!0,offsetX:0,offsetY:0,blur:4,color:"#959494"}}},Ct={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:26784e5,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},eC=Object.freeze([1,2,5]),Hr=["cross","crossRot","star","line"],q={calculateX(t,e,n,i,s=0){if(t==null||t>n||t<e)return null;const l=i/(n-e);return Math.ceil(s+l*(t-e))},calculateSubX(t,e,n,i,s=0){if(t==null)return null;const l=i/(n-e);return Math.ceil(s+l*(t-e))},calculateY(t,e,n,i,s=0){let l;if(t==null||t>n||t<e)return null;const a=i/(n-e);return s?l=s-a*(t-(e||0)):l=-(a*(t-(e||0))),Math.floor(l)},drawPoint(t,e,n,i,s){if(!(isNaN(n)||n<=0)){if(e==="rect"){const l=1/Math.SQRT2*n;t.fillRect(i-l,s-l,2*l,2*l),t.strokeRect(i-l,s-l,2*l,2*l);return}t.beginPath(),this._appendPointPath(t,e,n,i,s),Hr.includes(e)||t.fill(),t.stroke()}},_appendPointPath(t,e,n,i,s){let l,a,r,c,d,h,u,f,m;switch(e){case"triangle":l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,t.moveTo(i-l/2,s+c/3),t.lineTo(i+l/2,s+c/3),t.lineTo(i,s-2*c/3),t.closePath();break;case"rectRounded":h=n/Math.SQRT2,u=i-h,f=s-h,m=Math.SQRT2*n,this.roundedRect(t,u,f,m,m,n/2),t.closePath();break;case"rectRot":d=1/Math.SQRT2*n,t.moveTo(i-d,s),t.lineTo(i,s+d),t.lineTo(i+d,s),t.lineTo(i,s-d),t.closePath();break;case"cross":t.moveTo(i,s+n),t.lineTo(i,s-n),t.moveTo(i-n,s),t.lineTo(i+n,s),t.closePath();break;case"crossRot":a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i-a,s+r),t.lineTo(i+a,s-r),t.closePath();break;case"star":t.moveTo(i,s+n),t.lineTo(i,s-n),t.moveTo(i-n,s),t.lineTo(i+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i-a,s+r),t.lineTo(i+a,s-r),t.closePath();break;case"line":t.moveTo(i-n,s),t.lineTo(i+n,s),t.closePath();break;default:t.moveTo(i+n,s),t.arc(i,s,n,0,Math.PI*2);break}},drawPointBatch(t,e,n,i){if(!(isNaN(n)||n<=0||!i||!i.length)){if(e==="rect"){const s=1/Math.SQRT2*n;for(let l=0;l<i.length;l++)t.fillRect(i[l].xp-s,i[l].yp-s,2*s,2*s),t.strokeRect(i[l].xp-s,i[l].yp-s,2*s,2*s);return}t.beginPath();for(let s=0;s<i.length;s++)this._appendPointPath(t,e,n,i[s].xp,i[s].yp);Hr.includes(e)||t.fill(),t.stroke()}},roundedRect(t,e,n,i,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,i/2),d=e+c,h=n+c,u=e+i-c,f=n+s-c;t.moveTo(e,h),d<u&&h<f?(t.arc(d,h,c,-a,-r),t.arc(u,h,c,-r,0),t.arc(u,f,c,0,r),t.arc(d,f,c,r,a)):d<u?(t.moveTo(d,n),t.arc(u,h,c,-r,r),t.arc(d,h,c,r,a+r)):h<f?(t.arc(d,h,c,-a,0),t.arc(d,f,c,0,a)):t.arc(d,h,c,-a,a),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,s)},createGradient(t,e,n,i,s,l){const{x:a,y:r,w:c,h:d}=n;let h;e?h=t.createLinearGradient(a,0,a+c,0):h=t.createLinearGradient(0,r,0,r+d);for(let u=0;u<i.length;u++){const f=i[u][0]??0,m=i[u][1]??"rgba(255, 255, 255, 0)",g=m.includes("rgba")?O.getOpacity(m):1,p=s?l:g;h.addColorStop(f,O.colorStringToRgba(m,p))}return h}},tC=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),Fr=Math.PI*2;class nC{constructor(e,n,i){const s=Xe({},n,gi);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:Ht[i%Ht.length])}),this.type="line",this.sId=e,this.extent={downplay:{opacity:.3,lineWidth:1},normal:{opacity:1,lineWidth:1},highlight:{opacity:1,lineWidth:2}},this.data=[],this.beforeMouseXp=0,this.beforeMouseYp=0,this.beforeFindItemIndex=-1,this.size={comboOffset:0}}useLinearInterpolation(){return this.interpolation==="linear"||this.interpolation==="none"&&!!this.passingValue&&this.hasPassingValueInData}_getValidGData(){const e=this.data,n=this._validGDataCache;if(n&&n.src===e&&n.length===e.length)return n.value;const i=e.filter(s=>!O.isNullOrUndefined(s.x));return this._validGDataCache={src:e,length:e.length,value:i},i}computeGeometry(e){if(!this.show)return;const n=e.scaleVersion!=null&&e.dataEpoch!=null;if(n&&this._lastDataEpoch===e.dataEpoch&&this._lastScaleVersion===e.scaleVersion&&this._lastGeomData===this.data)return;const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=e,r=this.useLinearInterpolation();let c=0;const d=l.x[this.xAxisIndex],h=l.y[this.yAxisIndex];let u=i.chartWidth-(s.left+s.right);const f=i.chartHeight-(s.top+s.bottom);this.combo&&(c=u/(this.data.length||1),u-=c,this.size.comboOffset=c);const m=i.x1+s.left+c/2,g=i.y2-s.bottom,p=d.graphMin,y=d.graphMax,C=h.graphMin,b=h.graphMax,k=u/(y-p),T=f/(b-C),w=C||0,M=x=>x==null||x<p||x>y?null:Math.ceil(m+k*(x-p)),V=x=>{const S=a&&x>b?b:x;return S==null||S<C||S>b?null:Math.floor(g?g-T*(S-w):-(T*(S-w)))};for(let x=0;x<this.data.length;x++){const S=this.data[x];let L=M(S.x),I=V(S.y);this.isExistGrp&&r&&S.o===null&&(I=V(S.b??0)),L!==null&&(L+=O.aliasPixel(L)),S.xp=L,S.yp=I}n&&(this._lastDataEpoch=e.dataEpoch,this._lastScaleVersion=e.scaleVersion,this._lastGeomData=this.data)}hasRenderableValue(){return this.data.some(e=>e.o!==null&&e.o!==void 0)}draw(e){var Y,H,K,D,z,_,ee,J,te;if(!this.show)return;const{ctx:n,chartRect:i,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h,displayOverflow:u}=e;if(this.computeGeometry(e),!this.hasRenderableValue()&&!this.isExistGrp)return;const f=a==null?void 0:a.option,m=(f==null?void 0:f.use)&&(f==null?void 0:f.useSeriesOpacity),g=((Y=a==null?void 0:a.selected)==null?void 0:Y.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((H=r==null?void 0:r.option)!=null&&H.use&&((D=(K=r==null?void 0:r.selected)==null?void 0:K.seriesId)!=null&&D.length)){const U=(_=(z=r==null?void 0:r.selected)==null?void 0:z.seriesId)==null?void 0:_.includes(this.sId);p=this.extent[U?"highlight":"downplay"]}else m&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const y=U=>U!=null&&U.includes("rgba")?O.getOpacity(U):p.opacity,C=this.color,b=y(C),k=this.pointFill,T=y(k),w=this.extent.downplay?this.fillOpacity*p.opacity:this.fillOpacity,M=this.lineWidth*p.lineWidth,V=this._rgbaCache||(this._rgbaCache={}),x=(U,ne,Q)=>{const $=V[U];if($!==void 0&&$.s===ne&&$.o===Q)return $.v;const j=O.colorStringToRgba(ne,Q);return V[U]={s:ne,o:Q,v:j},j};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=x("stroke",C,b),this.segments&&n.setLineDash(this.segments);const S=this.useLinearInterpolation();let L=0;const I=l.x[this.xAxisIndex],v=l.y[this.yAxisIndex];let W=i.chartWidth-(s.left+s.right);const E=i.chartHeight-(s.top+s.bottom);this.combo&&(L=W/(this.data.length||1),W-=L,this.size.comboOffset=L);const G=i.x1+s.left+L/2,R=i.y2-s.bottom,X=U=>q.calculateX(U,I.graphMin,I.graphMax,W,G),Z=U=>q.calculateY(u&&U>v.graphMax?v.graphMax:U,v.graphMin,v.graphMax,E,R);let N,P=null,B=null;for(let U=0;U<this.data.length;U++){const ne=this.data[U],Q=ne.xp,$=ne.yp;S&&ne.o===null||(Q===null||$===null?N=void 0:(Yt(N==null?void 0:N.y)&&!this.isExistGrp||!S&&(Yt(N==null?void 0:N.y)||Yt(ne.o))?(n.moveTo(Q,$),P=Q,B=$):(Q!==P||$!==B)&&(n.lineTo(Q,$),P=Q,B=$),N=ne))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const U=this.data.some(ae=>ae.o<0),ne=U?Z(0):i.y2-s.bottom,Q=x("fill",this.fillColor||C,w);if((ee=this.fill)!=null&&ee.gradient){let ae=this.data[0].yp,xe=this.data[0].y;this.data.forEach(re=>{re.yp&&re.yp<=ae?ae=re.yp:re.y&&re.y>=xe&&(xe=re.y)});const be=n.createLinearGradient(0,i.y2,0,ae),oe=p.opacity<1?Q:C;be.addColorStop(0,U?oe:Q),be.addColorStop(.5,Q),be.addColorStop(1,oe),n.fillStyle=be}else n.fillStyle=Q;let $=null,j=null;const he=[],me=this.data.length;for(let ae=0;ae<me+1;ae++){const xe=(J=this.data[ae])==null?void 0:J.o;if(S&&hb(xe)||!S&&Yt(xe)){if($!==null&&j!==null){let be=$-1;for(let oe=ae-1;oe>=$;oe--){const re=(te=this.data[oe])==null?void 0:te.o;if(!Yt(re)&&re!==null){be=oe;break}}he.push([$,be]),$=null,j=null}}else S&&xe===null||($=$===null?ae:$),j=ae}he.forEach(([ae,xe])=>{if(ae===xe){const oe=this.data[ae];if(oe.xp===null||oe.yp===null)return;n.moveTo(oe.xp-M,oe.yp),n.lineTo(oe.xp+M,oe.yp),n.lineTo(oe.xp+M,Z(oe.b)??ne);return}let be=!1;for(let oe=ae;oe<=xe;oe++){const re=this.data[oe];if(re.xp!==null&&re.yp!==null&&(be?re.o!==null&&n.lineTo(re.xp,re.yp):(n.moveTo(re.xp,re.yp),be=!0)),oe===xe)for(let Ie=xe;Ie>=ae;Ie--){const Ee=this.data[Ie],kt=X(Ee.x);if(kt!==null&&Ee.o!==null){const Vt=Z(Ee.b)??Z(0);n.lineTo(kt,Vt)}}}}),n.fill()}if(!d){n.strokeStyle=x("stroke",C,b);const U=x("focus",k,1),ne=x("blur",k,T);let Q=!1;if(this.interpolation==="linear"){let oe=0;for(let re=0;re<this.data.length&&!(this.data[re].o!==null&&(oe++,oe>1));re++);Q=oe===1}const $=g.length?new Set(g):null,j=this.pointSize,he=this.pointStyle,me=this.data,ae=me.length,xe=!tC.has(he),be=oe=>{const re=me[oe];if(re.xp===null||re.yp===null||re.o===null)return 0;let pe;if(Q)pe=!0;else if(S)pe=!1;else{const Ee=oe>0?me[oe-1].o:null,kt=oe+1<ae?me[oe+1].o:null;pe=Ee==null&&kt==null}const Ie=$?$.has(oe):!1;return this.point||pe||Ie?Ie&&!c?2:1:0};if(xe){let oe=!1,re=null;for(let pe=0;pe<ae;pe++){const Ie=be(pe);if(Ie!==0){const Ee=me[pe];Ie===2?(re===null&&(re=[]),re.push(Ee)):(oe||(n.beginPath(),oe=!0),n.moveTo(Ee.xp+j,Ee.yp),n.arc(Ee.xp,Ee.yp,j,0,Fr))}}if(oe&&(n.fillStyle=ne,n.fill(),n.stroke()),re!==null){n.beginPath();for(let pe=0;pe<re.length;pe++){const Ie=re[pe];n.moveTo(Ie.xp+j,Ie.yp),n.arc(Ie.xp,Ie.yp,j,0,Fr)}n.fillStyle=U,n.fill(),n.stroke()}}else{let oe=null,re=null;for(let pe=0;pe<ae;pe++){const Ie=be(pe);if(Ie!==0){const Ee=me[pe];Ie===2?(re===null&&(re=[]),re.push(Ee)):(oe===null&&(oe=[]),oe.push(Ee))}}oe!==null&&(n.fillStyle=ne,q.drawPointBatch(n,he,j,oe)),re!==null&&(n.fillStyle=U,q.drawPointBatch(n,he,j,re))}}n.restore()}itemHighlight(e,n){const i=e.data,s=n,{xp:l,yp:a,o:r}=i;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=O.colorStringToRgba(this.color,0),s.fillStyle=O.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),q.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,q.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",q.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(e,n,i,s){var f;const l=e[0],a=e[1],r={data:null,hit:!1,color:this.color},c=this._getValidGData(),d=this.useLinearInterpolation(),h=Math.max((this.pointSize??gi.pointSize)+gi.pointSize,gi.highlight.maxSize),u=m=>{if(!m||m.xp===void 0||m.yp===void 0)return!1;const g=l-m.xp,p=a-m.yp;return g*g+p*p<=h*h};if(c!=null&&c.length)if(typeof i=="number"&&this.show){if(r.data=c[i],r.index=i,r.data){const m=c[i];m.o!==null&&m.o!==void 0&&m.yp!==null&&m.yp!==void 0&&(Math.abs(a-m.yp)<=15&&(r.hit=!0),u(m)&&(r.hit=!0,r.directHit=!0))}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let m=1/0,g=-1;const p=[];c.forEach((k,T)=>{k.xp!==null&&k.yp!==null&&k.o!==null&&p.push({...k,originalIndex:T})}),p.length===0&&c.forEach((k,T)=>{p.push({...k,originalIndex:T})});let y=0,C=p.length-1;for(;y<=C;){const k=Math.floor((y+C)/2),T=p[k],w=Math.abs(l-T.xp);if(w<m&&(m=w,g=T.originalIndex),T.xp<l){if(y=k+1,y<p.length){const M=Math.abs(l-p[y].xp);M<m&&(m=M,g=p[y].originalIndex)}}else if(T.xp>l){if(C=k-1,C>=0){const M=Math.abs(l-p[C].xp);M<m&&(m=M,g=p[C].originalIndex)}}else break}const b=p.findIndex(k=>k.originalIndex===g);if(b!==-1)for(let k=Math.max(0,b-2);k<=Math.min(p.length-1,b+2);k++){const T=p[k],w=Math.abs(l-T.xp);w<m&&(m=w,g=T.originalIndex)}if(g!==-1){let k=50;if(c.length>1){const w=[];for(let M=1;M<c.length;M++)c[M].xp!==null&&c[M-1].xp!==null&&w.push(Math.abs(c[M].xp-c[M-1].xp));w.length>0&&(k=w.reduce((M,V)=>M+V,0)/w.length)}const T=Math.max(k,1);if(m<=T)r.data=c[g],r.index=g;else{let w=!1,M=d?1/0:T;const V=d?p:c;for(let x=0;x<V.length;x++){const S=Math.abs(l-V[x].xp);S<=M&&(w=!0,M=S,g=d?V[x].originalIndex:x)}w&&(r.data=c[g],r.index=g)}if(r.data){const w=c[g];Math.abs(a-w.yp)<=15&&(r.hit=!0),u(w)&&(r.hit=!0,r.directHit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((f=r==null?void 0:r.data)==null?void 0:f.o)===null&&(r.data=null),r}findApproximateData(e){var f,m;const n=e[0],i=e[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(g=>!O.isNullOrUndefined(g.x));if(!l.length)return s;const a=l.length>1?Math.abs(((f=l[1])==null?void 0:f.xp)-((m=l[0])==null?void 0:m.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,u=1/0;for(;c<=d;){const g=Math.floor((c+d)/2),p=l[g].xp;if(p-r<=n&&n<=p+r){const y=Math.max(0,g-2),C=Math.min(l.length-1,g+2);for(let b=y;b<=C;b++)if(l[b].xp!==null&&l[b].yp!==null){const k=Math.sqrt((n-l[b].xp)**2+(i-l[b].yp)**2);k<u&&(u=k,h=b)}return h!==-1&&(s.data=l[h],s.index=h,u<5&&(s.hit=!0)),s}else if(p+r<n){if(g<d&&n<l[g+1].xp){const y=Math.abs(l[g].xp-n),C=Math.abs(l[g+1].xp-n);s.data=y>C?l[g+1]:l[g],s.index=y>C?g+1:g;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}c=g+1}else{if(g>0&&n>l[g-1].xp){const y=Math.abs(l[g-1].xp-n),C=Math.abs(l[g].xp-n);s.data=y>C?l[g]:l[g-1],s.index=y>C?g:g-1;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}d=g-1}}return s}findItems({xsp:e,width:n}){const i=e+n;return this.data.filter(s=>e-1<=s.xp&&s.xp<=i+1)}}class iC{constructor(e,n,i,s=!1){const l=vo({},gi,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=Ht[i%Ht.length])}),this.sId=e,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(e,n){const i=`${e}_${n}`;if(this._colorCache.has(i))return this._colorCache.get(i);const s=O.colorStringToRgba(e,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(i,s),s}draw(e){this.show&&(this.computeGeometry(e),this.realTimeScatter?this.realTimeScatterDraw(e):this.defaultScatterDraw(e))}computeGeometry(e){this.show&&(this.realTimeScatter?this.computeRealTimeGeometry(e):this.computeDefaultGeometry(e))}computeDefaultGeometry(e){const{duple:n,legendHitInfo:i,coordinateDedupe:s}=e,l=new Set,a=s!==!1;for(let r=0;r<this.data.length;r++){const c=this.data[r],d=O.coordinateKey(c.x,c.y);let h;i?h=i.sId===this.sId:a?h=n.get(d)===this.sId&&!l.has(d):h=!0,h&&(this.calcItem(c,e),c.xp!==null&&c.yp!==null&&a&&!i&&l.add(d))}}computeRealTimeGeometry(e){var r,c,d,h,u,f;const{duple:n,legendHitInfo:i,coordinateDedupe:s}=e,l=s!==!1;let a=0;for(let m=0;m<((c=(r=this.data[this.sId])==null?void 0:r.dataGroup)==null?void 0:c.length);m++)for(let g=0;g<((h=(d=this.data[this.sId])==null?void 0:d.dataGroup[m])==null?void 0:h.data.length);g++){const p=(f=(u=this.data[this.sId])==null?void 0:u.dataGroup[m])==null?void 0:f.data[g];a++;let y;i?y=i.sId===this.sId:l?y=n.get(O.coordinateKey(p.x,p.y))===this.sId:y=!0,y&&this.calcItem(p,e)}this._rtTotalCount=a}getOpacity(e,n,i){const s=n.includes("rgba")?O.getOpacity(n):1;let l=!1;const{selectInfo:a,legendHitInfo:r,unSelectedOpacity:c}=e;return r?l=r.sId!==this.sId:a&&(l=(a==null?void 0:a.seriesID)!==this.sId||(a==null?void 0:a.dataIndex)!==i),l?c:s}calcItem(e,n){const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=n,r=l.x[this.xAxisIndex],c=l.y[this.yAxisIndex],d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=this.realTimeScatter?n.rtXOffsetCss??0:0,f=i.x1+s.left+u,m=i.y2-s.bottom;let g=q.calculateX(e.x,r.graphMin,r.graphMax,d,f);const p=q.calculateY(a&&e.y>c.graphMax?c.graphMax:e.y,c.graphMin,c.graphMax,h,m);g!==null&&!this.realTimeScatter&&(g+=O.aliasPixel(g)),e.xp=g,e.yp=p}defaultScatterDraw(e){const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=e,r=i.y[this.yAxisIndex],c=new Set,d=a!==!1,h=d&&!l,u=h?new Map:null;for(let f=0;f<this.data.length;f++){const m=this.data[f],g=f,p=O.coordinateKey(m.x,m.y);let y;if(l?y=l.sId===this.sId:d?y=s.get(p)===this.sId&&!c.has(p):y=!0,y&&m.xp!==null&&m.yp!==null){const b=m.y>r.graphMax&&this.overflowColor||m.dataColor||this.color,k=this.getOpacity(e,b,g),T=this.getCachedColor(b,k),w=m.dataColor||this.pointFill,M=this.getOpacity(e,w,g),V=this.getCachedColor(w,M);if(h){const x=`${T} ${V}`;let S=u.get(x);S||(S={strokeStyle:T,fillStyle:V,points:[]},u.set(x,S)),S.points.push(m),c.add(p)}else n.strokeStyle=T,n.fillStyle=V,q.drawPoint(n,this.pointStyle,this.pointSize,m.xp,m.yp)}}h&&u.forEach(f=>{n.strokeStyle=f.strokeStyle,n.fillStyle=f.fillStyle,q.drawPointBatch(n,this.pointStyle,this.pointSize,f.points)})}realTimeScatterDraw(e){var g,p,y,C,b,k;const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=e,r=i.y[this.yAxisIndex],c=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,d=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;let h=0;const u=a!==!1,f=u&&!l,m=f?new Map:null;for(let T=0;T<((p=(g=this.data[this.sId])==null?void 0:g.dataGroup)==null?void 0:p.length);T++)for(let w=0;w<((C=(y=this.data[this.sId])==null?void 0:y.dataGroup[T])==null?void 0:C.data.length);w++){const M=(k=(b=this.data[this.sId])==null?void 0:b.dataGroup[T])==null?void 0:k.data[w];h++;let V;if(l?V=l.sId===this.sId:u?V=s.get(M.k??O.coordinateKey(M.x,M.y))===this.sId:V=!0,V&&M.xp!==null&&M.yp!==null){const x=M.y>r.graphMax&&this.overflowColor,S=x||M.color||this.color,L=x||M.color||this.pointFill||this.color,I=this.getOpacity(e,S,w),v=this.getOpacity(e,L,w),W=this.getCachedColor(S,I),E=this.getCachedColor(L,v);if(f){const G=`${W} ${E}`;let R=m.get(G);R||(R={strokeStyle:W,fillStyle:E,points:[]},m.set(G,R)),R.points.push(M)}else n.strokeStyle=W,n.fillStyle=E,q.drawPoint(n,c,d,M.xp,M.yp);e.markDrawn&&(M.drawn=!0)}}f&&m.forEach(T=>{n.strokeStyle=T.strokeStyle,n.fillStyle=T.fillStyle,q.drawPointBatch(n,c,d,T.points)}),this._rtTotalCount=h}realTimeScatterDrawStrip(e,n,i){var u;if(!this.show)return;const s=(u=this.data[this.sId])==null?void 0:u.dataGroup;if(!s)return;const{duple:l,coordinateDedupe:a}=i,r=a!==!1&&!!l,c=i.axesSteps.y[this.yAxisIndex],d=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,h=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;for(let f=0;f<n.length;f++){const m=s[n[f]];if(m!=null&&m.data)for(let g=0;g<m.data.length;g++){const p=m.data[g];if(!p.drawn&&!(r&&l.get(p.k??O.coordinateKey(p.x,p.y))!==this.sId)&&(this.calcItem(p,i),p.xp!==null&&p.yp!==null)){const y=p.y>c.graphMax&&this.overflowColor,C=y||p.color||this.color,b=y||p.color||this.pointFill||this.color,k=this.getOpacity(i,C,g),T=this.getOpacity(i,b,g);e.strokeStyle=this.getCachedColor(C,k),e.fillStyle=this.getCachedColor(b,T),q.drawPoint(e,d,h,p.xp,p.yp),p.drawn=!0}}}}refreshRtHitCoords(e){var i,s;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let l=0;l<n.length;l++){const a=(s=n[l])==null?void 0:s.data;if(a)for(let r=0;r<a.length;r++)this.calcItem(a[r],e)}}refreshRtTotalCount(){var i,s,l;let e=0;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let a=0;a<n.length;a++)e+=((l=(s=n[a])==null?void 0:s.data)==null?void 0:l.length)??0;return this._rtTotalCount=e,e}findItemsInRange(e,n,i,s,l){return e.filter(a=>n-1<=a.xp&&a.xp<=s+1&&i-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(e,n,i,s,l){return this.findItemsInRange(e,n,i,s,l)}realTimeScatterFindItems(e,n,i,s,l){const a=[];for(let r=0;r<e[this.sId].dataGroup.length;r++){const c=e[this.sId].dataGroup[r];a.push(...this.findItemsInRange(c.data,n,i,s,l))}return a}findItems({xsp:e,ysp:n,width:i,height:s}){const l=this.data,a=e+i,r=n+s;let c=[];return this.realTimeScatter?c=this.realTimeScatterFindItems(l,e,n,a,r):c=this.defaultScatterFindItems(l,e,n,a,r),c}itemHighlight(e,n){const i=e.data,s=n,l=i.xp,a=i.yp;if(s.save(),l!==null&&a!==null){const r=i.dataColor||this.color,c=i.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),q.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,q.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",q.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(e){var c;const n=e[0],i=e[1],s={data:null,hit:!1,color:this.color,index:null},l=this.pointSize;if(this.realTimeScatter){const d=(c=this.data[this.sId])==null?void 0:c.dataGroup;if(!d)return s;let u=this._rtTotalCount-1;for(let f=d.length-1;f>=0;f--){const m=d[f];if(m!=null&&m.data)for(let g=m.data.length-1;g>=0;g--){const p=m.data[g];if(p.xp!==null&&p.yp!==null){const y=p.xp,C=p.yp;if(y-l<=n&&n<=y+l&&C-l<=i&&i<=C+l)return s.data=p,s.index=u,s.hit=!0,s}u--}}return s}const a=this.data,r=a.findIndex(d=>{const h=d.xp,u=d.yp;return h-l<=n&&n<=h+l&&u-l<=i&&i<=u+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class zr{constructor(e,n,i,s){const l=Xe({},n,QS);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Ht[i%Ht.length]),this.type="bar",this.sId=e,this.data=[],this.isHorizontal=s,this.size={cat:0,bar:0,cPad:0,bPad:0,w:0,h:0,ix:0}}computeGeometry(e){if(!this.show)return;const n=e.scaleVersion!=null&&e.dataEpoch!=null,i=e.showIndex??0,s=e.showSeriesCount??0;if(n&&this._lastDataEpoch===e.dataEpoch&&this._lastScaleVersion===e.scaleVersion&&this._lastShowIndex===i&&this._lastShowSeriesCount===s&&this._lastGeomData===this.data)return;const l=e.chartRect,a=e.labelOffset,r=e.axesSteps,c=e.showIndex,d=e.thickness,h=e.showSeriesCount;this.isHorizontal=e.isHorizontal;const{isHorizontal:u}=this;let f,m;const g=r.x[this.xAxisIndex],p=r.y[this.yAxisIndex];let y=this.data.length;const[C,b]=u?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex];ve(C)&&ve(b)&&(y=b-C+1);const k=l.chartWidth-(a.left+a.right),T=l.chartHeight-(a.top+a.bottom),w=l.x1+a.left,M=l.y2-a.bottom,V=q.calculateX(0,g.graphMin,g.graphMax,k),x=q.calculateY(0,p.graphMin,p.graphMax,T),S=u?w+V:w,L=u?M:M+x,I=u?T:k,v=I/(y||1);let W;e.cPadRatio>=1||e.cPadRatio<=0?W=2:W=Math.max(I*(e.cPadRatio/2)/y,2);let G,R,X;G=v>W*2?v-W*2:v,G=this.isExistGrp?G:G/h;const Z=this.calculateBarSize(d,G);R=u?null:Z,X=u?Z:null;const N=u?(G-X)/2:(G-R)/2,P=this.isExistGrp?1:c+1;this.size.cat=v,this.size.bar=G,this.size.cPad=W,this.size.bPad=N,this.size.w=R,this.size.h=X,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=e.borderRadius,this.filteredCount=y;const B=ve(C)?C:0,Y=ve(b)?b:this.data.length-1;this.visibleStartIndex=B;for(let H=B;H<=Y;H++){const K=H-B,D=this.data[H];if(D){const z=u?L-v*K-W:S+v*K+W;if(u?(f=S,m=Math.round(z-(G*P-(X+N)))):(f=Math.round(z+(G*P-(R+N))),m=L),u){const _=D.b?D.o:D.x,ee=e.displayOverflow&&_>g.graphMax?g.graphMax:_;R=q.calculateX(ee,g.graphMin,g.graphMax,k,-V),D.b&&(f=q.calculateX(D.b,g.graphMin,g.graphMax,k,S-V));const J=_>0?-1:1;R=_&&R!==null&&Math.abs(R)===0?J:R}else{const _=D.b?D.o:D.y,ee=e.displayOverflow&&_>p.graphMax?p.graphMax:_;X=q.calculateY(ee,p.graphMin,p.graphMax,T,-x),D.b&&(m=q.calculateY(D.b,p.graphMin,p.graphMax,T,L-x));const J=_>0?-1:1;X=_&&X!==null&&Math.abs(X)===0?J:X}D.xp=f,D.yp=m,D.w=R,D.h=u?-X:X,D.index=H}}n&&(this._lastDataEpoch=e.dataEpoch,this._lastScaleVersion=e.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(e){var K,D,z,_,ee;if(!this.show)return;this.computeGeometry(e);const n=e.ctx,i=e.chartRect,s=e.labelOffset,l=e.axesSteps,a=e.showIndex,r=e.thickness,c=e.showSeriesCount,d=e.displayOverflow;this.isHorizontal=e.isHorizontal;const{isHorizontal:h,showValue:u}=this;let f,m;const g=l.x[this.xAxisIndex],p=l.y[this.yAxisIndex],[y,C]=h?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex],b=ve(y)&&ve(C),k=b?y:0,T=b?C:this.data.length-1,w=T-k+1,M=i.chartWidth-(s.left+s.right),V=i.chartHeight-(s.top+s.bottom),x=i.x1+s.left,S=i.y2-s.bottom,L=q.calculateX(0,g.graphMin,g.graphMax,M),I=q.calculateY(0,p.graphMin,p.graphMax,V),v=h?x+L:x,W=h?S:S+I,E=h?V:M,G=E/(w||1);let R;e.cPadRatio>=1||e.cPadRatio<=0?R=2:R=Math.max(E*(e.cPadRatio/2)/w,2);let Z,N,P;Z=G>R*2?G-R*2:G,Z=this.isExistGrp?Z:Z/c;const B=this.calculateBarSize(r,Z);N=h?null:B,P=h?B:null;const Y=h?(Z-P)/2:(Z-N)/2,H=this.isExistGrp?1:a+1;this.size.cat=G,this.size.bar=Z,this.size.cPad=R,this.size.bPad=Y,this.size.w=N,this.size.h=P,this.size.ix=H,this.chartRect=i,this.labelOffset=s,this.borderRadius=e.borderRadius,this.filteredCount=w,this.visibleStartIndex=k;for(let J=k;J<=T;J++){const te=J-k,U=this.data[J];if(U){const ne=h?W-G*te-R:v+G*te+R;if(h?(f=v,m=Math.round(ne-(Z*H-(P+Y)))):(f=Math.round(ne+(Z*H-(N+Y))),m=W),h){const oe=U.b?U.o:U.x,re=d&&oe>g.graphMax?g.graphMax:oe;N=q.calculateX(re,g.graphMin,g.graphMax,M,-L),U.b&&(f=q.calculateX(U.b,g.graphMin,g.graphMax,M,v-L));const pe=oe>0?-1:1;N=oe&&N!==null&&Math.abs(N)===0?pe:N}else{const oe=U.b?U.o:U.y,re=d&&oe>p.graphMax?p.graphMax:oe;P=q.calculateY(re,p.graphMin,p.graphMax,V,-I),U.b&&(m=q.calculateY(U.b,p.graphMin,p.graphMax,V,W-I));const pe=oe>0?-1:1;P=oe&&P!==null&&Math.abs(P)===0?pe:P}const Q=U.dataColor||this.color,$=e==null?void 0:e.legendHitInfo,j=(K=e==null?void 0:e.selectLabel)==null?void 0:K.option,he=(D=e==null?void 0:e.selectItem)==null?void 0:D.option,me=((_=(z=e==null?void 0:e.selectLabel)==null?void 0:z.selected)==null?void 0:_.dataIndex)??[],{dataIndex:ae,seriesID:xe}=((ee=e==null?void 0:e.selectItem)==null?void 0:ee.selected)??{};let be=!1;if($?be=($==null?void 0:$.sId)!==this.sId:j!=null&&j.use&&(j!=null&&j.useSeriesOpacity)?be=me.length&&!me.includes(J):yt(ae)&&(he!=null&&he.useSeriesOpacity)&&(this.isExistGrp?be=ae!==J:be=ae!==J||xe!==this.sId),typeof Q!="string")n.fillStyle=q.createGradient(n,h,{x:f,y:m,w:N,h:P},Q,be,e.unSelectedOpacity);else{const oe=Q.includes("rgba")?O.getOpacity(Q):1,re=be?e.unSelectedOpacity:oe;n.fillStyle=O.colorStringToRgba(Q,re)}this.drawBar({ctx:n,positions:{x:f,y:m,w:N,h:P}}),u.use&&this.drawValueLabels({context:n,data:U,positions:{x:f,y:m,h:P,w:N},isHighlight:!1,textColor:U.dataTextColor,index:J})}}}itemHighlight(e,n,i,s){const l=this.showValue,a=e.data,r=n,c=a.xp,d=a.yp,h=a.w,u=a.h;r.save(),r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=4;const f=e.data.dataColor||this.color;if(typeof f!="string"){const m=q.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:u},f,!1,s);r.fillStyle=m,r.shadowColor=f[f.length-1][1]}else r.fillStyle=f,r.shadowColor=f;r.beginPath(),this.drawBar({ctx:r,positions:{x:c,y:d,w:h,h:this.isHorizontal?-u:u}}),l.use&&this.drawValueLabels({context:r,data:a,positions:{x:c,y:d,h:u,w:h},isHighlight:!0,textColor:e.data.dataTextColor||e.dataTextColor,index:i}),r.restore()}findGraphData(e,n,i,s){if(typeof i=="number"&&this.show&&s){const l=this.data,a={data:null,hit:!1,color:this.color},r=this.visibleStartIndex??0,c=r+(this.filteredCount??l.length)-1,d=Math.max(r,Math.min(i,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(e,l[d]),a.directHit=a.hit),a}return n?this.findGraphRangeCount(e):this.findGraphRange(e)}binarySearchBar(e,n){const[i,s]=e,l={data:null,hit:!1,color:this.color},a=this.data,r=this.visibleStartIndex??0,c=this.filteredCount??a.length;let d=r,h=Math.min(r+c-1,a.length-1);for(;d<=h;){const u=Math.floor((d+h)/2),f=a[u];if(!f){console.warn(`[EVUI][Bar] binarySearchBar: gdata[${u}] is falsy`);break}const{xp:m,yp:g,w:p,h:y}=f,C=m+p,b=g+y;if(n?b<=s&&s<=g:m<=i&&i<=C)return l.data=f,l.index=f.index,l.hit=this.isPointInBar(e,f),l.directHit=l.hit,l;(n?!(b<s):m+4<i)?d=u+1:h=u-1}return l}findGraphRange(e){return this.binarySearchBar(e,!1)}findGraphRangeCount(e){return this.binarySearchBar(e,!0)}drawValueLabels({context:e,data:n,positions:i,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:u,decimalPoint:f}=this.showValue,{x:m,y:g,w:p,h:y}=i,C=e;C.save(),C.beginPath(),C.font=`normal normal normal ${c}px Roboto`,C.fillStyle=l||d,C.lineWidth=1,C.textBaseline="middle",C.textAlign=r&&h!=="center"?"left":"center";let b;const k=yt(this.stackIndex);k?b=n.o:b=(r?n.x:n.y)??"";let T;u&&(T=u(b,{label:r?n.y:n.x,index:a})),(!u||typeof T!="string")&&(T=O.labelSignFormat(b,f)??"");const w=b<0,M=Math.round(C.measureText(T).width),V=c,x=r&&h!=="end"?10:4,S=w?m-x:m+x,L=w?g+x:g-x,I=m+p/2,v=s?g+y/2:g-y/2,W=r?v+c*.1:v,E=Math.abs(p),G=Math.abs(y),R=E-x,X=G-x,Z=M<=E&&E>=V;switch(h){case"start":{if(r){if(M<R&&V<G){const N=w?S-M:S;C.fillText(T,N,W)}}else if(Z&&V+x<=G){const N=w?g+V/2+x:g-V/2-x;C.fillText(T,I,N)}break}case"center":{r?M<R&&V<G&&C.fillText(T,I,W):Z&&V<X&&C.fillText(T,I,g+y/2);break}case"out":{if(k){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const N=this.chartRect.x1+this.labelOffset.left,P=this.chartRect.x2-this.labelOffset.right;if(V<this.size.bar)if(w){const B=m-x+p-M;B>N&&C.fillText(T,B,W)}else{const B=m+x+p;B+M<P&&C.fillText(T,B,W)}}else{const N=this.chartRect.y1+this.labelOffset.top,P=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(w){const B=g+y+x+V/2;B+V/2<=P&&C.fillText(T,I,B)}else{const B=g+y-x-V/2;B-V/2>=N&&C.fillText(T,I,B)}}break}default:case"end":{if(r){if(M<R&&V<G){const N=w?m+p+x:m+p-M-x;C.fillText(T,N,W)}}else if(w){const N=g+y-V/2-x;N>L&&Z&&V+x<=G&&C.fillText(T,I,N)}else Z&&V+x<=G&&C.fillText(T,I,g+y+V/2+x);break}}C.restore()}calculateBarSize(e,n){return typeof e=="string"&&/[0-9]+px/.test(e)?Math.min(n,Number(e.replace("px",""))):typeof e=="number"&&e<=1&&e>=0?Math.ceil(n*e):n}drawBar({ctx:e,positions:n}){const{isHorizontal:i,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=i?-n.h:n.h;if(!(d===0||h===0)){if(e.save(),a&&!l)try{this.drawRoundedRect(e,n)}catch{e.fillRect(r,c,d,h)}else e.fillRect(r,c,d,h);e.restore()}}isPointInBar(e,n){const[i,s]=e,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=i&&i<=d&&h<=s&&s<=a}drawRoundedRect(e,n){const{chartRect:i,labelOffset:s,isHorizontal:l,borderRadius:a}=this,{x:r,y:c}=n;let{w:d,h}=n,u=a;const f=new Path2D;f.rect(i.x1+s.left,i.y1,i.chartWidth-s.right,i.chartHeight-s.bottom),e.clip(f),e.beginPath(),e.moveTo(r,c),Math.abs(d)<u*2&&(u=Math.abs(d)/2),Math.abs(h)<u*2&&(u=Math.abs(h)/2),l?d<0?(d+=u,e.lineTo(r+d,c),e.arcTo(r+d-u,c,r+d-u,c-u,u),e.arcTo(r+d-u,c-h,r+d,c-h,u),e.lineTo(r,c-h),e.lineTo(r,c)):(d-=u,e.lineTo(r+d,c),e.arcTo(r+d+u,c,r+d+u,c-u,u),e.arcTo(r+d+u,c-h,r+d,c-h,u),e.lineTo(r,c-h),e.lineTo(r,c)):h>0?(h-=u,e.lineTo(r+d,c),e.lineTo(r+d,c+h),e.arcTo(r+d,c+h+u,r-d+u,c+h+u,u),e.arcTo(r,c+h+u,r,c+h,u),e.lineTo(r,c)):(h+=u,e.lineTo(r+d,c),e.lineTo(r+d,c+h),e.arcTo(r+d,c+h-u,r+d-u,c+h-u,u),e.arcTo(r,c+h-u,r,c+h,u),e.lineTo(r,c)),e.fill(),e.closePath()}}class sC extends zr{computeGeometry(e){if(!this.show)return;const n=e.chartRect,i=e.labelOffset,s=e.axesSteps,l=e.showIndex,a=e.isHorizontal,r=e.thickness,c=e.showSeriesCount;let d,h;const u=s.x[this.xAxisIndex],f=s.y[this.yAxisIndex],m=n.chartWidth-(i.left+i.right),g=n.chartHeight-(i.top+i.bottom),p=n.x1+i.left,y=n.y2-i.bottom,C=n.x2-i.right,k=(a?g:m)/(this.data.length||1),T=2;let w;this.isExistGrp?w=k-T*2:w=(k-T*2)/c;const V=typeof r=="string"&&/[0-9]+px/.test(r)?Math.min(w,Number(r.replace("px",""))):typeof r=="number"&&r<=1&&r>=0?Math.ceil(w*r):w;let x=a?null:V,S=a?null:V,L=a?V:null;const I=a?(w-L)/2:(w-x)/2,v=this.isExistGrp?1:l+1;this.size.cat=k,this.size.bar=w,this.size.cPad=T,this.size.bPad=I,this.size.w=x,this.size.ix=v,this.chartRect=n,this.labelOffset=i,this.borderRadius=e.borderRadius,this.data.forEach(W=>{a?(d=p,h=q.calculateY(W.y,f.graphMin,f.graphMax,g,y)):(d=q.calculateSubX(W.x,u.graphMin,u.graphMax,m,p),d<p?(S-=p-d,d=d+x<p?null:p):d+x>C&&(S-=S-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(w*v)-Math.round(x+I)),h=y),a?W.b?(x=q.calculateX(W.x-W.b,u.graphMin,u.graphMax,m),d=q.calculateX(W.b,u.graphMin,u.graphMax,m,p)):x=q.calculateX(W.x,u.graphMin,u.graphMax,m):W.b?(L=q.calculateY(W.y-W.b,f.graphMin,f.graphMax,g),h=q.calculateY(W.b,f.graphMin,f.graphMax,g,y)):L=q.calculateY(W.y,f.graphMin,f.graphMax,g),d!==null&&h!==null&&typeof(W.dataColor||this.color)!="string"&&(x=x!==S?S:x),S=x,W.xp=d,W.yp=h,W.w=x,W.h=a?-L:L})}draw(e){if(!this.show)return;this.computeGeometry(e);const n=e.ctx,i=e.chartRect,s=e.labelOffset,l=e.axesSteps,a=e.showIndex,r=e.isHorizontal,c=e.thickness,d=e.showSeriesCount;let h,u;const f=l.x[this.xAxisIndex],m=l.y[this.yAxisIndex],g=i.chartWidth-(s.left+s.right),p=i.chartHeight-(s.top+s.bottom),y=i.x1+s.left,C=i.y2-s.bottom,b=i.x2-s.right,T=(r?p:g)/(this.data.length||1),w=2;let M;this.isExistGrp?M=T-w*2:M=(T-w*2)/d;const x=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(M,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(M*c):M;let S=r?null:x,L=r?null:x,I=r?x:null;const v=r?(M-I)/2:(M-S)/2,W=this.isExistGrp?1:a+1;this.size.cat=T,this.size.bar=M,this.size.cPad=w,this.size.bPad=v,this.size.w=S,this.size.ix=W,this.chartRect=i,this.labelOffset=s,this.borderRadius=e.borderRadius,this.data.forEach((E,G)=>{if(n.beginPath(),r?(h=y,u=q.calculateY(E.y,m.graphMin,m.graphMax,p,C)):(h=q.calculateSubX(E.x,f.graphMin,f.graphMax,g,y),h<y?(L-=y-h,h=h+S<y?null:y):h+S>b&&(L-=L-(b-h)),h>=b&&(h=null),h!==null&&(h+=Math.ceil(M*W)-Math.round(S+v)),u=C),r?E.b?(S=q.calculateX(E.x-E.b,f.graphMin,f.graphMax,g),h=q.calculateX(E.b,f.graphMin,f.graphMax,g,y)):S=q.calculateX(E.x,f.graphMin,f.graphMax,g):E.b?(I=q.calculateY(E.y-E.b,m.graphMin,m.graphMax,p),u=q.calculateY(E.b,m.graphMin,m.graphMax,p,C)):I=q.calculateY(E.y,m.graphMin,m.graphMax,p),h!==null&&u!==null){const R=E.dataColor||this.color,X=R.includes("rgba")?O.getOpacity(R):1,Z=this.state==="downplay"?e.unSelectedOpacity:X;typeof R!="string"?(S=S!==L?L:S,n.fillStyle=q.createGradient(n,r,{x:h,y:u,w:S,h:I},R,this.state==="downplay",e.unSelectedOpacity)):n.fillStyle=O.colorStringToRgba(R,Z),this.drawBar({ctx:n,positions:{x:h,y:u,w:S,h:I}}),this.showValue.use&&this.drawValueLabels({context:n,data:E,positions:{x:h,y:u,h:I,w:S},isHighlight:!1,index:G})}L=S})}}class oC{constructor(e,n,i){const s=vo({},$S,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Ht[i%Ht.length]),this.sId=e,this.show=!0,this.data=[],this.type="pie",this.centerX=0,this.centerY=0,this.radius=0,this.doughnutHoleSize=0,this.startAngle=0,this.endAngle=0,this.ctx=null,this.isSelect=!1}draw(e,n,i){var h;const s=e??this.ctx,l=new Path2D,a=this.isSelect?this.radius+5:this.radius,r=this.color,c=r.includes("rgba")?O.getOpacity(r):1,d=this.isDownplay?i:c;s.beginPath(),l.moveTo(this.centerX,this.centerY),l.arc(this.centerX,this.centerY,a,this.startAngle,this.endAngle),l.lineTo(this.centerX,this.centerY),s.fillStyle=O.colorStringToRgba(r,d),s.fill(l),n.use&&(s.lineCap="round",s.lineWidth=n==null?void 0:n.lineWidth,s.strokeStyle=n==null?void 0:n.color,s.stroke(l)),(h=this.showValue)!=null&&h.use&&this.drawValueLabels(s),s.closePath(),this.ctx=s}findGraphData([e,n]){const i={data:null,hit:!1,color:null,index:-1},{radius:s,startAngle:l,endAngle:a,centerX:r,centerY:c}=this,d=Math.sqrt((e-r)**2+(n-c)**2),h=2.5*Math.PI-Math.atan2(e-r,n-c),u=s>d&&h>=l&&h<=a;return this.show&&u&&(i.type=this.type,i.data=this.data,i.hit=!0,i.color=this.color,i.index=0),i}itemHighlight(e,n){var a,r;const i=n,s=this.isSelect?this.radius+5:this.radius;i.save(),i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=4;const l=((a=e==null?void 0:e.data)==null?void 0:a.dataColor)||this.color;i.fillStyle=l,i.shadowColor=l,i.beginPath(),i.moveTo(this.centerX,this.centerY),i.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),i.lineTo(this.centerX,this.centerY),i.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(i),i.closePath(),i.restore()}drawValueLabels(e){const n=e,i=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:i,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=O.labelSignFormat(i));const c=1.8,d=this.radius-this.doughnutHoleSize,h=(this.endAngle-this.startAngle)*180/Math.PI,u=s+4,f=Math.round(n.measureText(r).width);if(h>=f*c&&h>=u*c&&d>=f*c&&d>=u*c){n.save(),n.beginPath();const m=l.includes("rgba")?O.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:m;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=O.colorStringToRgba(l,g),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const p=d/2+this.doughnutHoleSize,y=(this.endAngle-this.startAngle)/2+this.startAngle,C=p*Math.cos(y)+this.centerX,b=p*Math.sin(y)+this.centerY;n.fillText(r,C,b),n.restore()}}}class lC{constructor(e,n,i,s,l){const a=vo({},qS,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(i),this.sId=e,this.data=[],this.labels={x:[],y:[]},this.valueOpt={},this.size={w:0,h:0},this.type="heatMap",this.currentLabelInfo={x:{steps:0,min:0,max:0},y:{steps:0,min:0,max:0}}}createColorState(e){const n=[],i=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=e,h=s.includes("#")?O.hexToRgb(s):s.replace(i,""),u=l.includes("#")?O.hexToRgb(l):l.replace(i,""),[f,m,g]=h.split(","),[p,y,C]=u.split(",");if(this.isGradient)n.push({minColor:{minR:f,minG:m,minB:g},maxColor:{maxR:p,maxG:y,maxB:C},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:b,label:k},T)=>{n.push({id:`color#${T}`,color:b,label:k,state:"normal",show:!0})});else{const b=Math.floor((f-p)/(a-1)),k=Math.floor((m-y)/(a-1)),T=Math.floor((g-C)/(a-1));for(let w=0;w<a;w++){const M=+f-b*w,V=+m-k*w,x=+g-T*w;n.push({id:`color#${w}`,color:`rgb(${M},${V},${x})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(e){const{minColor:n,maxColor:i}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=i,h=+s-Math.floor((s-r)*e/100),u=+l-Math.floor((l-c)*e/100),f=+a-Math.floor((a-d)*e/100);return`rgb(${h},${u},${f})`}getColorIndexByValue(e){const{existError:n,min:i,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&e<0)return a;const r=Math.floor(+(e-i).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(e){const{min:n,max:i}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=Je(e-n,i-n),{start:a,end:r,selectedValue:c}=this.colorState[0];(e<0||a<=l&&l<=r)&&(s.show=!0,s.isHighlight=c!==null&&Math.floor(e)===Math.floor(n+(i-n)*(c/100)),s.dataColor=e<0?this.errorColor:this.getColorForGradient(l))}else{const l=this.getColorIndexByValue(e),{show:a,state:r,color:c,id:d}=this.colorState[l];s.show=a,s.opacity=r==="downplay"?.1:1,s.dataColor=e<0?this.errorColor:c,s.id=d}return s}drawItem(e,n,i,s,l,a){if(e.beginPath(),!(s<0||l<0)){if(a.show){const{radius:r}=a;if(r>0){const c=Math.min(s,l);let d=r;d>c/2&&(d=Math.floor(c/2)),e.moveTo(n+d,i),e.arcTo(n+s,i,n+s,i+l,d),e.arcTo(n+s,i+l,n,i+l,d),e.arcTo(n,i+l,n,i,d),e.arcTo(n,i,n+s,i,d),e.stroke(),e.fill()}else e.strokeRect(n,i,s,l),e.fillRect(n,i,s,l)}else{const r=O.aliasPixel(1);e.fillRect(n,i-r,s+r,l+r)}e.closePath()}}calculateXY(e,n,i,s){let l=null;if(this.labels[e]&&this.labels[e].length){let a=this.labels[e].findIndex(f=>f===n);a===-1&&(a=this.labels[e].findIndex(f=>+f==+n));const{minIndex:r,maxIndex:c,graphMin:d,graphMax:h}=s;if(ve(c)&&a>c||ve(r)&&a<r||io(r)&&io(c)&&(n<d||n>h))return null;const u=r??this.labels[e].findIndex(f=>+f==+d);a>-1&&(a-=u>-1?u:0,l=e==="x"?i+this.size.w*a:i-this.size.h*(a+1))}return l}computeGeometry(e){if(!this.show)return;const{chartRect:n,labelOffset:i,selectItem:s,axesSteps:l}=e,a=n.chartWidth-(i.left+i.right),r=n.chartHeight-(i.top+i.bottom),c=n.x1+i.left,d=n.y2-i.bottom,h=l.x[this.xAxisIndex],u=l.y[this.yAxisIndex];this.size.w=a/h.oriSteps,this.size.h=r/u.oriSteps,this.currentLabelInfo={x:{steps:h.oriSteps,min:h.graphMin,max:h.graphMax},y:{steps:u.oriSteps,min:u.graphMin,max:u.graphMax}},this.data.forEach((f,m)=>{var T;let p=this.calculateXY("x",f.x,c,h),y=this.calculateXY("y",f.y,d,u),C=this.size.w,b=this.size.h;const k=f.o;if(p!==null&&y!==null&&k!==null&&k!==void 0){const{show:w,dataColor:M,id:V}=this.getItemInfo(k);if(f.dataColor||(f.dataColor=M),f.cId=V,w){let x=this.stroke;const S=s==null?void 0:s.option,L=(S==null?void 0:S.use)&&(S==null?void 0:S.showBorder),I=m===((T=s==null?void 0:s.selected)==null?void 0:T.dataIndex);if(L&&I&&(x={show:S==null?void 0:S.showBorder,...S==null?void 0:S.borderStyle}),x.show&&x.lineWidth>0){const{lineWidth:v}=x,W=v*2;W<Math.floor(C)&&W<Math.floor(b)&&(p+=v,y+=v,C-=W,b-=W)}p+=1,f.xp=p,f.yp=y,f.w=C,f.h=b}}})}draw(e){if(!this.show)return;this.computeGeometry(e);const{ctx:n,chartRect:i,labelOffset:s,selectLabel:l,legendHitInfo:a,selectItem:r,axesSteps:c}=e,d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=i.x1+s.left,f=i.y2-s.bottom,m=c.x[this.xAxisIndex],g=c.y[this.yAxisIndex];this.size.w=d/m.oriSteps,this.size.h=h/g.oriSteps,this.currentLabelInfo={x:{steps:m.oriSteps,min:m.graphMin,max:m.graphMax},y:{steps:g.oriSteps,min:g.graphMin,max:g.graphMax}};const p=(y,C,b)=>{var k,T;if(!a){let w;const{option:M,selected:V}=r,{option:x,selected:S}=l,L=yt(V==null?void 0:V.dataIndex)&&(V==null?void 0:V.dataIndex)>-1,I=((k=S==null?void 0:S.label)==null?void 0:k.length)>0;return L?w=M.useSeriesOpacity?b!==(V==null?void 0:V.dataIndex):!1:I&&(w=x.useSeriesOpacity?!((T=S==null?void 0:S.label)!=null&&T.includes(this.getItemLabel(l,y))):!1),w?.1:C}return C};this.data.forEach((y,C)=>{var x;let k=this.calculateXY("x",y.x,u,m),T=this.calculateXY("y",y.y,f,g),w=this.size.w,M=this.size.h;const V=y.o;if(k!==null&&T!==null&&V!==null&&V!==void 0){const{show:S,opacity:L,dataColor:I,id:v}=this.getItemInfo(V);let W=L;L===1&&O.getColorStringType(y.dataColor)==="RGBA"&&(W=O.getOpacity(y.dataColor));const E=p(y,W,C);if(y.dataColor||(y.dataColor=I),y.cId=v,n.save(),S){n.fillStyle=O.colorStringToRgba(y.dataColor,E);let G=this.stroke;const R=r==null?void 0:r.option,X=(R==null?void 0:R.use)&&(R==null?void 0:R.showBorder),Z=C===((x=r==null?void 0:r.selected)==null?void 0:x.dataIndex);X&&Z&&(G={show:R==null?void 0:R.showBorder,...R==null?void 0:R.borderStyle});let N=!1;if(G.show&&G.lineWidth>0){const{color:P,lineWidth:B,opacity:Y}=G,H=B*2;N=H<Math.floor(w)&&H<Math.floor(M),n.strokeStyle=N?O.colorStringToRgba(P,E===1?Y:E):void 0,N?(n.lineWidth=B,k+=B,T+=B,w-=H,M-=H):n.lineWidth=0}k+=1,this.drawItem(n,k,T,w,M,{...G,show:N}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:y})}}})}drawOverlay(e){if(!this.show)return;const{overlayCtx:n,chartRect:i,labelOffset:s,axesSteps:l}=e;if(!n)return;const a=i.x1+s.left,r=i.y2-s.bottom,c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex];this.data.forEach(h=>{const u=this.calculateXY("x",h.x,a,c),f=this.calculateXY("y",h.y,r,d),m=h.o;if(u!==null&&f!==null&&m!==null&&m!==void 0){const{show:g,isHighlight:p}=this.getItemInfo(m);g&&p&&this.itemHighlight({data:h},n)}})}drawValueLabels({context:e,data:n}){const{fontSize:i,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:u,o:f}=n,m=e;m.save(),m.beginPath(),m.font=`normal normal normal ${i}px Roboto`,m.fillStyle=s,m.lineWidth=1,m.textBaseline="middle",m.textAlign=l!=="center"?"left":"center";let g;a&&(g=a(f)),(!a||typeof g!="string")&&(g=O.labelSignFormat(f,r));const p=Math.round(m.measureText(g).width),y=i,C=c+h/2,b=d+u/2;if(!(p>=h||y>=u||g<0)){switch(l){case"top":{const k=C-p/2,T=b-y/2;m.fillText(g,k,T);break}case"right":{const k=c+h-p;m.fillText(g,k,b);break}case"bottom":{const k=C-p/2,T=b+y/2;m.fillText(g,k,T);break}case"left":m.fillText(g,c,b);break;default:{const k=C-p/2;m.fillText(g,k,b);break}}m.restore()}}getAdjustedBounds({xp:e,yp:n,width:i,height:s}){const a=Math.max(0,i),r=Math.max(0,s);return{xsp:Math.floor(e*100)/100,xep:Math.ceil((e+a)*100)/100,ysp:Math.floor(n*100)/100,yep:Math.ceil((n+r)*100)/100}}findItems(e){const n=this.data,{xsp:i,xep:s,ysp:l,yep:a}=this.getAdjustedBounds({xp:e.xsp,yp:e.ysp,width:e.width,height:e.height});return n.filter(({xp:r,yp:c,w:d,h})=>{const{xsp:u,xep:f,ysp:m,yep:g}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return u>=i&&f<=s&&m>=l&&g<=a})}itemHighlight(e,n){var p;const i=e.data,s=n,{stroke:l,shadow:a}=this.highlight,r=i.xp,c=i.yp,d=i.w,h=i.h,u=i.cId;let f;if(this.isGradient){const{min:y,max:C}=this.valueOpt,b=Je(i.o-y,C-y),{start:k,end:T}=this.colorState[0];f=k<=b&&b<=T||i.o===-1}else f=(p=this.colorState.find(({id:y})=>y===u))==null?void 0:p.show;if(r===null||c===null||!f)return;s.save();const m=O.getColorStringType(i.dataColor)==="RGBA"?e.dataColor:O.colorStringToRgba(i.dataColor,1);s.fillStyle=m,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const g={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:y,width:C,radius:b}=l;g.show=!0,g.radius=b,s.lineWidth=C,g.lineWidth=C,s.strokeStyle=y||m,g.color=y||m}else g.show=!1,s.strokeStyle=m,g.color=m;this.drawItem(s,r-.5,c-.5,d+1,h+1,g),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:i})}findGraphData(e){const n=e[0],i=e[1],s={data:null,hit:!1,color:null,dataColor:null,name:null},l=this.data,a=l.findIndex(r=>{const{xp:c,yp:d,w:h,h:u}=r;return c<=n&&n<=c+h&&d<=i&&i<=d+u});if(a>-1){const r=l[a];s.data=r,s.color=r.dataColor,s.dataColor=r.dataColor,s.index=a,s.hit=!0}return s}findBlockRange({xcp:e,xep:n,ycp:i,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(e,n),ysp:Math.min(i,s),width:Math.ceil(Math.abs(n-e)),height:Math.ceil(Math.abs(s-i))};if(a.x.length&&a.y.length){const d=this.currentLabelInfo.x.steps||a.x.length,h=this.currentLabelInfo.y.steps||a.y.length,{x1:u,x2:f,y1:m,y2:g}=l,p=(f-u)/d,y=(g-m)/h,C={xsp:e,xep:n,ysp:i,yep:s},b=(k,T,w)=>{let M,V,x;k==="x"?(V=p,x=u+r):(V=y,x=m),a[k].findIndex((L,I)=>(M=x+V*I,M<=T&&T<=M+V))>-1?C[w]=["xsp","ysp"].includes(w)?M:M+V:T<x&&(C[w]=x)};b("x",Math.min(e,n),"xsp"),b("x",Math.max(e,n),"xep"),b("y",Math.min(i,s),"ysp"),b("y",Math.max(i,s),"yep"),c.xsp=Math.min(C.xsp,C.xep),c.ysp=Math.min(C.ysp,C.yep),c.width=Math.abs(C.xep-C.xsp),c.height=Math.abs(C.yep-C.ysp)}return c}getFilteredLabel(e,n,i,s){return e.length!==n?e.filter(l=>i<=l&&l<=s):e}findSelectionRange(e){const{xsp:n,ysp:i,width:s,height:l,range:a}=e;let r=null;const{x1:c,x2:d,y1:h,y2:u}=a,{x:f,y:m}=this.labels;if(f.length&&m.length){const{x:{steps:g,min:p,max:y},y:{steps:C,min:b,max:k}}=this.currentLabelInfo,T=g||f.length,w=C||m.length,M=(d-c)/T,V=(u-h)/w,x=n+s,S=i+l,L={min:Math.floor((n-c)/M),max:Math.floor((x-c-M)/M)},I=w-1,v={min:I-Math.round((S-h-V)/V),max:I-Math.round((i-h)/V)},W=this.getFilteredLabel(f,T,p,y),E=this.getFilteredLabel(m,w,b,k);r={xMin:W[L.min],xMax:W[L.max],yMin:E[v.min],yMax:E[v.max]}}return r}getItemLabel(e,n){const{option:i,selected:s}=e;let l=this.isHorizontal?n.y:n.x;return i!=null&&i.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const Ar={Store:JS,Series:{createSeriesSet(t,e,n,i){let s=Object.keys(t);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(t,e,i)),s.forEach((l,a)=>{const r=t[l].type||e;this.seriesList[l]=this.addSeries({type:r,id:l,opt:t[l],index:a,isHorizontal:n})})},reconcileSeriesSet(t,e,n,i,s){var d,h,u;let l=Object.keys(t);this.options.overlapping.use&&(l=this.getOverlappingSeriesKeys(t,e,i));const a=s||{},r={},c=this.prunedRealTimeScatterSeries;if(c!=null&&c.size){for(let f=0;f<l.length;f++){const m=l[f];c.has(m)&&((u=(h=(d=this.data)==null?void 0:d.data)==null?void 0:h[m])!=null&&u.length)&&c.delete(m)}l=l.filter(f=>!c.has(f))}for(let f=0;f<l.length;f++){const m=l[f],g=t[m],p=g.type||e,y=a[m];y&&this.canReuseSeries(y,p,g,n)?(this.seriesInfo.charts[p].push(m),y.show=y._freshShow,this.resetSeriesGroupMeta(y),r[m]=y):r[m]=this.addSeries({type:p,id:m,opt:g,index:f,isHorizontal:n})}this.seriesList=r},computeReconcileKey(t,e,n){var i,s;return{type:t,isHorizontal:n,timeMode:t==="bar"&&!!e.timeMode,realTime:t==="scatter"&&!!((i=this.options.realTimeScatter)!=null&&i.use),heatMapColor:t==="heatMap"?this.options.heatMapColor:null,isGradient:t==="heatMap"&&((s=this.options.legend)==null?void 0:s.type)==="gradient"}},canReuseSeries(t,e,n,i){const s=t._reconcileKey;if(!s||t._optSnapshot===void 0)return!1;const l=this.computeReconcileKey(e,n,i);return s.type!==l.type||s.isHorizontal!==l.isHorizontal||s.timeMode!==l.timeMode||s.realTime!==l.realTime||s.heatMapColor!==l.heatMapColor||s.isGradient!==l.isGradient?!1:Fe(t._optSnapshot,n)},resetSeriesGroupMeta(t){t.isExistGrp=!1,t.stackIndex=0,t.groupIndex=null,t.bsId=null,t.bsIds=[],t.isOverlapping=!1},getOverlappingSeriesKeys(t,e,n){const i=[],s=[],l=n.flat();return Object.keys(t).forEach(a=>{if((t[a].type||e)==="bar"&&l.length){const d=l.findIndex(h=>h===a);i.push({key:a,overlappingIdx:d})}else s.push({key:a})}),i.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...i,...s].map(({key:a})=>a)},addSeries(t){var r;const{type:e,id:n,opt:i,index:s,isHorizontal:l}=t;let a=!1;if(e==="line")this.seriesInfo.charts.line.push(n),a=new nC(n,i,s);else if(e==="scatter")this.seriesInfo.charts.scatter.push(n),a=new iC(n,i,s,(r=this.options.realTimeScatter)==null?void 0:r.use);else if(e==="bar")this.seriesInfo.charts.bar.push(n),i.timeMode?a=new sC(n,i,s,l):a=new zr(n,i,s,l);else if(e==="pie")this.seriesInfo.charts.pie.push(n),a=new oC(n,i,s);else if(e==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:c,legend:d}=this.options,h=d.type==="gradient";a=new lC(n,i,c,l,h)}return a&&(a._reconcileKey=this.computeReconcileKey(e,i,l),a._optSnapshot=i,a._freshShow=a.show),a},addGroupInfo(t){t.forEach((e,n)=>{let i=0;e.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+i,r.groupIndex=n,r.isExistGrp=!0,r.bsId=s,r.bsIds=e.filter((c,d)=>c!==l&&a>d),r.isOverlapping=this.options.overlapping.use,r.show||i--,r.show?l:s},e[0])})}}};class bi{constructor(e,n,i,s){const l=Xe({},n,Yr);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=e,this.ctx=i,this.units=jS[this.type],this.options=s,this.position||(this.position=e==="x"?"bottom":"left")}calculateLabelRange(e,n,i,s){let l,a,r;e==="x"?(l=n.chartWidth,r=Math.floor(s*1.2),a=[i.left,i.right]):(l=n.chartHeight,a=[i.top,i.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r),1);return{min:d,max:h}}calculateScaleRange(e,n){var d;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+e.max?+e.max:a[1],s=a[0]<+e.min?+e.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(e.min,e.max):(i=e.max,s=e.min),this.autoScaleRatio&&(i=Math.ceil(i*(this.autoScaleRatio+1))),this.startToZero&&(s=0),i===s&&(i+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:r,maxLabel:c,size:O.calcTextSizeCanvas(c,O.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(e,n,i=[]){const s=O.getLabelStyle(this.labelStyle);return[...(e??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=O.calcTextSizeCanvas(c,s))==null?void 0:h.width)??0;return Math.max(r,d)},0)}calculateSteps(e){const{maxValue:n,minValue:i}=e;let{maxSteps:s}=e,l=this.getInterval(e),a=i,r;for(;a<n;)a+=l;const c=a,d=i,h=c-d;if(r=Math.round(h/l),n===1&&(this.decimalPoint?s>2?(l=.2,r=5,s=5):(l=.5,r=2,s=2):(l=1,r=1,s=1)),this.fixedSteps)return{steps:r,interval:l,graphMin:d,graphMax:c};for(;r>s;)l*=2,r=Math.round(h/l),l=Math.ceil(h/r);return c-d>r*l&&(l=Math.ceil((c-d)/r)),{steps:r,interval:l,graphMin:d,graphMax:c}}drawAxisTitle(e,n){const i=this.title;if(!(i!=null&&i.use)||isNaN(i.fontSize))return;const s=this.ctx;s.save(),s.font=O.getLabelStyle(i),s.fillStyle=i.color,s.textAlign=i.textAlign;const l={xLeft:e.x1+n.left,xRight:e.x2-n.right,yTop:e.y1};let a,r;const c=10;this.type==="x"?(a=l.xRight,r=e.y2+i.fontSize+c):(r=l.yTop-i.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(i.text,a,r),s.restore()}draw(e,n,i,s,l,a){var T,w,M,V,x,S,L,I,v,W,E,G,R,X,Z,N,P,B;const r=this.ctx,c=this.options,d={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},h=i.steps,u=i.graphMin,f=i.graphMax,m=i.interval,g=d[this.units.rectStart],p=d[this.units.rectEnd],y=d[this.units.rectOffset(this.position)],C=d[this.units.rectOffsetCounter(this.position)],b=5;let k;if(this.drawAxisTitle(e,n),r.font=O.getLabelStyle(this.labelStyle),r.fillStyle=this.labelStyle.color,this.type==="x"?(r.textAlign="center",r.textBaseline=this.position==="top"?"bottom":"top"):(r.textAlign=this.position==="left"?"right":"left",r.textBaseline="middle"),this.showAxis&&(r.lineWidth=this.axisLineWidth,k=O.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(g,y+k),r.lineTo(p,y+k)):(r.moveTo(y+k,g),r.lineTo(y+k,p)),r.stroke(),r.closePath()),!(h===0||u===null)){if((T=this.labelStyle)!=null&&T.show){const Y=p-g,H=Y/h,K=[],D=i.interval;let z=null,_=null,ee=g,J=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const U=Math.floor(u/D)*D;U!==+u&&(J=U+D,ee+=Y/(f-u)*(J-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,k=O.aliasPixel(r.lineWidth);let te;for(let U=0;U<=h;U++)if(z=Math.round(ee+H*U),z<=p||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),K[U]=J+U*m,K[U]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,_=z+k,te=this.getLabelFormat(Math.min(f,K[U]),{prev:K[U-1]??""});const Q=((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.use)&&((x=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:x.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((S=l==null?void 0:l.dataIndex)==null?void 0:S.length)&&!(l!=null&&l.label.map(me=>this.getLabelFormat(Math.min(f,me),{prev:K[U-1]??""})).includes(te));let $;U===h&&this.lastLabelFontStyle?(r.font=O.getLabelStyle(this.lastLabelFontStyle),$=this.lastLabelFontStyle.color):U===0&&this.firstLabelFontStyle?(r.font=O.getLabelStyle(this.firstLabelFontStyle),$=this.firstLabelFontStyle.color):(r.font=O.getLabelStyle(this.labelStyle),$=this.labelStyle.color);let j=1;O.getColorStringType($)==="RGBA"&&(j=O.getOpacity($)),r.fillStyle=O.colorStringToRgba($,Q?(L=this.options)==null?void 0:L.unSelectedOpacity:j);let he;if(this.type==="x"){if(he=this.position==="top"?y-10:y+10,((I=c==null?void 0:c.brush)!=null&&I.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),z,he),!Q&&((v=c==null?void 0:c.selectItem)!=null&&v.showLabelTip)&&(s!=null&&s.label)&&!((W=this.options)!=null&&W.horizontal)){const me=this.getLabelFormat(Math.min(f,s.label+0*m));if(me===te){const ae=Math.round(r.measureText((E=this.labelStyle)==null?void 0:E.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(me).width)+10,height:ae,x:z,y:he+(ae-2),borderRadius:2,arrowSize:3,text:te,backgroundColor:(R=(G=c==null?void 0:c.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:R.backgroundColor,textColor:(Z=(X=c==null?void 0:c.selectItem)==null?void 0:X.labelTipStyle)==null?void 0:Z.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(_,y),r.lineTo(_,y+b),r.stroke(),r.closePath()),(U!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(_,y),r.lineTo(_,C),r.stroke(),r.closePath())}else he=this.position==="left"?y-10:y+10,((N=c==null?void 0:c.brush)!=null&&N.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),he,z),U===h&&(_-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(y+(this.axisLineWidth??1),_),r.lineTo(y-b,_),r.stroke(),r.closePath()),U!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(y,_),r.lineTo(C,_),r.stroke(),r.closePath())}}((P=this.plotBands)!=null&&P.length||(B=this.plotLines)!=null&&B.length)&&(this._plotGeom={aPos:d,axisMin:u,axisMax:f,aliasPixel:k,chartRect:e,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:e,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=e.x1,u=e.x2+d,f=e.y1-d,m=e.y2,g={minX:h,maxX:u,minY:f,maxY:m};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(k=>{const T=Xe({},k,Ko),{from:w,to:M,label:V,border:x}=T,S=O.isNullOrUndefined(w)?n:Math.max(w,n),L=O.isNullOrUndefined(M)?i:Math.min(M,i);let I,v;if(this.type==="x"){if(I=q.calculateX(S,n,i,r,h),v=q.calculateX(L,n,i,r,h),I===null||v===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(I,v,h,u,f,m,x)}else{if(I=q.calculateY(S,n,i,c,m),v=q.calculateY(L,n,i,c,m),I===null||v===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(I,v,h,u,f,m,x)}this.drawPlotBandLabel(I,v,V,g,l,S,L)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const T=Xe({},k,Ao),{value:w,label:M}=T;let V;if(this.type==="x"){if(V=q.calculateX(w,n,i,r,h),V===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(V,h,u,f,m)}else{if(V=q.calculateY(w,n,i,c,m),V===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(V,h,u,f,m)}this.drawPlotLineLabel(V,M,g,l,w)})}setPlotLineStyle(e){const n=this.ctx,{color:i,lineWidth:s}=e;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=i,n.setLineDash(e.segments??[])}setPlotBandStyle(e){const n=this.ctx,{color:i}=e;n.beginPath(),n.save(),n.fillStyle=i}drawXPlotBand(e,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(e)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(e,l),c.lineTo(e,a),c.lineTo(n,a),c.lineTo(n,l),c.lineTo(e,l),c.fill(),this.drawPlotBandBorder(r,[[e,l,e,a],[n,l,n,a]]),c.restore(),c.closePath()}drawXPlotLine(e,n,i,s,l){const a=this.ctx;if(!Number.isFinite(e)||e<n||e>i){a.closePath(),a.restore();return}let r=e;r+=O.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(e,n,i,s,l){const a=this.ctx;if(!Number.isFinite(e)||e>l||e<s){a.closePath(),a.restore();return}let r=e;r+=O.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(i,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(e,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(e)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(i,e),c.lineTo(i,n),c.lineTo(s,n),c.lineTo(s,e),c.lineTo(i,e),c.fill(),this.drawPlotBandBorder(r,[[i,e,s,e],[i,n,s,n]]),c.restore(),c.closePath()}drawPlotBandBorder(e,n){if(!e||!(e.width>0))return;const i=this.ctx;i.save(),i.beginPath(),i.strokeStyle=e.color??"#000000",i.lineWidth=e.width,i.setLineDash(e.segments??[]),n.forEach(([s,l,a,r])=>{i.moveTo(s,l),i.lineTo(a,r)}),i.stroke(),i.restore()}getNormalizedLabelOptions(e,n,i=null){const s=Xe({},n,Or),l=this.ctx,{maxWidth:a,responsive:r}=s,c=s.fontSize>20?20:s.fontSize,d=e.chartWidth,h=r==null?void 0:r.valueOnlyBelow,u=r==null?void 0:r.hideBelow,f=!O.isNullOrUndefined(u)&&d<u,m=!f&&!O.isNullOrUndefined(h)&&d<h,g=s.text!=null?String(s.text):"",p=!O.isNullOrUndefined(i)&&Number.isFinite(+i),y=s.showValue&&p?String(this.getLabelFormat(i)):"";let C;s.showValue?C=m?y:[g,y].filter(I=>I).join(" "):C=g,l.save(),l.font=O.getLabelStyle({...s,fontSize:c});let b=C,k=a??l.measureText(b).width;const T=this.type==="y"?e.width-e.chartWidth:a??e.width;s.position==="outside"&&T<l.measureText(b).width&&s.textOverflow==="ellipsis"&&(b=O.truncateLabelWithEllipsis(C,T,l),k=l.measureText(b).width),l.restore();const w=c/4,M=s.padding;let V=w,x=w,S=w,L=w;return typeof M=="number"?(V=M,x=M,S=M,L=M):M&&typeof M=="object"&&(V=M.top??w,x=M.right??w,S=M.bottom??w,L=M.left??w),{...s,label:b,fontSize:c,labelWidth:k,padTop:V,padRight:x,padBottom:S,padLeft:L,lineGap:s.gap!=null?s.gap:w+2,borderRadius:Math.max(0,s.borderRadius??0),hidden:f,valueOnly:m,hoverText:g}}getPlotBandLabelPosition(e,n,i,s){const{fontSize:l,labelWidth:a,padTop:r,padRight:c,padBottom:d,padLeft:h,position:u}=i,{maxX:f}=s;if(l<=0)return null;const m=(e+n)/2;if(this.type==="x")return this.computeTopLabelBox(m,i,s);if(u==="innerStart"||u==="innerEnd")return this.computeInnerLabelBox(m,i,s);const g=a+h+c,p=l+r+d,y=f+h,C=y+g;let b;switch(i.verticalAlign){case"top":b=n;break;case"bottom":b=e;break;case"middle":default:b=(e+n)/2;break}const k=b-p/2,T=b+p/2;return{textX:y+h+a/2,textY:k+r+l/2,textAlign:"center",textBaseline:"middle",box:{left:y,top:k,right:C,bottom:T},pointerEdge:"left"}}getPlotLineLabelPosition(e,n,i){const{fontSize:s,labelWidth:l,padTop:a,padRight:r,padBottom:c,padLeft:d,position:h}=n,{maxX:u}=i;if(s<=0)return null;if(this.type==="x")return this.computeTopLabelBox(e,n,i);if(h==="innerStart"||h==="innerEnd")return this.computeInnerLabelBox(e,n,i);const f=l+d+r,m=s+a+c,g=u+d,p=g+f;let y,C;switch(n.verticalAlign){case"top":C=e,y=C-m;break;case"bottom":y=e,C=y+m;break;case"middle":default:y=e-m/2,C=e+m/2;break}return{textX:g+d+l/2,textY:y+a+s/2,textAlign:"center",textBaseline:"middle",box:{left:g,top:y,right:p,bottom:C},pointerEdge:"left"}}computeTopLabelBox(e,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,textAlign:h}=n,{minY:u}=i,f=s+d+r,m=l+a+c,g=n.gap!=null?n.gap:2,p=u-g,y=p-m,C=0;let b,k;switch(h){case"left":k=e-C,b=k-f;break;case"right":b=e+C,k=b+f;break;default:b=e-f/2,k=e+f/2;break}return{textX:b+d+s/2,textY:y+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:b,top:y,right:k,bottom:p},pointerEdge:"bottom",pointerTipX:e}}computeInnerLabelBox(e,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,lineGap:h,position:u,verticalAlign:f,textAlign:m}=n,{minX:g,maxX:p,minY:y,maxY:C}=i,b=s+d+r,k=l+a+c;let T,w,M,V;if(this.type==="x")switch(u==="innerEnd"?(V=C-h,w=V-k):(w=y+h,V=w+k),m){case"left":T=e+h,M=T+b;break;case"right":M=e-h,T=M-b;break;default:T=e-b/2,M=e+b/2;break}else switch(u==="innerEnd"?(M=p-h,T=M-b):(T=g+h,M=T+b),f){case"top":V=e-h,w=V-k;break;case"bottom":w=e+h,V=w+k;break;default:w=e-k/2,V=e+k/2;break}let x;return this.type==="x"?x=u==="innerEnd"?"top":"bottom":f==="top"?x="bottom":f==="bottom"?x="top":x=null,{textX:T+d+s/2,textY:w+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:T,top:w,right:M,bottom:V},pointerEdge:x}}drawPlotLabel(e,n){var w,M;if(!n)return;const{textX:i,textY:s,textAlign:l="left",textBaseline:a="alphabetic",box:r}=n,{label:c,fontSize:d,fontColor:h,fillColor:u,lineColor:f,lineWidth:m,borderRadius:g=0}=e;if(d<=0||!r)return;const{left:p,top:y,right:C,bottom:b}=r,k=this.ctx;k.save(),k.beginPath(),k.font=O.getLabelStyle(e),k.setLineDash([]),k.fillStyle=u,k.strokeStyle=f,k.lineWidth=m;const T=Math.min(g,Math.abs(C-p)/2,Math.abs(b-y)/2);T>0?(k.moveTo(p+T,y),k.lineTo(C-T,y),k.arcTo(C,y,C,y+T,T),k.lineTo(C,b-T),k.arcTo(C,b,C-T,b,T),k.lineTo(p+T,b),k.arcTo(p,b,p,b-T,T),k.lineTo(p,y+T),k.arcTo(p,y,p+T,y,T),k.closePath()):(k.moveTo(p,b),k.lineTo(p,y),k.lineTo(C,y),k.lineTo(C,b),k.lineTo(p,b)),k.fill(),m>0&&k.stroke(),(w=e.pointer)!=null&&w.show&&n.pointerEdge&&this.drawLabelPointer(r,n.pointerEdge,e.pointer.color??u,f,m,n.pointerTipX,T),k.fillStyle=h,k.textAlign=l,k.textBaseline=a,k.fillText(c,i,s),k.closePath(),k.restore(),e.valueOnly&&((M=e.showTextOnHover)!=null&&M.use)&&e.hoverText&&(this.plotLabelHitRegions||(this.plotLabelHitRegions=[]),this.plotLabelHitRegions.push({x:Math.min(p,C),y:Math.min(y,b),width:Math.abs(C-p),height:Math.abs(b-y),text:e.hoverText,style:e.showTextOnHover}))}drawLabelPointer(e,n,i,s,l,a,r=0){const c=this.ctx,d=4,h=4,u=(e.left+e.right)/2,f=(e.top+e.bottom)/2,m=Math.min(r+h,(e.right-e.left)/2),g=Math.min(r+h,(e.bottom-e.top)/2),p=a??u,y=Math.max(e.left+m,Math.min(e.right-m,p)),C=Math.max(e.top+g,Math.min(e.bottom-g,f));let b,k,T,w,M,V;switch(n){case"top":b=y-h,k=e.top,T=y+h,w=e.top,M=p,V=e.top-d;break;case"left":b=e.left,k=C-h,T=e.left,w=C+h,M=e.left-d,V=C;break;case"right":b=e.right,k=C-h,T=e.right,w=C+h,M=e.right+d,V=C;break;case"bottom":default:b=y-h,k=e.bottom,T=y+h,w=e.bottom,M=p,V=e.bottom+d;break}c.beginPath(),c.moveTo(b,k),c.lineTo(M,V),c.lineTo(T,w),c.closePath(),c.fillStyle=i,c.fill(),l>0&&(c.beginPath(),c.moveTo(b,k),c.lineTo(M,V),c.lineTo(T,w),c.strokeStyle=s,c.lineWidth=l,c.stroke())}drawPlotLineLabel(e,n,i,s,l=null){if(!(n!=null&&n.show))return;const a=this.getNormalizedLabelOptions(s,n,l);if(a.hidden)return;const r=this.getPlotLineLabelPosition(e,a,i);this.drawPlotLabel(a,r)}drawPlotBandLabel(e,n,i,s,l,a,r){if(!(i!=null&&i.show))return;if(i.showValue){const h=a<=r,u=this.type==="x"?{textAlign:h?"left":"right"}:{verticalAlign:h?"bottom":"top"},f=this.type==="x"?{textAlign:h?"right":"left"}:{verticalAlign:h?"top":"bottom"};this.drawPlotLineLabel(e,{...i,...u},s,l,a),this.drawPlotLineLabel(n,{...i,...f},s,l,r);return}const c=this.getNormalizedLabelOptions(l,i,null);if(c.hidden)return;const d=this.getPlotBandLabelPosition(e,n,c,s);this.drawPlotLabel(c,d)}checkFixWidth(e){const{fixWidth:n,fitDir:i}=this.labelStyle;return ve(n)&&n>0?O.truncateLabelWithEllipsis(e,n,this.ctx,i):e}}function aC(t){if(typeof t=="string"&&Ct[t])return{ms:Ct[t].size,unit:t,time:1};if(typeof t=="object"&&t!==null&&t.unit&&t.time>0){const e=Ct[t.unit];return e?{ms:t.time*e.size,unit:t.unit,time:t.time}:null}return typeof t=="number"&&t>0&&Number.isFinite(t)?{ms:t,unit:null,time:null}:null}function rC(t,e){if(!e.unit)return Pe(t.valueOf()+e.ms);const n=e.time||1;switch(e.unit){case"month":return t.add(n,"month");case"quarter":return t.add(n*3,"month");case"year":return t.add(n,"year");case"week":return t.add(n*7,"day");default:return Pe(t.valueOf()+e.ms)}}function cC(t,e){return e.unit?rC(Pe(t),e).valueOf():t+e.ms}function dC(t,e){if(!e.unit)return Math.ceil(t/e.ms)*e.ms;const n=e.time||1,i=Pe(t);if(["millisecond","second","minute","hour"].includes(e.unit)){const s=i.startOf("day").valueOf(),l=Ct[e.unit].size*n,a=t-s;return s+Math.ceil(a/l)*l}if(e.unit==="day"){const s=i.startOf("year").valueOf(),l=Ct.day.size*n,a=t-s;return s+Math.ceil(a/l)*l}if(e.unit==="week"){let s=i.startOf("year");const l=s.day();s=s.subtract((l+6)%7,"day");const a=s.valueOf(),r=Ct.week.size*n,c=t-a;return a+Math.ceil(c/r)*r}if(e.unit==="month"){const s=i.startOf("year"),l=i.startOf("month"),a=i.month(),r=l.valueOf()>=t?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"month").valueOf()}if(e.unit==="quarter"){const s=i.startOf("year"),l=Math.floor(i.month()/3),r=i.month(l*3).startOf("month").valueOf()>=t?l:l+1,c=Math.ceil(r/n)*n;return s.add(c*3,"month").valueOf()}if(e.unit==="year"){const s=i.startOf("year"),l=2e3,a=s.valueOf()>=t?i.year()-l:i.year()+1-l,r=Math.ceil(a/n)*n;return Pe(`${l+r}-01-01`).startOf("day").valueOf()}return t}function hC(t,e,n){const i=[];let s=dC(t,n);const l=1e4;for(;s<=e&&i.length<l;)i.push(s),s=cC(s,n);return i}const _o=864e5,uC=["millisecond","second","minute","hour"],Uo=new Map;function fC(t){if(Uo.has(t))return Uo.get(t);const e=[],n=[];for(let s=1;s*s<=t;s+=1)t%s===0&&(e.push(s),s!==t/s&&n.push(t/s));const i=e.concat(n.reverse());return Uo.set(t,i),i}function Kr(t,e,n){const i=Math.ceil(e/t.ms);let s=i>n?Math.max(1,Math.floor(i/n)):1,l=t.ms*s;const a=s+1e4;for(;s<=a&&Math.floor(e/l)+1>n;)s+=1,l=t.ms*s;return t.unit?{ms:l,unit:t.unit,time:(t.time||1)*s}:{ms:l,unit:null,time:null}}function mC(t,e,n){const i=s=>Math.floor(e/s)+1<=n;if(i(t.ms))return t;if(t.unit&&uC.includes(t.unit)&&_o%t.ms===0){const s=fC(_o/t.ms);for(let l=0;l<s.length;l+=1){const a=t.ms*s[l];if(i(a))return{ms:a,unit:t.unit,time:(t.time||1)*s[l]}}return Kr({ms:_o,unit:"day",time:1},e,n)}return Kr(t,e,n)}function _r(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;const e=Pe(t).valueOf();return Number.isFinite(e)?e:null}class pC extends bi{normalizeTimeValue(e){return _r(e)}calculateScaleRange(e,n){const i=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(i)||typeof i=="function")&&((e==null?void 0:e.min)==null||(e==null?void 0:e.max)==null))return{min:null,max:null,minLabel:"",maxLabel:"",size:O.calcTextSizeCanvas("",O.getLabelStyle(this.labelStyle))};let l=i;Array.isArray(i)&&i.length===2?l=[this.normalizeTimeValue(i[0]),this.normalizeTimeValue(i[1])]:typeof i=="function"&&(l=(...h)=>{const[u,f]=i(...h);return[this.normalizeTimeValue(u),this.normalizeTimeValue(f)]});const a=this.range,r=n!=null&&n.use?{...n,range:l}:n,c={...e,min:this.normalizeTimeValue(e==null?void 0:e.min),max:this.normalizeTimeValue(e==null?void 0:e.max)};let d;try{n!=null&&n.use||(this.range=l),d=super.calculateScaleRange(c,r)}finally{this.range=a}return{...d,min:this.normalizeTimeValue(d.min),max:this.normalizeTimeValue(d.max)}}getLabelFormat(e,n={}){if(this.formatter){const i=this.formatter(e,n);if(typeof i=="string")return i}return Pe(e).format(this.timeFormat)}getInterval(e){const n=this.normalizeTimeValue(e.maxValue),i=this.normalizeTimeValue(e.minValue),s=e.maxSteps;if(this.interval){let l;if(typeof this.interval=="string"?l=Ct[this.interval].size:typeof this.interval=="object"?l=this.interval.time*Ct[this.interval.unit].size:typeof this.interval=="number"&&(l=this.interval),l>0&&Number.isFinite(l))return l}return Math.ceil((n-i)/s)}calculateSteps(e){const n=this.normalizeTimeValue(e.minValue),i=this.normalizeTimeValue(e.maxValue),s=Math.max(1,e.maxSteps??1);if(n==null||i==null)return{steps:0,interval:0,baseInterval:0,graphMin:null,graphMax:null,ticks:[]};const l=+n,a=+i;if(l>=a)return{steps:0,interval:0,baseInterval:0,graphMin:l,graphMax:a,ticks:[]};const r=aC(this.interval);let c;r?c=r:c={ms:Math.max(1,Math.ceil((a-l)/Math.max(1,s))),unit:null,time:null};const d=a-l,h=this.fixedSteps?c:mC(c,d,s),u=h.ms,f=hC(l,a,h);return{steps:Math.max(0,f.length-1),interval:u,baseInterval:c.ms,graphMin:l,graphMax:a,ticks:f}}draw(e,n,i,s,l){var b,k,T,w,M,V,x,S,L,I,v,W,E,G,R,X,Z,N;const a=this.ctx,r=this.options,c={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},d=i.graphMin,h=i.graphMax,u=i.ticks,f=c[this.units.rectStart],m=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=5;let C=0;if(this.drawAxisTitle(e,n),a.font=O.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),this.showAxis&&(a.lineWidth=this.axisLineWidth,C=O.aliasPixel(a.lineWidth),a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+C),a.lineTo(m,g+C)):(a.moveTo(g+C,f),a.lineTo(g+C,m)),a.stroke(),a.closePath()),!(!(u!=null&&u.length)||d===null)){if((b=this.labelStyle)!=null&&b.show){const P=c.x2-c.x1,B=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=O.aliasPixel(a.lineWidth);let Y;for(let H=0;H<u.length;H++){const K=u[H];let D;if(this.type==="x"?D=q.calculateX(K,d,h,P,c.x1):D=q.calculateY(K,d,h,B,c.y2),D===null)continue;K===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const _=D+C;Y=this.getLabelFormat(K,{prev:u[H-1]??""});const ee=((T=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:T.use)&&((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((V=l==null?void 0:l.dataIndex)==null?void 0:V.length)&&!(l!=null&&l.label.map(ne=>this.getLabelFormat(ne,{prev:u[H-1]??""})).includes(Y));let J;H===u.length-1&&this.lastLabelFontStyle?(a.font=O.getLabelStyle(this.lastLabelFontStyle),J=this.lastLabelFontStyle.color):H===0&&this.firstLabelFontStyle?(a.font=O.getLabelStyle(this.firstLabelFontStyle),J=this.firstLabelFontStyle.color):(a.font=O.getLabelStyle(this.labelStyle),J=this.labelStyle.color);let te=1;O.getColorStringType(J)==="RGBA"&&(te=O.getOpacity(J)),a.fillStyle=O.colorStringToRgba(J,ee?(x=this.options)==null?void 0:x.unSelectedOpacity:te);let U;if(this.type==="x"){if(U=this.position==="top"?g-10:g+10,((S=r==null?void 0:r.brush)!=null&&S.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(Y),D,U),!ee&&((L=r==null?void 0:r.selectItem)!=null&&L.showLabelTip)&&(s!=null&&s.label)&&!((I=this.options)!=null&&I.horizontal)){const ne=this.getLabelFormat(s.label);if(ne===Y){const Q=Math.round(a.measureText((v=this.labelStyle)==null?void 0:v.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ne).width)+10,height:Q,x:D,y:U+(Q-2),borderRadius:2,arrowSize:3,text:Y,backgroundColor:(E=(W=r==null?void 0:r.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:E.backgroundColor,textColor:(R=(G=r==null?void 0:r.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:R.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(_,g),a.lineTo(_,g+y),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(_,g),a.lineTo(_,p),a.stroke(),a.closePath())}else{U=this.position==="left"?g-10:g+10,((X=r==null?void 0:r.brush)!=null&&X.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(Y),U,D);let ne=_;H===u.length-1&&(ne-=1),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),ne),a.lineTo(g-y,ne),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,ne),a.lineTo(p,ne),a.stroke(),a.closePath())}}}((Z=this.plotBands)!=null&&Z.length||(N=this.plotLines)!=null&&N.length)&&(this._plotGeom={aPos:c,axisMin:d,axisMax:h,aliasPixel:C,chartRect:e,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:e,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=e.x1,u=e.x2+d,f=e.y1-d,m=e.y2,g={minX:h,maxX:u,minY:f,maxY:m};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(k=>{const T=Xe({},k,Ko),{from:w,to:M,label:V,border:x}=T,S=O.isNullOrUndefined(w)?n:Math.max(w,n),L=O.isNullOrUndefined(M)?i:Math.min(M,i);let I,v;if(this.type==="x"){if(I=q.calculateX(S,n,i,r,h),v=q.calculateX(L,n,i,r,h),I===null||v===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(I,v,h,u,f,m,x)}else{if(I=q.calculateY(S,n,i,c,m),v=q.calculateY(L,n,i,c,m),I===null||v===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(I,v,h,u,f,m,x)}this.drawPlotBandLabel(I,v,V,g,l,S,L)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const T=Xe({},k,Ao),{value:w,label:M}=T;let V;if(this.type==="x"){if(V=q.calculateX(w,n,i,r,h),V===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(V,h,u,f,m)}else{if(V=q.calculateY(w,n,i,c,m),V===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(V,h,u,f,m)}this.drawPlotLineLabel(V,M,g,l,w)})}}class gC extends bi{getTruthyValue(e){const n=this.adjustedDecimalPoint??this.decimalPoint;return ve(e)?Number(e.toFixed(n)):e}getLabelFormat(e,n={}){if(this.formatter){const s=this.getTruthyValue(e),l=this.formatter(s,{...n,prevOriginalValue:n==null?void 0:n.prev,prevDecimalPointValue:this.getTruthyValue(n==null?void 0:n.prev),currentOriginalValue:e,currentDecimalPointValue:s});if(typeof l=="string")return l}const i=this.adjustedDecimalPoint??this.decimalPoint;return O.labelSignFormat(e,i)}getInterval(e){if(this.interval)return this.interval;let n=0;const i=e.maxValue,s=e.minValue,l=e.maxSteps;if(!l||l<=0)return 0;if(this.startToZero&&s<0){const a=Math.abs(s)+Math.abs(i),r=Math.abs(s)/a,c=Math.abs(i)/a;let d=Math.max(1,Math.round(r*l)),h=Math.max(1,l-d);d+h>l&&(r>c?d-=1:h-=1),n=Math.max(Math.abs(s)/(d||1),Math.abs(i)/(h||1))}else n=(i-s)/l;return this.decimalPoint?n:Math.ceil(n)}getExactInterval(e,n){if(!Number.isFinite(e)||e<=0)return{interval:1,steps:1};const i=Math.max(1,n);let s=null,l=0,a=1/0;for(let r=i;r>=1;r--){const c=e/r;let d=1;for(let h=0;h<=12;h++,d*=10){const u=c*d;if(Math.abs(u-Math.round(u))<1e-6){h<a&&c<e&&(a=h,s=Math.round(u)/d,l=r);break}}if(a===0)break}return l>0?{interval:s,steps:l}:{interval:parseFloat((e/i).toFixed(12)),steps:i}}getStepsWithNiceScale({max:e,min:n,maxSteps:i}){const s=e-n;if(!Number.isFinite(s)||s<=0)return{max:n+1,min:n,interval:1,steps:1};const l=s/i,a=Math.floor(Math.log10(l)),r=Math.ceil(Math.log10(s));let c=e,d=n,h=0,u=0,f=1/0;for(let m=a;m<=r;m++){const g=10**m;for(const p of eC){const y=p*g;if(y>=l){const C=y*1e-10,b=Math.floor((n+C)/y)*y,k=Math.ceil((e-b-C)/y),T=b+y*k;if(k<=i&&T>=e-C){const w=n-b+(T-e);w<f&&(c=T,d=b,h=y,u=k,f=w)}}}}if(!(h>0)||u<=0){const m=Math.max(1,i),g=s/m||1;return{max:e,min:n,interval:g,steps:m}}return{max:c,min:d,interval:h,steps:u}}getDecimalPointFromInterval(e){if(!Number.isFinite(e)||e===0)return 0;const n=Math.abs(e),i=10,s=1e-10,l=(c,d=0)=>{const h=10**d;return Math.round((c+Number.EPSILON)*h)/h},a=(c,d)=>{const h=l(c,d);return Math.abs(c-h)<s};if(n>=1&&a(n,0))return 0;const r=n>=1?0:Math.max(0,Math.ceil(-Math.log10(n)));for(let c=r;c<=i;c+=1)if(a(n,c))return c;return i}getLegacyOneMaxScale(e){return this.decimalPoint?e>2?{interval:.2,steps:5}:{interval:.5,steps:2}:{interval:1,steps:1}}calculateSteps(e){const{minValue:n,maxValue:i}=e,s=Math.max(1,e.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(e):null,c=r!=null&&r>0&&Number.isFinite(r),d=l?+this.range[0]:null,h=l?+this.range[1]:null,u=1e-10,f=b=>{if(this.decimalPoint==="auto"){const k=this.getDecimalPointFromInterval(b);k!=null&&!Number.isNaN(k)?this.adjustedDecimalPoint=k:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(b):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},m=(b,k)=>Math.max(1,Math.round(b/k+u)),g=({min:b,max:k,interval:T})=>{let w=0,M=0;return b>=0?(w=+b,M=Math.ceil(k/T)*T):k>=0?(w=Math.floor(b/T)*T,M=Math.ceil(k/T)*T):(M=+k,w=Math.floor(b/T)*T),{graphMin:w,graphMax:M}};if(l&&c){const b=d,k=h,T=r,M=(k-b)/T;if(Math.abs(M-Math.round(M))<u&&M<=s||this.fixedSteps){const x=Math.round(M);return f(T),{steps:x,interval:T,graphMin:b,graphMax:k}}}if(l){const b=d,k=h,T=k-b,{interval:w,steps:M}=this.getExactInterval(T,s);return f(w),{steps:M,interval:w,graphMin:b,graphMax:k}}if(c){let b=r,k=0,T=0,w=0,M=0;for({graphMin:k,graphMax:T}=g({min:n,max:i,interval:b}),w=T-k,M=m(w,b);M>s;)b+=r,{graphMin:k,graphMax:T}=g({min:n,max:i,interval:b}),w=T-k,M=m(w,b);return f(b),{steps:M,interval:b,graphMin:k,graphMax:T}}const p=this.startToZero&&n>=0?0:n,y=this.startToZero&&i<=0?0:i;if(p===0&&y===1){const b=this.getLegacyOneMaxScale(s);return f(b.interval),{steps:b.steps,interval:b.interval,graphMin:p,graphMax:y}}const C=this.getStepsWithNiceScale({min:p,max:y,maxSteps:s});return f(C.interval),{steps:C.steps,interval:C.interval,graphMin:C.min,graphMax:C.max}}calculateScaleRange(e,n){var u;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(a)||typeof a=="function")&&((e==null?void 0:e.min)==null||(e==null?void 0:e.max)==null)){const f=this.getLabelFormat(0),m=this.getLabelFormat(1,{isMaxValueSameAsMin:!0});return{min:0,max:1,minLabel:f,maxLabel:m,size:O.calcTextSizeCanvas(m,O.getLabelStyle(this.labelStyle))}}Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+e.max?+e.max:a[1],s=a[0]<+e.min?+e.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(e.min,e.max):(i=e.max,s=e.min);const c=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!c){const f=i,m=i*(this.autoScaleRatio+1);if(i=this.decimalPoint?m:Math.ceil(m),i>0&&s<0){const g=f-i;s+=g}else if(i<0&&s<0){const g=s*(this.autoScaleRatio+1);s=this.decimalPoint?g:Math.ceil(g)}}this.startToZero&&!c&&(s>0&&(s=0),i<0&&(i=0)),i===s&&(i+=1,l=!0);const d=this.getLabelFormat(s),h=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:d,maxLabel:h,size:O.calcTextSizeCanvas(h,O.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class bC extends bi{calculateScaleRange(e){let n,i,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],i=this.range[0]):typeof range=="function"?[i,n]=this.range(e.min,e.max):(n=e.max,i=e.min);const l=O.calculateMagnitude(n-i);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(i=0),n===i&&(n+=1,s=!0);const a=this.getLabelFormat(i),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:i,max:n,minLabel:a,maxLabel:r,size:O.calcTextSizeCanvas(r,O.getLabelStyle(this.labelStyle))}}calculateSteps(e,n){const i=e.maxValue,s=e.minValue,l=e.maxSteps,a=O.calculateMagnitude(i-s);let r=this.getInterval(e),c;const d=i,h=s,u=d-h;for(c=Math.round(u/r),i===1&&(r=.2,c=5);(c>l||c*2<l)&&!n;)if(c>l)r*=2,c=Math.ceil(u/r);else if(a>=0)if(r/2%1===0)r/=2,c=Math.ceil(u/r);else break;else r/=2,c=Math.ceil(u/r);return{steps:c,interval:r,graphMin:h,graphMax:Math.ceil(h+c*r)}}getLabelFormat(e,n={}){if(this.formatter){const i=this.formatter(e,n);if(typeof i=="string")return i}return O.labelSignFormat(e,this.decimalPoint)}getInterval(e){const n=e.maxValue,i=e.minValue;return 10**O.calculateMagnitude(n-i)}}const Jo=new WeakMap;class yC extends bi{constructor(e,n,i,s,l){super(e,n,i,l),this.labels=s}getMaxWidth(e,n){var s;const i=(s=this.labelStyle)==null?void 0:s.maxWidth;if(i==null)return n;if(typeof i=="string"){const l=i.trim();if(l.includes("%")){const r=Number.parseFloat(l.replace("%",""));return Number.isNaN(r)?n:e.chartWidth*(r/100)}const a=Number.parseFloat(l);return Number.isNaN(a)?n:a}return i}getStepMinMax(e,n){return this.labelStyle.alignToGridLine?e:n!=null&&n.use?(Jo.has(this.labels)||Jo.set(this.labels,O.getStringMinMax(this.labels)),Jo.get(this.labels)):O.getStringMinMax(this.labels)}calculateScaleRange(e,n,i){const s=this.getStepMinMax(e,n);let l=s.max,a=s.min,r=0,c=this.labels.length-1,d=this.labels.length;const h=n!=null&&n.use?n==null?void 0:n.range:this.range;if(Array.isArray(h)&&(h!=null&&h.length)){const[f,m]=h;ve(f)&&ve(m)&&(r=f<r?r:f,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[f,m]=h(a,l);r=f<r?r:f,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1}const u=this.getMaxWidth(i,i.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,u),maxLabel:this.getLabelFormat(l,u),size:O.calcTextSizeCanvas(this.getLabelFormat(l,u),O.getLabelStyle(this.labelStyle))}}getIndexInterval(e){const n=e.maxSteps;return this.interval?this.interval:Math.ceil(this.labels.length/n)}calculateSteps(e){const{minValue:n,maxValue:i,minIndex:s,maxIndex:l}=e,a=l-s+1;let r=1;const c=this.labels.every(d=>!isNaN(d));return this.labelStyle.alignToGridLine&&c&&(r=this.getIndexInterval(e)),{oriSteps:a,steps:a,indexInterval:r,graphMin:n,graphMax:i,minIndex:s,maxIndex:l}}draw(e,n,i,s,l){var b,k,T,w,M,V,x,S,L;const a=this.ctx,r=this.labels,c={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},d=i.steps,h=i.indexInterval,u=i.minIndex,f=c[this.units.rectStart],m=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=this.getMaxWidth(e,e.chartWidth/(d+2)),C=5;if(this.drawAxisTitle(e,n),(b=this.labelStyle)!=null&&b.show){a.font=O.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const I=O.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+I),a.lineTo(m,g+I)):(a.moveTo(g+I,f),a.lineTo(g+I,m)),a.stroke(),d===0)return;const v=(m-f)/d,W=this.labelStyle.alignToGridLine;let E=null,G=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let R,X,Z;for(Z=0;Z<d;Z+=h){const N=u+Z,P=this.labels[N];E=Math.round(f+v*Z),G=E+I,R=this.getLabelFormat(P,y);const{selectLabel:B,selectItem:Y,horizontal:H}=this.options;let K;l!=null&&l.targetAxis?K=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":K=H?"y":"x";const D=(B==null?void 0:B.use)&&(B==null?void 0:B.useLabelOpacity)&&K===this.type&&((k=l==null?void 0:l.dataIndex)==null?void 0:k.length)&&!((T=l==null?void 0:l.dataIndex)!=null&&T.includes(N));let z;Z===d-1&&this.lastLabelFontStyle?(a.font=O.getLabelStyle(this.lastLabelFontStyle),z=this.lastLabelFontStyle.color):Z===0&&this.firstLabelFontStyle?(a.font=O.getLabelStyle(this.firstLabelFontStyle),z=this.firstLabelFontStyle.color):(a.font=O.getLabelStyle(this.labelStyle),z=this.labelStyle.color);let _=1;if(O.getColorStringType(z)==="RGBA"&&(_=O.getOpacity(z)),a.fillStyle=O.colorStringToRgba(z,D?(w=this.options)==null?void 0:w.unSelectedOpacity:_),this.type==="x"){X=this.position==="top"?g-10:g+10;const ee=W?E:E+v/2;if(a.fillText(this.checkFixWidth(R),ee,X),!D&&(Y!=null&&Y.showLabelTip)&&(s!=null&&s.label)&&!H){const J=s.label;if(J===R){const te=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(J).width)+10,height:te,x:E+v/2,y:X+(te-2),borderRadius:2,arrowSize:3,text:R,backgroundColor:(V=Y==null?void 0:Y.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(x=Y==null?void 0:Y.labelTipStyle)==null?void 0:x.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(E+v/2,g),a.lineTo(E+v/2,g+C),a.stroke(),a.closePath()),Z>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(G,g),a.lineTo(G,p),a.stroke(),a.closePath())}else{X=this.position==="left"?g-10:g+10;const ee=W?E:E+v/2;a.fillText(this.checkFixWidth(R),X,ee),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),ee),a.lineTo(g-C,ee),a.stroke(),a.closePath()),Z>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,G),a.lineTo(p,G),a.stroke(),a.closePath())}a.stroke()}if(this.showLastLabel){const N=u+d-1;if(u+Math.floor((d-1)/h)*h!==N){const B=Math.round(f+v*(d-1)),Y=W?B:B+v/2,H=this.getLabelFormat(r[N],y);a.font=this.lastLabelFontStyle?O.getLabelStyle(this.lastLabelFontStyle):O.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(H),Y,X):a.fillText(this.checkFixWidth(H),X,Y),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(Y,g),a.lineTo(Y,g+C)):(a.moveTo(g+(this.axisLineWidth??1),Y),a.lineTo(g-C,Y)),a.stroke(),a.closePath())}}if(W&&!this.showLastLabel){const N=T0(+r[1],+r[0]),P=Ho(+r[r.length-1],N);if(isNaN(P))return;E=Math.round(f+v*this.labels.length),G=E+I;const B=this.getLabelFormat(`${P}`,y),Y=E+v/2;a.font=O.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),E,X):a.fillText(this.checkFixWidth(B),X,E),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(Y,g),a.lineTo(Y,g+C)):(a.moveTo(g+(this.axisLineWidth??1),G),a.lineTo(g-C,G)),a.stroke(),a.closePath())}a.closePath()}((S=this.plotBands)!=null&&S.length||(L=this.plotLines)!=null&&L.length)&&(this._plotGeom={aPos:c,startPoint:f,endPoint:m,chartRect:e,aliasPixel:O.aliasPixel(a.lineWidth)})}drawPlots(){var g,p,y,C;if(!((g=this.plotBands)!=null&&g.length||(p=this.plotLines)!=null&&p.length)||!this._plotGeom)return;const e=this.labels,{aPos:n,startPoint:i,endPoint:s,chartRect:l,aliasPixel:a}=this._plotGeom,r=a+1,c=n.x1+r,d=n.x2,h=n.y1+r,u=n.y2,f=(s-i)/(this.labelStyle.show?e.length:1),m={minX:c,maxX:d,minY:h,maxY:u};this.plotLabelHitRegions=[],(y=this.plotBands)==null||y.forEach(b=>{if(O.isNullOrUndefined(b.from)&&O.isNullOrUndefined(b.to))return;const k=Xe({},b,Ko),{from:T=0,to:w=e.length,label:M,border:V}=k,x=Math.round(i+f*T),S=Math.round(i+f*w);this.setPlotBandStyle(k),this.type==="x"?this.drawXPlotBand(x,S,c,d,h,u,V):this.drawYPlotBand(x,S,c,d,h,u,V),this.drawPlotBandLabel(x,S,M,m,l,T,w)}),(C=this.plotLines)==null||C.forEach(b=>{if(O.isNullOrUndefined(b.value))return;const k=Xe({},b,Ao),{value:T,label:w}=k,M=Math.round(i+f*T)+f/2;this.setPlotLineStyle(k),this.type==="x"?this.drawXPlotLine(M,c,d,h,u):this.drawYPlotLine(M,c,d,h,u),this.drawPlotLineLabel(M,w,m,l,T)})}getLabelFormat(e,n,i={}){if(this.formatter){const s=this.formatter(e,i);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(e,n):e}fittingString(e,n){const i=this.ctx;i.save(),i.font=O.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return O.truncateLabelWithEllipsis(e,n,i,s)}getLabelWidthHasMaxLength(e,n,i=[]){const s=O.getLabelStyle(this.labelStyle),l=(e==null?void 0:e.length)??0,a=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(l+2));return[...(e??[]).map(d=>this.getLabelFormat(d,a)),...i].reduce((d,h)=>{var f;const u=((f=O.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class xC extends bi{constructor(e,n,i,s,l){super(e,n,i),this.labels=s,this.options=l}getLabelFormat(e,n={}){if(this.formatter){const i=this.formatter(e,n);if(typeof i=="string")return i}return Pe(e).format(this.timeFormat)}calculateScaleRange(e,n,i){const s=super.calculateScaleRange(e,n,i),l=this.labels;if(!(l!=null&&l.length))return{...s,minIndex:0,maxIndex:-1};let a=0,r=l.length-1;const{min:c,max:d}=s;if(Number.isFinite(c)&&Number.isFinite(d)){const h=l.findIndex(f=>f>=c);let u=-1;for(let f=l.length-1;f>=0;f-=1)if(l[f]<=d){u=f;break}h===-1||u===-1||u<h?(a=0,r=-1):(a=h,r=u)}else{const h=n!=null&&n.use?n==null?void 0:n.range:this.range;h!=null&&console.warn("[EVUI][TimeCategoryScale] axis range가 유효한 min/max 숫자로 해석되지 않아 전체 라벨 범위로 폴백합니다. range 설정을 확인하세요:",h)}return{...s,minIndex:a,maxIndex:r}}getInterval(e){const n=e.maxValue,i=e.minValue,s=e.maxSteps;if(this.interval){if(typeof this.interval=="string")return Ct[this.interval].size;if(typeof this.interval=="object")return this.interval.time*Ct[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-i)/s)}calculateSteps(e){const{maxValue:n,minValue:i,maxSteps:s,minIndex:l,maxIndex:a}=e,r=this.getInterval(e);let c=r,d=i,h;for(;d<n;)d+=c;const u=d>n?n:d,f=i,m=u-f;h=Math.round(m/c)+1;const g=h;for(n===1&&(c=.2,h=5);h>s;)c*=2,h=Math.round(m/c),c=Math.ceil(m/h);return u-f>h*c&&(c=Math.ceil((u-f)/h)),{steps:h,oriSteps:g,interval:c,rawInterval:r,graphMin:f,graphMax:u,minIndex:l,maxIndex:a}}draw(e,n,i,s,l){var E,G,R,X,Z,N,P,B,Y,H,K,D,z,_,ee,J;const a=this.ctx,r=this.labels,c={x1:e.x1+n.left,x2:e.x2-n.right,y1:e.y1+n.top,y2:e.y2-n.bottom},d=i.steps,h=i.graphMin,u=i.graphMax,f=i.rawInterval,m=i.oriSteps;let g=c[this.units.rectStart];const p=c[this.units.rectEnd],y=c[this.units.rectOffset(this.position)],C=c[this.units.rectOffsetCounter(this.position)],b=5;this.drawAxisTitle(e,n),a.font=O.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const k=O.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(g,y+k),a.lineTo(p,y+k)):(a.moveTo(y+k,g),a.lineTo(y+k,p)),a.stroke(),a.closePath(),d===0||h===null)return;const T=this.labelStyle.alignToGridLine,w=(p-g)/(m||1);this.categoryMode&&!T&&(g+=Math.ceil(w/2)-2);const M=[];let V=null,x=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let S,L,I;const v=d<=2?Math.max(1,m-1):Math.round(m/d),W=v===m?m:m-1;for(I=0;I<=W;I+=v){M[I]=Pe(h).valueOf()+I*f,V=Math.round(g+w*I),x=V+k;let te;for(let $=0;$<M.length;$++)M[$]!==void 0&&$!==I&&(te=M[$]);S=this.getLabelFormat(Math.min(u,M[I]),{prev:te});const U=((G=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:G.use)&&((X=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:X.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((Z=l==null?void 0:l.dataIndex)==null?void 0:Z.length)&&!(l!=null&&l.label.map($=>this.getLabelFormat(Math.min(u,$),{prev:te})).includes(S)),ne=this.labelStyle.color;let Q=1;if(O.getColorStringType(ne)==="RGBA"&&(Q=O.getOpacity(ne)),a.fillStyle=O.colorStringToRgba(ne,U?(N=this.options)==null?void 0:N.unSelectedOpacity:Q),this.type==="x"){if(L=this.position==="top"?y-10:y+10,a.fillText(this.checkFixWidth(S),V,L),!U&&((B=(P=this.options)==null?void 0:P.selectItem)!=null&&B.showLabelTip)&&(s!=null&&s.label)&&!((Y=this.options)!=null&&Y.horizontal)){const $=this.getLabelFormat(Math.min(u,s.label+0*f));if($===S){const j=Math.round(a.measureText((H=this.labelStyle)==null?void 0:H.fontSize).width);O.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText($).width)+10,height:j,x:V,y:L+(j-2),borderRadius:2,arrowSize:3,text:S,backgroundColor:(z=(D=(K=this.options)==null?void 0:K.selectItem)==null?void 0:D.labelTipStyle)==null?void 0:z.backgroundColor,textColor:(J=(ee=(_=this.options)==null?void 0:_.selectItem)==null?void 0:ee.labelTipStyle)==null?void 0:J.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(x,y),a.lineTo(x,y+b),a.stroke(),a.closePath()),I<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(x,y),a.lineTo(x,C),a.stroke(),a.closePath())}else L=this.position==="left"?y-10:y+10,a.fillText(this.checkFixWidth(S),L,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(y+(this.axisLineWidth??1),x),a.lineTo(y-b,x),a.stroke(),a.closePath()),I<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(y,x),a.lineTo(C,x),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&T&&I*v===m){const te=Pe(r[1]).diff(Pe(r[0])),U=this.getLabelFormat(Pe(M[m-1]+te));V=Math.round(g+w*m),x=V+k,this.type==="x"?(a.fillText(this.checkFixWidth(U),V,L),this.showGrid&&(a.moveTo(x,y),a.lineTo(x,C))):(a.fillText(this.checkFixWidth(U),L,V),this.showGrid&&(a.moveTo(y,x),a.lineTo(C,x))),a.stroke()}a.closePath()}}const SC={createTitle(){this.titleDOM=document.createElement("div"),this.titleDOM.className="ev-chart-title",this.wrapperDOM.appendChild(this.titleDOM)},initTitle(){this.isInitTitle||this.createTitle(),this.updateTitle(),this.isInitTitle=!0},showTitle(){this.titleDOM.style.display="block",this.wrapperDOM.style.paddingTop=`${this.options.title.height}px`},hideTitle(){this.titleDOM.style.display="none",this.wrapperDOM.style.paddingTop="0px"},updateTitle(){const t=this.options.title;Object.keys(t.style).forEach(e=>{this.titleDOM.style[e]=t.style[e]}),this.titleDOM.textContent=t.text,this.titleDOM.style.height=`${t.height}px`,this.titleDOM.style.lineHeight=`${t.height}px`}},CC={createLegendLayout(){var t,e;this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",(e=(t=this.options)==null?void 0:t.legend)!=null&&e.allowResize&&(this.resizeDOM=document.createElement("div"),this.resizeDOM.className="ev-chart-resize-bar",this.ghostDOM=document.createElement("div"),this.ghostDOM.className="ev-chart-resize-ghost",this.wrapperDOM.appendChild(this.resizeDOM)),this.useTable?(this.legendTableDOM=document.createElement("table"),this.legendTableDOM.className="ev-chart-legend--table",this.setLegendColumnHeader(),this.legendBoxDOM.appendChild(this.legendTableDOM),this.legendDOM.style.overflow="auto"):(this.legendBoxDOM.style.overflowX="hidden",this.legendBoxDOM.style.overflowY="auto",this.legendBoxDOM.style.height="100%"),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM),this.options.legend.virtualScroll&&!this.useTable&&(this.legendTopSpacer=document.createElement("div"),this.legendTopSpacer.className="ev-chart-legend--top-spacer",this.legendTopSpacer.style.clear="both",this.legendTopSpacer.style.opacity=0,this.legendBottomSpacer=document.createElement("div"),this.legendBottomSpacer.className="ev-chart-legend--bottom-spacer",this.legendBottomSpacer.style.clear="both",this.legendBottomSpacer.style.opacity=0,this.legendBoxDOM.appendChild(this.legendTopSpacer),this.legendBoxDOM.appendChild(this.legendBottomSpacer),this.updateVisibleRowCountFrameId=requestAnimationFrame(()=>{this.updateVisibleRowCount()}))},setLegendColumnHeader(){var i;const t=(i=this.options.legend)==null?void 0:i.table,e=t.columns;["color",...Object.keys(e)].forEach(s=>{var a,r;const l=document.createElement("th");if(l.className="ev-chart-legend--table__column-name",(a=e[s])!=null&&a.use||s==="color"||s==="name"){const c=e[s],d=(c==null?void 0:c.title)??"";l.textContent=d,l.setAttribute("title",d),l.dataset.type=d,O.setDOMStyle(l,(r=t==null?void 0:t.style)==null?void 0:r.header),this.legendTableDOM.append(l)}})},initLegend(){var t,e;this.isHeatMapType=this.options.type==="heatMap",this.useTable=!!((e=(t=this.options.legend)==null?void 0:t.table)!=null&&e.use)&&this.options.type!=="heatmap"&&this.options.type!=="scatter",this.legendItemHeight=18,this.isInitLegend||this.createLegendLayout(),this.isHeatMapType?(this.initEventForColorLegend(),this.addColorLegendList()):(this.initEvent(),this.addLegendList()),this.initResizeEvent(),this.isInitLegend=!0,this.isLegendMove=!1},updateVisibleRowCount(){const t=this.options.legend.position==="right"||this.options.legend.position==="left",e=this.legendBoxDOM.clientHeight,n=this.legendBoxDOM.clientWidth,i=Math.max(this.options.legend.width-8,1),s=Object.values(this.seriesList).filter(l=>l.showLegend!==!1).length;this.itemsPerRow=t?1:Math.floor(n/i),this.totalRowCount=Math.ceil(s/this.itemsPerRow),this.visibleRowCount=e>this.legendItemHeight?Math.round(e/this.legendItemHeight)+1:this.totalRowCount},updateStartEndRowIndex(){var e;const t=Math.max(Math.floor(((e=this.legendBoxDOM)==null?void 0:e.scrollTop)/this.legendItemHeight),0);this.startRowIndex=Math.min(t,Math.max(this.totalRowCount-this.visibleRowCount,0)),this.endRowIndex=this.startRowIndex+this.visibleRowCount+1},renderVisibleLegends(){this.updateStartEndRowIndex();const t=this.legendBoxDOM.querySelectorAll(".ev-chart-legend-container");if(t&&t.length)for(const c of t)c.remove();const e=this.totalRowCount*this.legendItemHeight,n=this.startRowIndex*this.legendItemHeight,i=Math.max(e-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${i}px`;const s=this.startRowIndex*this.itemsPerRow,l=this.endRowIndex*this.itemsPerRow,a=this.data.groups.at(0);let r=[];if(a?r=a.filter(c=>this.seriesList[c].showLegend).map(c=>[c,this.seriesList[c]]):r=Object.entries(this.seriesList).filter(([,c])=>c.showLegend),r&&r.length)for(let c=s;c<l&&c<r.length;c++){const[,d]=r[c];this.addLegend(d)}},addLegendList(){const{groups:t}=this.data,{seriesList:e}=this;this.options.legend.virtualScroll&&!this.useTable?this.renderVisibleLegendsFrameId=requestAnimationFrame(()=>{this.renderVisibleLegends()}):(this.addLegendForGroups(t,e,this.useTable),this.addStandaloneLegends(e,this.useTable))},addLegendForGroups(t,e,n){t==null||t.forEach(i=>{i==null||i.forEach(s=>{const l=e[s];l&&l.showLegend&&this.addLegendBasedOnType(l,n)})})},addStandaloneLegends(t,e){Object.values(t).forEach(n=>{!n.isExistGrp&&n.showLegend&&this.addLegendBasedOnType(n,e)})},addLegendBasedOnType(t,e){e?this.addLegendWithValues(t):this.addLegend(t)},addColorLegendList(){const t=this.seriesList;Object.values(t).forEach(e=>{if(!e.isExistGrp&&e.showLegend){const{colorState:n,valueOpt:i}=e,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=i,d=n.length,h=r?d-2:d-1;for(let u=0;u<d;u++){const{id:f,color:m,label:g=""}=n[u],p=s+a*u;let y=p+a;u<h?y-=.1**c:y=l+.1**c;let C=g;if(!C)if(C=`${p.toFixed(c)} - ${y.toFixed(c)}`,s===void 0||l===void 0)if(u===0)C="0";else break;else{if(p>l)break;a<=1&&c===0&&(C=p)}this.addLegend({cId:f,color:m,name:C,show:!0})}}})},getContainerDOM(t){let e=null;const n=t.target.dataset.type;return n==="container"?e=t.target:["name","color","min","max","avg","total","last"].includes(n)&&(e=t.target.parentElement,e!=null&&e.series||(e=e.parentElement)),e},initEvent(){if(this.isInitLegend)return;const t={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`,value:`ev-chart-legend${this.useTable?"--table__value":"-value"}`},e=(l,a)=>{const r=l==null?void 0:l.getElementsByClassName(t.color)[0],c=l==null?void 0:l.getElementsByClassName(t.name)[0],d=l==null?void 0:l.getElementsByClassName(t.value),h=l==null?void 0:l.series;if(r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a,d&&d.length)for(const u of d)u.style.color=a;h.show=!1,l.dataset.inactive=!0},n=(l,a)=>{var f,m;let r;const c=l==null?void 0:l.getElementsByClassName(t.color)[0],d=l==null?void 0:l.getElementsByClassName(t.name)[0],h=l==null?void 0:l.getElementsByClassName(t.value),u=l==null?void 0:l.series;if(typeof u.color!="string"?r=u.color[u.color.length-1][1]:r=u.color,u.type==="line"&&u.fill?(c.style.height="8px",c.style.backgroundColor=O.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const g of h){const p=(m=(f=this.options.legend.table)==null?void 0:f.columns[g.dataset.type])==null?void 0:m.style;g.style.color=p!=null&&p.color?p.color:a}u.show=!0,l.dataset.inactive=!1},i=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!1})},s=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!0})};this.onLegendBoxClick=l=>{var y;const{legend:a}=this.options;if(a!=null&&a.stopClickEvt)return;const{chartIdx:r}=this.data,c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(t.color)[0],h=c==null?void 0:c.getElementsByClassName(t.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false";if(!d||!h)return;if(a.clickMode==="active"){const C=Array.from(this.legendBoxDOM.getElementsByClassName(t.container));C.every(T=>T.dataset.inactive==="false")?(C.forEach(T=>{e(T,a.inactive)}),i(),n(c,a.color),this.seriesInfo.count=1):u?(e(c,a.inactive),this.seriesInfo.count--):u||(n(c,a.color),this.seriesInfo.count++),C.every(T=>T.dataset.inactive==="true")&&(C.forEach(T=>{n(T,a.color)}),s(),this.seriesInfo.count=C.length)}if(a.clickMode!=="active"){if(u&&this.seriesInfo.count===1)return;u?(e(c,a.inactive),this.seriesInfo.count--):(n(c,a.color),this.seriesInfo.count++)}if(this.brushSeries){const C=[...this.brushSeries.list];C[r]=this.seriesList,this.brushSeries.list=C,this.brushSeries.chartIdx=r}((y=this.options.eventBehavior)==null?void 0:y.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=Object.values(this.seriesList).filter(C=>C.show).map(C=>C.sId),g=m.length===Object.values(this.seriesList).length,p={e:l,data:{seriesIds:g?[]:m,isActiveAll:g}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](p)},this.onLegendBoxLeave=()=>{this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})},this.onLegendBoxOver=l=>{var d;const a=this.getContainerDOM(l);if(!a){this.onLegendBoxLeave();return}const c={sId:(d=a==null?void 0:a.series)==null?void 0:d.sId,type:this.options.type};this.legendHover=c,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:c},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.addEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.addEventListener("scroll",this.renderVisibleLegends.bind(this))),this.initResizeEvent()},initEventForColorLegend(){if(this.isInitLegend)return;const t={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`},e=(l,a)=>{var f;const r=l==null?void 0:l.getElementsByClassName(t.color)[0],c=l==null?void 0:l.getElementsByClassName(t.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a;const u=d.colorState.findIndex(m=>m.id===h);u>-1&&(d.colorState[u].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var f,m;const r=l==null?void 0:l.getElementsByClassName(t.color)[0],c=l==null?void 0:l.getElementsByClassName(t.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=(m=l==null?void 0:l.series)==null?void 0:m.color,c.style.color=a;const u=d.colorState.findIndex(g=>g.id===h);u>-1&&(d.colorState[u].show=!0),l.dataset.inactive=!1},i=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!1})},s=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!0})};this.onLegendBoxClick=l=>{var C;const a=this.options.legend;if(a!=null&&a.stopClickEvt)return;const r=Object.values(this.seriesList)[0],c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(t.color)[0],h=c==null?void 0:c.getElementsByClassName(t.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false",f=r.colorState.filter(b=>b.show).length;if(!d||!h)return;if(a.clickMode==="active"){const b=Array.from(this.legendBoxDOM.getElementsByClassName(t.container));b.every(w=>w.dataset.inactive==="false")?(b.forEach(w=>{e(w,a.inactive)}),i(),n(c,a.color)):u?e(c,a.inactive):u||n(c,a.color),b.every(w=>w.dataset.inactive==="true")&&(b.forEach(w=>{n(w,a.color)}),s())}if(a.clickMode!=="active"){if(u&&f===1)return;u?e(c,a.inactive):n(c,a.color)}((C=this.options.eventBehavior)==null?void 0:C.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=r.colorState.filter(b=>b.show),g=m.map(b=>+b.id.split("#")[1]),p=r.colorState.length===m.length,y={e:l,data:{seriesIndices:p?[]:g,isActiveAll:p}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](y)},this.onLegendBoxLeave=()=>{this.legendHover=null,Object.values(this.seriesList)[0].colorState.forEach(a=>{a.state="normal"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:!0})},this.onLegendBoxOver=l=>{var h,u;const a=(h=Object.values(this.seriesList))==null?void 0:h[0],r=this.getContainerDOM(l);if(!r){this.onLegendBoxLeave();return}const c=(u=r==null?void 0:r.series)==null?void 0:u.cId,d={sId:c,type:this.options.type};this.legendHover=d,a.colorState.forEach(f=>{f.state=f.id===c?"highlight":"downplay"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:d},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.initResizeEvent()},initResizeEvent(){this.onResizeMouseDown=t=>{t.stopPropagation(),t.preventDefault();const e=this.options,n=e.legend.position,i=e.title.show?e.title.height:0,s=this.ghostDOM;this.resizeDOM.style.display="none",this.wrapperDOM.appendChild(s),n==="left"||n==="right"?(s.style.top=`${i}px`,s.style.left=this.resizeDOM.style.left,s.style.right=this.resizeDOM.style.right,s.style.height=this.resizeDOM.style.height):(s.classList.add("horizontal"),n==="top"?s.style.top=this.resizeDOM.style.top:n==="bottom"&&(s.style.bottom=this.resizeDOM.style.bottom)),this.wrapperDOM.addEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.addEventListener("mouseup",this.mouseUp,!1)},this.resizeDOM&&(this.resizeDOM.addEventListener("mousedown",this.onResizeMouseDown),this.mouseMove=this.onMouseMove.bind(this),this.mouseUp=this.onMouseUp.bind(this))},updateLegend(){this.resetLegend(),this.isHeatMapType?this.addColorLegendList():this.addLegendList()},updateLegendTableValues(){var i,s,l,a,r;const t=(l=(s=(i=this.options)==null?void 0:i.legend)==null?void 0:s.table)==null?void 0:l.columns,e=this.getAggregations(),n=(a=this.legendBoxDOM)==null?void 0:a.getElementsByClassName("ev-chart-legend--table__row");if(n&&n.length)for(const c of n){const d=c==null?void 0:c.getElementsByClassName("ev-chart-legend--table__value");if(d&&d.length)for(const h of d){const u=h.dataset.type;if(u!=="name"){const f=c.series.sId,m=(r=e==null?void 0:e[f])==null?void 0:r[u];h.textContent=this.getFormattedValue(t[u],m)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var e,n;const t=this.legendBoxDOM;if(t){if(this.useTable){const i=this.legendTableDOM;for(;i.hasChildNodes();)i.removeChild(i.firstChild);this.setLegendColumnHeader()}else if(this.options.legend.virtualScroll)((n=(e=this.legendDOM)==null?void 0:e.style)==null?void 0:n.display)==="none"?this.legendNeedsUpdate=!0:(this.updateVisibleRowCount(),this.renderVisibleLegends());else for(;t.hasChildNodes();)t.removeChild(t.firstChild);this.seriesInfo.count=0}},destroyLegend(){const t=this.legendDOM;this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),t&&(t.remove(),this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.isInitLegend=!1,this.seriesInfo.count=0)},addLegend(t){const e=this.options.legend,n=document.createElement("div"),i=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!t.show,n.series=t,i.className="ev-chart-legend-color",t.type==="line"&&t.point&&!t.fill&&(i.className+=" ev-chart-legend-color--point-line"),s.className="ev-chart-legend-name";let l;t.show?typeof t.color!="string"?l=t.color[t.color.length-1][1]:l=t.color:l=e.inactive,t.type==="line"&&t.fill?(i.style.height="8px",i.style.backgroundColor=t.show?O.rgbaAdjustHalfOpacity(l):e.inactive,i.style.border=`1px solid ${l}`):i.style.backgroundColor=l,i.dataset.type="color",s.style.color=e.color,s.textContent=t.name,s.setAttribute("title",t.name),s.dataset.type="name",n.appendChild(i),n.appendChild(s),e.position==="top"||e.position==="bottom"?(n.style.width=`${e.width-8}px`,n.style.margin="0 4px"):n.style.width="100%",n.style.height=`${this.legendItemHeight}px`,n.style.display="inline-block",n.style.overflow="hidden",n.dataset.type="container",this.legendBoxDOM.insertBefore(n,this.legendBottomSpacer),t.show&&this.seriesInfo.count++},addLegendWithValues(t){var h,u,f,m,g;const e=this.options.legend,n=(h=e==null?void 0:e.table)==null?void 0:h.columns,i=(u=this.getAggregations())==null?void 0:u[t==null?void 0:t.sId];if(!i||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!t.show,O.setDOMStyle(s,(m=(f=e.table)==null?void 0:f.style)==null?void 0:m.row),s.series=t,s.dataset.type="container";const l=document.createElement("td");l.className="ev-chart-legend--table__color-wrapper",l.dataset.type="color";const a=document.createElement("div");a.className="ev-chart-legend--table__color",a.dataset.type="color";let r;switch(t.show?typeof t.color!="string"?r=t.color[t.color.length-1][1]:r=t.color:r=e.inactive,t.type){case"line":{t.fill?(a.style.backgroundColor=O.rgbaAdjustHalfOpacity(r),a.style.border=`1px solid ${r}`):(t.point&&(a.className+=" ev-chart-legend--table__color--point-line"),a.className+=" ev-chart-legend--table__color--line",a.style.backgroundColor=r);break}case"bar":case"pie":default:{a.style.height="10px",a.style.backgroundColor=r;break}}t.type==="line"&&t.fill?(a.style.height="8px",a.style.backgroundColor=t.show?O.rgbaAdjustHalfOpacity(r):e.inactive,a.style.border=`1px solid ${r}`):a.style.backgroundColor=r,l.appendChild(a),s.appendChild(l);const c=document.createElement("td");c.className="ev-chart-legend--table__name",c.style.color=t.show?e.color:e.inactive,c.textContent=t.name,c.setAttribute("title",t.name),c.dataset.type="name",O.setDOMStyle(c,(g=n==null?void 0:n.name)==null?void 0:g.style),t.show||(c.style.color=e.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(p=>{var y;if(p!=="name"&&n[p].use){const C=this.getFormattedValue(n[p],i[p]),b=document.createElement("td");b.className="ev-chart-legend--table__value",b.style.color=t.show?e.color:e.inactive,b.textContent=C,b.dataset.type=p.toString(),O.setDOMStyle(b,(y=n[p])==null?void 0:y.style),t.show||(b.style.color=e.inactive),s.appendChild(b)}}),this.legendTableDOM.appendChild(s),t.show&&this.seriesInfo.count++},setLegendPosition(){var g,p,y,C,b,k,T,w,M;const t=this.options,e=(g=t==null?void 0:t.legend)==null?void 0:g.position,n=(p=this.wrapperDOM)==null?void 0:p.style,i=(y=this.legendDOM)==null?void 0:y.style,s=(C=this.legendBoxDOM)==null?void 0:C.style,l=(b=this.resizeDOM)==null?void 0:b.style;let a,r;const c=(k=t==null?void 0:t.title)!=null&&k.show?(T=t==null?void 0:t.title)==null?void 0:T.height:0,d=c+((w=t==null?void 0:t.legend)==null?void 0:w.height),{top:h=0,bottom:u=0,left:f=0,right:m=0}=((M=t==null?void 0:t.legend)==null?void 0:M.padding)??{};if(!(!n||!i))switch(s.padding=`${h}px ${m}px ${u}px ${f}px`,e){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${t.legend.height-r}px`,i.top=`${c}px`,i.right="",i.bottom="",i.left="",i.width=`${a.width}px`,i.height=`${t.legend.height+(l?4:0)}px`,l&&(l.top=`${d}px`,l.right="",l.bottom="",l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"right":n.padding=`${c}px ${t.legend.width}px 0 0`,a=this.chartDOM.getBoundingClientRect(),s.width=`${t.legend.width-10}px`,s.maxHeight=`${a.height}px`,i.paddingLeft="10px",i.top=`${c}px`,i.right="0px",i.bottom="",i.left="",i.width=`${t.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right=`${t.legend.width}px`,l.bottom="",l.left="",l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break;case"bottom":n.padding=`${c}px 0 ${t.legend.height}px 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${t.legend.height-r}px`,i.top="",i.right="",i.bottom="0px",i.left="0px",i.width=`${a.width}px`,i.height=`${t.legend.height+(l?4:0)}px`,l&&(l.top="",l.right="",l.bottom=`${t.legend.height}px`,l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"left":n.padding=`${c}px 0 0 ${t.legend.width}px`,a=this.chartDOM.getBoundingClientRect(),s.width=`${t.legend.width}px`,s.maxHeight=`${a.height}px`,s.display="absolute",s.bottom="0px",i.top=`${c}px`,i.right="",i.bottom="",i.left="0px",i.width=`${t.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right="",l.bottom="",l.left=`${t.legend.width}px`,l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break}},updateLegendContainerSize(){var n;if(!this.options||!this.legendBoxDOM)return;const t=(n=this.options)==null?void 0:n.legend,e=this.legendBoxDOM.getElementsByClassName("ev-chart-legend-container");if(e)for(let i=0;i<e.length;i++)t.position==="top"||t.position==="bottom"?(e[i].style.width=`${t.width-8}px`,e[i].style.margin="0 4px"):e[i].style.width="100%"},onMouseMove(t){t.stopPropagation(),t.preventDefault();const e=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,i=this.wrapperDOM.offsetHeight,s=this.options.title.show?this.options.title.height:0,l=this.options.legend.position,a=150,r=70,c=120,d=20;let h;switch(l){case"left":h=t.clientX-e.left,h<c?h=c:h>n-a&&(h=n-a),this.ghostDOM.style.left=`${h}px`;break;case"right":h=t.clientX-e.left,h<a?h=a:h>n-c&&(h=n-c),this.ghostDOM.style.left=`${h}px`;break;case"top":h=t.clientY-e.top,h<d+s?h=d+s:h>i-r&&(h=i-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=t.clientY-e.top,h<r+s?h=r+s:h>i-d&&(h=i-d),this.ghostDOM.style.bottom=`${this.wrapperDOM.offsetHeight-h}px`;break}this.isLegendMove=!0},onMouseUp(t){t.stopPropagation(),t.preventDefault(),this.wrapperDOM.removeEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.removeEventListener("mouseup",this.mouseUp,!1);const e=this.options,n=e.legend.position,i=this.resizeDOM.style,s=this.legendDOM.style,l=this.legendBoxDOM.style,a=this.ghostDOM.style,r=this.wrapperDOM.style,c=e.title.show?e.title.height:0,d=+this.legendDOM.style.paddingLeft.replace("px","");let h;if(this.isLegendMove)switch(n){case"top":i.top=a.top,h=+a.top.replace("px",""),s.height=`${h-c}px`,l.height=`${h-c-4}px`,e.legend.height=h-c-4,r.padding=`${h}px 0 0 0`;break;case"right":i.left=a.left,h=+a.left.replace("px",""),s.width=`${this.wrapperDOM.offsetWidth-h-4}px`,l.width=`${this.wrapperDOM.offsetWidth-h-4-d}px`,e.legend.width=this.wrapperDOM.offsetWidth-h-4,r.padding=`${c}px ${this.wrapperDOM.offsetWidth-h}px 0 0`;break;case"bottom":i.bottom=a.bottom,h=this.wrapperDOM.offsetHeight-+a.bottom.replace("px",""),s.height=`${this.wrapperDOM.offsetHeight-h}px`,l.height=`${h-c-4}px`,e.legend.height=this.wrapperDOM.offsetHeight-h,r.padding=`${c}px 0 ${this.wrapperDOM.offsetHeight-h}px 0`;break;case"left":i.left=a.left,h=+a.left.replace("px",""),s.width=`${h}px`,l.width=`${h}px`,e.legend.width=h,r.padding=`${c}px 0 0 ${h-4}px`;break}i.display="block",this.ghostDOM.remove(),this.isLegendMove&&(this.render(),this.isLegendMove=!1)},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block"),this.legendNeedsUpdate&&this.options.legend.virtualScroll&&!this.useTable&&(this.legendNeedsUpdate=!1,this.updateVisibleRowCount(),this.renderVisibleLegends())},hideLegend(){var l,a,r,c,d;const t=this.options,e=(l=this.wrapperDOM)==null?void 0:l.style,n=(a=this.resizeDOM)==null?void 0:a.style,i=(r=this.legendDOM)==null?void 0:r.style,s=(c=t==null?void 0:t.title)!=null&&c.show?(d=t==null?void 0:t.title)==null?void 0:d.height:0;!i||!e||(n&&(n.display="none"),i.display="none",i.width="0",i.height="0",e.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:t,decimalPoint:e},n){if(n==null)return"Null";let i;return t&&(i=t(+n)),(!t||typeof i!="string")&&(i=O.labelSignFormat(+n,e)),i}},Ur=28,kC={width:70,height:60},wC={createLegendLayout(){this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",this.containerDOM=document.createElement("div"),this.containerDOM.className="ev-chart-legend-container",this.legendBoxDOM.appendChild(this.containerDOM),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM)},initLegend(){this.isInitLegend||(this.createLegendLayout(),this.createLegend()),Object.values(this.seriesList).forEach(t=>{this.setLegendStyle(t)}),this.initEvent(),this.isInitLegend=!0,this.legendDragInfo={dragging:!1,isStart:!0}},initEvent(){this.isInitLegend||(this.onLegendMouseDown=t=>{t.stopPropagation(),t.preventDefault();const e=t.target.dataset.type;let n;if(e==="handle")n=t.target;else if(e==="handle-btn")n=t.target.parentElement;else if(e==="handle-btn-color")n=t.target.parentElement.parentElement;else return;const i=Object.values(this.seriesList);if(!i.length)return;const{colorState:s}=i[0],{start:l,end:a}=s[0];s[0].selectedValue=null,this.clearOverlay(),this.legendDragInfo.dragging=!0,this.legendDragInfo.isStart=l!==a?n.className.includes("start"):this.legendDragInfo.isStart,n.classList.add("dragging"),this.legendBoxDOM.addEventListener("mousemove",this.onLegendMouseMove,!1),this.legendBoxDOM.addEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendMouseMove=t=>{t.stopPropagation(),t.preventDefault();const{dragging:e,isStart:n}=this.legendDragInfo;if(e){let i=this.getSelectedValue(t);i=this.isSide?100-i:i;const s=n?"start":"end",l=Object.values(this.seriesList);if(!l.length)return;const{colorState:a}=l[0],{start:r,end:c}=a[0];if(n&&i>c||!n&&i<r)return;a[0][s]=i,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})}},this.onLegendMouseUp=()=>{this.legendDragInfo.dragging=!1;const t=this.containerDOM.getElementsByClassName("ev-chart-legend-handle dragging")[0];t==null||t.classList.remove("dragging"),this.legendBoxDOM.removeEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendBoxOver=t=>{const e=t.target.dataset.type,n=Object.values(this.seriesList);if(!n.length)return;const{colorState:i,valueOpt:s}=n[0],l=i[0];let a=this.getSelectedValue(t);if(a=this.isSide?100-a:a,["line","thumb","layer","overlay","overlay-item"].includes(e))if(l.start<=a&&a<=l.end)l.selectedValue=a,this.createLegendOverlay(a,s);else return;else if(["handle","handle-btn","handle-btn-color"].includes(e)){const r=t.target.className.includes("start");l.selectedValue=r?l.start:l.end,this.clearOverlay()}else return;this.legendHover={sId:"gradient",type:this.options.type},this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.onLegendBoxLeave=()=>{this.legendDragInfo.dragging=!1,this.legendHover=null,this.clearOverlay();const t=Object.values(this.seriesList);if(!t.length)return;const{colorState:e}=t[0];e[0].selectedValue=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.legendBoxDOM.addEventListener("mousedown",this.onLegendMouseDown),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave))},getSelectedValue(t){const{x:e,y:n,width:i,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?e:n,r=l?i:s;let c=l?t.clientX:t.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+Je(d,r)},updateLegend(){this.resetLegend(),this.createLegend(),Object.values(this.seriesList).forEach(t=>{this.setLegendStyle(t)})},resetLegend(){const t=this.containerDOM;if(t)for(;t.hasChildNodes();)t.removeChild(t.firstChild)},clearOverlay(){const t=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],e=t==null?void 0:t.getElementsByClassName("ev-chart-legend-overlay")[0];if(e){t.removeChild(e);const i=t.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(i&&i.length)for(const s of i)s.style.opacity=1}},createLegendOverlay(t,e){this.clearOverlay();const n=this.legendHandleSize,{min:i,max:s}=e;if(i===void 0||s===void 0)return;const l=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],a=document.createElement("div");a.className="ev-chart-legend-overlay",a.dataset.type="overlay";const r=document.createElement("div");r.className="ev-chart-legend-overlay-tooltip",r.innerText=Math.floor(i+(s-i)*(t/100));const c=document.createElement("span");c.className="ev-chart-legend-overlay-item",c.dataset.type="overlay-item";let d,h;const u=Math.floor(n/2)+14;this.isSide?(h=`top:${100-t}%;left:${u}px;transform:translateY(-50%);`,d=`top:${100-t}%;transform:translateY(-50%);`):(h=`top:-${u}px;left:${t}%;transform:translateX(-50%);`,d=`left:${t}%;transform:translateX(-50%);`),d+=`width:${n-10}px;height:${n-10}px;`,r.style.cssText=h,c.style.cssText=d,a.appendChild(r),a.appendChild(c),l==null||l.appendChild(a);const f=l==null?void 0:l.getElementsByClassName("ev-chart-legend-thumb")[0];if(f){const m=f.children;if(m&&m.length)for(const g of m)g.style.opacity=.2}},createLegendHandle(t){const e=document.createElement("span");e.className=`ev-chart-legend-handle-btn-color ${t}`,e.dataset.type="handle-btn-color";const n=document.createElement("div");n.className=`ev-chart-legend-handle-btn ${t}`,n.dataset.type="handle-btn",n.appendChild(e);const i=document.createElement("div");return i.className=`ev-chart-legend-handle ${t}`,i.dataset.type="handle",i.appendChild(n),i},createLegendLabel(){const t=document.createElement("span");t.className="ev-chart-legend-label-text";const e=document.createElement("div");return e.className="ev-chart-legend-label",e},createLegend(){if(!Object.values(this.seriesList).length)return;const t=this.options.legend;this.isSide=!["top","bottom"].includes(t.position);const e=this.isSide?t.width:t.height;this.legendHandleSize=e>Ur?Ur:e;const n=this.legendHandleSize,i=this.createLegendHandle(this.isSide?"end":"start",n),s=this.createLegendHandle(this.isSide?"start":"end",n),l=document.createElement("div");l.className="ev-chart-legend-line-layer",l.dataset.type="line-layer";const a=document.createElement("div");a.className="ev-chart-legend-thumb",a.dataset.type="thumb",a.appendChild(this.createLegendLabel()),a.appendChild(this.createLegendLabel());const r=document.createElement("div");r.className="ev-chart-legend-line",r.dataset.type="line",r.appendChild(l),r.appendChild(a),this.containerDOM.appendChild(r),this.containerDOM.appendChild(i),this.containerDOM.appendChild(s)},setLegendStyle(t){const e=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:i,colorState:s}=t,{min:l,max:a,decimalPoint:r}=i,{start:c,end:d}=s[0],h=t.getColorForGradient(c),u=t.getColorForGradient(d);let f=`linear-gradient(to ${e}, `;f+=`${h}, ${u})`;const m=Math.floor(n/2)+14;let g=`width:${n}px;height:${n}px;`,p,y,C,b=`background:${f};`;this.isSide?(g+=`margin-top:-${n/2}px;`,p=`left:${m}px;transform:translateY(-50%);top:`,y=`top:${100-d}%;`,C=`top:${100-c}%;`,b+=`top:${100-d}%;height:${d-c}%;`):(g+=`margin-left:-${n/2}px;`,p=`top:-${m}px;transform:translateX(-50%);left:`,y=`left:${c}%;`,C=`left:${d}%;`,b+=`left:${c}%;width:${d-c}%;`);const k=(l+(a-l)*(c/100)).toFixed(r),T=(l+(a-l)*(d/100)).toFixed(r),w=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];w.style.cssText=b;const M=w.getElementsByClassName("ev-chart-legend-label");M[0].style.cssText=`${p}0%;`,M[1].style.cssText=`${p}100%;`,l!==void 0&&a!==void 0&&(M[0].innerText=this.isSide?T:k,M[1].innerText=this.isSide?k:T);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=g+y,V[1].style.cssText=g+C;const x=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");x[0].style.backgroundColor=this.isSide?u:h,x[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var y,C,b,k;const t=this.options,e=(y=t==null?void 0:t.legend)==null?void 0:y.position,{width:n,height:i}=kC,s=this.legendHandleSize,l=(C=t==null?void 0:t.title)!=null&&C.show?(b=t==null?void 0:t.title)==null?void 0:b.height:0,a=l+i,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((k=t==null?void 0:t.legend)==null?void 0:k.padding)??{},u=this.wrapperDOM.style;if(!u)return;let f,m,g,p;switch(e){case"top":u.padding=`${a}px 0 0 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%",m+=`height${i}px;`,f=`width:${p.width}px;`,f+=`height:${i}px;`,f+=`top:${l}px;`;break;case"right":u.padding=`${l}px ${n}px 0 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+=`width:${n}px;`,m+="height:100%;",m+=`max-height:${p.height}px;`,f=`width:${n}px;`,f+=`height:${p.height}px;`,f+=`top:${l}px;right:0px;`;break;case"bottom":u.padding=`${l}px 0 ${i}px 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%;",m+=`height:${i}px;`,f=`width:${p.width}px;`,f+=`height:${i}px;`,f+="bottom:0px;left:0px;";break;case"left":u.padding=`${l}px 0 0 ${n}px`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+="display:absolute;",m+="bottom:0px;",m+=`width:${n}px;`,m+="height:100%;",m+=`maxHeight:${p.height}px;`,f=`width:${n}px;`,f+=`height:${p.height}px;`,f+=`top:${l}px;left:0px`;break}if(["top","bottom"].includes(e)){const T=p.width/2;g=`left:${p.width/2-T/2}px;`,g+=`width:${T}px;`,g+=`height:${s}px;`,g+="padding:4px 0;",g+="margin:0 4px;"}else{const T=p.height/2;g=`top:${p.height/2-T/2}px;`,g+="left:5px;",g+=`width:${s}px;`,g+=`height:${T}px;`,g+="padding:0 4px;",g+="margin:4px 0;"}this.containerDOM.style.cssText=g,this.legendBoxDOM.style.cssText=m,this.legendDOM.style.cssText=f},updateLegendContainerSize(){Object.values(this.seriesList).forEach(t=>{this.setLegendStyle(t)})},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block")},hideLegend(){var s,l,a,r;const t=this.options,e=(s=this.wrapperDOM)==null?void 0:s.style,n=(l=this.legendDOM)==null?void 0:l.style,i=(a=t==null?void 0:t.title)!=null&&a.show?(r=t==null?void 0:t.title)==null?void 0:r.height:0;!n||!e||(n.display="none",n.width="0",n.height="0",e.padding=`${i}px 0 0 0`)}},IC={initScrollbar(){var t,e,n,i,s,l;(n=(e=(t=this.options.axesX)==null?void 0:t[0])==null?void 0:e.scrollbar)!=null&&n.use&&this.initScrollbarInfo(this.options.axesX,"x"),(l=(s=(i=this.options.axesY)==null?void 0:i[0])==null?void 0:s.scrollbar)!=null&&l.use&&this.initScrollbarInfo(this.options.axesY,"y")},initScrollbarInfo(t,e){var s,l,a,r,c,d;const n=this.scrollbar[e],i=Xe({},(s=t==null?void 0:t[0])==null?void 0:s.scrollbar,Yr.scrollbar);Object.keys(i).forEach(h=>{n[h]=i[h]}),n.resetPosition&&(n.range=(a=(l=t==null?void 0:t[0])==null?void 0:l.range)!=null&&a.length?[...t[0].range]:null,this.updateScrollbarAnchorEdge(e)),n.isInit||(n.type=(r=t==null?void 0:t[0])==null?void 0:r.type,n.range=(d=(c=t==null?void 0:t[0])==null?void 0:c.range)!=null&&d.length?[...t[0].range]:null,this.initScrollbarRange(e),this.updateScrollbarAnchorEdge(e),this.createScrollbarLayout(e),this.createScrollbar(e),this.createScrollEvent(e),n.isInit=!0)},initScrollbarRange(t){var i;const e=this.scrollbar[t],n=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels;if((i=e.range)!=null&&i.length&&n.length){const[s,l]=e.range;if(ve(s)&&ve(l)){const a=this.getScrollbarLimits(t);if(!a)return;const{limitMin:r,limitMax:c}=a,d=l-s,h=c-r;if(d>=h)e.range[0]=r,e.range[1]=c;else{let u=+s<r?r:+s,f=u+d;f>c&&(f=c,u=f-d,u<r&&(u=r)),e.range[0]=u,e.range[1]=f}}}},updateScrollbarInfo(t,e){var r,c,d,h,u,f,m,g,p,y,C,b,k,T,w;const{axesX:n,axesY:i}=this.options,s=t==="x"?n:i;if(!this.scrollbar[t].isInit&&((c=(r=s==null?void 0:s[0])==null?void 0:r.scrollbar)!=null&&c.use)&&((d=s==null?void 0:s[0])!=null&&d.range)){this.initScrollbarInfo(s,t);return}else if(!((h=s==null?void 0:s[0].scrollbar)!=null&&h.use)||io((u=s==null?void 0:s[0])==null?void 0:u.range)){this.destroyScrollbar(t);return}const l=t==="x"?this.axesX:this.axesY,a=!Fe((f=s==null?void 0:s[0])==null?void 0:f.range,(m=l==null?void 0:l[0])==null?void 0:m.range);if(a||e){const M=t==="x"?(y=(p=(g=this.options.axesX)==null?void 0:g[0])==null?void 0:p.scrollbar)==null?void 0:y.resetPosition:(k=(b=(C=this.options.axesY)==null?void 0:C[0])==null?void 0:b.scrollbar)==null?void 0:k.resetPosition;if(a){const V=(T=s==null?void 0:s[0])==null?void 0:T.range,x=this.scrollbar[t].range;if(!M&&(V!=null&&V.length)&&(x!=null&&x.length)){const S=V[1]-V[0],L=this.scrollbar[t].anchorEdge,I=L?this.getScrollbarLimits(t):null;L==="start"&&I?this.scrollbar[t].range=[I.limitMin,I.limitMin+S]:L==="end"&&I?this.scrollbar[t].range=[I.limitMax-S,I.limitMax]:this.scrollbar[t].range=[x[0],x[0]+S]}else this.scrollbar[t].range=V!=null&&V.length?[...V]:null}this.initScrollbarRange(t),a&&this.updateScrollbarAnchorEdge(t)}this.scrollbar[t].use=!!((w=s==null?void 0:s[0].scrollbar)!=null&&w.use)},updateScrollbarPosition(t){var e,n,i,s;(e=this.scrollbar.x)!=null&&e.use&&((n=this.scrollbar.x)!=null&&n.isInit)&&this.setScrollbarPosition("x",t),(i=this.scrollbar.y)!=null&&i.use&&((s=this.scrollbar.y)!=null&&s.isInit)&&this.setScrollbarPosition("y",t)},createScrollbarLayout(t){const e=this.scrollbar[t];e.dom=document.createElement("div"),e.dom.className="ev-chart-scrollbar",e.dom.dataset.type="scrollbar";const n=document.createElement("div");n.className="ev-chart-scrollbar-container",n.dataset.type=t,e.dom.appendChild(n),this.wrapperDOM.appendChild(e.dom)},createScrollbar(t){const e=this.scrollbar[t],n=e.dom.children[0];this.createScrollbarTrack(n),this.createScrollbarThumb(n),e.showButton&&this.createScrollbarButton(n)},createScrollbarTrack(t){const e=document.createElement("div");e.className="ev-chart-scrollbar-track",e.dataset.type="track",t.appendChild(e)},createScrollbarThumb(t){const e=document.createElement("div");e.className="ev-chart-scrollbar-thumb",e.dataset.type="thumb",t.appendChild(e)},createScrollbarButton(t){const e=document.createElement("div");e.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-up",e.dataset.type="button";const n=document.createElement("i");n.className="ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon",n.dataset.type="button-icon",e.appendChild(n);const i=document.createElement("div");i.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",i.dataset.type="button";const s=document.createElement("i");s.className="ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon",s.dataset.type="button-icon",i.appendChild(s),t.appendChild(e),t.appendChild(i)},setScrollbarPosition(t,e){var V,x;const n=this.scrollbar[t];if(!n.use||!n.range)return;const i=n.dom,s=this.chartRect,l=e??this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(V=this.options.title)!=null&&V.show?(x=this.options.title)==null?void 0:x.height:0,c=t==="x",d=c?n.height:n.width,h=c?a.x2-a.x1:a.y2-a.y1,u=n.showButton?d:0,f=h-u*2,m=this.getScrollbarThumbSize(t,f),g=Math.max(0,f-m.size);m.position=Math.min(Math.max(m.position,0),g);let p="display: block;",y,C,b,k,T=`width:${u}px;height:${u}px;`;c?(p=`top: ${s.y2+r+l.top}px;`,p+=`left: ${a.x1}px;`,p+=`width: ${h}px;`,p+=` height: ${d}px;`,y="top: 0;",y+=`left: ${u}px;`,y+=`width: ${f}px;`,y+="height: 100%;",C=`width: ${m.size}px;`,C+="height: 100%;",C+=`left: ${m.position+u}px`,T+="transform:rotate(90deg);top: 0;",b=`${T}right:0;`,k=`${T}left:0;`):(p=`top: ${a.y1+r}px;`,p+=`left: ${a.x2+10}px;`,p+=`width: ${d}px;`,p+=`height: ${h}px;`,y=`top: ${u}px;`,y+="left: 0;",y+="width: 100%;",y+=`height: ${f}px;`,C="width: 100%;",C+=`height: ${m.size}px;`,C+=`bottom: ${m.position+u}px`,T+="left:0;",b=`${T}top: 0;`,k=`${T}bottom: 0;`),i.style.cssText=p;const w=i.getElementsByClassName("ev-chart-scrollbar-track");w[0].style.cssText=y,w[0].style.backgroundColor=n.background;const M=i.getElementsByClassName("ev-chart-scrollbar-thumb");if(M[0].style.cssText=C,M[0].style.backgroundColor=n.thumbStyle.background,M[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const S=i.getElementsByClassName("ev-chart-scrollbar-button-up"),L=Math.floor(f-m.size),I=Math.floor(m.position)>L?.5:1;S[0].style.cssText=`background-color: ${n.background};${b}`,S[0].style.opacity=I,S[0].children[0].style.display="block";const v=i.getElementsByClassName("ev-chart-scrollbar-button-down");v[0].style.cssText=`background-color: ${n.background};${k}`,v[0].style.opacity=Math.floor(m.position)<0?.5:1,v[0].children[0].style.display="block"}},getScrollbarThumbSize(t,e){var u,f,m,g;const n=this.scrollbar[t],[i,s]=n.range,l=n.type;let a,r,c=1,d=0,h=0;if(l==="step"){const p=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels,y=s-i+1;r=p.length;const C=e/r;a=C*y,h=C*i}else{const p=t==="x"?this.axesX:this.axesY,y=(u=this.minMax[t])==null?void 0:u[0],C=+y.max-+y.min,b=+s-+i;l==="time"&&(c=(g=p==null?void 0:p[0])==null?void 0:g.getInterval({minValue:y.min,maxValue:y.max,maxSteps:(m=(f=this.labelRange[t])==null?void 0:f[0])==null?void 0:m.max})),r=Math.ceil(C/c)+1,d=+y.min;const k=e/r,T=b/c+1,w=+i-d;a=k*T,h=k*(w/c)}return n.startValue=d,n.steps=r,n.interval=c,{size:a,position:h}},getScrollbarContainerDOM(t){const e=["track","thumb","button"],n=t.dataset.type;return e.includes(n)?t.parentElement:n==="button-icon"?t.parentElement.parentElement:n==="scrollbar"?t.getElementsByClassName("ev-chart-scrollbar-container")[0]:t},updateScrollbarRange(t,e){const n=this.scrollbar[t],{startValue:i,range:s,interval:l,steps:a}=n,r=i+l*a,c=t==="x"?this.axesX[0]:this.axesY[0],[d,h]=s??[];(!ve(d)||!ve(h))&&(n.range=(c==null?void 0:c.range)||null);let u,f,m=!1;e?(u=d+l,f=h+l,m=f>=r):(u=d-l,f=h-l,m=u<i),m||(n.range=[u,f],this.updateScrollbarAnchorEdge(t),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:u>1,updateByScrollbar:!0}))},getScrollbarLimits(t){var l,a;const e=this.scrollbar[t];if((e==null?void 0:e.type)==="step"){const r=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels;return r!=null&&r.length?{limitMin:0,limitMax:r.length-1}:null}const n=(a=(l=this.minMax)==null?void 0:l[t])==null?void 0:a[0];if((n==null?void 0:n.min)==null||(n==null?void 0:n.max)==null)return null;const i=+n.min,s=+n.max;return!Number.isFinite(i)||!Number.isFinite(s)?null:{limitMin:i,limitMax:s}},updateScrollbarAnchorEdge(t){const e=this.scrollbar[t];if(!e)return;const n=e.range,i=this.getScrollbarLimits(t);if(!Array.isArray(n)||n.length!==2||!i){e.anchorEdge=null;return}n[0]<=i.limitMin?e.anchorEdge="start":n[1]>=i.limitMax?e.anchorEdge="end":e.anchorEdge=null},createScrollEvent(){var e,n,i;this.onScrollbarClick=s=>{s.preventDefault();const l=s.target.dataset.type,a=this.getScrollbarContainerDOM(s.target),r=["button","button-icon"],c=a.dataset.type;let d;if(r.includes(l)){let h;l==="button"?h=s.target:l==="button-icon"&&(h=s.target.parentElement),d=h.className.includes("up")}else if(l==="track"){const h=a.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:u,y:f}=h[0].getBoundingClientRect(),m=c==="x",g=m?s.clientX:-s.clientY,p=m?u:-f;d=g>p}else return;this.updateScrollbarRange(c,d)},this.onScrollbarDown=s=>{if(s.preventDefault(),s.target.dataset.type!=="thumb")return;const l=this.getScrollbarContainerDOM(s.target),a=l.dataset.type,r=l.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:c,y:d,height:h}=r[0].getBoundingClientRect(),u=this.scrollbar[a];u.scrolling=!0,a==="x"?u.pointInThumb=s.clientX-c:u.pointInThumb=d+h-s.clientY;const f=u.dom;f.addEventListener("mousemove",this.onScrollbarMove),f.addEventListener("mouseup",this.onScrollbarUp)};const t=s=>{this.scrolling(s)};if(this.onScrollbarMove=ss(t,5),this.onScrollbarUp=s=>{s.preventDefault(),this.stopScrolling(s)},this.onScrollbarLeave=s=>{s.preventDefault(),this.scrolling(s),this.stopScrolling(s)},this.onScrollbarWheel=s=>{var h,u,f,m,g,p,y,C;const l=((u=(h=this.tooltipDOM)==null?void 0:h.style)==null?void 0:u.display)==="block",a=this.tooltipBodyDOM||((f=this.tooltipDOM)==null?void 0:f.querySelector(this.options.tooltip.htmlScrollTarget));if(l&&a){const{scrollTop:b,scrollHeight:k,clientHeight:T}=a,w=b<=0,M=Math.ceil(b)+T>=k,V=s.deltaY<0,x=s.deltaY>0;if(!(w&&V||M&&x))return}s.preventDefault();const r=1;if((m=this.scrollbar.x)!=null&&m.use&&s.shiftKey&&Math.abs(s.deltaY)>r){this.updateScrollbarRange("x",s.deltaY>0);return}const c=Math.abs(s.deltaX),d=Math.abs(s.deltaY);if(c>r&&d>r){c>d&&((g=this.scrollbar.x)!=null&&g.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((p=this.scrollbar.y)!=null&&p.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((y=this.scrollbar.x)!=null&&y.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(C=this.scrollbar.y)!=null&&C.use&&d>r&&this.updateScrollbarRange("y",s.deltaY<0)},this.scrollbar.x.use&&!this.scrollbar.x.isInit){const s=this.scrollbar.x.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}if(this.scrollbar.y.use&&!this.scrollbar.y.isInit){const s=this.scrollbar.y.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}((e=this.scrollbar.x)!=null&&e.use||(n=this.scrollbar.y)!=null&&n.use)&&((i=this.overlayCanvas)==null||i.addEventListener("wheel",this.onScrollbarWheel,{passive:!1}))},scrolling(t){const e=this.getScrollbarContainerDOM(t.target),n=e.dataset.type;if(!this.scrollbar[n].scrolling)return;const{steps:i,range:s,pointInThumb:l,startValue:a,interval:r}=this.scrollbar[n],c=e.getElementsByClassName("ev-chart-scrollbar-track"),{x:d,y:h,width:u,height:f}=c[0].getBoundingClientRect(),m=n==="x",g=m?d:h,p=m?u:f,y=p/i,C=a+(i-1)*r;let b=m?t.clientX:t.clientY;b<g?b=g:b>g+p&&(b=g+p);let k;if(m?k=b-g-l:k=g+p-b-l,k<=0)return;let T,w;const M=Math.round(Math.abs(k)/y)*r,[V,x]=s;if(k>0){const S=a+(M-+V);T=+V+S,w=T+(+x-+V)}T<a||w>C||(this.scrollbar[n].range=[T,w],this.updateScrollbarAnchorEdge(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:T>1,updateByScrollbar:!0}))},stopScrolling(t){const n=this.getScrollbarContainerDOM(t.target).dataset.type,i=this.scrollbar[n];if(i.scrolling){i.scrolling=!1;const s=i.dom;s.removeEventListener("mousemove",this.onScrollbarMove,!1),s.removeEventListener("mouseup",this.onScrollbarUp,!1)}},hideScrollbar(t){const e=this.scrollbar[t].dom;if(!e)return;const n=e==null?void 0:e.style;n.display="none",n.width="0",n.height="0"},destroyScrollbar(t){var n,i,s;const e=this.scrollbar[t].dom;e&&(e.remove(),this.scrollbar[t]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((i=this.scrollbar.y)!=null&&i.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function LC(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")}function Jr(t,e,n){let i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;const m=!e&&e!==0&&typeof root.requestAnimationFrame=="function";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0,LC(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Math.max(+n.maxWait||0,e):l,f="trailing"in n?!!n.trailing:f);function g(L){const I=i,v=s;return i=s=void 0,d=L,a=t.apply(v,I),a}function p(L,I){return m?(window.cancelAnimationFrame(r),window.requestAnimationFrame(L)):setTimeout(L,I)}function y(L){if(m)return window.cancelAnimationFrame(L);clearTimeout(L)}function C(L){return d=L,r=p(T,e),h?g(L):a}function b(L){const I=L-c,v=L-d,W=e-I;return u?Math.min(W,l-v):W}function k(L){const I=L-c,v=L-d;return c===void 0||I>=e||I<0||u&&v>=l}function T(){const L=Date.now();if(k(L))return w(L);r=p(T,b(L))}function w(L){return r=void 0,f&&i?g(L):(i=s=void 0,a)}function M(){r!==void 0&&y(r),d=0,i=c=s=r=void 0}function V(){return r===void 0?a:w(Date.now())}function x(){return r!==void 0}function S(...L){const I=Date.now(),v=k(I);if(i=L,s=this,c=I,v){if(r===void 0)return C(c);if(u)return r=p(T,e),g(c)}return r===void 0&&(r=p(T,e)),a}return S.cancel=M,S.flush=V,S.pending=x,S}const TC="Expected a function";function MC(t,e,n){let i=!0,s=!0;if(typeof t!="function")throw new TypeError(TC);return Jr(t,e,{leading:i,maxWait:e,trailing:s})}const vC={createEventFunctions(){var s,l,a,r;this.onMouseMove=c=>{var w,M;if((w=this.dragInfo)!=null&&w.isMove||this.isMobile)return;const d={e:c},{indicator:h,tooltip:u,type:f}=this.options,m=this.getMousePosition(c),g=this.findHitItem(m),p=this.findPlotLabelHitRegion(m);p&&(g.items={},g.hitId=null),!p&&(u!=null&&u.showAllValueInRange)&&(g!=null&&g.items)&&this.addNotHitInfo(g);const y=this.overlayCtx,C=Object.keys(g.items),b=C.length>0;let k="";if(b){k=`h=${g.hitId}`;const V=C.slice().sort();for(let x=0;x<V.length;x++){const S=V[x];k+=`|${S}:${g.items[S].index}`}}const T=k!==""&&k===this._lastHoverSig&&this.tooltipDOM&&this.tooltipDOM.style.display!=="none";if(this.overlayClear(),b){if(u.use&&this.isInitTooltip)if(this.drawItemsHighlight(g,y),typeof(u==null?void 0:u.returnValue)=="function"){const x=[];for(let S=0;S<C.length;S++){const L=C[S],I=g.items[L];x.push({sId:L,data:I.data,color:I.color,name:I.name,dataId:I.id,index:I.index})}this.hideTooltipDOM(),u.returnValue(x,c)}else(M=u==null?void 0:u.formatter)!=null&&M.html?(T||this.drawCustomTooltip(g==null?void 0:g.items),this.setCustomTooltipLayoutPosition(g,c)):(this.setTooltipLayoutPosition(g,c),f==="scatter"?this.drawTooltipForScatter(g,this.tooltipCtx):f==="heatMap"?this.drawToolTipForHeatMap(g,this.tooltipCtx):this.drawTooltip(g,this.tooltipCtx));const V=Object.values(this.seriesList||{}).some(x=>x.type==="line");if(u.use&&(f==="line"||V)){const x=this.drawIndicatorForTooltip(g,h.color),S=x==null?void 0:x.labelValue,L=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:L,mousePosition:[c.clientX,c.clientY],dataLabel:S}}}else u.use&&this.isInitTooltip&&(typeof(u==null?void 0:u.returnValue)=="function"&&u.returnValue([],c),this.hideTooltipDOM());if(this.handlePlotLabelHover(p,c),this._lastHoverSig=k,this.dragInfoBackup&&!this.dragDisplayCanvas&&this.drawSelectionArea(this.dragInfoBackup),!d.hoveredLabel&&!this.isNotUseIndicator()){const V=Object.values(this.seriesList||{}).some(S=>S.type==="line");(f!=="line"&&!V||!u.use||!Object.keys(g.items).length)&&this.drawIndicator(m,h.color);const x=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:x,mousePosition:[c.clientX,c.clientY]}}else d.hoveredLabel||(d.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(f!=="pie"&&(d.curMouseTargetVal=this.getCurMouseTargetVal(m,g)),this.listeners["mouse-move"](d))},this.onMouseLeave=c=>{var u;const{tooltip:d,dragSelection:h}=this.options;d.throttledMove&&this.onMouseMove.cancel(),(!h.use||!h.keepDisplay)&&this.overlayClear(),(u=this.hidePlotLabelTooltip)==null||u.call(this),d.use&&this.isInitTooltip&&(typeof(d==null?void 0:d.returnValue)=="function"&&d.returnValue([],c),this.tooltipClear()),this._lastHoverSig="",this.invalidateClientRectCache(),this.listeners["mouse-leave"]()},this.onDblClick=c=>{const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:f,selectLabel:m,selectSeries:g}=this.options,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),y=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick);p?d.eventTarget="item":y?d.eventTarget="label":C&&(d.eventTarget="series");const b=()=>{var x,S;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],V=w.items[M];V&&(d.label=V.label,d.value=(x=V.data)==null?void 0:x.o,d.seriesId=M,d.dataIndex=V.index,d.acc=(S=V.data)==null?void 0:S.acc)},k=w=>{var I,v;const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],x=M.items[V],{labelIndex:S}=this.getLabelInfoByPosition(h,w),{dataIndex:L}=this.regulateSelectedLabelInfo(S,w);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(L,w),x&&(d.label=x.label,d.seriesId=V,d.value=(I=x.data)==null?void 0:I.o,d.acc=(v=x.data)==null?void 0:v.acc,d.dataIndex=x.index)},T=()=>{var x,S,L;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],V=w.items[M];if(M!==null){const I=this.updateSelectedSeriesInfo(M,!0);V&&(d.label=V.label,d.value=(x=V.data)==null?void 0:x.o,d.seriesId=(S=I.seriesId)==null?void 0:S.at(0),d.acc=(L=V.data)==null?void 0:L.acc,d.dataIndex=V.index)}};switch(u){case"bar":{y?k(this.options.horizontal?"yAxis":"xAxis"):b();break}case"line":{p?b():y?k():C&&T();break}default:{b();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](d)},this.onClick=c=>{var w;if(this.isMouseMove){this.isMouseMove=!1;return}const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:f,selectLabel:m,selectSeries:g}=this.options,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),y=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick),b=()=>{const M=this.getHitItemByPosition(h,!1,void 0,!1,!0);({label:d.label,value:d.value,sId:d.seriesId,dataIndex:d.dataIndex,acc:d.acc}=M),M!=null&&M.sId&&(d.selected={eventTarget:"item",seriesId:this.isDeselectItem(M)?null:M.sId,dataIndex:this.isDeselectItem(M)?null:M.dataIndex})},k=M=>{var S,L,I,v;const{labelIndex:V}=this.getLabelInfoByPosition(h,M),{dataIndex:x}=this.regulateSelectedLabelInfo(V,M);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(x,M),M&&(this.defaultSelectInfo.targetAxis=x!=null&&x.length?M:null),d.selected={eventTarget:"label",...Re(this.defaultSelectInfo)},d.label=(L=(S=this.defaultSelectInfo)==null?void 0:S.label)==null?void 0:L.at(0),d.dataIndex=(v=(I=this.defaultSelectInfo)==null?void 0:I.dataIndex)==null?void 0:v.at(0)},T=()=>{const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],x=M.items[V];if(!Yt(V)){const S=this.updateSelectedSeriesInfo(V,!1);this.defaultSelectInfo.seriesId=S.seriesId,d.selected={eventTarget:"series",...Re(this.defaultSelectInfo)},d.label=x.label,d.dataIndex=x.index}};switch(u){default:case"bar":{p?b():y&&k(this.options.horizontal?"yAxis":"xAxis");break}case"line":{p?b():y?k():C&&T();break}case"heatMap":{const M=!!this.options.horizontal;if(p&&y){const{useBothAxis:V}=m,x=this.getCurMouseLocation(h);if(x==="chartBackground")this.clearSelectedLabelInfo(),d.deselected={eventTarget:"label"},b();else if(x==="yAxis"||x==="xAxis"){if(this.clearSelectedItemInfo(),d.deselected={eventTarget:"item"},!V&&x!==(M?"yAxis":"xAxis"))return;k(x)}}else if(p)b();else if(y){const{useBothAxis:V}=m,x=this.getCurMouseLocation(h);if((x==="yAxis"||x==="xAxis")&&!V&&x!==(M?"yAxis":"xAxis"))return;x!=="canvas"&&k(V?x:null)}break}case"pie":{p&&b();break}case"scatter":{if(p&&b(),(w=this.options.dragSelection)!=null&&w.use&&this.isMobile){let M=this.setTouchInfo(c);this.overlayClear(),this.options.dragSelection.keepDisplay&&(c.layerX<M.range.x1||c.layerY<M.range.y1||c.layerX>M.range.x2||c.layerY>M.range.y2)?this.isTouchOverlay=!1:(M=this.setTouchBoxDimensions(M),this.isTouchOverlay=!0,this.drawSelectionArea(M)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),d.e=c,d.touchInfo=M,d.data=this.findSelectedItems(M),d.range=this.getSelectionRange(M),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](d)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(d))},this.onMouseDown=c=>{const{dragSelection:d,type:h}=this.options;d.use&&(h==="scatter"||h==="line"||h==="heatMap")&&(this.removeSelectionArea(),this.dragStart(c,h))},this.onWheel=c=>{var b,k,T,w;if(!(((k=(b=this.tooltipDOM)==null?void 0:b.style)==null?void 0:k.display)==="block"))return;const h=((T=this.vsState)==null?void 0:T.scrollEl)||(this.options.tooltip.htmlScrollTarget?(w=this.tooltipDOM)==null?void 0:w.querySelector(this.options.tooltip.htmlScrollTarget):null)||this.tooltipBodyDOM;if(!h||h.scrollHeight<=h.clientHeight){this.hideTooltipDOM();return}const{scrollTop:u,scrollHeight:f,clientHeight:m}=h,g=u<=0,p=Math.ceil(u)+m>=f,y=c.deltaY<0,C=c.deltaY>0;c.preventDefault(),!(g&&y)&&!(p&&C)&&(h.scrollTop+=c.deltaY)};const t=(s=this.options)==null?void 0:s.tooltip,e=!!((l=t==null?void 0:t.formatter)!=null&&l.html)&&!!(t!=null&&t.virtualScroll)&&t.virtualScroll.use!==!1;(t!=null&&t.useScrollbar||e)&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(r=(a=this.options)==null?void 0:a.tooltip)!=null&&r.throttledMove&&(this.onMouseMove=MC(this.onMouseMove,30)),this.overlayCanvas.addEventListener("mousemove",this.onMouseMove),this.overlayCanvas.addEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.addEventListener("dblclick",this.onDblClick),this.overlayCanvas.addEventListener("click",this.onClick);const{startArea:n,displayFromStartArea:i}=this.options.dragSelection;this.dragStartTarget=n&&this.target.closest(n)||this.overlayCanvas,this.dragStartTarget.addEventListener("mousedown",this.onMouseDown),i&&this.options.type==="scatter"&&!this.isMobile&&this.dragStartTarget!==this.overlayCanvas&&this.createDragDisplayCanvas(),this.dragTouchSelectionEvent=c=>this.dragTouchSelectionDestroy(c),window.addEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll=()=>this.invalidateClientRectCache(),window.addEventListener("scroll",this.invalidateRectOnScroll,{capture:!0,passive:!0})},dragStart(t,e){this.dragDisplayCanvas&&this.refreshDragDisplayCanvas();let n;this.dragDisplayCanvas&&(n=this.dragStartTarget.style.userSelect,this.dragStartTarget.style.userSelect="none");const[i,s,l,a]=this.getMousePosition(t);let r=i,c=s;const d=this.chartRect,h=this.labelOffset,u={x1:d.x1+h.left,x2:d.x2-h.right,y1:d.y1+h.top,y2:d.y2-h.bottom};r<u.x1&&(r=u.x1),r>u.x2&&(r=u.x2),c<u.y1&&(c=u.y1),c>u.y2&&(c=u.y2),this.dragInfo={xcp:r,ycp:c,range:u};const f=(C,b)=>C>=0&&C<=l&&b>=0&&b<=a;let m=!1;const g=()=>{m||(m=!0,this.removeSelectionArea())};(f(i,s)||this.dragDisplayCanvas)&&g();const p=C=>{const[b,k]=this.getMousePosition(C);if(!m)if(f(b,k))g();else return;C.preventDefault();const T=this.dragInfo,{xcp:w,ycp:M,range:V}=T;let x,S;if(T.isMove=!0,this.isMouseMove=!0,b<V.x1?x=V.x1:b>V.x2?x=V.x2:x=b,k<V.y1?S=u.y1:k>V.y2?S=V.y2:S=k,e==="heatMap"){const L={xcp:w,xep:x,ycp:M,yep:S,range:V},{xsp:I,ysp:v,width:W,height:E}=this.getDragInfoForHeatMap(L);T.xsp=I,T.ysp=v,T.width=W,T.height=E}else T.xsp=Math.min(w,x),T.ysp=e==="scatter"?Math.min(M,S):V.y1,T.width=Math.ceil(Math.abs(x-w)),T.height=e==="scatter"?Math.ceil(Math.abs(S-M)):V.y2-V.y1;this.dragDisplayCanvas&&e==="scatter"&&(T.displayRect={xsp:Math.min(i,b),ysp:Math.min(s,k),width:Math.ceil(Math.abs(b-i)),height:Math.ceil(Math.abs(k-s)),range:V}),this.overlayClear(),this.drawSelectionArea(T)},y=C=>{var k,T;const b=this.dragInfo;if(m&&(b!=null&&b.isMove)&&(b==null?void 0:b.width)>1&&(b==null?void 0:b.height)>1){const w={e:C,data:this.findSelectedItems(b),range:e==="heatMap"?this.getSelectionRangeForHeatMap(b):this.getSelectionRange(b)};if(this.dragInfoBackup=Xe({},b),typeof this.listeners["drag-select"]=="function"&&!((T=(k=this.options)==null?void 0:k.zoom)!=null&&T.use))this.listeners["drag-select"](w);else{const{xsp:M,range:V,width:x}=b,S=M-V.x1;w.range.dragSelectionInfo={dragXsp:S,dragXep:S+x,exceptAxesYChartWidth:V.x2-V.x1,exceptAxesXChartHeight:V.y2-V.y1,chartRange:V,chartTitle:this.options.title.text},this.options.zoom.getRangeInfo(w)}this.options.dragSelection.keepDisplay||this.removeSelectionArea()}this.dragInfo=null,n!==void 0&&(this.dragStartTarget.style.userSelect=n),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)},drawSelectionArea(t){var h,u;const e=!!this.dragDisplayCanvas,n=e?this.dragDisplayCtx:this.overlayCtx,{fillColor:i,opacity:s}=this.options.dragSelection;let l=0,a=0;e&&(this.dragDisplayClear(),l=((h=this.dragDisplayOffset)==null?void 0:h.x)??0,a=((u=this.dragDisplayOffset)==null?void 0:u.y)??0);const r=this.chartRect,c=this.labelOffset,d={x1:r.x1+c.left,x2:r.x2-c.right,y1:r.y1+c.top,y2:r.y2-c.bottom};if(n.fillStyle=i,n.globalAlpha=s,e&&t.displayRect){const f=t.displayRect,{xsp:m,ysp:g,width:p,height:y,range:C}=t;let b=m,k=g,T=p,w=y;if(!Fe(d,C)){const L=C.x2-C.x1,I=C.y2-C.y1,v=d.x2-d.x1,W=d.y2-d.y1;b=d.x1+v*((m-C.x1)/L),k=d.y1+W*((g-C.y1)/I),T=v*(p/L),w=W*(y/I)}const M=m-f.xsp,V=g-f.ysp,x=f.xsp+f.width-(m+p),S=f.ysp+f.height-(g+y);n.fillRect(b-M+l,k-V+a,T+M+x,w+V+S)}else{const{xsp:f,ysp:m,width:g,height:p,range:y}=t;if(Fe(d,y))n.fillRect(f+l,m+a,g,p);else{const C=y.x2-y.x1,b=y.y2-y.y1,k=d.x2-d.x1,T=d.y2-d.y1,w=(f-y.x1)/C,M=(m-y.y1)/b,V=d.x1+k*w,x=d.y1+T*M,S=g/C,L=p/b,I=k*S,v=T*L;n.fillRect(V+l,x+a,I,v)}}n.globalAlpha=1},createDragDisplayCanvas(){const t=this.dragStartTarget;if(!t||t===this.overlayCanvas)return;window.getComputedStyle(t).position==="static"&&(this.dragStartAreaPrevPosition=t.style.position,t.style.position="relative");const e=document.createElement("canvas");e.className="ev-chart-drag-display-canvas",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex="3",e.style.pointerEvents="none",t.appendChild(e),this.dragDisplayCanvas=e,this.dragDisplayCtx=e.getContext("2d"),this.refreshDragDisplayCanvas()},refreshDragDisplayCanvas(){if(!this.dragDisplayCanvas||!this.dragStartTarget)return;const{width:t,height:e}=this.dragStartTarget.getBoundingClientRect(),n=Math.max(1,Math.round(t)),i=Math.max(1,Math.round(e)),s=n*this.pixelRatio,l=i*this.pixelRatio;(this.dragDisplayCanvas.width!==s||this.dragDisplayCanvas.height!==l)&&(this.dragDisplayCanvas.width=s,this.dragDisplayCanvas.height=l,this.dragDisplayCanvas.style.width=`${n}px`,this.dragDisplayCanvas.style.height=`${i}px`),this.dragDisplayCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.dragDisplayClear();const a=this.overlayCanvas.getBoundingClientRect(),r=this.dragDisplayCanvas.getBoundingClientRect();this.dragDisplayOffset={x:a.left-r.left,y:a.top-r.top}},dragDisplayClear(){if(!this.dragDisplayCtx||!this.dragDisplayCanvas)return;const t=this.pixelRatio<1?this.pixelRatio:1;this.dragDisplayCtx.clearRect(0,0,this.dragDisplayCanvas.width/t,this.dragDisplayCanvas.height/t)},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear(),this.dragDisplayCanvas&&this.dragDisplayClear()},getMousePosition(t){const e=t.originalEvent||t,n=this.getOverlayClientRect();return[e.clientX-n.left,e.clientY-n.top,n.width,n.height]},findPlotLabelHitRegion(t){const e=this.plotLabelHitRegions;if(!(e!=null&&e.length))return null;const[n,i]=t;return e.find(s=>n>=s.x&&n<=s.x+s.width&&i>=s.y&&i<=s.y+s.height)??null},handlePlotLabelHover(t,e){var n;t?this.showPlotLabelTooltip(t,e.originalEvent||e):(n=this.hidePlotLabelTooltip)==null||n.call(this)},getCurMouseTargetVal(t,e){const n=this.getCurMouseLocation(t),i={location:n,labelIdx:-1,labelVal:"",dataIdx:-1,maxDataVal:"",originVal:""};if(n==="chartBackground"){const{maxHighlight:s,items:l}=e;if(s!=null&&s.length){const[a,r]=s;l[a]&&(i.dataIdx=l[a].index,i.maxDataVal=r,i.originVal=e)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{i.labelIdx=d,i.labelVal=c[0].type==="time"?Pe(h).format(c[0].timeFormat):h,i.originVal=c[0].type==="time"?Pe(h):h};(c=>{const{labelIndex:d}=this.getLabelInfoByPosition(t,n),{labelVal:h,labelIdx:u}=this.getCurMouseLabelVal(c,t,d);a(c==="xAxis"?s:l,u,h)})(n)}return i},setTouchInfo(t){let[e,n]=this.getMousePosition(t);const i=this.chartRect,s=this.labelOffset,l={x1:i.x1+s.left,x2:i.x2-s.right,y1:i.y1+s.top,y2:i.y2-s.bottom};return e=Math.max(l.x1,Math.min(e,l.x2)),n=Math.max(l.y1,Math.min(n,l.y2)),{xcp:e,ycp:n,range:l}},setTouchBoxDimensions(t){var h;const e=((h=this.options.dragSelection)==null?void 0:h.size)||50,n=e/2,{xcp:i,ycp:s,range:l}=t;let a=i-n,r=s-n,c=e,d=e;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},i<l.x1+n&&(a=l.x1,c=n-(l.x1-i),this.boxOverflow.x1=!0),i>l.x2-n&&(c=n-(i-l.x2),this.boxOverflow.x2=!0),s<l.y1+n&&(r=l.y1,d=n-(l.y1-s),this.boxOverflow.y1=!0),s>l.y2-n&&(d=n-(s-l.y2),this.boxOverflow.y2=!0),t.xsp=a,t.ysp=r,t.width=c,t.height=d,t},dragTouchSelectionDestroy(t){var e;(e=this.options.dragSelection)!=null&&e.use&&t.target!==this.overlayCanvas&&this.isTouchOverlay&&(this.isTouchOverlay=!1,this.overlayClear())},findHitItem(t,e=!1){var w,M,V,x;(w=this.ensureHitCoordsFresh)==null||w.call(this);const n=Object.keys(this.seriesList),i={},s=!!this.options.horizontal,l=this.tooltipCtx,[a,r]=t;let c=null,d="",h=0,u="",f=null,m=null,g=1/0,p=!1,y=null,C=1/0;const b=this.findClosestDataIndex(t,n,e);if(b===-1&&!this.isNotUseIndicator())return{items:i,hitId:c,maxTip:[d,u],maxHighlight:null};const k=n.every(S=>this.seriesList[S].type==="bar");for(let S=0;S<n.length;S++){const L=n[S],I=this.seriesList[L];if(I.findGraphData&&I.show){const v=I.findGraphData(t,s,b,!k);if(v!=null&&v.data){let W;if(v.data.o===null&&I.interpolation!=="zero"?I.isExistGrp||(W=s?v.data.x:v.data.y):isNaN(v.data.o)||(W=v.data.o),W!=null){const E=this.getFormattedTooltipLabel({dataId:I.id,seriesId:L,seriesName:I.name,itemData:v.data}),G=l?l.measureText(E).width:1;v.id=I.id,v.name=E,v.axis={x:I.xAxisIndex,y:I.yAxisIndex},v.label=s?(M=v.data)==null?void 0:M.y:(V=v.data)==null?void 0:V.x,i[L]=v;const R=this.getFormattedTooltipValue({dataId:I.id,seriesId:L,seriesName:E,value:W,itemData:v.data});if(v.data.formatted=R,h<G&&(d=E,h=G),u.length<=`${R}`.length&&(u=`${R}`),(f===null||f<=W)&&(f=W,m=L),v.hit&&v.data.xp!==void 0&&v.data.yp!==void 0){const X=(v.data.xp-t[0])**2+(v.data.yp-t[1])**2;v.directHit?((!p||X<g)&&(g=X,c=L),p=!0):!p&&X<g&&(g=X,c=L)}if(c===null&&v.data.xp!==void 0&&v.data.yp!==void 0&&v.data.xp!==null&&v.data.yp!==null){const X=O.calcBoxDistance(v.data,a,r);X<C&&(C=X,y=L)}}}}}c===null&&(c=y!==null?y:Object.keys(i)[0]);const T=f!==null?[m,f]:null;if(e&&Object.keys(i).length===0&&b!==-1){const S=n.find(I=>{var W;const v=this.seriesList[I];return(v==null?void 0:v.show)&&((W=v==null?void 0:v.data)==null?void 0:W.length)>0}),L=S?(x=this.seriesList[S].data)==null?void 0:x[b]:null;L&&(i[""]={id:"",name:"",label:s?L.y:L.x,index:b,axis:{x:0,y:0},data:{o:void 0,x:L.x,y:L.y}},c="")}return{items:i,hitId:c,maxTip:[d,u],maxHighlight:T}},buildLabelValidMask(t){var s,l;const e=t??Object.keys(this.seriesList);let n=0;for(let a=0;a<e.length;a++){const r=this.seriesList[e[a]];r!=null&&r.show&&((s=r.data)==null?void 0:s.length)>n&&(n=r.data.length)}const i=new Uint8Array(n);for(let a=0;a<e.length;a++){const r=this.seriesList[e[a]];if(r!=null&&r.show&&r.data){const{data:c}=r;for(let d=0;d<c.length;d++){const h=(l=c[d])==null?void 0:l.o;h!=null&&(i[d]=1)}}}return this.labelValidMask=i,i},findClosestDataIndex(t,e,n=!1){var p;const[i,s]=t,l=!!this.options.horizontal,a=l?s:i,r=e.find(y=>{var b;const C=this.seriesList[y];return(C==null?void 0:C.show)&&((b=C==null?void 0:C.data)==null?void 0:b.length)>0});if(!r||!((p=this.seriesList[r])!=null&&p.data))return-1;const c=this.seriesList[r].data;let d=50;if(c.length>1){const y=[];for(let C=1;C<c.length;C++){const b=c[C-1],k=c[C];if(b&&k){let T,w;l?(T=b.h?b.yp+b.h/2:b.yp,w=k.h?k.yp+k.h/2:k.yp):(T=b.w?b.xp+b.w/2:b.xp,w=k.w?k.xp+k.w/2:k.xp),T!==null&&w!==null&&y.push(Math.abs(w-T))}}y.length>0&&(d=y.reduce((C,b)=>C+b,0)/y.length)}let h=1/0,u=-1,f=this.labelValidMask;!n&&(!f||f.length<c.length)&&(f=this.buildLabelValidMask(e));for(let y=0;y<c.length;y++)if(n||f[y]===1){const b=c[y];if(b){let k;if(l?k=b.h?b.yp+b.h/2:b.yp:k=b.w?b.xp+b.w/2:b.xp,k!==null){const T=Math.abs(a-k);T<h&&(h=T,u=y)}}}if(u===-1)return-1;const g=Math.max(d,6);return h>=g?e.some(C=>{const b=this.seriesList[C];if(b!=null&&b.show){const k=b.passingValue,T=b.interpolation,w=b.hasPassingValueInData;return T==="linear"||T==="none"&&!!k&&w}return!1})?u:-1:u},getFormattedTooltipLabel({dataId:t,seriesId:e,seriesName:n,itemData:i}){var c;const l=this.options.tooltip,a=(c=l==null?void 0:l.formatter)==null?void 0:c.label;let r=n;return a&&(r=a({dataId:t,seriesId:e,seriesName:n,itemData:i})),r},getFormattedTooltipValue({dataId:t,seriesId:e,seriesName:n,value:i,itemData:s}){var u;const l=this.options,a=!!l.horizontal,r=l.tooltip,c=typeof(r==null?void 0:r.formatter)=="function"?r==null?void 0:r.formatter:(u=r==null?void 0:r.formatter)==null?void 0:u.value,d=s!==null&&typeof s=="object"&&c;if(d){this._tooltipValueCache||(this._tooltipValueCache=new WeakMap);const f=this._tooltipValueCache.get(s);if(f!==void 0){const m=f[e];if(m!==void 0)return m}}let h=i;if(c&&(l.type==="pie"?h=c({value:i,name:n,percentage:s==null?void 0:s.percentage,seriesId:e,dataId:t}):l.type==="heatMap"?h=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:i>-1?i:"error",seriesId:e,dataId:t}):h=c({x:a?i:s==null?void 0:s.x,y:a?s==null?void 0:s.y:i,o:s==null?void 0:s.o,name:n,seriesId:e,dataId:t})),i&&(!c||typeof h!="string")&&(l.type==="heatMap"?h=i<0?"error":Qt(i):h=Qt(i)),d){let f=this._tooltipValueCache.get(s);f||(f=Object.create(null),this._tooltipValueCache.set(s,f)),f[e]=h}return h},addNotHitInfo(t){var c,d,h,u,f,m;const e=this.tooltipCtx,n=!!this.options.horizontal,i=Object.keys(t.items)[0],s=n?(h=(d=(c=t.items)==null?void 0:c[i])==null?void 0:d.data)==null?void 0:h.y:(m=(f=(u=t.items)==null?void 0:u[i])==null?void 0:f.data)==null?void 0:m.x;let l="",a="";const r=Object.keys(this.seriesList);for(let g=0;g<r.length;g++){const p=r[g],y=this.seriesList[p];if(y!=null&&y.show){const C=y.data.find(x=>n?(x==null?void 0:x.y)===s:(x==null?void 0:x.x)===s),b=this.getFormattedTooltipLabel({dataId:y.id,seriesId:p,seriesName:y.name,itemData:C}),k=this.getFormattedTooltipValue({dataId:y.id,seriesId:p,seriesName:b,value:C==null?void 0:C.o,itemData:C});if(C&&C.o!==null&&C.o!==void 0&&!t.items[p]){const x={};x.color=y.color,x.hit=!1,x.name=b,x.axis={x:y.xAxisIndex,y:y.yAxisIndex},x.index=n?y.yAxisIndex:y.xAxisIndex,x.data=C,x.data.formatted=k,t.items[p]=x}const T=e?e.measureText(l).width:1,w=e?e.measureText(b).width:1;T<w&&(l=b);const M=e?e.measureText(a).width:1,V=e?e.measureText(`${k}`).width:1;M<V&&(a=`${k}`)}}t.maxTip=[l,a]},selectItemByData(t,e){this.defaultSelectItemInfo=t;let n;e==="pie"?n={type:"pie",sId:t.seriesID}:n=isNaN(t==null?void 0:t.dataIndex)?null:this.getItem(t,!1),this.render(n)},selectLabelByData(t,e){this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(t,e),this.render()},selectSeriesByData(t){const e=t??[],n=this._renderedSelectSeriesIds;n&&n.length===e.length&&n.every((i,s)=>i===e[s])||(this.defaultSelectInfo.seriesId=t,this._renderedSelectSeriesIds=[...e],this.render())},getSelectedLabelInfoWithLabelData(t,e){const{selectLabel:n,type:i,horizontal:s}=this.options,l=Re(this.defaultSelectInfo);switch(l.dataIndex=t,i){default:case"bar":case"line":{l.dataIndex.splice(n.limit),l.label=l.dataIndex.map(r=>this.data.labels[r]);const a=Object.entries(this.data.data);l.data=l.dataIndex.map(r=>Object.fromEntries(a.map(([c,d])=>[c,d[r]])));break}case"heatMap":{const{limit:a,useBothAxis:r}=this.options.selectLabel;l.dataIndex.splice(a);let c;r?c=e==="yAxis"?"y":"x":c=s?"y":"x",l.label=l.dataIndex.map(h=>this.data.labels[c][h]);const d=Object.values(this.data.data)[0];l.data=d.filter(({x:h,y:u})=>l.label.includes(c==="y"?u:h));break}}return l},regulateSelectedLabelInfo(t,e){var l,a;const n=((l=this.options)==null?void 0:l.selectLabel)??{},i=e===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===e?{...this.defaultSelectInfo,targetAxis:e}:{dataIndex:[],targetAxis:e},s=Re(i);if(i.dataIndex.includes(t)){const r=i.dataIndex.indexOf(t);s.dataIndex.splice(r,1)}else t>-1&&(s.dataIndex.push(t),n.limit>0&&n.limit<s.dataIndex.length&&(n.useDeselectOverflow?s.dataIndex.splice(0,1):s.dataIndex.pop()));return s},updateSelectedSeriesInfo(t,e){var l;const n=((l=this.options)==null?void 0:l.selectSeries)??{},i=this.defaultSelectInfo??{seriesId:[]};typeof i.seriesId=="string"&&(i.seriesId=[i.seriesId]);const s=Re(i);if(i.seriesId.includes(t)){if(!e){const a=i.seriesId.indexOf(t);s.seriesId.splice(a,1)}}else t&&(s.seriesId.push(t),n.limit>0&&n.limit<s.seriesId.length&&(n.useDeselectOverflow?s.seriesId.splice(0,1):s.seriesId.pop()));return s},drawIndicatorForTooltip(t,e){var d;if(!(t!=null&&t.items)||!Object.keys(t.items).length)return null;const n=this.overlayCtx,{horizontal:i}=this.options,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=Object.keys(t.items)[0],a=t.items[l];if(!(a!=null&&a.data))return null;const r=i?a.data.y:a.data.x;let c;if(i){const h=a.data.yp+(a.data.h?a.data.h/2:0);c=[s.x1,h]}else c=[a.data.xp+(a.data.w?a.data.w/2:0),s.y1];return n.beginPath(),n.save(),n.strokeStyle=e,n.lineWidth=1,(d=this.options.indicator)!=null&&d.segments&&n.setLineDash(this.options.indicator.segments),i?(n.moveTo(s.x1,c[1]+.5),n.lineTo(s.x2,c[1]+.5)):(n.moveTo(c[0]+.5,s.y1),n.lineTo(c[0]+.5,s.y2)),n.stroke(),n.restore(),n.closePath(),{labelValue:r,position:c}},findSelectedItems(t){var i;(i=this.ensureHitCoordsFresh)==null||i.call(this);const e=[],n=Object.keys(this.seriesList);for(let s=0;s<n.length;s++){const l=n[s],a=this.seriesList[l],r=a.findItems;if(r){const c=r.call(a,t);c&&c.length&&e.push({seriesName:a.name,seriesId:l,items:c})}}return e},getSelectionRange({xsp:t,ysp:e,width:n,height:i,range:s}){var k,T,w,M;const l=this.axesSteps.x.length?this.axesSteps.x[0]:null,a=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!l||!a)return null;const r=t+n,c=e+i,d=l.graphMax-l.graphMin,h=a.graphMax-a.graphMin,u=this.getRatioInRange(s.x1,s.x2,t),f=this.getRatioInRange(s.x1,s.x2,r),m=this.getRatioInRange(s.y1,s.y2,c),g=this.getRatioInRange(s.y1,s.y2,e),p=this.isMobile&&((k=this.boxOverflow)!=null&&k.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*u,l.graphMin),y=this.isMobile&&((T=this.boxOverflow)!=null&&T.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*f,l.graphMax),C=this.isMobile&&((w=this.boxOverflow)!=null&&w.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-m),a.graphMin),b=this.isMobile&&((M=this.boxOverflow)!=null&&M.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-g),a.graphMax);return{xMin:+p.toFixed(3),xMax:+y.toFixed(3),yMin:+C.toFixed(3),yMax:+b.toFixed(3)}},getRatioInRange(t,e,n){const i=e-t;return(n-t)/i},getDragInfoForHeatMap(t){const e=Object.keys(this.seriesList)[0];return this.seriesList[e].findBlockRange(t)},getSelectionRangeForHeatMap(t){const e=this.axesSteps.x.length?this.axesSteps.x[0]:null,n=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!e||!n)return null;const i=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[i].findSelectionRange(t)??{};return{xMin:s??e.graphMin,xMax:l??e.graphMax,yMin:a??n.graphMin,yMax:r??n.graphMax}},isDeselectItem(t){var e,n;return this.options.selectItem.useDeselectItem&&(t==null?void 0:t.dataIndex)===((e=this.defaultSelectItemInfo)==null?void 0:e.dataIndex)&&(t==null?void 0:t.sId)===((n=this.defaultSelectItemInfo)==null?void 0:n.seriesID)&&!isNaN(t==null?void 0:t.dataIndex)},getCurMouseLocation(t){const[e,n]=t,i={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},s=i[this.axesX[0].units.rectStart],l=i[this.axesX[0].units.rectEnd],a=i[this.axesY[0].units.rectStart],r=i[this.axesY[0].units.rectEnd];return St(e,this.chartRect.x1,i.x1)&&St(n,a,r)?"yAxis":St(e,s,l)&&St(n,i.y2,this.chartRect.y2)?"xAxis":St(e,i.x1,i.x2)&&St(n,i.y1,i.y2)?"chartBackground":"canvas"},isNotUseIndicator(){return this.options.type==="pie"||this.options.type==="scatter"||this.options.type==="heatMap"},clearSelectedLabelInfo(){this.defaultSelectInfo={dataIndex:[]}},clearSelectedItemInfo(){this.defaultSelectItemInfo=null}},jo=8,ps=50,yi=17,RC=8,VC={createTooltipDOM(){var t,e;this.tooltipDOM=document.createElement("div"),this.tooltipDOM.className="ev-chart-tooltip",this.tooltipHeaderDOM=document.createElement("div"),this.tooltipHeaderDOM.className="ev-chart-tooltip-header",this.tooltipBodyDOM=document.createElement("div"),this.tooltipBodyDOM.className="ev-chart-tooltip-body",this.tooltipCanvas=document.createElement("canvas"),this.tooltipCanvas.className="ev-chart-tooltip-canvas",this.tooltipCtx=this.tooltipCanvas.getContext("2d"),this.tooltipDOM.style.display="none",(e=(t=this.options.tooltip)==null?void 0:t.formatter)!=null&&e.html||this.setDefaultTooltipLayout(),document.body.appendChild(this.tooltipDOM),this.options.tooltip.debouncedHide?this.hideTooltipDOM=Jr(()=>{this.tooltipDOM.style.display="none"},200):this.hideTooltipDOM=()=>{this.tooltipDOM.style.display="none"},this.isInitTooltip=!0},setDefaultTooltipLayout(){this.tooltipBodyDOM.appendChild(this.tooltipCanvas),this.tooltipDOM.appendChild(this.tooltipHeaderDOM),this.tooltipDOM.appendChild(this.tooltipBodyDOM)},createPlotLabelTooltipDOM(){this.plotLabelTooltipDOM=document.createElement("div"),this.plotLabelTooltipDOM.className="ev-chart-plot-label-tooltip",this.plotLabelTooltipDOM.style.position="fixed",this.plotLabelTooltipDOM.style.display="none",this.plotLabelTooltipDOM.style.pointerEvents="none",this.plotLabelTooltipDOM.style.zIndex="1000",this.plotLabelTooltipDOM.style.whiteSpace="nowrap",document.body.appendChild(this.plotLabelTooltipDOM)},showPlotLabelTooltip(t,e){this.plotLabelTooltipDOM||this.createPlotLabelTooltipDOM();const n=this.plotLabelTooltipDOM,i=t.style??{},s=i.padding??{top:4,right:8,bottom:4,left:8},l=i.backgroundColor??"#4C4C4C";n.textContent=t.text,n.style.backgroundColor=l,n.style.color=i.fontColor??"#FFFFFF",n.style.border=`1px solid ${i.borderColor??l}`,n.style.borderRadius=`${i.borderRadius??4}px`,n.style.fontSize=`${i.fontSize??12}px`,n.style.fontWeight=`${i.fontWeight??400}`,n.style.fontFamily=i.fontFamily??"Roboto",n.style.padding=`${s.top}px ${s.right}px ${s.bottom}px ${s.left}px`,n.style.boxShadow=i.useShadow?`2px 2px 4px rgba(0, 0, 0, ${i.shadowOpacity??.25})`:"none",n.style.left=`${e.clientX+10}px`,n.style.top=`${e.clientY+10}px`,n.style.display="block"},hidePlotLabelTooltip(){this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.style.display="none")},getFontStyle(t){var s,l;const e=(s=this.options)==null?void 0:s.tooltip,n=((l=e==null?void 0:e.fontSize)==null?void 0:l[t])??14,i=(e==null?void 0:e.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${i}`},getTextHeight(){var t,e,n;return(((n=(e=(t=this.options)==null?void 0:t.tooltip)==null?void 0:e.fontSize)==null?void 0:n.contents)??14)+6},getColorMargin(){var t,e,n;return(((n=(e=(t=this.options)==null?void 0:t.tooltip)==null?void 0:e.fontSize)==null?void 0:n.contents)??14)+2},getBoxPadding(){var s,l;const{top:t=0,right:e=20,bottom:n=3,left:i=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t,l:i,b:n,r:e}},setTooltipLayoutPosition(t,e){var H,K,D,z,_,ee,J;const n=this.tooltipCtx,i=e.pageX,s=e.pageY,l=t.items,[a,r]=t.maxTip,d=Object.keys(l).length,h=this.getBoxPadding(),u=this.options.tooltip,f=this.getColorMargin(),m=t.hitId,g=l[m].data,p=l[m].axis,y=(H=u.formatter)==null?void 0:H.title;this.axesX.length&&this.axesY.length&&u.showHeader&&(y?this.tooltipHeaderDOM.textContent=y({x:g.x,y:g.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[p.y].getLabelFormat(g.y):this.axesX[p.x].getLabelFormat(g.x)),u.textOverflow&&this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${u.textOverflow}`),this.tooltipHeaderDOM.style.visibility="hidden",n.save(),n.font=this.getFontStyle("contents");const b=!!this.options.horizontal?(D=(K=l[t.hitId])==null?void 0:K.data)==null?void 0:D.y:(_=(z=l[t.hitId])==null?void 0:z.data)==null?void 0:_.x,k=(b==null?void 0:b.length)>a.length?b:a,T=Math.round(n.measureText(k).width),w=Math.round(n.measureText(r).width),M=T+w+h.l+h.r+f+ps+yi,V=M>u.maxWidth?u.maxWidth:M;let x=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const te=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+f+ps+yi);Object.values(l).map(ne=>ne.name).forEach(ne=>{if(n.measureText(ne).width>te){let Q="";for(let $=0;$<ne.length;$++){const j=ne[$],he=`${Q}${j}`;n.measureText(he).width>te?(Q=j,x+=1):Q=he}}x+=1}),n.restore()}const S=h.t+x*this.getTextHeight()+d*jo+h.b;let L;u.useScrollbar&&S>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",L=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",L=S),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=S*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${S}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${L+6}px`,this.tooltipDOM.style.display="block";const I=document.body.clientWidth,v=document.body.clientHeight,W=20,E=((ee=this.tooltipDOM)==null?void 0:ee.offsetHeight)||((J=this.tooltipHeaderDOM)==null?void 0:J.offsetHeight)+L+RC,G=I-V-W,R=v-E-W,X=i+W,Z=s+W,N=i-V-W,P=s-E-W,B=X>G?N:X,Y=Z>R?P:Z;this.tooltipDOM.style.transform=`translate3d(${B}px, ${Y}px, 0)`},drawSeriesColorShape(t,e,n){var a,r;const i=(r=(a=this.options.tooltip)==null?void 0:a.fontSize)==null?void 0:r.contents,{x:s,y:l}=n;if(e==="circle"){t.beginPath();const c=i/2;t.arc(s,l-c/2,c,0,2*Math.PI),t.fill()}else{const c=i;t.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(t,e){const n=e,i=t.items,[,s]=t.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.horizontal,c=this.options.tooltip,d=this.getTextHeight(),h=this.getColorMargin();this.axesX.length&&this.axesY.length&&c.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let u=2,f=2;u+=O.aliasPixel(u),f+=O.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=yi),u+=a.l,f+=a.t,n.font=this.getFontStyle("contents");const m=[];l.forEach(y=>{m.push({id:y,data:i[y].data,color:i[y].color,name:i[y].name,dataId:i[y].id})}),c.sortByValue&&m.sort((y,C)=>{let b=y.data.o,k=C.data.o;return b==null&&(b=r?y.data.x:y.data.y),k==null&&(k=r?C.data.x:C.data.y),k-b}),this.setTooltipDOMStyle(c);const g=this.tooltipDOM.offsetWidth;let p=1;for(let y=0;y<m.length;y++){const C=m[y].data,b=m[y].color,k=m[y].name,T=C.formatted;let w=u+4,M=f+p*d;w+=O.aliasPixel(w),M+=O.aliasPixel(M),n.beginPath(),typeof b!="string"?n.fillStyle=q.createGradient(n,r,{x:w-4,y:M,w:12,h:-12},b):n.fillStyle=b;const V={id:m[y].id,name:m[y].name,value:T,dataId:m[y].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:w,y:M}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(V):c.fontColor.label??c.fontColor;const x=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-ps,S=w+h,L=M;if(x>n.measureText(k).width)n.fillText(k,S,L);else if(c.textOverflow==="wrap"){let I="",v=L;for(let W=0;W<k.length;W++){const E=k[W],G=`${I}${E}`;n.measureText(G).width>x?(n.fillText(I,S,v),I=E,p+=1,v+=d):I=G}n.fillText(I,S,v)}else{const I=O.truncateLabelWithEllipsis(k,x,n);n.fillText(I,S,L)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(V):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(T,g-a.r,M),n.restore(),n.closePath(),f+=jo,p+=1}n.restore()},drawToolTipForHeatMap(t,e){const n=e,i=t.items,s=t.hitId,l=i[s].data,a=i[s].axis,r=i[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,u=Object.values(this.seriesList)[0],f=this.getTextHeight(),m=this.getColorMargin();let g=!1,p=l.formatted;const{colorState:y,isGradient:C}=u;if(C){const{min:M,max:V}=u.valueOpt,x=Je(l.o-M,V-M),{start:S,end:L}=y[0];g=S<=x&&x<=L||l.o===-1}else{const M=y.find(({id:V})=>V===l.cId);g=M==null?void 0:M.show,p=(M==null?void 0:M.label)??p}if(!g){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h);const b=this.tooltipDOM.offsetWidth;n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=yi);const k=c.l+2,T=c.t+f+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=q.createGradient(n,d,{x:k,y:T,w:12,h:-12},r):n.fillStyle=r;const w={id:t.hitId,name:l.y,value:p,dataId:i[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:k,y:T}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(w):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),k+m,T),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(w):h.fontColor.value??h.fontColor,n.fillText(p,b-c.r,T),n.closePath()},drawTooltipForScatter(t,e){const n=e,i=t.items,[,s]=t.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.tooltip,c=this.getTextHeight(),d=this.getColorMargin();this.axesX.length&&this.axesY.length&&r.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let h=2,u=2;h+=O.aliasPixel(h),u+=O.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=yi),h+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const f=[];l.forEach(p=>{f.push({data:i[p].data,color:i[p].color,name:i[p].name})}),r.sortByValue&&f.sort((p,y)=>{let C=p.data.o,b=y.data.o;return C==null&&(C=p.data.y),b==null&&(b=y.data.y),b-C}),this.setTooltipDOMStyle(r);const m=this.tooltipDOM.offsetWidth;let g=1;for(let p=0;p<f.length;p++){const y=f[p].data,C=f[p].color,b=f[p].name,k=y.formatted;let T=h+4,w=u+g*c;T+=O.aliasPixel(T),w+=O.aliasPixel(w),n.beginPath(),typeof C!="string"?n.fillStyle=q.createGradient(n,!1,{x:T-4,y:w,w:12,h:-12},C):n.fillStyle=C;const M={id:t.hitId,name:f[p].name,value:k,dataId:f[p].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:T,y:w}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(M):r.fontColor.label??r.fontColor;const V=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-ps,x=T+d,S=w;if(V>n.measureText(b).width)n.fillText(b,x,S);else if(r.textOverflow==="wrap"){let L="",I=S;for(let v=0;v<b.length;v++){const W=b[v],E=`${L}${W}`;n.measureText(E).width>V?(n.fillText(L,x,I),L=W,g+=1,I+=c):L=E}n.fillText(L,x,I)}else{const L=O.truncateLabelWithEllipsis(b,V,n);n.fillText(L,x,S)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(M):r.fontColor.value??r.fontColor,n.fillText(k,m-a.r,w),n.restore(),n.closePath(),u+=jo,g+=1}n.restore()},setCustomTooltipLayoutPosition(t,e){var k;const n=e.pageX,i=e.pageY;if(!this.tooltipDOM)return;let s=this.tooltipDOM.firstElementChild;if(!s&&(t!=null&&t.items)&&Object.keys(t.items).length&&(this.drawCustomTooltip(t.items),s=this.tooltipDOM.firstElementChild),!s)return;this.tooltipDOM.style.display="block";const l=s.offsetWidth,a=s.offsetHeight;this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${a+6}px`;const r=document.body.clientWidth,c=document.body.clientHeight,d=(k=this.tooltipDOM)==null?void 0:k.getBoundingClientRect(),h=20,u=r-l-h,f=c-(d==null?void 0:d.height)-h,m=n+h,g=i+h,p=n-l-h,y=i-(d==null?void 0:d.height)-h,C=m>u?p:m,b=g>f?y:g;this.tooltipDOM.style.transform=`translate3d(${C}px, ${b}px, 0)`},drawCustomTooltip(t){var l,a,r,c,d;const e=(l=this.options)==null?void 0:l.tooltip;if(!((a=e==null?void 0:e.formatter)!=null&&a.html))return;const n=Object.keys(t).length;if((r=this._shouldVirtualizeCustomTooltip)!=null&&r.call(this,n)&&this.drawCustomTooltipVirtual(t))return;(c=this._teardownCustomTooltipVirtualScroll)==null||c.call(this),this.tooltipDOM.innerHTML="";const i=[];Object.keys(t).forEach(h=>{i.push({sId:h,data:t[h].data,color:t[h].color,name:t[h].name,dataId:t[h].id,index:t[h].index})});const s=O.htmlToElement(e.formatter.html(i));s&&this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((d=e.fontColor)==null?void 0:d.title)??e.fontColor},setTooltipDOMStyle(t){var e;if(this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((e=t.fontColor)==null?void 0:e.title)??t.fontColor,this.tooltipHeaderDOM.style.fontSize=`${t.fontSize.title}px`,this.tooltipHeaderDOM.style.fontFamily=this.getFontStyle("title"),t.useShadow){const n=`rgba(0, 0, 0, ${t.shadowOpacity})`;this.tooltipDOM.style.boxShadow=`2px 2px 2px ${n}`}this.tooltipDOM.style.display="block"},drawItemsHighlight(t,e){Object.keys(t.items).forEach(n=>{var s;const i=this.seriesList[n];i.itemHighlight(t.items[n],e,t.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),O.isDoughnutHole(i.type)&&this.drawDoughnutHole(e)})},drawIndicator(t,e){var d;const n=this.overlayCtx,[i,s]=t,l={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},a=15,r=15,c=this.options;i>=l.x1-a&&i<=l.x2+a&&s>=l.y1-r&&s<=l.y2+r&&(n.beginPath(),n.save(),n.strokeStyle=e,n.lineWidth=1,(d=c.indicator)!=null&&d.segments&&n.setLineDash(c.indicator.segments),c.horizontal?(n.moveTo(l.x1,s+.5),n.lineTo(l.x2,s+.5)):(n.moveTo(i+.5,l.y1),n.lineTo(i+.5,l.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(t){var u,f,m,g;const e=this.options;if(e.syncHover===!1||!e.horizontal&&!e.axesX.every(({type:p})=>p==="time")||e.horizontal&&!e.axesY.every(({type:p})=>p==="time"))return null;const n=+((u=this.data.labels)==null?void 0:u[0]),i=+((f=this.data.labels)==null?void 0:f[this.data.labels.length-1]);if(n==null||i==null)return null;const[s,l]=t,a={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(e.horizontal?(m=e.axesY)==null?void 0:m.every(p=>p.categoryMode):(g=e.axesX)==null?void 0:g.every(p=>p.categoryMode)){const p=this.data.labels.length;if(!p)return null;let y;if(e.horizontal){const b=a.y2-a.y1;y=(l-a.y1)/b}else{const b=a.x2-a.x1;y=(s-a.x1)/b}const C=Math.min(Math.max(Math.floor(y*p),0),p-1);return+this.data.labels[C]}if(e.horizontal){const p=a.y2-a.y1,C=(l-a.y1)*(i-n)/p+n;return Math.round(C)}const c=a.x2-a.x1,h=(s-a.x1)*(i-n)/c+n;return Math.round(h)},drawSyncedIndicator({horizontal:t,label:e,mousePosition:n,dataLabel:i}){var g,p;if(!this._canDrawSyncedIndicator(t,n))return;if(i){this.drawSyncedIndicatorForTooltip({dataLabel:i,mousePosition:n});return}const s=+((g=this.data.labels)==null?void 0:g[0]),l=+((p=this.data.labels)==null?void 0:p[this.data.labels.length-1]),[a,r]=n,{top:c,bottom:d,left:h,right:u}=this.getChartDOMClientRect();if(St(a,h,u)&&St(r,d,c))return;this.overlayClear();const m={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(t){const C=(m.y2-m.y1)*(e-s)/(l-s)+m.y1;this.drawIndicator([m.x2,C],this.options.indicator.color)}else{const C=(m.x2-m.x1)*(e-s)/(l-s)+m.x1;this.drawIndicator([C,m.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(t,e){return!e||!!t!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(t)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(t){var n,i;return this.options.syncHover===!1||!((i=(n=this.data)==null?void 0:n.labels)!=null&&i.length)?!1:t?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,i;const t=+((n=this.data.labels)==null?void 0:n[0]),e=+((i=this.data.labels)==null?void 0:i[this.data.labels.length-1]);return t!=null&&e!=null},drawSyncedIndicatorForTooltip({dataLabel:t,mousePosition:e}){var u,f,m,g,p,y,C,b,k,T,w,M,V;if(!((u=this.data)!=null&&u.labels)||!t)return;const n=this.data.labels.findIndex(x=>(x==null?void 0:x.valueOf())===(t==null?void 0:t.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:i}=this.options,s=this.getChartDOMClientRect(),[l,a]=e;if(St(l,s.left,s.right)&&St(a,s.bottom,s.top))return;this.overlayClear();const c={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},d=this.data.labels.length;let h;if(i){const x=c.y2-c.y1,S=(f=this.options.axesY)==null?void 0:f.some(v=>v.categoryMode),L=(m=this.options.axesY)==null?void 0:m.some(v=>v.type==="time");let I;if(S)I=c.y1+x*(n+.5)/d;else if(L){const v=(p=(g=this.axesSteps)==null?void 0:g.y)==null?void 0:p[0],W=(v==null?void 0:v.graphMin)??+((y=this.data.labels)==null?void 0:y[0]),E=(v==null?void 0:v.graphMax)??+((C=this.data.labels)==null?void 0:C[this.data.labels.length-1]);I=c.y1+x*(+t-W)/(E-W)}else I=c.y1+x*n/(d-1);h=[c.x2,I]}else{const x=c.x2-c.x1,S=(b=this.options.axesX)==null?void 0:b.some(v=>v.categoryMode),L=(k=this.options.axesX)==null?void 0:k.some(v=>v.type==="time");let I;if(S)I=c.x1+x*(n+.5)/d;else if(L){const v=(w=(T=this.axesSteps)==null?void 0:T.x)==null?void 0:w[0],W=(v==null?void 0:v.graphMin)??+((M=this.data.labels)==null?void 0:M[0]),E=(v==null?void 0:v.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);I=c.x1+x*(+t-W)/(E-W)}else I=c.x1+x*n/(d-1);h=[I,c.y2]}this.drawIndicator(h,this.options.indicator.color)},tooltipClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.tooltipCtx.clearRect(0,0,this.tooltipCanvas.width/this.clearRectRatio,this.tooltipCanvas.height/this.clearRectRatio),this.tooltipDOM.style.display="none"},alignSeriesList(t){const e=this.data.groups,n=this.seriesList,i=[];return e.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&t.includes(l)&&i.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&t.includes(s)&&i.push(s)}),i},tooltipDestroy(){var t;(t=this._teardownCustomTooltipVirtualScroll)==null||t.call(this),this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.remove(),this.plotLabelTooltipDOM=null),this.isInitTooltip=!1}},EC=480,WC=28,GC=5,ZC=50,XC={_shouldVirtualizeCustomTooltip(t){var i,s;if(this._vsDetectFailed)return!1;const e=(i=this.options)==null?void 0:i.tooltip;if(!((s=e==null?void 0:e.formatter)!=null&&s.html))return!1;const n=e.virtualScroll;return!n||n.use===!1?!1:n.use===!0?t>0:t>=(n.threshold??ZC)},_findCustomTooltipContainer(t,e){if(!t||!t.querySelectorAll)return null;const n=t.querySelectorAll("[data-evui-tooltip-row]");if(n.length===e&&n.length>0){const s=n[0].parentElement;let l=!!s;for(let a=1;a<n.length;a++)if(n[a].parentElement!==s){l=!1;break}if(l)return s}const i=[t];for(;i.length;){const s=i.shift();if(s.children&&s.children.length===e)return s;if(s.children)for(let l=0;l<s.children.length;l++)i.push(s.children[l])}return null},_createVirtualScrollAnatomy(){const t=document.createElement("div");t.className="ev-chart-tooltip-virtual__spacer",t.setAttribute("aria-hidden","true");const e=document.createElement("div");e.className="ev-chart-tooltip-virtual__viewport";const n=document.createElement("div");return n.className="ev-chart-tooltip-virtual__spacer",n.setAttribute("aria-hidden","true"),{topSpacer:t,viewport:e,bottomSpacer:n}},_recomputeCustomTooltipPrefixSums(){const t=this.vsState,e=t.heights.length;t.prefixSums.length!==e+1&&(t.prefixSums=new Array(e+1));let n=0;t.prefixSums[0]=0;for(let i=0;i<e;i++)n+=t.heights[i],t.prefixSums[i+1]=n;t.totalHeight=n},_computeCustomTooltipVisibleRange(){const t=this.vsState,e=t.heights.length;if(!e)return{start:0,end:-1};const n=t.scrollEl.clientHeight||t.maxHeight,i=t.scrollEl.scrollTop;let s=0,l=e;for(;s<l;){const d=s+l>>>1;t.prefixSums[d+1]>i?l=d:s=d+1}const a=Math.max(0,s-t.overscan),r=i+n;for(s=a,l=e;s<l;){const d=s+l>>>1;t.prefixSums[d]>=r?l=d:s=d+1}const c=Math.min(e-1,s+t.overscan);return{start:a,end:c}},_syncCustomTooltipSpacers(){const t=this.vsState,e=t.prefixSums[t.range.start]||0,n=Math.max(0,t.totalHeight-(t.prefixSums[t.range.end+1]||t.totalHeight)),i=`${e}px`,s=`${n}px`;t.topSpacer.style.height!==i&&(t.topSpacer.style.height=i),t.bottomSpacer.style.height!==s&&(t.bottomSpacer.style.height=s)},_renderVisibleCustomTooltipRows(){const t=this.vsState;if(!t||!t.items.length)return;const e=this._computeCustomTooltipVisibleRange();if(t.range.start===e.start&&t.range.end===e.end)t.range=e;else{for(;t.viewport.firstChild;)t.viewport.removeChild(t.viewport.firstChild);const s=document.createDocumentFragment();for(let l=e.start;l<=e.end;l++){const a=t.items[l];a&&s.appendChild(a)}t.viewport.appendChild(s),t.range=e}this._syncCustomTooltipSpacers();let i=!1;for(let s=e.start;s<=e.end;s++)if(!t.measured[s]){i=!0;break}if(i){const s=t.measureDepth||0;if(s<2){t.measureDepth=s+1;try{this._measureVisibleCustomTooltipRows()}finally{t.measureDepth=s}}}},_measureVisibleCustomTooltipRows(){const t=this.vsState;if(!t||!t.viewport)return;const e=t.viewport.children,n=e.length;if(!n)return;const i=t.range.start,s=t.prefixSums[i]||0;let l=!1,a=0,r=0;for(let c=0;c<n;c++){const d=t.range.start+c,h=e[c].offsetHeight;h>0&&(h!==t.heights[d]&&(t.heights[d]=h,l=!0),t.measured[d]=!0),t.isRow[d]&&h>0&&(a+=h,r+=1)}if(r>0){const c=a/r;if(t.learnedAverageHeight=c,c>0&&Math.abs(c-t.estimatedRowHeight)>.5){t.estimatedRowHeight=c;for(let d=0;d<t.heights.length;d++)t.isRow[d]&&!t.measured[d]&&t.heights[d]!==c&&(t.heights[d]=c,l=!0)}}if(l){this._recomputeCustomTooltipPrefixSums();const d=(t.prefixSums[i]||0)-s;d!==0&&(t.suppressScroll=!0,t.scrollEl.scrollTop+=d,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.vsState&&(this.vsState.suppressScroll=!1)})})),this._renderVisibleCustomTooltipRows()}else this._syncCustomTooltipSpacers()},drawCustomTooltipVirtual(t){var b,k,T;const e=(b=this.options)==null?void 0:b.tooltip;if(!((k=e==null?void 0:e.formatter)!=null&&k.html))return!1;const n=[];Object.keys(t).forEach(w=>{n.push({sId:w,data:t[w].data,color:t[w].color,name:t[w].name,dataId:t[w].id,index:t[w].index})});let i;try{i=e.formatter.html(n)}catch(w){return console.warn("[evui] tooltip.formatter.html threw, falling back:",w),!1}const s=O.htmlToElement(i);if(!s||!s.children)return!1;const l=this._findCustomTooltipContainer(s,n.length);if(!l)return this._vsDetectFailed=!0,this._vsWarnedFallback||(this._vsWarnedFallback=!0,console.warn("[evui] tooltip.virtualScroll: formatter.html 반환 구조에서 row를 식별하지 못해 가상 스크롤을 건너뜁니다. 시리즈당 wrapper element에 `data-evui-tooltip-row` 속성을 추가하거나, row 컨테이너 직속 자식이 시리즈 수와 일치하도록 마크업을 정리하세요.")),!1;const a=Array.from(l.children);if(!a.length)return!1;const r=w=>!!(w.hasAttribute&&w.hasAttribute("data-evui-tooltip-row")),c=a.some(r),d=a.map(w=>c?r(w):!0);for(let w=0;w<a.length;w++){const M=a[w];M.parentNode&&M.parentNode.removeChild(M)}for(;l.firstChild;)l.removeChild(l.firstChild);const{topSpacer:h,viewport:u,bottomSpacer:f}=this._createVirtualScrollAnatomy();l.appendChild(h),l.appendChild(u),l.appendChild(f);const m=e.maxHeight||EC;l.style.maxHeight=`${m}px`,l.style.overflowY="auto",l.style.overflowX="hidden",l.style.overflowAnchor="none",this._teardownCustomTooltipVirtualScroll();const g=e.virtualScroll||{},p=this._vsLearnedAverageHeight,y=p??g.estimatedRowHeight??WC;this.vsState={scrollEl:l,topSpacer:h,viewport:u,bottomSpacer:f,items:a,isRow:d,heights:new Array(a.length).fill(y),measured:new Array(a.length).fill(!1),prefixSums:[],totalHeight:0,range:{start:0,end:-1},estimatedRowHeight:y,overscan:g.overscan??GC,maxHeight:m,rafPending:!1,suppressScroll:!1,learnedAverageHeight:p,resizeObserver:null,onScroll:null},this._recomputeCustomTooltipPrefixSums();const C=()=>{this.vsState&&(this.vsState.suppressScroll||this.vsState.rafPending||(this.vsState.rafPending=!0,requestAnimationFrame(()=>{this.vsState&&(this.vsState.rafPending=!1,this._renderVisibleCustomTooltipRows())})))};if(l.addEventListener("scroll",C,{passive:!0}),this.vsState.onScroll=C,typeof ResizeObserver<"u"){let w=l.clientWidth;const M=new ResizeObserver(()=>{if(!this.vsState)return;const V=l.clientWidth;V!==w&&(w=V,this.vsState.measured.fill(!1),this.vsState.heights.fill(this.vsState.estimatedRowHeight),this._recomputeCustomTooltipPrefixSums(),this._renderVisibleCustomTooltipRows())});M.observe(l),this.vsState.resizeObserver=M}for(;this.tooltipDOM.firstChild;)this.tooltipDOM.removeChild(this.tooltipDOM.firstChild);return this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((T=e.fontColor)==null?void 0:T.title)??e.fontColor,this._renderVisibleCustomTooltipRows(),!0},_teardownCustomTooltipVirtualScroll(){const t=this.vsState;t&&(t.scrollEl&&t.onScroll&&t.scrollEl.removeEventListener("scroll",t.onScroll),t.resizeObserver&&t.resizeObserver.disconnect(),t.learnedAverageHeight&&(this._vsLearnedAverageHeight=t.learnedAverageHeight),this.vsState=null)}},NC={pieDataSet:[],drawPie(t,e=this.bufferCtx){var T;const n=this.chartRect,i=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,u,f,m;const g=n.width/2,p=n.height/2,y=g-(l.left+l.right),C=p-(l.bottom+l.top);if(typeof y=="number"&&y<0||typeof C=="number"&&C<0)return;const b=Math.min(y,C)*s.doughnutHoleSize,k=Math.min(y,C);for(let w=0;w<i.length;w++){const M=i[w];if(!M)return;let V=k-(k-b)/i.length*w;if((T=s==null?void 0:s.pieStroke)!=null&&T.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(M.or=V,w<i.length-1?M.ir=k-(k-b)/i.length*(w+1):M.ir=1,M.total){for(let x=0;x<M.data.length;x++)if(r=M.data[x],c=r.value,m=c/M.total*100,d=2*Math.PI*(c/M.total),u=h+d,r.sa=h,r.ea=u,f=this.seriesList[r.id],c){const S={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(S.use=!1,e.lineWidth=s.pieStroke.lineWidth,e.strokeStyle=s.pieStroke.color,e.arc(g,p,V,0,2*Math.PI),e.stroke());const{selectInfo:L,legendHitInfo:I,unSelectedOpacity:v}=t;f.isSelect=(L==null?void 0:L.sId)===r.id,f.isDownplay=I&&I.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=g,f.centerY=p,f.radius=V,f.doughnutHoleSize=V*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:m},f.draw(e,S,v),h+=d}}}},drawSunburst(t,e=this.bufferCtx){var p;const{width:n,height:i}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=i/2,u=d-(a.left+a.right),f=h-(a.bottom+a.top);if(typeof u=="number"&&u<0||typeof f=="number"&&f<0)return;const m=Math.min(u,f)*l.doughnutHoleSize,g=Math.min(u,f);for(let y=0;y<s.length;y++){const C=s[y];if(!C)return;let b=g-(g-m)/s.length*y;if((p=l==null?void 0:l.pieStroke)!=null&&p.use&&(b-=l.pieStroke.lineWidth),b<0)return;C.or=b,y<s.length-1?C.ir=g-(g-m)/s.length*(y+1):C.ir=1;for(let k=0;k<C.data.length;k++)if(r=C.data[k],r.id==="dummy")e.save(),e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle="#fff",e.lineWidth=2,e.strokeStyle="#fff",e.moveTo(d,h),e.arc(d,h,b,r.sa,r.ea),e.stroke(),e.fill(),e.closePath(),e.restore();else if(c=this.seriesList[r.id],r.value){const T={...l.pieStroke};C.data.length===1&&l.pieStroke.use&&(T.use=!1,e.lineWidth=l.pieStroke.lineWidth,e.strokeStyle=l.pieStroke.color,e.arc(d,h,b,0,2*Math.PI),e.stroke());const{selectInfo:w,legendHitInfo:M,unSelectedOpacity:V}=t;c.isSelect=(w==null?void 0:w.sId)===r.id,c.isDownplay=M&&M.sId!==r.id,c.type="sunburst",c.centerX=d,c.centerY=h,c.radius=b,c.doughnutHoleSize=b*(l.doughnutHoleSize??0),c.startAngle=r.sa,c.endAngle=r.ea,c.data={o:r.value},c.draw(e,T,V)}}},drawDoughnutHole(t=this.bufferCtx){var h;const e=this.options,{width:n,height:i}=this.chartRect,s=this.options.padding,l=n/2,a=i/2,r=l-(s.left+s.right),c=a-(s.bottom+s.top);if(typeof r=="number"&&r<0||typeof c=="number"&&c<0)return;const d=Math.min(r,c)*e.doughnutHoleSize;t.save(),t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle="#fff",t.fillOpacity=0,t.arc(l,a,d,0,2*Math.PI),t.fill(),t.strokeStyle="#fff",t.stroke(),t.closePath(),t.restore(),(h=e==null?void 0:e.pieStroke)!=null&&h.use&&(t.beginPath(),t.strokeStyle=e.pieStroke.color,t.lineWidth=e.pieStroke.lineWidth,t.arc(l,a,d,0,Math.PI*2),t.stroke(),t.closePath()),this.pieDataSet[this.pieDataSet.length-1].ir=d}},PC={drawTips(t,e=this.bufferCtx){var u,f,m,g,p,y,C,b;const n=this.options;let i=null;const s=!!n.horizontal,l=n.maxTip,a=n.selectItem,r=n.selectLabel;let c,d;typeof((u=n.tooltip)==null?void 0:u.formatter)=="function"?i=(f=n.tooltip)==null?void 0:f.formatter:typeof((g=(m=n.tooltip)==null?void 0:m.formatter)==null?void 0:g.value)=="function"&&(i=(y=(p=n.tooltip)==null?void 0:p.formatter)==null?void 0:y.value),r.use&&r.showTip&&(d=n.type==="heatMap"?this.drawLabelTipForHeatMap(e):this.drawTipForSelectedLabel(e));const h=k=>{t.forEach(T=>{if(T){const w=this.seriesList[T==null?void 0:T.sId];if(!(w!=null&&w.show))return;const M=this.calculateTipInfo(w,"sel",T);if(M&&M.dp!==null){let V=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(V=!0),k.showTextTip||k.showTip){if(k.tipText==="label"){const x=s?n.axesY[0]:n.axesX[0],S=M.label;M.text=x.type==="time"?Pe(S).format(x.timeFormat):S}else M.text=Qt(M.value);this.drawTextTip({opt:k,tipType:"sel",seriesOpt:w,isSamePos:V,ctx:e,...M})}k.showIndicator&&this.drawFixedIndicator({opt:k,seriesOpt:w,ctx:e,...M})}T&&(T!=null&&T.label)&&(T==null?void 0:T.label)===0&&(this.lastHitInfo=T)}})};if(t&&!d&&(a.use?h(a):r.use&&n.type==="line"&&h(r)),l.use&&!d){const k=s?this.axesSteps.y[0]:this.axesSteps.x[0],T=k==null?void 0:k.minIndex,w=k==null?void 0:k.maxIndex,M=(b=(C=s?this.axesY[0]:this.axesX[0])==null?void 0:C.labels)==null?void 0:b.length,V=Number.isFinite(M)?M-1:w,x=Number.isFinite(T)&&Number.isFinite(w),S=x&&w<T,L=x&&(T>0||w<V);let I,v=null;S?I=void 0:L?(v=this.getVisibleWindowMaxSeries(T,w),I=v==null?void 0:v.sId):I=this.minMax[s?"x":"y"][0].maxSID;const W=I?this.seriesList[I]:null;W&&(c=this.calculateTipInfo(W,"max",v),l.use&&c&&c.dp!==null&&(i?c.text=i({seriesId:W.sId,x:s?c.value:void 0,y:s?void 0:c.value}):c.text=Qt(c.value),this.drawTextTip({opt:l,tipType:"max",seriesOpt:W,ctx:e,...c}),l.showIndicator&&this.drawFixedIndicator({opt:l,seriesOpt:W,ctx:e,...c})))}},calculateTipInfo(t,e,n){if(!t)return!1;const i=!!this.options.horizontal,s=this.lastTip,l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=l.chartHeight-(a.top+a.bottom),d=l.chartWidth-(a.left+a.right),h=this.axesSteps.x[t.xAxisIndex],u=this.axesSteps.y[t.yAxisIndex],f=r.x1,m=r.x2,g=r.y2,{type:p,size:y}=t,{maxDomain:C,maxDomainIndex:b}=t.minMax;if(C===null||b<0)return!1;const k=p==="bar"?n==null?void 0:n.index:n==null?void 0:n.domain,T=e==="max"&&n&&Number.isFinite(k)&&Number.isFinite(n.value);let w;T?w=k:w=p==="bar"?b:C,e==="sel"&&(n&&n.label!==null?(s.pos=p==="bar"?n.dataIndex:n.label,w=s.pos):s.pos!==null&&(w=s.pos));let M;T?M=n.value:M=i?t.minMax.maxX:t.minMax.maxY;let V;if(e==="sel"){if(n&&n.label!==null)V=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=V;else if(s.value!==null)M=s.value,V=s.label;else if(s.pos!==null){const E=p==="bar"?"getItemByLabelIndex":"getItemByLabel";if(typeof this[E]=="function"){const G=this[E](s.pos);M=G.useStack?G.acc:G.value,V=G.label,s.value=M,s.label=V}}}const x=i?h.graphMax:u.graphMax;if((e==="max"||e==="sel")&&M>x&&!this.options.displayOverflow)return!1;let S,L,I;if(p==="bar"){const E=i?this.scrollbar.y:this.scrollbar.x;if(E!=null&&E.use){const[G,R]=(E==null?void 0:E.range)??[];if(w>=G&&w<=R)w-=G??0;else return!1}else{const G=i?u:h,{minIndex:R,maxIndex:X}=G??{};if(Number.isFinite(R)&&Number.isFinite(X))if(w>=R&&w<=X)w-=R;else return!1}i?(L=Math.round(y.h/2),S=g-y.cat*w-y.cPad,I=S-(y.bar*y.ix-(y.h+y.bPad))-L):(L=Math.round(y.w/2),S=f+y.cat*w+y.cPad,I=S+(y.bar*y.ix-(y.w+y.bPad))+L)}else p==="line"?I=q.calculateX(w,h.graphMin,h.graphMax,d-y.comboOffset,f+y.comboOffset/2):p==="scatter"&&(I=q.calculateX(w,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:m,ysp:g},...{dp:I,value:M,label:V,type:p}}},drawFixedIndicator(t){const e=!!this.options.horizontal,n=t.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:u,opt:f,seriesOpt:m}=t;let g=0;h==="line"?g+=3:h==="scatter"&&(g+=(m==null?void 0:m.pointSize)??0);let p;if(f.fixedPosTop)e?p=q.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r):(p=q.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),p-=g);else if(e){const y=Math.min(Math.max(u,i.graphMin),i.graphMax);p=q.calculateX(y,i.graphMin,i.graphMax,l,r)}else{const y=Math.min(Math.max(u,s.graphMin),s.graphMax);p=q.calculateY(y,s.graphMin,s.graphMax,a,c),p-=g}d!==null&&(n.beginPath(),n.save(),n.strokeStyle=f.indicatorColor,n.lineWidth=2,e?(n.moveTo(r,d),n.lineTo(p,d)):(n.moveTo(d,c),n.lineTo(d,p)),n.stroke(),n.restore(),n.closePath())},drawTipForSelectedLabel(t=this.bufferCtx){var c,d;const e=this.options,n=!!e.horizontal,i=e.selectLabel,{dataIndex:s,data:l,label:a}=this.defaultSelectInfo;let r=!1;if(s.length){r=!0;const h=this.chartRect,u=this.labelOffset,f={x1:h.x1+u.left,x2:h.x2-u.right,y1:h.y1+u.top,y2:h.y2-u.bottom},m=n?this.axesY[0]:this.axesX[0],g=n?this.axesX[0]:this.axesY[0],p=n?this.axesSteps.x[0]:this.axesSteps.y[0],y=n?q.calculateX:q.calculateY,C=n?q.calculateY:q.calculateX,b=n?this.scrollbar.y:this.scrollbar.x,k=h.chartWidth-(u.left+u.right),T=h.chartHeight-(u.top+u.bottom),w=n?k:T,M=f[g.units.rectStart];let V=this.options.type==="bar"?4:6;V*=n?1:-1;const x=Object.keys(this.seriesList??{}),S=x.filter(H=>this.seriesList[H].show),L=x.some(H=>this.seriesList[H].isExistGrp&&!this.seriesList[H].isOverlapping),I=((c=this.data.groups)==null?void 0:c[0])??[];let v,W,E,G,R,X,Z,N,P,B=0,Y=(d=m.labels)==null?void 0:d.length;if(m.labels){let H=m.labels.length;if(b!=null&&b.use){const{range:K,interval:D,type:z}=b,[_,ee]=K??[];if(ve(_)&&ve(ee))H=Math.floor((+ee-+_)/D)+1,B=z==="step"?_:m.labels.findIndex(J=>J===+_),Y=z==="step"?ee:m.labels.findIndex(J=>J===+ee);else{const J=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(J==null?void 0:J.minIndex)&&Number.isFinite(J==null?void 0:J.maxIndex)&&J.minIndex<J.maxIndex&&(B=J.minIndex,Y=J.maxIndex,H=Y-B+1)}}G=f[m.units.rectStart],R=f[m.units.rectEnd],X=(R-G)/H}else Z=this.axesSteps.x[0],N=x.find(H=>{var K;return((K=this.seriesList[H])==null?void 0:K.type)==="line"}),P=this.seriesList[N].size;l.forEach((H,K)=>{var D;if(E=p.graphMax,!i.fixedPosTop){if(L){const z=S==null?void 0:S.reduce((J,te)=>{var U,ne;return I.includes(te)&&(((U=H[te])==null?void 0:U.value)??H[te])>0?J+(((ne=H[te])==null?void 0:ne.value)??H[te]):J},0),_=((D=S==null?void 0:S.filter(J=>!I.includes(J)))==null?void 0:D.map(J=>{var te;return((te=H[J])==null?void 0:te.value)??H[J]}))??[],ee=(_==null?void 0:_.length)>0?_.reduce((J,te)=>Math.max(J,te??-1/0),-1/0):-1/0;E=z>0?Math.max(ee,z):Math.max(ee,0)}else if(S.length){const z=S.map(ee=>{var J;return((J=H[ee])==null?void 0:J.value)??H[ee]}),_=z.length>0?z.reduce((ee,J)=>Math.max(ee,J??-1/0),-1/0):-1/0;E=_>0||this.options.type!=="bar"?_:0}}if(m.labels){if(s[K]<B||s[K]>Y)return;const z=s[K]-B;v=Math.round(G+X*z)+X/2}else v=C(a[K],Z.graphMin,Z.graphMax,k-P.comboOffset,f.x1+P.comboOffset/2);W=y(E,p.graphMin,p.graphMax,w,M)+V,this.showTip({context:t,x:n?W:v,y:n?v:W,opt:i,isSamePos:!1})})}return r},drawLabelTipForHeatMap(t=this.bufferCtx){const e=this.options,n=!!e.horizontal,i=e.selectLabel,{dataIndex:s}=this.defaultSelectInfo;let l=!1;if(s){l=!0;const a=this.chartRect,r=this.labelOffset,c={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},d=n?this.axesY[0]:this.axesX[0],h=c[d.units.rectStart],f=(c[d.units.rectEnd]-h)/d.labels.length,m=n?this.axesX[0]:this.axesY[0],g=6*(n?1:-1),p=c[m.units.rectEnd]+g;s==null||s.forEach(y=>{const b=Math.round(h+f*y)+f/2;this.showTip({context:t,x:n?p:b,y:n?b:p,opt:i,isSamePos:!1})})}return l},drawTextTip(t){const e=!!this.options.horizontal,n=t.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=t,{dp:h,value:u,text:f,opt:m,type:g,tipType:p,isSamePos:y,seriesOpt:C}=t,b=4,k=4,{fontSize:T,fontFamily:w,fontWeight:M,height:V}=m.tipStyle,x=`normal normal ${M} ${T}px ${w}`;let S=1;g==="line"?S+=6:g==="scatter"?S+=C==null?void 0:C.pointSize:g==="bar"&&(S+=4);let L,I=h;if(m.fixedPosTop)e?(L=q.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),L+=S):(L=q.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),L-=S);else if(e){const E=Math.min(Math.max(u,i.graphMin),i.graphMax);L=q.calculateX(E,i.graphMin,i.graphMax,l,r),L=u<0?L-S:L+S}else{const E=g==="bar"&&u<0?0:u,G=Math.min(Math.max(E,s.graphMin),s.graphMax);L=q.calculateY(G,s.graphMin,s.graphMax,a,d),L=E<0?L+S:L-S}let v="center";n.save(),n.font=x;const W=Math.round(Math.max(n.measureText(f).width+12,40));e||(h+W/2>c-10?(v="right",I-=W/2-b*2):h-W/2<r+10&&(v="left",I+=W/2-b*2)),n.restore(),(m.showTextTip||p==="max")&&this.showTextTip({context:n,type:v,width:W,height:V,x:e?L+W/2:I,y:e?I+V/2:L,opt:m,arrowSize:b,borderRadius:k,text:f,textStyle:x,isNegative:u<0}),m.showTip&&p==="sel"&&this.showTip({context:n,x:e?L:h,y:e?h:L,opt:m,isSamePos:y})},showTextTip(t){const e=!!this.options.horizontal,{type:n,width:i,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:u,isNegative:f}=t,m=t.context;let g=l-i/2,p=l+i/2;const y=a-s,C=a;f&&e&&(g=l-i/2-i,p=l-i/2),m.save(),m.font=u,m.fillStyle=h.tipBackground??h.tipStyle.background,m.shadowBlur=0,m.beginPath(),m.moveTo(g+c,y),m.quadraticCurveTo(g,y,g,y+c),m.lineTo(g,C-c),m.quadraticCurveTo(g,C,g+c,C),m.lineTo(p-c,C),m.quadraticCurveTo(p,C,p,C-c),m.lineTo(p,y+c),m.quadraticCurveTo(p,y,p-c,y),m.lineTo(g+c,y),m.closePath(),m.fill(),m.beginPath(),e?(f?(m.moveTo(p,C),m.lineTo(p,y+c+r/2),m.lineTo(p+r,C-s/2),m.lineTo(p,C-c-r/2)):(m.moveTo(g,y),m.lineTo(g,y+c+r/2),m.lineTo(g-r,C-s/2),m.lineTo(g,C-c-r/2)),m.closePath(),m.fill()):(f?n==="left"?(m.lineTo(g+c+r,C+r),m.lineTo(g+c+r*2,C)):n==="right"?(m.lineTo(p-r*2-c,C),m.lineTo(p-r-c,C+r)):(m.lineTo(l-r,C),m.lineTo(l,C+r),m.lineTo(l+r,C)):f||(n==="left"?(m.moveTo(g,y),m.lineTo(g+c+r,C+r),m.lineTo(g+c+r*2,C)):n==="right"?(m.moveTo(p,y),m.lineTo(p-r*2-c,C),m.lineTo(p-r-c,C+r)):(m.lineTo(l-r,C),m.lineTo(l,C+r),m.lineTo(l+r,C))),m.closePath(),m.fill()),m.restore(),m.save(),m.font=u,m.fillStyle=h.tipTextColor??h.tipStyle.textColor,m.textBaseline="middle",m.textAlign="center",m.fillText(`${d}`,g+i/2,y+s/2),m.restore()},showTip(t){const e=!!this.options.horizontal,{x:n,y:i,opt:s,isSamePos:l}=t,a=t.context,c=i-(l?24:0);a.save(),a.fillStyle=s.tipBackground??s.tipStyle.background,a.beginPath(),a.moveTo(n,c),e?(a.lineTo(n+6,c-6),a.lineTo(n+6,c+6)):(a.lineTo(n+6,c-6),a.lineTo(n-6,c-6)),a.lineTo(n,c),a.closePath(),a.fill(),a.restore()}},BC={initBlitState(){var t;this._blitPrev=null,this._blitDiag=null,this.pointsLayers=new Map,this.pointsLayerValid=!1,this._blitCarry=0,this._framesSinceFullRedraw=0,this._pointsLayerStamp=null,this._pointsLayerOptionsRef=null,this._hitCoordsDirty=!1,(t=this.options.realTimeScatter)!=null&&t.use&&this.createPointsLayers()},createPointsLayers(){var l,a,r,c;const t=((a=(l=this.seriesInfo)==null?void 0:l.charts)==null?void 0:a.scatter)??[];if(this.pointsLayers.size===t.length&&t.every(d=>this.pointsLayers.has(d))&&this.pointsLayers.size)return;const n=((r=this.bufferCanvas)==null?void 0:r.width)??0,i=((c=this.bufferCanvas)==null?void 0:c.height)??0,s=new Map;for(let d=0;d<t.length;d++){const h=document.createElement("canvas"),u=document.createElement("canvas");n>1&&i>1&&(h.width=n,h.height=i,u.width=n,u.height=i),s.set(t[d],{a:h,b:u,actx:h.getContext("2d"),bctx:u.getContext("2d"),cur:"A"})}this.pointsLayers=s,this.pointsLayerValid=!1},getSeriesLayer(t){const e=this.pointsLayers.get(t);if(!e)return null;const n=e.cur==="A";return{src:n?e.a:e.b,srcCtx:n?e.actx:e.bctx,dst:n?e.b:e.a,dstCtx:n?e.bctx:e.actx,dstName:n?"B":"A",layer:e}},resizePointsLayers(t,e){let n=!1;return this.pointsLayers.forEach(i=>{(i.a.width!==t||i.a.height!==e)&&(i.a.width=t,i.a.height=e,i.b.width=t,i.b.height=e,n=!0)}),n},pointsLayersSized(){if(!this.pointsLayers.size||!this.bufferCanvas)return!1;const t=this.bufferCanvas.width,e=this.bufferCanvas.height;if(!(t>1)||!(e>1))return!1;let n=!0;return this.pointsLayers.forEach(i=>{(i.a.width!==t||i.a.height!==e)&&(n=!1)}),n},getBlitScatterSeriesList(){var n,i;const t=((i=(n=this.seriesInfo)==null?void 0:n.charts)==null?void 0:i.scatter)??[],e=[];for(let s=0;s<t.length;s++){const l=this.seriesList[t[s]];l!=null&&l.show&&e.push({sId:t[s],series:l,xi:l.xAxisIndex??0,yi:l.yAxisIndex??0})}return e},getBlitScatterSeries(){return this.getBlitScatterSeriesList()[0]??null},areBlitSeriesAligned(t){var n,i,s,l;if(!t||t.length<1)return!1;const e=(i=(n=this.dataSet)==null?void 0:n[t[0].sId])==null?void 0:i.lastTick;if(!e)return!1;for(let a=1;a<t.length;a++){const r=(l=(s=this.dataSet)==null?void 0:s[t[a].sId])==null?void 0:l.lastTick;if(!r||r.gapCount!==e.gapCount||r.toTime!==e.toTime||r.endIndex!==e.endIndex||r.length!==e.length)return!1}return!0},blitShiftDenominator(){const t=this.pixelRatio;if(!(t>0))return null;if(Number.isInteger(t))return 1;const e=4;for(let n=2;n<=e;n++)if(Math.abs(t*n-Math.round(t*n))<1e-6)return n;return null},evaluateBlitGate(t){var p,y,C,b,k,T,w,M,V,x,S,L,I,v,W;const e=this.options,n=this._blitPrev,i=this.isInit===!0&&((p=e.realTimeScatter)==null?void 0:p.use)===!0&&!e.brush&&this.updateSeries!==!0&&!t&&!((C=(y=this.scrollbar)==null?void 0:y.x)!=null&&C.use||(k=(b=this.scrollbar)==null?void 0:b.y)!=null&&k.use),s=this.getBlitScatterSeriesList(),l=this.areBlitSeriesAligned(s),a=!((T=e.selectItem)!=null&&T.use&&(((w=this.defaultSelectItemInfo)==null?void 0:w.dataIndex)!=null||((M=this.lastHitInfo)==null?void 0:M.dataIndex)!=null))&&!((V=e.selectSeries)!=null&&V.use&&this.defaultSelectInfo)&&!this.legendHover,r={modeOk:i,seriesAligned:l,selectionOk:a,scatterOnly:this.hasOnlyVisibleScatter(),deviceRatioBlittable:this.blitShiftDenominator()!==null,hasPrev:!!n,optionsStable:!!n&&n.optionsRef===this.options,yFixed:!1,xWidthStable:!1,xAreaStable:!1,labelOffsetStable:!1,xMonotonic:!1,deviceStable:!1,gapOk:!1};let c=0,d=0,h=0;const u=s[0]??null,f=u?(S=(x=this.axesSteps)==null?void 0:x.x)==null?void 0:S[u.xi]:null,m=u?(I=(L=this.axesSteps)==null?void 0:L.y)==null?void 0:I[u.yi]:null;if(u&&f&&m&&this.chartRect&&this.labelOffset){const E=this.chartRect,G=E.chartWidth-(this.labelOffset.left+this.labelOffset.right);n&&(r.yFixed=m.graphMin===n.graphMinY&&m.graphMax===n.graphMaxY,r.xWidthStable=f.graphMax-f.graphMin===n.graphMaxX-n.graphMinX,r.xAreaStable=G===n.xArea,r.labelOffsetStable=this.labelOffset.left===n.labelOffsetLeft&&this.labelOffset.right===n.labelOffsetRight,c=f.graphMin-n.graphMinX,r.xMonotonic=Number.isFinite(c)&&c>0,r.deviceStable=this.pixelRatio===n.pixelRatio&&E.chartWidth===n.chartWidth&&E.chartHeight===n.chartHeight&&E.x1===n.x1&&E.y2===n.y2);const R=(W=(v=this.dataSet)==null?void 0:v[u.sId])==null?void 0:W.lastTick;R&&(d=R.gapCount??0,h=R.length??0,r.gapOk=d>0&&d<h)}return{ok:r.modeOk&&r.seriesAligned&&r.selectionOk&&r.scatterOnly&&r.deviceRatioBlittable&&r.hasPrev&&r.optionsStable&&r.yFixed&&r.xWidthStable&&r.xAreaStable&&r.labelOffsetStable&&r.xMonotonic&&r.deviceStable&&r.gapOk,parts:r,shiftMs:c,gapCount:d,length:h,scatterList:s}},hasOnlyVisibleScatter(){var n,i;const t=((n=this.seriesInfo)==null?void 0:n.charts)??{},e=Object.keys(t);for(let s=0;s<e.length;s++){if(e[s]==="scatter")continue;const l=t[e[s]];for(let a=0;a<l.length;a++)if((i=this.seriesList[l[a]])!=null&&i.show)return!1}return!0},snapshotBlitState(){var s,l,a,r,c;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const t=this.getBlitScatterSeries();if(!t)return null;const e=(a=(l=this.axesSteps)==null?void 0:l.x)==null?void 0:a[t.xi],n=(c=(r=this.axesSteps)==null?void 0:r.y)==null?void 0:c[t.yi];if(!e||!n||!this.chartRect||!this.labelOffset)return null;const i=this.chartRect;return{sId:t.sId,graphMinX:e.graphMin,graphMaxX:e.graphMax,graphMinY:n.graphMin,graphMaxY:n.graphMax,xArea:i.chartWidth-(this.labelOffset.left+this.labelOffset.right),labelOffsetLeft:this.labelOffset.left,labelOffsetRight:this.labelOffset.right,pixelRatio:this.pixelRatio,chartWidth:i.chartWidth,chartHeight:i.chartHeight,x1:i.x1,y2:i.y2,optionsRef:this.options}},recordBlitDiag(t,e,n){var s;if(typeof window>"u"||!window.__EVUI_BLIT_DEBUG__)return;(s=this.options.realTimeScatter)!=null&&s.use&&(window.__EVUI_BLIT_CHART__=this),this._blitDiag||(this._blitDiag={ticks:0,eligible:0,blitted:0,fail:{},rate:0,lastShiftMs:0,lastGap:0});const i=this._blitDiag;if(i.ticks++,i.lastShiftMs=t.shiftMs,i.lastGap=t.gapCount,t.ok)i.eligible++;else{const l=Object.keys(t.parts);for(let a=0;a<l.length;a++)t.parts[l[a]]||(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}if(t.ok&&!e&&n){const l=Object.keys(n);for(let a=0;a<l.length;a++)n[l[a]]&&(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}e&&i.blitted++,i.rate=i.blitted/i.ticks,window.__EVUI_BLIT_DIAG__=i},collectStripDuplicatePoints(t,e){var s,l,a;const n=((l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)??[],i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!(c!=null&&c.show))continue;const d=(a=c.data[c.sId])==null?void 0:a.dataGroup;if(d)for(let h=0;h<e.length;h++){const u=d[e[h]];if(u!=null&&u.data)for(let f=0;f<u.data.length;f++){const m=u.data[f];t.set(m.k??O.coordinateKey(m.x,m.y),c.sId)}}}},drawChartBlitFastPath(t,e){var v,W,E,G;const n=e.scatterList??this.getBlitScatterSeriesList(),i=n[0]??null,s=(W=(v=this.dataSet)==null?void 0:v[i==null?void 0:i.sId])==null?void 0:W.lastTick;if(!i||!s)return!1;const l=this.pixelRatio,a=this.chartRect,r=this.labelOffset,c=this.axesSteps.x[i.xi],d=a.chartWidth-(r.left+r.right),h=c.graphMax-c.graphMin;if(!(h>0)||!(d>0))return!1;const u=this.blitShiftDenominator()??1,f=d/h*e.shiftMs,m=this._blitCarry+f,g=Math.round(m/u)*u;if(g<1)return!1;const p=Math.round(g*l);let y=s.maxDirtyAge,C=typeof i.series.pointSize=="number"?i.series.pointSize:i.series.pointSize.value;for(let R=1;R<n.length;R++){const X=(G=(E=this.dataSet)==null?void 0:E[n[R].sId])==null?void 0:G.lastTick;X&&X.maxDirtyAge>y&&(y=X.maxDirtyAge);const Z=n[R].series.pointSize,N=typeof Z=="number"?Z:Z.value;N>C&&(C=N)}if(y>s.gapCount+1)return!1;const b=this.bufferCanvas.width,k=this.bufferCanvas.height;if(p>=b)return!1;this._blitCarry=m-g;const{gapCount:T,endIndex:w,length:M}=s,V=Math.min(M,Math.max(T+1,y+1)),x=new Array(V);for(let R=0;R<V;R++){let X=(w-R)%M;X<0&&(X+=M),x[R]=X}const S=this.options.coordinateDedupe!==!1&&n.length>1,L=S?new Map:null;S&&this.collectStripDuplicatePoints(L,x);const I={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:L,coordinateDedupe:S,rtXOffsetCss:this._blitCarry};for(let R=0;R<n.length;R++){const X=n[R],Z=this.getSeriesLayer(X.sId);if(!Z)return!1;Z.dstCtx.setTransform(1,0,0,1,0,0),Z.dstCtx.clearRect(0,0,b,k),Z.dstCtx.drawImage(Z.src,p,0,b-p,k,0,0,b-p,k),Z.dstCtx.setTransform(l,0,0,l,0,0),X.series.realTimeScatterDrawStrip(Z.dstCtx,x,I),Z.dstCtx.setTransform(1,0,0,1,0,0),Z.layer.cur=Z.dstName,X.series.refreshRtTotalCount()}return this.drawStaticLayer(this.bufferCtx,t),this.compositePointsLayer(C),!0},compositePointsLayer(t){const e=this.pixelRatio,n=this.chartRect,i=this.labelOffset,s=n.chartWidth-(i.left+i.right),l=n.chartHeight-(i.top+i.bottom),a=n.x1+i.left,r=n.y2-i.bottom,c=r-l,d=a+s,h=(a-t)*e,u=(c-t)*e,f=this.blitShiftDenominator()??1,m=(Math.ceil(d)+t+Math.ceil(f/2)+1)*e,g=(r+t)*e,p=this.getBlitScatterSeriesList(),y=!!this.options.seriesReverse;this.bufferCtx.save(),this.bufferCtx.setTransform(1,0,0,1,0,0),this.bufferCtx.beginPath(),this.bufferCtx.rect(h,u,m-h,g-u),this.bufferCtx.clip();for(let C=0;C<p.length;C++){const b=y?p[p.length-1-C]:p[C],k=this.pointsLayers.get(b.sId);k&&this.bufferCtx.drawImage(k.cur==="A"?k.a:k.b,0,0)}this.bufferCtx.restore()},computePointsLayerStamp(){var s,l,a,r,c,d,h;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const t=this.getBlitScatterSeriesList();if(!t.length||!this.chartRect||!this.labelOffset||!this.axesSteps)return null;const e=this.chartRect,n=this.labelOffset,i=[this.pixelRatio,(l=this.bufferCanvas)==null?void 0:l.width,(a=this.bufferCanvas)==null?void 0:a.height,e.chartWidth,e.chartHeight,e.x1,e.y2,n.left,n.right,n.top,n.bottom];for(let u=0;u<t.length;u++){const{sId:f,xi:m,yi:g}=t[u],p=(c=(r=this.dataSet)==null?void 0:r[f])==null?void 0:c.lastTick,y=(d=this.axesSteps.x)==null?void 0:d[m],C=(h=this.axesSteps.y)==null?void 0:h[g];if(!y||!C)return null;i.push(f,p?`${p.seq}/${p.toTime}/${p.endIndex}/${p.length}`:"nt",y.graphMin,y.graphMax,C.graphMin,C.graphMax)}return i.join("|")},maybeRebuildPointsLayer(t=!1){var n;if(!((n=this.options.realTimeScatter)!=null&&n.use))return!1;const e=this.computePointsLayerStamp();return!t&&e&&this.pointsLayerValid&&this._pointsLayerStamp===e&&this._pointsLayerOptionsRef===this.options?!1:(this.rebuildPointsLayer(),this._pointsLayerStamp=this.pointsLayerValid?e:null,this._pointsLayerOptionsRef=this.pointsLayerValid?this.options:null,this.pointsLayerValid)},canRouteFallbackViaLayer(t){var n,i,s,l,a;const e=this.options;return!((n=e.realTimeScatter)!=null&&n.use)||t||(i=e.selectItem)!=null&&i.use&&(((s=this.defaultSelectItemInfo)==null?void 0:s.dataIndex)!=null||((l=this.lastHitInfo)==null?void 0:l.dataIndex)!=null)||(a=e.selectSeries)!=null&&a.use&&this.defaultSelectInfo||!this.pointsLayersSized()||!this.hasOnlyVisibleScatter()?!1:this.getBlitScatterSeriesList().length>0},ensureHitCoordsFresh(){var n,i,s;if(!this._hitCoordsDirty||!((n=this.options.realTimeScatter)!=null&&n.use)||!this.chartRect||!this.labelOffset||!this.axesSteps)return;const t=this.getBlitScatterSeriesList(),e={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,rtXOffsetCss:this._blitCarry};for(let l=0;l<t.length;l++)(s=(i=t[l].series).refreshRtHitCoords)==null||s.call(i,e);this._hitCoordsDirty=!1},getMaxVisibleScatterPointSize(){const t=this.getBlitScatterSeriesList();let e=0;for(let n=0;n<t.length;n++){const i=t[n].series.pointSize,s=typeof i=="number"?i:(i==null?void 0:i.value)??0;s>e&&(e=s)}return e},rebuildPointsLayer(){var l,a,r;if(!((l=this.options.realTimeScatter)!=null&&l.use)||!this.pointsLayersSized()){this.pointsLayerValid=!1;return}const t=this.getBlitScatterSeriesList();if(!t.length){this.pointsLayerValid=!1;return}const e=this.pixelRatio,n=((r=(a=this.seriesInfo)==null?void 0:a.charts)==null?void 0:r.scatter)??[],i=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(n),s=i?new Map:null;i&&this.collectDuplicatePoints(s,n);for(let c=0;c<t.length;c++){const d=t[c],h=this.pointsLayers.get(d.sId);if(!h){this.pointsLayerValid=!1;return}const u=h.cur==="A"?h.a:h.b,f=h.cur==="A"?h.actx:h.bctx;f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,u.width,u.height),f.setTransform(e,0,0,e,0,0);const m={ctx:f,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,duple:s,coordinateDedupe:i,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,rtXOffsetCss:this._blitCarry,markDrawn:!0};d.series.computeGeometry(m),d.series.realTimeScatterDraw(m),f.setTransform(1,0,0,1,0,0)}this.pointsLayerValid=!0}},DC={selectedSeriesAllLineSafe(){var e;const t=((e=this.defaultSelectInfo)==null?void 0:e.seriesId)??[];for(let n=0;n<t.length;n++){const i=this.seriesList[t[n]];if(!i||i.type!=="line"||i.fill||i.isExistGrp)return!1}return!0},shouldDrawSelectedOnTop(t){var n,i,s,l;const e=this.options;return!((n=e.selectSeries)!=null&&n.use)||e.brush||(i=e.realTimeScatter)!=null&&i.use||e.workerRender||t!=null&&t.legend||this.legendHover||!((l=(s=this.defaultSelectInfo)==null?void 0:s.seriesId)!=null&&l.length)?!1:this.selectedSeriesAllLineSafe()},drawSelectedSeriesOnly(){var d;const{maxTip:t,selectLabel:e,selectItem:n,selectSeries:i,brush:s,displayOverflow:l,unSelectedOpacity:a}=this.options,r={ctx:this.bufferCtx,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:t.background,color:t.color},selectLabel:{option:e,selected:this.defaultSelectInfo},selectSeries:{option:i,selected:this.defaultSelectInfo},selectItem:{option:n,selected:this.defaultSelectItemInfo},isBrush:!!s,displayOverflow:l,unSelectedOpacity:a,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion},c=((d=this.defaultSelectInfo)==null?void 0:d.seriesId)??[];for(let h=0;h<c.length;h++){const u=this.seriesList[c[h]];u&&u.show&&u.draw({...r})}}},jr=2,YC=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],OC=["sId","type","name","show","color","fill","fillColor","fillOpacity","pointFill","point","lineWidth","thickness","pointSize","pointStyle","interpolation","passingValue","hasPassingValueInData","segments","combo","xAxisIndex","yAxisIndex","stackIndex","groupIndex","isExistGrp","showValue"];function st(t){if(t===null)return null;const e=typeof t;if(e==="number"||e==="string"||e==="boolean")return t;if(e==="function"||e==="undefined"||e==="symbol"||e==="bigint")return;if(Array.isArray(t))return t.map(i=>st(i)??null);const n=Object.getPrototypeOf(t);if(n===Object.prototype||n===null){const i={};return Object.keys(t).forEach(s=>{const l=st(t[s]);l!==void 0&&(i[s]=l)}),i}}function Qr(t,e){const n={};return t&&e.forEach(i=>{const s=st(t[i]);s!==void 0&&(n[i]=s)}),n}function $r(t,e){if(e==="time")return _r(t);if(typeof t=="number")return t;if(e==="step"){const n=Number(t);return Number.isFinite(n)?n:null}return null}function HC(t,e={}){const n=t.data??[];if(t.type==="pie")return{value:n.map(d=>typeof(d==null?void 0:d.value)=="number"?d.value:null)};const i=e.x??"linear",s=e.y??"linear",l=new Array(n.length),a=new Array(n.length),r=new Array(n.length),c=new Array(n.length);for(let d=0;d<n.length;d++){const h=n[d]??{};l[d]=$r(h.x,i),a[d]=$r(h.y,s),r[d]=typeof h.o=="number"?h.o:null,c[d]=typeof h.b=="number"?h.b:null}return{x:l,y:a,o:r,b:c}}function FC(t){var s,l,a,r,c,d,h,u;const e=t.options??{},n=t.defaultSelectInfo,i=t.defaultSelectItemInfo;return{selectSeries:{use:!!((s=e.selectSeries)!=null&&s.use),selected:{seriesId:st(n==null?void 0:n.seriesId)??[]}},selectItem:{use:!!((l=e.selectItem)!=null&&l.use),useSeriesOpacity:!!((a=e.selectItem)!=null&&a.useSeriesOpacity),showBorder:!!((r=e.selectItem)!=null&&r.showBorder),borderStyle:st((c=e.selectItem)==null?void 0:c.borderStyle)??null,selected:i?{dataIndex:i.dataIndex??null,seriesID:i.seriesID??null}:null},selectLabel:{use:!!((d=e.selectLabel)!=null&&d.use),useSeriesOpacity:!!((h=e.selectLabel)!=null&&h.useSeriesOpacity),useBothAxis:!!((u=e.selectLabel)!=null&&u.useBothAxis),selected:{dataIndex:st(n==null?void 0:n.dataIndex)??[],label:st(n==null?void 0:n.label)??[],targetAxis:(n==null?void 0:n.targetAxis)??null}}}}function zC(t,e=0){var a,r,c,d,h;const n={},i=t.seriesList??{};Object.keys(i).forEach(u=>{var p,y,C,b,k,T;const f=i[u];if(!f||typeof f.hasRenderableValue=="function"&&!f.isExistGrp&&!f.hasRenderableValue())return;const m=((C=(y=(p=t.options)==null?void 0:p.axesX)==null?void 0:y[f.xAxisIndex??0])==null?void 0:C.type)??"linear",g=((T=(k=(b=t.options)==null?void 0:b.axesY)==null?void 0:k[f.yAxisIndex??0])==null?void 0:T.type)??"linear";n[u]={...Qr(f,OC),data:HC(f,{x:m,y:g})},f.type==="heatMap"&&f.labels&&(n[u].labels=st(f.labels)??{})});const s={},l=((a=t.seriesInfo)==null?void 0:a.charts)??{};return Object.keys(l).forEach(u=>{s[u]=(l[u]??[]).filter(f=>n[f])}),{version:jr,epoch:e,pixelRatio:t.pixelRatio??1,chartRect:st(t.chartRect)??{},labelOffset:st(t.labelOffset)??{},axesSteps:{x:st((r=t.axesSteps)==null?void 0:r.x)??[],y:st((c=t.axesSteps)==null?void 0:c.y)??[]},options:{...Qr(t.options,YC),isGradient:((h=(d=t.options)==null?void 0:d.legend)==null?void 0:h.type)==="gradient"},selection:FC(t),seriesOrder:s,series:n}}function AC(t){const e={},n=[],i=t.series??{};return Object.keys(i).forEach(s=>{const l=i[s].data??{},a={};let r=0;Object.keys(l).forEach(c=>{const d=l[c]??[];r=d.length;const h=new Float64Array(d.length);for(let u=0;u<d.length;u++)h[u]=typeof d[u]=="number"?d[u]:NaN;a[c]=h,n.push(h.buffer)}),a.length=r,e[s]=a}),{columns:e,transferList:n}}const qr="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLFp0PU9iamVjdC5wcm90b3R5cGUsRGU9WnQuaGFzT3duUHJvcGVydHksemU9WnQudG9TdHJpbmcsTXQ9T3Q/T3QudG9TdHJpbmdUYWc6dm9pZCAwO2Z1bmN0aW9uIEVlKGUpe3ZhciB0PURlLmNhbGwoZSxNdCksbj1lW010XTt0cnl7ZVtNdF09dm9pZCAwO3ZhciBzPSEwfWNhdGNoe312YXIgaT16ZS5jYWxsKGUpO3JldHVybiBzJiYodD9lW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jpnc30pO3JldHVybn1pZih0LnR5cGU9PT0icmVuZGVyIil0cnl7SXModCl9Y2F0Y2gobil7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVuZGVyLWVycm9yIixlcG9jaDp0LmVwb2NoLG1lc3NhZ2U6U3RyaW5nKG4mJm4ubWVzc2FnZXx8biksbmFtZTpuJiZuLm5hbWUsc3RhY2s6biYmbi5zdGFja30pfX19fSkoKTsK",KC=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),ec=typeof self<"u"&&self.Blob&&new Blob([KC(qr)],{type:"text/javascript;charset=utf-8"});function _C(t){let e;try{if(e=ec&&(self.URL||self.webkitURL).createObjectURL(ec),!e)throw"";const n=new Worker(e,{name:t==null?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch{return new Worker("data:text/javascript;base64,"+qr,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const mt={IDLE:"idle",INITIALIZING:"initializing",READY:"ready",FAILED:"failed"},UC=3e3,JC=2,jC=3,Ft=()=>{},QC={onInitFailure:Ft,onTimeout:Ft,onRenderException:Ft,onFallback:Ft};function $C(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function qC(t){if(typeof structuredClone!="function")return!1;try{return structuredClone(t),!0}catch{return!1}}function e1(){return new _C}class t1{constructor(e={}){this.state=mt.IDLE,this.worker=null,this.version=e.version??jr,this.initTimeoutMs=e.initTimeoutMs??UC,this.maxInFlight=e.maxInFlight??JC,this.maxRenderErrors=e.maxRenderErrors??jC,this.hooks={...QC,...e.hooks||{}},this._timer=null,this._frameHandler=Ft,this._errorHandler=Ft,this._inFlight=0,this._renderErrorStreak=0,this._isEnabled=e.isEnabled||(()=>!1),this._isSupported=e.isSupported||$C,this._createWorker=e.createWorker||e1}start(){if(this.state!==mt.IDLE)return this.state;if(!this._isEnabled())return this.hooks.onFallback("opt-in-off"),this.state;if(!this._isSupported())return this.hooks.onFallback("unsupported"),this.state;let e;try{e=this._createWorker()}catch(n){return this.state=mt.FAILED,this.hooks.onInitFailure(n),this.hooks.onFallback("worker-create-failed"),this.state}return e?(this.worker=e,this.state=mt.INITIALIZING,e.onmessage=n=>this._handleMessage(n),e.onerror=()=>this._fail("worker-error"),this._timer=setTimeout(()=>this._handleTimeout(),this.initTimeoutMs),e.postMessage({type:"init",version:this.version}),this.state):(this.state=mt.FAILED,this.hooks.onInitFailure("worker-create-failed"),this.hooks.onFallback("worker-create-failed"),this.state)}isReady(){return this.state===mt.READY}shouldRenderOnWorker(e){return this.isReady()&&qC(e)}setFrameHandler(e){this._frameHandler=e||Ft}setErrorHandler(e){this._errorHandler=e||Ft}canAcceptRender(){return this.isReady()&&this._inFlight<this.maxInFlight}render(e,n,i){if(!this.canAcceptRender()||!this.worker)return!1;this._inFlight+=1;try{this.worker.postMessage({type:"render",epoch:e.epoch,snapshot:e,columns:n},i||[])}catch(s){return this._inFlight=0,this.hooks.onRenderException(s),this._fail("post-message-failed"),!1}return!0}destroy(){this._clearTimer(),this.worker&&(this.worker.terminate(),this.worker=null),this.state=mt.IDLE}_handleMessage(e){const n=e&&e.data;if(n)if(n.type==="ready"&&this.state===mt.INITIALIZING){if(n.version!==this.version){this._fail("version-mismatch");return}this._clearTimer(),this.state=mt.READY}else n.type==="unsupported"?this._fail("worker-unsupported"):n.type==="rendered"?(this._inFlight=Math.max(0,this._inFlight-1),this._renderErrorStreak=0,this._frameHandler(n)):n.type==="render-error"&&(this._inFlight=Math.max(0,this._inFlight-1),this.hooks.onRenderException(n),this._errorHandler(n),this._renderErrorStreak+=1,this._renderErrorStreak>=this.maxRenderErrors&&(this._inFlight=0,this._fail("render-error-threshold")))}_handleTimeout(){this.state===mt.INITIALIZING&&(this.hooks.onTimeout("init-timeout"),this._fail("init-timeout"))}_fail(e){this._clearTimer(),this.state=mt.FAILED,this.worker&&(this.worker.terminate(),this.worker=null);const n=this._inFlight>0;this._inFlight=0,this.hooks.onInitFailure(e),this.hooks.onFallback(e),n&&this._errorHandler()}_clearTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}const n1=["text","badge","callout","circle"],i1=["axis","pixel","series"],s1=["straight","elbow"],o1=["top","bottom","left","right","auto"],l1=["start","end"],a1={type:"pixel",xAxisIndex:0,yAxisIndex:0,xValue:null,yValue:null,x:0,y:0,seriesId:null,location:"end",offsetX:0,offsetY:0},r1={enabled:!1,type:"straight",style:{stroke:"#9E9E9E",strokeWidth:1,dashStyle:"solid"}},tc={text:{style:{color:"#212121",backgroundColor:"transparent",borderColor:"transparent",borderWidth:0,borderRadius:0,padding:[0,0],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},badge:{style:{color:"#8B2323",backgroundColor:"#FDF0F0",borderColor:"#B24C4C",borderWidth:1,borderRadius:6,padding:[6,10],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},callout:{style:{anchor:"auto",arrowSize:4,color:"#212121",backgroundColor:"#FFFFFF",borderColor:"#B0B0B0",borderWidth:1,borderRadius:4,padding:[4,8],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},circle:{style:{radius:10,backgroundColor:"rgba(178, 76, 76, 0.15)",borderColor:"#B24C4C",borderWidth:1}}};function c1(t){const e=n=>Number.isFinite(n)&&n>0?n:0;if(typeof t=="number"){const n=e(t);return[n,n,n,n]}if(Array.isArray(t)){const n=t.map(e);if(n.length===1)return[n[0],n[0],n[0],n[0]];if(n.length===2)return[n[0],n[1],n[0],n[1]];if(n.length===3)return[n[0],n[1],n[2],n[1]];if(n.length>=4)return[n[0],n[1],n[2],n[3]]}return[0,0,0,0]}function d1(t,e,n){if(i1.includes(t.type)||(n.push(`[annotation:${e}] unknown position.type "${t.type}" — fallback to "pixel".`),t.type="pixel"),t.type==="axis")(t.xValue==null||t.yValue==null)&&n.push(`[annotation:${e}] position.type "axis" requires both xValue and yValue.`);else if(t.type==="series"){t.seriesId==null&&n.push(`[annotation:${e}] position.type "series" requires seriesId.`);const i=t.location;l1.includes(i)||typeof i=="number"&&Number.isInteger(i)||(n.push(`[annotation:${e}] invalid location "${i}" — fallback to "end".`),t.location="end")}}function h1(t,e,n){const i=t.id!=null?String(t.id):`annotation-${e}`;let s=t.type;n1.includes(s)||(n.push(`[annotation:${i}] unknown type "${s}" — fallback to "text".`),s="text");const l=Re(t.style)||{},a=Xe({},l,tc[s].style);if("padding"in a){const h="padding"in l?l.padding:tc[s].style.padding;a.padding=c1(h)}s==="circle"&&typeof a.radius=="number"&&a.radius<0&&(n.push(`[annotation:${i}] style.radius must be >= 0 — clamped to 0.`),a.radius=0),s==="callout"&&!o1.includes(a.anchor)&&(n.push(`[annotation:${i}] invalid style.anchor "${a.anchor}" — fallback to "auto".`),a.anchor="auto");const r=Xe({},Re(t.position)||{},a1);d1(r,i,n);const c=Xe({},Re(t.connector)||{},r1);s1.includes(c.type)||(n.push(`[annotation:${i}] invalid connector.type "${c.type}" — fallback to "straight".`),c.type="straight"),s==="callout"&&c.enabled&&(n.push(`[annotation:${i}] connector is ignored for type "callout" (the arrow acts as the connector).`),c.enabled=!1);let d=t.content;return s==="circle"?d="":!Kn(d)&&typeof d!="string"&&(d=d==null?"":String(d)),{id:i,type:s,content:d,position:r,connector:c,style:a}}function u1(t){const e=[];if(!Array.isArray(t))return{annotations:[],warnings:e};const n=new Set,i=t.filter(s=>s&&typeof s=="object").map((s,l)=>h1(s,l,e));return i.forEach(s=>{n.has(s.id)&&e.push(`[annotation:${s.id}] duplicate id — annotations should have unique ids.`),n.add(s.id)}),{annotations:i,warnings:e}}function f1(t,e){if(t==null)return null;if(((e==null?void 0:e.type)||"linear")==="time"){if(typeof t=="number")return Number.isFinite(t)?t:null;const s=Pe(t).valueOf();return Number.isFinite(s)?s:null}const i=typeof t=="number"?t:Number(t);return Number.isFinite(i)?i:null}function m1(t,e=[]){const i=(Array.isArray(e)?e:[]).indexOf(t);return i!==-1?i:typeof t=="number"&&Number.isInteger(t)?t:-1}function p1(t,e,n,i,s){const l=Array.isArray(e.labels)?e.labels:[],a=e.minIndex??0,r=e.maxIndex??l.length-1,c=r-a+1;if(c<=0)return null;const d=m1(t,l);if(d<a||d>r)return null;const h=n/c,u=h*(d-a)+h/2;return Math.round(s?i+u:i-u)}function nc(t,e,n,i,s){if(!e)return null;if((e.type||"linear")==="step")return p1(t,e,n,i,s);const l=f1(t,e);return l===null?null:s?q.calculateX(l,e.graphMin,e.graphMax,n,i):q.calculateY(l,e.graphMin,e.graphMax,n,i)}function ic(t,e,n=!1){const i=Array.isArray(e);let s=0;if(i?s=e.length:typeof e=="number"&&(s=e),s<=0)return-1;if(typeof t=="number"&&Number.isInteger(t))return Math.min(Math.max(t,0),s-1);const l=a=>a&&(n?a.x!=null:a.y!=null);if(t==="start"){if(!i)return 0;for(let a=0;a<s;a++)if(l(e[a]))return a;return-1}if(!i)return s-1;for(let a=s-1;a>=0;a--)if(l(e[a]))return a;return-1}function g1(t,e){var a,r,c,d,h,u,f,m,g;const n={x:0,y:0,anchorX:0,anchorY:0,isVisible:!1},{position:i}=t;if(!i)return n;const s=i.offsetX||0,l=i.offsetY||0;if(i.type==="pixel"){const p=i.x||0,y=i.y||0;return{x:p+s,y:y+l,anchorX:p,anchorY:y,isVisible:!0}}if(i.type==="axis"){const{chartRect:p,labelOffset:y}=e||{},C=((r=(a=e==null?void 0:e.axes)==null?void 0:a.x)==null?void 0:r[i.xAxisIndex])??((d=(c=e==null?void 0:e.axesSteps)==null?void 0:c.x)==null?void 0:d[i.xAxisIndex]),b=((u=(h=e==null?void 0:e.axes)==null?void 0:h.y)==null?void 0:u[i.yAxisIndex])??((m=(f=e==null?void 0:e.axesSteps)==null?void 0:f.y)==null?void 0:m[i.yAxisIndex]);if(!C||!b||!p||!y)return n;const k=p.chartWidth-(y.left+y.right),T=p.chartHeight-(y.top+y.bottom),w=p.x1+y.left,M=p.y2-y.bottom,V=nc(i.xValue,C,k,w,!0),x=nc(i.yValue,b,T,M,!1);return V===null||x===null?n:{x:V+s,y:x+l,anchorX:V,anchorY:x,isVisible:!0}}if(i.type==="series"){const p=(g=e==null?void 0:e.seriesList)==null?void 0:g[i.seriesId];if(!p||p.show===!1)return n;if(p.type==="pie"){const{centerX:M,centerY:V,radius:x,startAngle:S,endAngle:L}=p;if(M==null||V==null||x==null||S==null||L==null)return n;let I=(S+L)/2;Math.abs(L-S)>=Math.PI*2-1e-6&&(I=0);const W=M+Math.cos(I)*x,E=V+Math.sin(I)*x;return{x:W+s,y:E+l,anchorX:W,anchorY:E,isVisible:!0}}const y=p.data;if(!Array.isArray(y))return n;const C=ic(i.location,y,!!p.isHorizontal),b=C>=0?y[C]:null;if(!b||b.xp==null||b.yp==null)return n;let k=b.xp,T=b.yp;const w=typeof b.w=="number"&&typeof b.h=="number";return p.type==="bar"&&w?p.isHorizontal?(k=b.xp+b.w,T=b.yp+b.h/2):(k=b.xp+b.w/2,T=b.yp+b.h):w&&(k=b.xp+b.w/2,T=b.yp+b.h/2),{x:k+s,y:T+l,anchorX:k,anchorY:T,isVisible:!0}}return n}function b1(t,e){var s,l,a;const{position:n}=t,i={xValue:null,yValue:null,seriesId:null,seriesName:null,dataIndex:-1,percentage:null};if(!n)return i;if(n.type==="axis")i.xValue=n.xValue,i.yValue=n.yValue;else if(n.type==="series"){const r=(s=e==null?void 0:e.seriesList)==null?void 0:s[n.seriesId],c=r==null?void 0:r.data;if(i.seriesId=n.seriesId,i.seriesName=(r==null?void 0:r.name)??null,(r==null?void 0:r.type)==="pie")i.yValue=((l=r.data)==null?void 0:l.o)??null,i.percentage=((a=r.data)==null?void 0:a.percentage)??null,i.dataIndex=0;else if(Array.isArray(c)){const d=ic(n.location,c,!!r.isHorizontal);i.dataIndex=d,d>=0&&c[d]&&(i.xValue=c[d].x,i.yValue=c[d].y)}}return i}function y1(t,e={}){if(Kn(t))try{const n=t(e);return n==null?"":String(n)}catch{return""}return typeof t!="string"?t==null?"":String(t):t.replace(/\{(\w+)\}/g,(n,i)=>i in e&&e[i]!=null?String(e[i]):n)}function sc(t={}){const e=t.fontWeight||"normal",n=typeof t.fontSize=="number"?`${t.fontSize}px`:t.fontSize||"11px",i=t.fontFamily||"sans-serif";return`${e} ${n} ${i}`}function x1(t,e,n=O.calcTextSizeCanvas){const s=(t==null?"":String(t)).split(`
|
|
18
|
+
`);let l=0,a=0;const r=s.map(c=>{const d=n(c,e);return l=Math.max(l,d.width),a=Math.max(a,d.height),{text:c,width:d.width}});return{lines:r,width:l,height:a*r.length,lineHeight:a}}function S1(t,e,n=O.calcTextSizeCanvas){const{type:i,style:s}=t;if(i==="circle"){const f=s.radius||0;return{w:f*2,h:f*2,content:null}}const l=sc(s),a=`${l}|${e}`;let r;t._measure&&t._measure.key===a?r=t._measure.value:(r=x1(e,l,n),t._measure={key:a,value:r});const[c,d,h,u]=s.padding||[0,0,0,0];return{w:r.width+u+d,h:r.height+c+h,content:r}}function C1(t,e,n){if(t&&t!=="auto")return t;const i=n.x-e.x,s=n.y-e.y;return i===0&&s===0?"bottom":Math.abs(s)>=Math.abs(i)?s>=0?"bottom":"top":i>=0?"right":"left"}function k1(t,e,n,i){const s=Math.max(i,1);let l,a;return n==="bottom"||n==="top"?(l=n==="bottom"?t.y+t.h:t.y,a=Math.min(Math.max(e.x,t.x+s),t.x+t.w-s),{side:n,tipX:e.x,tipY:e.y,baseAX:a-s,baseAY:l,baseBX:a+s,baseBY:l}):(l=n==="right"?t.x+t.w:t.x,a=Math.min(Math.max(e.y,t.y+s),t.y+t.h-s),{side:n,tipX:e.x,tipY:e.y,baseAX:l,baseAY:a-s,baseBX:l,baseBY:a+s})}function w1(t,e,n,i=O.calcTextSizeCanvas){const{type:s,style:l}=t,a=S1(t,n,i);if(s==="circle"){const d=l.radius||0,h={cx:e.x,cy:e.y,r:d},u={x:e.x-d,y:e.y-d,w:d*2,h:d*2};return{type:s,box:u,shape:h,content:null,tail:null}}const r={x:Math.round(e.x-a.w/2),y:Math.round(e.y-a.h/2),w:a.w,h:a.h};let c=null;if(s==="callout"){const d={x:r.x+r.w/2,y:r.y+r.h/2},h={x:e.anchorX,y:e.anchorY},u=C1(l.anchor,d,h);c=k1(r,h,u,l.arrowSize||8)}return{type:s,box:r,content:a.content,shape:null,tail:c}}const oc={solid:[],dash:[4,4],dot:[1,3]};function I1(t,e){return{x:Math.min(Math.max(e.x,t.x),t.x+t.w),y:Math.min(Math.max(e.y,t.y),t.y+t.h)}}function L1(t,e,n,i){if(!(i!=null&&i.enabled))return;const s=I1(n,e),l=i.style||{};t.save();try{t.beginPath(),t.strokeStyle=l.stroke||"#9E9E9E",t.lineWidth=l.strokeWidth||1,t.setLineDash(oc[l.dashStyle]||oc.solid),t.moveTo(e.x,e.y),i.type==="elbow"&&t.lineTo(s.x,e.y),t.lineTo(s.x,s.y),t.stroke()}finally{t.restore()}}function T1(t,e,n){const i=n.backgroundColor&&n.backgroundColor!=="transparent",s=n.borderWidth>0&&n.borderColor&&n.borderColor!=="transparent";if(!(!i&&!s)){t.save();try{t.beginPath(),q.roundedRect(t,e.x,e.y,e.w,e.h,n.borderRadius||0),i&&(t.fillStyle=n.backgroundColor,t.fill()),s&&(t.lineWidth=n.borderWidth,t.strokeStyle=n.borderColor,t.stroke())}finally{t.restore()}}}function M1(t,e,n,i){const{x:s,y:l,w:a,h:r}=e,c=s,d=s+a,h=l,u=l+r,f=Math.min(i.borderRadius||0,a/2,r/2),m=n==null?void 0:n.side;t.save();try{t.beginPath(),t.moveTo(c+f,h),m==="top"&&(t.lineTo(Math.min(n.baseAX,n.baseBX),h),t.lineTo(n.tipX,n.tipY),t.lineTo(Math.max(n.baseAX,n.baseBX),h)),t.lineTo(d-f,h),t.quadraticCurveTo(d,h,d,h+f),m==="right"&&(t.lineTo(d,Math.min(n.baseAY,n.baseBY)),t.lineTo(n.tipX,n.tipY),t.lineTo(d,Math.max(n.baseAY,n.baseBY))),t.lineTo(d,u-f),t.quadraticCurveTo(d,u,d-f,u),m==="bottom"&&(t.lineTo(Math.max(n.baseAX,n.baseBX),u),t.lineTo(n.tipX,n.tipY),t.lineTo(Math.min(n.baseAX,n.baseBX),u)),t.lineTo(c+f,u),t.quadraticCurveTo(c,u,c,u-f),m==="left"&&(t.lineTo(c,Math.max(n.baseAY,n.baseBY)),t.lineTo(n.tipX,n.tipY),t.lineTo(c,Math.min(n.baseAY,n.baseBY))),t.lineTo(c,h+f),t.quadraticCurveTo(c,h,c+f,h),t.closePath(),i.backgroundColor&&i.backgroundColor!=="transparent"&&(t.fillStyle=i.backgroundColor,t.fill()),i.borderWidth>0&&i.borderColor&&i.borderColor!=="transparent"&&(t.lineWidth=i.borderWidth,t.strokeStyle=i.borderColor,t.stroke())}finally{t.restore()}}function v1(t,e,n){t.save();try{t.beginPath(),t.arc(e.cx,e.cy,e.r,0,Math.PI*2),n.backgroundColor&&n.backgroundColor!=="transparent"&&(t.fillStyle=n.backgroundColor,t.fill()),n.borderWidth>0&&n.borderColor&&n.borderColor!=="transparent"&&(t.lineWidth=n.borderWidth,t.strokeStyle=n.borderColor,t.stroke())}finally{t.restore()}}function R1(t,e,n,i){var s;if(!(!n||!((s=n.lines)!=null&&s.length))){t.save();try{t.fillStyle=i.color||"#212121",t.font=sc(i);const l=["left","right"].includes(i.textAlign)?i.textAlign:"center";t.textAlign=l,t.textBaseline="middle";const[,a,,r]=i.padding||[0,0,0,0];let c;l==="left"?c=e.x+r:l==="right"?c=e.x+e.w-a:c=e.x+e.w/2;const{lineHeight:d}=n,h=d*n.lines.length,u=e.y+e.h/2-h/2+d/2;n.lines.forEach((f,m)=>{t.fillText(f.text,c,u+m*d)})}finally{t.restore()}}}function V1(t,e,n,i){var a;const{type:s,style:l}=e;if(s==="circle"){v1(t,n.shape,l);return}(a=e.connector)!=null&&a.enabled&&s!=="callout"&&L1(t,{x:i.anchorX,y:i.anchorY},n.box,e.connector),s==="callout"?M1(t,n.box,n.tail,l):T1(t,n.box,l),R1(t,n.box,n.content,l)}function E1(t,e,n,i=O.calcTextSizeCanvas){!t||!Array.isArray(e)||!e.length||e.forEach(s=>{try{const l=g1(s,n);if(!l.isVisible)return;const a=b1(s,n),r=s.type==="circle"?"":y1(s.content,a),c=w1(s,l,r,i);V1(t,s,c,l)}catch(l){Hn.warn(`[EvChart] annotation render failed (id: ${s&&s.id}):`,l)}})}const W1=300;let gs=class{constructor(e,n,i,s,l,a,r){Object.keys(Ar).forEach(d=>Object.assign(this,Ar[d])),i.brush||(Object.assign(this,VC),Object.assign(this,XC),Object.assign(this,vC),Object.assign(this,PC),Object.assign(this,CC),Object.assign(this,NC),Object.assign(this,SC),Object.assign(this,IC)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,wC),this.isMobile=Hh(),this.brushSeries=r,this.target=e,this.data=n,this.options=i,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=i.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=i.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM);const c=i.type==="pie";this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d",{willReadFrequently:c}),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d",{willReadFrequently:c}),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),i.brush||(this.overlayCanvas=document.createElement("canvas"),this.overlayCanvas.setAttribute("style","display: block; z-index: 2;"),this.overlayCanvas.setAttribute("class","overlay-canvas"),this.overlayCtx=this.overlayCanvas.getContext("2d",{willReadFrequently:c}),this.chartDOM.appendChild(this.overlayCanvas),this.overlayCanvas.style.position="absolute",this.overlayCanvas.style.top="0px",this.overlayCanvas.style.left="0px"),this.isInitLegend=!1,this.isInitTitle=!1,this.isInit=!1,this.scrollbar={x:{isInit:!1},y:{isInit:!1}},this.seriesList={},this.lastTip={pos:null,value:null},this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.defaultSelectItemInfo=l,this.defaultSelectInfo=a,this.legendHover=null,this.initBlitState(),this.renderWorkerGate=new t1({isEnabled:()=>!!this.options.workerRender,hooks:{onInitFailure:d=>Hn.warn("[EvChart] workerRender 비활성화 — main 렌더로 fallback:",d),onRenderException:d=>Hn.warn("[EvChart] workerRender 렌더 예외 — main 렌더로 fallback:",d),onFallback:d=>{d==="unsupported"&&Hn.warn("[EvChart] workerRender 미지원 환경 — main 렌더 사용")}}}),this.renderEpoch=0,this.renderWorkerGate.setFrameHandler(d=>this.commitWorkerFrame(d)),this.renderWorkerGate.setErrorHandler(d=>this.drawSeriesLayerFallback(d)),this.renderWorkerGate.start()}init(){var u,f,m,g,p;const{series:e,data:n,labels:i,groups:s}=this.data,{type:l,axesX:a,axesY:r,tooltip:c,horizontal:d,realTimeScatter:h}=this.options;this.createSeriesSet(e,l,d,s),s.length&&this.addGroupInfo(s),h!=null&&h.use?(this.dataSet={},this.createRealTimeScatterDataSet(n)):this.createDataSet(n,i),this.minMax=this.getStoreMinMax(),this.initRect(),this.axesX=this.createAxes("x",a),this.axesY=this.createAxes("y",r),((f=(u=a==null?void 0:a[0])==null?void 0:u.scrollbar)!=null&&f.use||(g=(m=r==null?void 0:r[0])==null?void 0:m.scrollbar)!=null&&g.use)&&this.initScrollbar(),this.initDefaultSelectInfo(),this.drawChart(),c.use&&!this.isInitTooltip&&this.createTooltipDOM(),(p=this.createEventFunctions)==null||p.call(this),this.isInit=!0}_updateSeriesCount(){this.seriesInfo.count=Object.values(this.seriesList).filter(e=>e.show).length}initRect(){const e=this.options;e.title.show&&(this.isInitTitle||this.initTitle(),this.showTitle()),e.legend.show&&!e.legend.external?(this.isInitLegend||this.initLegend(),this.setLegendPosition()):e.legend.show&&e.legend.external&&this._updateSeriesCount(),this.chartRect=this.getChartRect()}drawSyncedIndicator({horizontal:e,label:n,mousePosition:i}){this.drawSyncedIndicator({horizontal:e,label:n,mousePosition:i})}adjustXAndYAxisWidth(){var i,s,l,a;const e=(r,c,d)=>{const{interval:h,graphMin:u,graphMax:f,steps:m=0,minIndex:g,maxIndex:p,indexInterval:y}=r??{};let C=[];if((d==null?void 0:d.type)==="step"&&g!==void 0&&p!==void 0&&y!==void 0){const{labels:b}=this.data,k=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[];C=[];for(let T=g;T<=p;T+=y)k[T]!==void 0&&C.push(k[T])}else if(h)C=Array.from({length:m},(b,k)=>u+k*h),C.push(f);else{const{labels:b}=this.data;C=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[]}return C},n={x:(s=(i=this.axesRange)==null?void 0:i.x)==null?void 0:s.map((r,c)=>{var y,C,b,k;const d=this.axesX[c],h=(y=this.axesSteps)==null?void 0:y.x[c],u=e(h,"x",d),f=ve((C=d==null?void 0:d.labelStyle)==null?void 0:C.fixWidth)?d.labelStyle.fixWidth:0;let m=[];const g=(b=this.axesSteps)==null?void 0:b.x[c];if((d==null?void 0:d.type)==="linear"&&g!=null){const{graphMin:T,graphMax:w}=g;if(typeof T=="number"&&typeof w=="number"){const M=Math.abs(T)>=Math.abs(w)?T:w;m=[AS(M)]}}const p=((k=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:k.call(d,u,this.chartRect,m))??0;return{...r,size:{width:f||Math.max(p,r.size.width),height:r.size.height}}}),y:(a=(l=this.axesRange)==null?void 0:l.y)==null?void 0:a.map((r,c)=>{var g,p,y;const d=this.axesY[c],h=(g=this.axesSteps)==null?void 0:g.y[c],u=e(h,"y",d),f=ve((p=d==null?void 0:d.labelStyle)==null?void 0:p.fixWidth)?d.labelStyle.fixWidth:0,m=((y=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:y.call(d,u,this.chartRect))??0;return{...r,size:{width:f||Math.max(m,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}computeAxesScaleChange(){var r;if(typeof((r=this.listeners)==null?void 0:r["axes-scale-change"])!="function")return null;const e=this._lastEmittedAxesRange,n=this.labelRange,i=(c,d)=>(c==null?void 0:c.min)===(d==null?void 0:d.min)&&(c==null?void 0:c.max)===(d==null?void 0:d.max),s=({min:c,max:d})=>({minSteps:c,maxSteps:d}),l=n.x.every((c,d)=>{var u;return!!!((u=this.options.axesX[d])!=null&&u.scaleChange)||!!e&&i(c,e.x[d])}),a=n.y.every((c,d)=>{var u;return!!!((u=this.options.axesY[d])!=null&&u.scaleChange)||!!e&&i(c,e.y[d])});return l&&a?null:(this._lastEmittedAxesRange=n,{x:n.x.map(s),y:n.y.map(s)})}emitDataMaxChange(){var i;const e=(i=this.listeners)==null?void 0:i["axes-data-max-change"];if(typeof e!="function")return;let n=-1/0;Object.values(this.seriesList).forEach(s=>{if(!(s!=null&&s.show)||!s.minMax)return;const l=s.minMax.maxY;Number.isFinite(l)&&l>n&&(n=l)}),e(Number.isFinite(n)?n:null)}prepareScale(){this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange();const e=this.labelOffset;return this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),{scaleChange:this.computeAxesScaleChange(),scrollbarLabelOffset:e}}drawChart(e,n){var l,a,r,c,d,h;this.renderEpoch+=1,this.initScale();const{scaleChange:i,scrollbarLabelOffset:s}=this.prepareScale();this.computeScaleVersion(),((a=(l=this.scrollbar)==null?void 0:l.x)!=null&&a.use||(c=(r=this.scrollbar)==null?void 0:r.y)!=null&&c.use)&&this.updateScrollbarPosition(s),i&&typeof((d=this.listeners)==null?void 0:d["axes-scale-change"])=="function"&&this.listeners["axes-scale-change"](i),this.emitDataMaxChange(),!(!n&&this.tryDrawSeriesOnWorker(e))&&((h=this.options.realTimeScatter)!=null&&h.use?this.drawAxisAndSeries(e):(this.drawStaticLayer(this.bufferCtx,e),this.drawSeriesLayer(this.bufferCtx,e),this.shouldDrawSelectedOnTop(e)&&this.drawSelectedSeriesOnly()),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas),this.drawAnnotationLayer())}tryDrawSeriesOnWorker(e){var r;if(!((r=this.renderWorkerGate)!=null&&r.canAcceptRender())||!this.canRenderSeriesOnWorker(e).ok)return!1;const n=this.renderEpoch,i=zC(this,n),{columns:s,transferList:l}=AC(i);return this.drawStaticLayer(this.bufferCtx,e),this.computeSeriesGeometry(),this.renderWorkerGate.render(i,s,l)?this.drawSeriesOverlay():(this.drawSeriesLayer(this.bufferCtx,e),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas)),this.drawAnnotationLayer(),!0}canRenderSeriesOnWorker(e){var a;if(e||this.lastHitInfo)return{ok:!1,reason:"hit-info"};const n=((a=this.seriesInfo)==null?void 0:a.charts)??{},i={line:!0,bar:!0,heatMap:!0},s=Object.keys(n).find(r=>!i[r]&&(n[r]??[]).some(c=>{var d;return((d=this.seriesList[c])==null?void 0:d.show)!==!1}));return s?{ok:!1,reason:`unsupported-type:${s}`}:(n.bar??[]).some(r=>{const c=this.seriesList[r];return(c==null?void 0:c.show)!==!1&&(c==null?void 0:c.timeMode)})?{ok:!1,reason:"time-bar"}:{ok:!0}}commitWorkerFrame(e){const n=e==null?void 0:e.bitmap;if(!n)return;if(e.epoch!==this.renderEpoch){n.close();return}const i=this.displayCtx;this.commitToDisplay(i,this.bufferCanvas),i.drawImage(n,0,0),n.close(),i.save(),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.drawForeground(i),i.restore()}drawSeriesLayerFallback(e){var n;e&&e.epoch!==this.renderEpoch||(this.drawSeriesLayer(this.bufferCtx,void 0),((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}commitToDisplay(e,n){if(this.displayCanvas){const i=this.pixelRatio<1?this.pixelRatio:1;e.clearRect(0,0,this.displayCanvas.width/i,this.displayCanvas.height/i)}n&&(n==null?void 0:n.width)>1&&(n==null?void 0:n.height)>1&&e.drawImage(n,0,0),this._blitPrev=this.snapshotBlitState()}drawAxisAndSeries(e){var d;(d=this.options.realTimeScatter)!=null&&d.use&&this.createPointsLayers();const n=this.evaluateBlitGate(e),i=typeof window<"u"&&window.__EVUI_BLIT_FORCE_OFF__===!0,s=typeof window<"u"?window.__EVUI_BLIT_REFRESH_INTERVAL__:void 0,l=Number.isFinite(s)?s:this._blitRefreshInterval||W1,a=n.ok&&!i&&this.pointsLayerValid&&this.pointsLayersSized()&&this._framesSinceFullRedraw<l,r={blockedByForceOff:i,blockedByLayerInvalid:!this.pointsLayerValid,blockedByLayerUnsized:!this.pointsLayersSized(),blockedByRefreshDue:this._framesSinceFullRedraw>=l};let c=!1;if(a&&(c=this.drawChartBlitFastPath(e,n)),this.recordBlitDiag(n,c,r),c)this._framesSinceFullRedraw++,this._pointsLayerStamp=this.computePointsLayerStamp(),this._pointsLayerOptionsRef=this.options,this._hitCoordsDirty=!0;else{this.drawStaticLayer(this.bufferCtx,e);let h=!1,u=!1;!i&&this.canRouteFallbackViaLayer(e)?(h=this.maybeRebuildPointsLayer(r.blockedByRefreshDue),this.pointsLayerValid?this.compositePointsLayer(this.getMaxVisibleScatterPointSize()):(this.drawSeriesLayer(this.bufferCtx,e),u=!0)):(this.drawSeriesLayer(this.bufferCtx,e),h=this.maybeRebuildPointsLayer(!1),u=!(e!=null&&e.legend)),(h||u)&&(this._hitCoordsDirty=!1),h&&(this._framesSinceFullRedraw=0)}}collectDuplicatePoints(e,n){var s,l,a;const i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!!(c!=null&&c.show))if((s=this.options.realTimeScatter)!=null&&s.use){const h=(l=c.data[c.sId])==null?void 0:l.dataGroup;for(let u=0;u<h.length;u++){const f=((a=h[u])==null?void 0:a.data)||[];for(let m=0;m<f.length;m++){const g=f[m];e.set(g.k??O.coordinateKey(g.x,g.y),c.sId)}}}else{const h=this.data.data[n[r]]??[];for(let u=0;u<h.length;u++){const f=h[u];e.set(O.coordinateKey(f.x,f.y),c.sId)}}}}canSkipRealtimeScatterDedupe(e){var i,s;if(!((i=this.options.realTimeScatter)!=null&&i.use))return!1;let n=0;for(let l=0;l<e.length;l++)if((s=this.seriesList[e[l]])!=null&&s.show&&(n++,n>1))return!1;return n===1}computeScaleVersion(){var r,c;const e=this.chartRect??{},n=this.labelOffset??{},i=this.options??{},s=((r=this.axesSteps)==null?void 0:r.x)??[],l=((c=this.axesSteps)==null?void 0:c.y)??[];let a=`${e.x1},${e.x2},${e.y1},${e.y2},${e.chartWidth},${e.chartHeight}|${n.left},${n.right},${n.top},${n.bottom}|${this.pixelRatio}|${i.horizontal?1:0}|${i.thickness},${i.cPadRatio},${i.borderRadius}|`;for(let d=0;d<s.length;d++){const h=s[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a+="|";for(let d=0;d<l.length;d++){const h=l[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a!==this._scaleKey&&(this._scaleKey=a,this._scaleVersion=(this._scaleVersion??0)+1)}computeSeriesGeometry(){const e={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let n=0;this.seriesInfo.charts.bar.forEach(r=>{var c;(c=this.seriesList[r])!=null&&c.show&&n++}),["line","heatMap"].forEach(r=>{this.seriesInfo.charts[r].forEach(c=>{var d,h;(h=(d=this.seriesList[c])==null?void 0:d.computeGeometry)==null||h.call(d,e)})});const{thickness:i,cPadRatio:s,borderRadius:l}=this.options;let a=0;this.seriesInfo.charts.bar.forEach(r=>{var d;const c=this.seriesList[r];c&&((d=c.computeGeometry)==null||d.call(c,{...e,thickness:i,cPadRatio:s,borderRadius:l,showSeriesCount:n,showIndex:a}),c.show&&a++)})}drawSeriesLayer(e,n){var p;const{maxTip:i,selectLabel:s,selectItem:l,selectSeries:a,brush:r,displayOverflow:c,unSelectedOpacity:d}=this.options,h={ctx:e,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:i.background,color:i.color},selectLabel:{option:s,selected:this.defaultSelectInfo},selectSeries:{option:a,selected:this.defaultSelectInfo},selectItem:{option:l,selected:this.defaultSelectItemInfo},isBrush:!!r,displayOverflow:c,unSelectedOpacity:d,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion,rtXOffsetCss:this._blitCarry};let u=0,f=0;this.seriesInfo.charts.bar.forEach(y=>{this.seriesList[y].show&&f++});const m=new Map,g=Object.keys(this.seriesInfo.charts);for(let y=0;y<g.length;y++){const C=g[y],b=this.seriesInfo.charts[C];let k=!1;C==="scatter"&&(k=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(b),k&&this.collectDuplicatePoints(m,b));for(let T=0;T<b.length;T++){let w=this.seriesList[b[T]];switch(C){case"line":{const M=n==null?void 0:n.legend;w.draw({legendHitInfo:M,...h});break}case"heatMap":{const M=n==null?void 0:n.legend;w.draw({legendHitInfo:M,...h});break}case"bar":{const M=n==null?void 0:n.legend,{thickness:V,cPadRatio:x,borderRadius:S}=this.options;w.draw({thickness:V,cPadRatio:x,borderRadius:S,showSeriesCount:f,showIndex:u,legendHitInfo:M,...h}),w.show&&u++;break}case"pie":{const M=this.lastHitInfo??{sId:(p=this.defaultSelectItemInfo)==null?void 0:p.seriesID},V=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},e):this.drawPie({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},e),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(e);break}case"scatter":{const M=n==null?void 0:n.legend;let V;if(l.use&&l.useSeriesOpacity){const x=this.lastHitInfo,S=this.defaultSelectItemInfo;x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?V={seriesID:x.sId,dataIndex:x.dataIndex}:S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?V={...S}:V=null}this.options.seriesReverse&&(w=this.seriesList[b.at(-1-T)]),w.draw({legendHitInfo:M,selectInfo:V,duple:m,coordinateDedupe:k,...h});break}}}}}drawSeriesOverlay(){var s,l;const e=this.overlayCtx;if(!e)return;const n={overlayCtx:e,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps},i=this.seriesInfo.charts.heatMap;for(let a=0;a<i.length;a++)(l=(s=this.seriesList[i[a]])==null?void 0:s.drawOverlay)==null||l.call(s,n)}ensureAnnotationCanvas(){if(this.annotationCtx)return!0;if(this.options.brush||!this.chartDOM||!this.displayCanvas)return!1;const e=this.options.type==="pie";return this.annotationCanvas=document.createElement("canvas"),this.annotationCanvas.setAttribute("style","display: block; z-index: 3;"),this.annotationCanvas.setAttribute("class","annotation-canvas"),this.annotationCtx=this.annotationCanvas.getContext("2d",{willReadFrequently:e}),this.chartDOM.appendChild(this.annotationCanvas),this.annotationCanvas.style.position="absolute",this.annotationCanvas.style.top="0px",this.annotationCanvas.style.left="0px",this.annotationCanvas.style.pointerEvents="none",this.annotationCanvas.width=this.displayCanvas.width,this.annotationCanvas.style.width=this.displayCanvas.style.width,this.annotationCanvas.height=this.displayCanvas.height,this.annotationCanvas.style.height=this.displayCanvas.style.height,this.annotationCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),!0}drawAnnotationLayer(){var l;const e=(l=this.options)==null?void 0:l.annotations;if(!(Array.isArray(e)&&e.length>0)){if(this._hadAnnotations&&this.annotationCtx){const a=this.pixelRatio<1?this.pixelRatio:1;this.annotationCtx.clearRect(0,0,this.annotationCanvas.width/a,this.annotationCanvas.height/a),this._hadAnnotations=!1}return}if(!this.ensureAnnotationCanvas())return;const i=this.annotationCtx,s=this.pixelRatio<1?this.pixelRatio:1;if(i.clearRect(0,0,this.annotationCanvas.width/s,this.annotationCanvas.height/s),this._hadAnnotations=!0,this._annotationSource!==e){const{annotations:a,warnings:r}=u1(e);this._normalizedAnnotations=a,this._annotationSource=e,r.forEach(c=>Hn.warn(c))}E1(i,this._normalizedAnnotations,this.buildAnnotationViewport())}buildAnnotationViewport(){var a,r,c,d,h;const e=(a=this.data)==null?void 0:a.labels,n=e&&!Array.isArray(e)&&typeof e=="object",i=n?e.x:e,s=n?e.y:e,l=(u,f,m)=>(u??[]).map((g,p)=>{var y;return{...g,type:((y=f==null?void 0:f[p])==null?void 0:y.type)||"linear",labels:m}});return{chartRect:this.chartRect,labelOffset:this.labelOffset,axes:{x:l((r=this.axesSteps)==null?void 0:r.x,(c=this.options)==null?void 0:c.axesX,i),y:l((d=this.axesSteps)==null?void 0:d.y,(h=this.options)==null?void 0:h.axesY,s)},seriesList:this.seriesList}}drawTip(e){var i;let n;this.lastHitInfo?n=this.lastHitInfo:this.defaultSelectItemInfo?n=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?n=this.getItem(this.defaultSelectInfo,!1):n=null,(i=this.drawTips)==null||i.call(this,n,e)}createAxes(e,n=[]){const i=this.bufferCtx,l=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels,a=this.options;return n.map(r=>{switch(r.type){case"linear":return new gC(e,r,i,a);case"time":return r.categoryMode?new xC(e,r,i,l,a):new pC(e,r,i,a);case"log":return new bC(e,r,i);case"step":return new yC(e,r,i,l,a);default:return!1}})}getAxesRange(){const e=this.axesX.map((i,s)=>i.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((i,s)=>i.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:e,y:n}}drawStaticLayer(e,n){var i;this.axesX.forEach((s,l)=>{s.ctx=e,s.draw(this.chartRect,this.labelOffset,this.axesSteps.x[l],n,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((s,l)=>{s.ctx=e,s.draw(this.chartRect,this.labelOffset,this.axesSteps.y[l],n,this.defaultSelectInfo)}),((i=this.options.plot)==null?void 0:i.aboveSeries)===!1&&this.drawPlotsFront(e)}drawPlotsFront(e=this.bufferCtx){this.plotLabelHitRegions=[],[...this.axesX??[],...this.axesY??[]].forEach(n=>{var i,s;n.ctx=e,(i=n.drawPlots)==null||i.call(n),(s=n.plotLabelHitRegions)!=null&&s.length&&this.plotLabelHitRegions.push(...n.plotLabelHitRegions)})}drawForeground(e=this.bufferCtx){var n;((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(e),this.drawTip(e)}calculateSteps(){const e=this.axesX.map((i,s)=>{const l={minValue:this.axesRange.x[s].min,maxValue:this.axesRange.x[s].max,minIndex:this.axesRange.x[s].minIndex,maxIndex:this.axesRange.x[s].maxIndex,minSteps:this.labelRange.x[s].min,maxSteps:this.labelRange.x[s].max};return i.calculateSteps(l)}),n=this.axesY.map((i,s)=>{const l={minValue:this.axesRange.y[s].min,maxValue:this.axesRange.y[s].max,minIndex:this.axesRange.y[s].minIndex,maxIndex:this.axesRange.y[s].maxIndex,minSteps:this.labelRange.y[s].min,maxSteps:this.labelRange.y[s].max};return i.calculateSteps(l)});return{x:e,y:n}}getAxesLabelRange(){const e=this.axesX.map((i,s)=>{const l=this.axesRange.x[s].size;return i.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((i,s)=>{const l=this.axesRange.y[s].size;return i.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:e,y:n}}computePixelRatio(){const e=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;return e/n}prepareLayout(e){this.pixelRatio=e,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}initScale(){const e=this.computePixelRatio();this.prepareLayout(e),this.overlayCtx&&this.overlayCtx.setTransform(e,0,0,e,0,0),this.annotationCtx&&this.annotationCtx.setTransform(e,0,0,e,0,0)}getChartDOMRect(){var s;const e=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(e==null?void 0:e.width)||10,i=(e==null?void 0:e.height)||10;return this.setWidth(n),this.setHeight(i),{width:n,height:i}}getOverlayClientRect(){return!this.cachedOverlayRect&&this.overlayCanvas&&(this.cachedOverlayRect=this.overlayCanvas.getBoundingClientRect()),this.cachedOverlayRect}getChartDOMClientRect(){return!this.cachedChartDOMRect&&this.chartDOM&&(this.cachedChartDOMRect=this.chartDOM.getBoundingClientRect()),this.cachedChartDOMRect}invalidateClientRectCache(){this.cachedOverlayRect=null,this.cachedChartDOMRect=null}getChartRect(){var w,M,V,x;const{width:e,height:n}=this.getChartDOMRect(),i=this.options.padding,s=(M=(w=this.options.axesX)==null?void 0:w[0])==null?void 0:M.title,l=(x=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:x.title,a=10;let r=0;s!=null&&s.use&&(s!=null&&s.text)&&(r=(isNaN(s==null?void 0:s.fontSize)?12:s==null?void 0:s.fontSize)+a);let c=0;l!=null&&l.use&&(l!=null&&l.text)&&(c=(isNaN(l==null?void 0:l.fontSize)?12:l==null?void 0:l.fontSize)+a);const d=this.scrollbar.x,h=this.scrollbar.y;let u=0;d!=null&&d.use&&(u=d==null?void 0:d.height);let f=0;h!=null&&h.use&&(f=h==null?void 0:h.width);const m=i.left+i.right+f,g=i.top+i.bottom+r+c+u,p=e>m?e-m:e,y=n>g?n-g:n,C=i.left,b=Math.max(e-i.right-f,C+2),k=i.top+c,T=Math.max(n-i.bottom-r-u,k+2);return{x1:C,x2:b,y1:k,y2:T,chartWidth:p,chartHeight:y,width:e,height:n}}setWidth(e){var i;if(!this.displayCanvas)return;const n=e*this.pixelRatio;this._deviceWidth!==n&&(this._deviceWidth=n,this.displayCanvas.width=n,this.displayCanvas.style.width=`${e}px`,this.bufferCanvas.width=n,this.bufferCanvas.style.width=`${e}px`,this.overlayCanvas&&(this.overlayCanvas.width=n,this.overlayCanvas.style.width=`${e}px`),this.annotationCanvas&&(this.annotationCanvas.width=n,this.annotationCanvas.style.width=`${e}px`),(i=this.pointsLayers)!=null&&i.size&&this.resizePointsLayers(this.bufferCanvas.width,this.bufferCanvas.height)&&(this.pointsLayerValid=!1))}setHeight(e){var i;if(!this.displayCanvas)return;const n=e*this.pixelRatio;this._deviceHeight!==n&&(this._deviceHeight=n,this.displayCanvas.height=n,this.displayCanvas.style.height=`${e}px`,this.bufferCanvas.height=n,this.bufferCanvas.style.height=`${e}px`,this.overlayCanvas&&(this.overlayCanvas.height=n,this.overlayCanvas.style.height=`${e}px`),this.annotationCanvas&&(this.annotationCanvas.height=n,this.annotationCanvas.style.height=`${e}px`),(i=this.pointsLayers)!=null&&i.size&&this.resizePointsLayers(this.bufferCanvas.width,this.bufferCanvas.height)&&(this.pointsLayerValid=!1))}getLabelOffset(e=null){const n=this.axesX,i=this.axesY,s=e??this.axesRange,l={top:2,left:2,right:2,bottom:2},a={width:14,height:4};let r=0,c=0;return n.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.x[h].size.width+a.width,c=s.x[h].size.height+a.height,d.position==="bottom"?c>l.bottom&&(l.bottom=c):d.position==="top"&&c>l.top&&(l.top=c),l.left=r/2>l.left?r/2:l.left,l.right=r/2>l.right?r/2:l.right)}),i.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.y[h].size.width+a.width,d.position==="left"?r>l.left&&(l.left=r):d.position==="right"&&r>l.right&&(l.right=r),l.top=c/2>l.top?c/2:l.top,l.bottom=c/2>l.bottom?c/2:l.bottom)}),l}updateScrollbar(e,n){var c,d,h,u,f,m,g,p,y,C;const i=n||e,s=((h=(d=(c=this.options.axesX)==null?void 0:c[0])==null?void 0:d.scrollbar)==null?void 0:h.use)??!1,l=((m=(f=(u=this.options.axesY)==null?void 0:u[0])==null?void 0:f.scrollbar)==null?void 0:m.use)??!1,a=((p=(g=this.scrollbar)==null?void 0:g.x)==null?void 0:p.use)??!1,r=((C=(y=this.scrollbar)==null?void 0:y.y)==null?void 0:C.use)??!1;(s!==a||s||i&&s)&&this.updateScrollbarInfo("x",e),(l!==r||l||i&&l)&&this.updateScrollbarInfo("y",e)}update(e){var y,C,b,k,T,w,M;const n=this.options,i=this.data.data,s=this.data.labels,l=this.data.groups,a=this.data.series,{updateSeries:r,updateSelTip:c,updateLegend:d,updateData:h,updateTooltip:u,lightUpdate:f,updateByScrollbar:m}=e;if(!this.isInit)return;if((h||r)&&(this._lastHoverSig=""),this.updateScrollbar(h,m),this.resetProps(),this.updateSeries=r,r&&(this.pointsLayerValid=!1),(y=this.options.realTimeScatter)!=null&&y.use&&this.createPointsLayers(),r){const V=this.seriesList;this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.lastTip={pos:null,value:null},this.reconcileSeriesSet(a,n.type,n.horizontal,l,V),this.legendDOM&&!n.legend.external&&this.updateLegend()}if(c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!f)if(l.length&&this.addGroupInfo(l),(C=this.options.realTimeScatter)!=null&&C.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(i)):this.createDataSet(i,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const V=!!((k=(b=n.legend)==null?void 0:b.table)!=null&&k.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():V&&h&&this.updateLegendTableValues():this.initLegend(),this.setLegendPosition(),this.updateLegendContainerSize(),this.showLegend()}else n.legend.show&&n.legend.external?(r||h)&&(this._updateSeriesCount(),this.emitLegendData()):this.isInitLegend&&this.hideLegend();u&&(this.isInitTooltip||this.createTooltipDOM(),this.tooltipDOM.innerHTML="",(w=(T=n.tooltip)==null?void 0:T.formatter)!=null&&w.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let g=e==null?void 0:e.hitInfo;!(g!=null&&g.legend)&&((M=this.legendHover)!=null&&M.sId)&&(g={...g||{},legend:this.legendHover}),this.render(g),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(f?this.drawSelectionArea(this.dragInfoBackup):this.dragInfoBackup=null)}resetProps(){this.axesX[0]=null,this.axesY[0]=null,this.axesX=null,this.axesY=null,this.minMax=null,this.axesRange=null,this.labelOffset=null,this.chartRect=null}overlayClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}clear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.bufferCanvas&&this.bufferCtx.clearRect(0,0,this.bufferCanvas.width/this.clearRectRatio,this.bufferCanvas.height/this.clearRectRatio),this.overlayCanvas&&this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}resize(e){var n,i,s,l,a,r,c;this.invalidateClientRectCache(),this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.pointsLayerValid=!1,((s=(i=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:i.scrollbar)!=null&&s.use||(r=(a=(l=this.options.axesY)==null?void 0:l[0])==null?void 0:a.scrollbar)!=null&&r.use)&&this.initScrollbar(),this.initRect(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(void 0,!0),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),e&&e(!0)}render(e){this.isInit&&(this.invalidateClientRectCache(),this._vsDetectFailed=!1,this.clear(),this.chartRect=this.getChartRect(),this.drawChart(e))}_getLegendSeries(){var n;const e=(n=this.data.groups)==null?void 0:n.at(0);return e?e.filter(i=>{var s;return(s=this.seriesList[i])==null?void 0:s.showLegend}).map(i=>[i,this.seriesList[i]]):Object.entries(this.seriesList).filter(([,i])=>i.showLegend)}_seriesToLegendItem(e){const n=typeof e.color!="string"?e.color[e.color.length-1][1]:e.color;return{sId:e.sId,name:e.name,color:n,type:e.type,show:e.show,fill:e.fill,fillColor:e.fillColor}}buildLegendData(){return this._getLegendSeries().map(([,e])=>this._seriesToLegendItem(e))}emitLegendData(){typeof this.listeners["update:legendData"]=="function"&&this.listeners["update:legendData"](this.buildLegendData())}toggleSeries(e){var d;const n=this.seriesList[e];if(!n)return;const i=this.options.legend,s=this._getLegendSeries();if(i.clickMode==="active")s.every(([,f])=>f.show)?(s.forEach(([,f])=>{f.show=!1}),n.show=!0,this.seriesInfo.count=1):n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++),s.every(([,f])=>!f.show)&&(s.forEach(([,f])=>{f.show=!0}),this.seriesInfo.count=s.length);else{if(n.show&&this.seriesInfo.count===1)return;n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++)}if(this.brushSeries){const{chartIdx:h}=this.data,u=[...this.brushSeries.list];u[h]=this.seriesList,this.brushSeries.list=u,this.brushSeries.chartIdx=h}((d=this.options.eventBehavior)==null?void 0:d.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const a=Object.values(this.seriesList).filter(h=>h.show).map(h=>h.sId),r=a.length===Object.values(this.seriesList).length,c={data:{seriesIds:r?[]:a,isActiveAll:r}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](c),this.options.legend.show&&this.options.legend.external&&this.emitLegendData()}highlightSeries(e){const n={sId:e,type:this.options.type};this.legendHover=n,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:n},lightUpdate:!0})}unhighlightSeries(){this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})}destroy(){var n,i;if(!this.isInit)return;const e=this.target;for(this.options.legend.show&&!this.options.legend.external&&(this.legendBoxDOM&&(this.legendBoxDOM.removeEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.removeEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.removeEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.type==="gradient"&&this.legendBoxDOM.removeEventListener("mousedown",this.onLegendMouseDown),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.removeEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.removeEventListener("scroll",this.renderVisibleLegends))),this.resizeDOM&&this.resizeDOM.removeEventListener("mousedown",this.onResizeMouseDown)),this.overlayCanvas&&(this.overlayCanvas.removeEventListener("mousemove",this.onMouseMove),this.overlayCanvas.removeEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.removeEventListener("dblclick",this.onDblClick),this.overlayCanvas.removeEventListener("click",this.onClick),(n=this.dragStartTarget)==null||n.removeEventListener("mousedown",this.onMouseDown),this.overlayCanvas.removeEventListener("wheel",this.onWheel),window.removeEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll&&window.removeEventListener("scroll",this.invalidateRectOnScroll,{capture:!0}),this.dragDisplayCanvas&&((i=this.dragDisplayCanvas.parentNode)==null||i.removeChild(this.dragDisplayCanvas),this.dragDisplayCanvas=null,this.dragDisplayCtx=null,this.dragDisplayOffset=null),this.dragStartTarget&&this.dragStartAreaPrevPosition!==void 0&&(this.dragStartTarget.style.position=this.dragStartAreaPrevPosition,this.dragStartAreaPrevPosition=void 0)),this.isInitTooltip&&this.tooltipDestroy(),this.renderWorkerGate&&this.renderWorkerGate.destroy(),this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),this.wrapperDOM=null,this.chartDOM=null,this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.ghostDOM=null,this.titleDOM=null,this.displayCanvas=null,this.bufferCanvas=null,this.overlayCanvas=null,this.annotationCanvas=null,this.annotationCtx=null,this._normalizedAnnotations=null,this._annotationSource=null,this._hadAnnotations=!1;e.hasChildNodes();)e.removeChild(e.firstChild)}hideTooltip(){var e;this.options.tooltip.use&&((e=this.tooltipDOM)!=null&&e.style)&&(this.tooltipDOM.style.display="none")}initDefaultSelectInfo(){var s,l;const{type:e,selectLabel:n,selectSeries:i}=this.options;if(n.use){let a=null;e==="heatMap"&&(n!=null&&n.useBothAxis)&&(a=(s=this.defaultSelectInfo)==null?void 0:s.targetAxis),this.defaultSelectInfo=(l=this.defaultSelectInfo)!=null&&l.dataIndex?this.getSelectedLabelInfoWithLabelData(this.defaultSelectInfo.dataIndex,a):{dataIndex:[],label:[],data:[]}}i.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};Object.assign(gs.prototype,BC),Object.assign(gs.prototype,DC);const G1={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},Z1={class:"ev-chart-toolbar"},X1={class:"ev-chart-toolbar__icon"};function N1(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",Z1,[o.createElementVNode("div",X1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.$props.toolbar.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${c}-${r.icon}`,class:o.normalizeClass(c),icon:r.icon,size:r.size,title:r.title,onClick:d=>t.$emit("onClickToolbar",d,c)},null,8,["class","icon","size","title","onClick"]))),128))])])}const lc=ce(G1,[["render",N1],["__scopeId","data-v-dfbffbab"]]);class P1{constructor(e,n,i,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=e.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=i.zoom;this.setEvChartZoomOptions(c),this.setIcon(s);const d=n.data[0].labels.length-1;this.cloneLabelsLastIdx=d,this.isAnimationFinish=!0,this.zoomAreaMemory={previous:[],current:[[0,d]],latest:[]},r&&(this.emitFunc=r,r.updateZoomStartIdx(0),r.updateZoomEndIdx(d)),c.useWheelMove&&(this.wrapWheelMoveZoomArea=this.wheelMoveZoomArea.bind(this)),this.evChartDomContainers=c.useAnimation?this.drawAnimationCanvas(e.dom):e.dom}setEvChartZoomOptions(e){this.evChartZoomOptions=e}setIcon(e){if(!e)return;const n=e.querySelector(".dragZoom");this.resetIcon=e.querySelector(".reset"),this.previousIcon=e.querySelector(".previous"),this.latestIcon=e.querySelector(".latest"),this.dragZoomIcon=n,this.iconStyle(n,"enable")}drawAnimationCanvas(e){return e.forEach(n=>{const i=document.createElement("canvas");i.setAttribute("style","display: block;"),i.setAttribute("class","animation-canvas"),i.style.position="absolute",n.appendChild(i)}),e}setEventListener(e){const n=e?"addEventListener":"removeEventListener";this.isUseZoomMode=e,this.evChartDomContainers.forEach(i=>{i[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(e){e.preventDefault();const[n,i]=this.zoomAreaMemory.current[0];if(n===i)return;let s,l;if(e.deltaY>0){if(!n)return;s=n-1,l=i-1}else{if(i===this.cloneLabelsLastIdx)return;s=n+1,l=i+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(e){if(!this.zoomAreaMemory[e].length)return;const[n,i]=this.zoomAreaMemory[e].pop();this.isUseToolbar=!0,this.executeZoom(n,i),this.setZoomAreaMemory(n,i,e==="previous"?"latest":"previous")}dragZoom({data:e,range:{dragSelectionInfo:n}}){const{dragXsp:i,dragXep:s,exceptAxesYChartWidth:l,chartTitle:a}=n,{options:r,data:c}=this.evChartProps,d=r.length>1?r.findIndex(h=>{var u;return(((u=h==null?void 0:h.title)==null?void 0:u.text)??"")===a}):0;if(r[d].axesX[0].type==="time"){const h=e[0].items,u=h[0].x,f=h[h.length-1].x,m=c[d].labels,g=this.evChartCloneData[d].labels,[p,y]=this.zoomAreaMemory.current[0];let C=g.findIndex(M=>+M.$d==+u.$d),b=g.findLastIndex(M=>+M.$d==+f.$d);const k=M=>l/(m.length-1)*(M-p);let T=k(C);if(C===b&&(T-i>=s-T?C-=1:b+=1),C===p&&b===y)return;C-b===-1&&(T=k(C));const w=k(b);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,C,b,T,w):(this.executeZoom(C,b),this.setZoomAreaMemory(C,b))}}dragZoomAnimation(e,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=e,d=window.devicePixelRatio||1,h=Array.from(this.evChartDomContainers).map(u=>{const f=u.querySelector(".animation-canvas");return[u.children[0],f]});for(let u=0;u<h.length;u++){const[f,m]=h[u],g=m.getContext("2d");m.style.top=`${a.y1}px`,m.style.left=`${a.x1}px`,m.width=r*d,m.style.width=`${r}px`,m.height=c*d,m.style.height=`${c}px`,m.style.display==="none"&&(m.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(f,g,e,s,l).then(p=>{m.style.display="none",p&&u===h.length-1&&(this.isAnimationFinish=p,this.executeZoom(n,i),this.setZoomAreaMemory(n,i))})}}executeZoom(e,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let i=0;i<this.evChartCloneData.length;i++){const{data:s,labels:l,series:a}=this.evChartCloneData[i],r=this.evChartProps.data[i],c=Object.keys(a);for(let d=0;d<c.length;d++){const h=c[d];r.data[h]=s[h].filter((u,f)=>e<=f&&n>=f)}r.labels=l.filter((d,h)=>e<=h&&n>=h)}!this.brushIdx.isUseButton&&!this.brushIdx.isUseScroll&&(this.brushIdx.start=e,this.brushIdx.end=n),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(e),this.emitFunc.updateZoomEndIdx(n))}setBrushIdx(e,n){this.brushIdx.end=-1;for(let i=0;i<n.value.length;i++){const s=e.data[n.value[i]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(e,n,i,s){const l=e.data[0].labels.length-1;if(this.cloneLabelsLastIdx=l,this.evChartCloneData=e.data,s){const a=this.zoomAreaMemory.current[0];let r=a[0],c=a[1];r===0&&c===-1&&(r=0,c=l,this.zoomAreaMemory={previous:[],current:[[r,c]],latest:[]}),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(r),this.emitFunc.updateZoomEndIdx(c)),this.executeZoom(r,c)}else this.dragZoomIcon&&this.dragZoomIcon.classList.remove("active"),this.zoomAreaMemory={previous:[],current:[[0,l]],latest:[]},this.emitFunc&&(this.emitFunc.updateZoomStartIdx(0),this.emitFunc.updateZoomEndIdx(l)),this.setIconStyle(i),this.setBrushIdx(e,n)}setZoomAreaMemory(e,n,i){if(e<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;i?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[i].push(r)):(e!==r[0]||n!==r[1])&&(r[0]===0&&r[1]===-1?s.push([0,this.cloneLabelsLastIdx]):s.push(r),a.length=0),l.push([e,n]),this.setIconStyle(this.isUseZoomMode)}executeDragZoomAnimation(e,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=i;let d=0,h=s,u=l-s,f=l,m=1;const g=.0015;let p=.5;const y=.1,C=.05,b=50,k=Math.ceil(b*(s/r)),T=Math.ceil(b*((r-l)/r)),w=M=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(e.style.opacity="initial",M(!0)):(p>=y&&(e.style.opacity=p,p-=C),n.globalAlpha=m,n.drawImage(e,a.x1,a.y1,s,c,d,0,s,c),n.drawImage(e,a.x1+s,a.y1,l-s,c,h,0,u,c),n.drawImage(e,a.x1+l,a.y1,r,c,f,0,r,c),m-=g,d-=k,h-=k,u+=k+T,f+=T,requestAnimationFrame(()=>w(M))));return new Promise(M=>w(M))}setIconStyle(e){const n=(i,s)=>{s?this.iconStyle(i,"enable"):this.iconStyle(i,"disable")};if(e&&this.dragZoomIcon.classList.contains("active")){const{previous:i,latest:s}=this.zoomAreaMemory;n(this.previousIcon,i.length),n(this.latestIcon,s.length),this.iconStyle(this.resetIcon,"enable")}else n(this.resetIcon),n(this.previousIcon),n(this.latestIcon)}iconStyle(e,n){if(!e)return;const[i,s]=n==="enable"?[1,"initial"]:[.5,"none"];e.style.opacity=i,e.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[e,n]=this.zoomAreaMemory.current[0],i=this.cloneLabelsLastIdx;(e!==0||n!==i)&&(this.isUseToolbar=!0,this.executeZoom(0,i),this.setZoomAreaMemory(0,i))}}const B1={padding:{top:20,right:2,left:2,bottom:4},border:2,title:{show:!1,height:40,text:"",style:{fontSize:15,color:"#000",fontFamily:"Roboto"}},legend:{show:!0,type:"icon",position:"right",color:"#353740",inactive:"#aaa",width:140,height:24,allowResize:!1,virtualScroll:!1,clickMode:"active",external:!1,table:{use:!1,columns:{name:{title:"Name"},min:{title:"MIN",use:!1},max:{title:"MAX",use:!1},avg:{title:"AVG",use:!1},total:{title:"TOTAL",use:!1},last:{title:"LAST",use:!1}}}},itemHighlight:!0,seriesHighlight:!0,unSelectedOpacity:.3,useSelect:!1,doughnutHoleSize:0,pieStroke:{use:!0,lineWidth:2,color:"#FFFFFF"},reverse:!1,horizontal:!1,displayOverflow:!1,overlapping:{use:!1},width:"100%",height:"100%",thickness:1,cPadRatio:0,borderRadius:0,combo:!1,tooltip:{use:!0,sortByValue:!0,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:"#666666",shadowOpacity:.25,useShadow:!1,throttledMove:!0,debouncedHide:!1,useScrollbar:!1,textOverflow:"wrap",fontFamily:"Roboto",colorShape:"rect",fontSize:{title:16,contents:14},rowPadding:{top:0,bottom:3,right:20,left:16},showHeader:!0,virtualScroll:{use:"auto",threshold:50,estimatedRowHeight:28,overscan:5}},indicator:{use:!0,color:"#EE7F44",segments:null},plot:{aboveSeries:!0},maxTip:{use:!1,fixedPosTop:!1,showIndicator:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400}},selectItem:{use:!1,useClick:!0,showTextTip:!1,tipText:"value",showTip:!1,showIndicator:!1,fixedPosTop:!1,useApproximateValue:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},useSeriesOpacity:!1,useDeselectItem:!1,showBorder:!1,borderStyle:{color:"#FFFFFF",lineWidth:1,opacity:1,radius:0}},selectLabel:{use:!1,useClick:!0,tipText:"value",limit:1,useDeselectOverflow:!1,showTip:!1,useSeriesOpacity:!0,useLabelOpacity:!0,fixedPosTop:!1,useApproximateValue:!1,tipBackground:"#000000",indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},showTextTip:!1,showIndicator:!1,useBothAxis:!1},selectSeries:{use:!1,useClick:!0,limit:1,useDeselectOverflow:!1},dragSelection:{use:!1,keepDisplay:!0,size:50,fillColor:"#38ACEC",opacity:.65,startArea:"",displayFromStartArea:!1},zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}},heatMapColor:{min:"#FFFFFF",max:"#0052FF",rangeCount:1,colorsByRange:[],stroke:{show:!1,color:"#FFFFFF",lineWidth:1,opacity:1,radius:0},error:"#FF0000",decimalPoint:0},seriesReverse:!1,coordinateDedupe:!0,eventBehavior:{legendClick:"update"},workerRender:!1,shallowDataWatch:!1,shallowOptionsWatch:!1},D1={series:{},groups:[],labels:[],data:{}},Y1=t=>tb({...t},D1),O1=t=>t instanceof Date||t!==null&&typeof t=="object"&&typeof t.toDate=="function"&&typeof t.format=="function",Qo=t=>ar(t,function e(n){if(O1(n))return n;if(o.isReactive(n))return ar(o.toRaw(n),e)}),H1=()=>{let t=null;const e=200;return{clickEventCallback:s=>{t&&(clearTimeout(t),t=null),t=setTimeout(()=>{s(),t=null},e)},dblClickEventCallback:s=>{t&&(clearTimeout(t),t=null),s()}}},ac=(t,e)=>{var m;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const p=Xe({},g,B1);return(g.type==="scatter"||g.type==="heatMap")&&!(g!=null&&g.tooltip)&&(p.tooltip.use=!1),g.type==="pie"&&!(g!=null&&g.padding)&&(p.padding={top:2,right:2,left:2,bottom:4}),p},a=Y1,r=Re(i.selectedItem),c=Re(i.selectedLabel??(t==null?void 0:t.value)),d=Re(i.selectedSeries),{clickEventCallback:h,dblClickEventCallback:u}=H1(),f={click:async g=>{await o.nextTick(),h(()=>{const{seriesId:p,dataIndex:y,eventTarget:C,targetAxis:b}=(g==null?void 0:g.selected)??{},{eventTarget:k}=(g==null?void 0:g.deselected)??{};switch(C){case"item":{p!==null?(s("update:selectedItem",{seriesID:p,dataIndex:y}),k==="label"&&s("update:selectedLabel",{dataIndex:[]})):s("update:selectedItem",null);break}case"label":{t!=null&&t.value?t.value.dataIndex=y:(s("update:selectedLabel",{dataIndex:y,targetAxis:b}),k==="item"&&s("update:selectedItem",null));break}case"series":{s("update:selectedSeries",{seriesId:p});break}}s("click",g)})},"dbl-click":async g=>{await o.nextTick(),u(()=>{const{eventTarget:p}=g;switch(p){case"series":{s("update:selectedSeries",{seriesId:g.seriesId?[g.seriesId]:[]});break}}s("dbl-click",g)})},"drag-select":async g=>{await o.nextTick(),s("drag-select",g)},"mouse-move":async g=>{e!=null&&e.value&&(e.value=g.hoveredLabel),await o.nextTick(),s("mouse-move",g)},"mouse-leave":()=>{e!=null&&e.value&&(e.value.label=null)},"click-legend":async g=>{await o.nextTick(),s("click-legend",g)},"update:legendData":async g=>{await o.nextTick(),s("update:legendData",g)},"axes-scale-change":g=>{s("axes-scale-change",g)}};return(m=n.vnode.props)!=null&&m.onAxesDataMaxChange&&(f["axes-data-max-change"]=g=>{s("axes-data-max-change",g)}),{eventListeners:f,selectItemInfo:r,selectLabelInfo:c,selectSeriesInfo:d,getNormalizedData:a,getNormalizedOptions:l}},rc=t=>{const e=o.ref(),n=o.computed(()=>{const i=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:i(da(t.width)),height:i(da(t.height))}});return{wrapper:e,wrapperStyle:n}},cc=(t,{wrapper:e,evChartGroupRef:n},i,s)=>{const{props:l,emit:a}=o.getCurrentInstance(),r=o.ref(!1),c=o.ref(!1),d=o.ref(!0),h=o.ref(),u=o.reactive({zoom:t.zoom}),f=o.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let m=null;const g=o.reactive({dom:[],props:{data:[],options:[]}}),p=o.reactive({data:null,options:null}),y=o.ref([]),C=S=>{S.data.length&&S.range&&c.value&&m.dragZoom(S)},b=()=>{g.props.options.forEach((S,L)=>{if(S.zoom={...S.zoom,use:c.value,getRangeInfo:C},c.value)S.dragSelection={...S.dragSelection,use:!0,keepDisplay:!1};else{const{use:I,keepDisplay:v}=p.options[L].dragSelection??{};S.dragSelection={use:!!I,keepDisplay:!!v}}})},k=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:S,options:L},I)=>{S.chartIdx=I,g.props.data.push(S),g.props.options.push(L),y.value.push(I)})):(g.dom=[e.value.querySelector(".ev-chart-container")],g.props.data.push(l.data),g.props.options.push(l.options)),g.props.data.length){p.data=Re(g.props.data),p.options=Re(g.props.options);const S={updateZoomStartIdx:L=>a("update:zoomStartIdx",L),updateZoomEndIdx:L=>a("update:zoomEndIdx",L)};m=new P1(g,p,u,h.value,r,f,S)}},T=S=>{p.data[0].labels.length<=1||(c.value=!c.value,S?S.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),b(),m.setIconStyle(c.value),m.setEventListener(c.value))},w=(S,L)=>{if(m.isAnimationFinish)switch(L){case"dragZoom":T(S.target);break;case"reset":m.initZoom();break;case"previous":case"latest":m.clickMoveZoomArea(L);break}};o.onUpdated(()=>{m&&h.value&&m.setIcon(h.value)});const M=S=>{!Fe(S.zoom,u.zoom)&&(u.zoom=S.zoom,m?(!u.zoom.toolbar.show&&c.value&&T(),m.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&k())},V=S=>{d.value?(r.value||(p.data=n?Qo(S):[Qo(S)],u.zoom.keepZoomStatus?d.value=!1:(c.value=!1,b()),m&&m.updateEvChartCloneData(p,y,c.value,u.zoom.keepZoomStatus)),r.value=!1):d.value=!0},x=(S,L)=>{if(m.isUseToolbar){m.isUseToolbar=!1;return}c.value&&(m.executeZoom(S,L),m.setZoomAreaMemory(S,L))};return o.watch(()=>[f.start,f.end],([S,L],[I])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")S>=(I??0)?i.value.dataIndex-=S-(I??0):i.value.dataIndex+=I-S;else for(let v=0;v<i.value.dataIndex.length;v++)S>=(I??0)?i.value.dataIndex[v]-=S-(I??0):i.value.dataIndex[v]+=I-S;(f.isUseButton||f.isUseScroll)&&m.executeZoom(S,L)}),o.watch(()=>[f.isUseButton,f.isUseScroll],([S,L],[I,v])=>{I&&!S?m.setZoomAreaMemory(f.start,f.end):v&&!L&&(m.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:p,brushIdx:f,createEvChartZoom:k,setOptionsForUseZoom:M,setDataForUseZoom:V,controlZoomIdx:x,onClickToolbar:w}},F1={name:"EvChart",components:{EvChartToolbar:lc},directives:{resize:Wn},props:{selectedItem:{type:Object,default:null},selectedLabel:{type:Object,default:null},selectedSeries:{type:Object,default:null},options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},resizeTimeout:{type:Number,default:0},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},realTimeScatterReset:{type:Boolean,default:!1},legendData:{type:Array,default:()=>[]}},emits:["click","dbl-click","drag-select","mouse-move","update:selectedItem","update:selectedLabel","update:selectedSeries","update:zoomStartIdx","update:zoomEndIdx","update:realTimeScatterReset","click-legend","update:legendData","axes-scale-change","axes-data-max-change"],setup(t,{emit:e}){let n=null;const i=o.ref(!1),s=o.inject("isChartGroup",!1),l=o.inject("brushSeries",{list:[],chartIdx:null}),a=o.inject("groupSelectedLabel",null),r=o.inject("groupHoveredLabel",null),c=o.inject("brushIdx",{start:0,end:-1}),d=o.inject("evChartPropsInGroup",[]),h=o.inject("groupInteraction",null),{eventListeners:u,selectItemInfo:f,selectLabelInfo:m,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:y}=ac(a,r),C=p(t.data),b=y(t.options),k=o.computed(()=>t.selectedLabel),T=o.computed(()=>t.selectedItem),{wrapper:w,wrapperStyle:M}=rc(b),{evChartZoomOptions:V,evChartToolbarRef:x,createEvChartZoom:S,setOptionsForUseZoom:L,setDataForUseZoom:I,controlZoomIdx:v,onClickToolbar:W}=s?{}:cc(b,{wrapper:w,evChartGroupRef:null},t.selectedLabel?k:T,d),E=()=>typeof performance<"u"?performance.now():Date.now();let G=null,R=null;const X=D=>{var te;G?(D.updateSeries&&(G.updateSeries=!0),D.updateData&&(G.updateData=!0),D.updateLegend&&(G.updateLegend=!0),D.updateTooltip&&(G.updateTooltip=!0),(te=D.updateSelTip)!=null&&te.update&&(G.updateSelTip??(G.updateSelTip={}),G.updateSelTip.update=!0)):G={...D};const z=()=>{const ne=((h==null?void 0:h.deferUntil)??0)-E();if(ne>0){R=setTimeout(z,ne);return}G&&n&&n.update(G),G=null,R=null};clearTimeout(R);const _=E(),ee=(h==null?void 0:h.deferUntil)??0,J=ee>_?ee-_:0;R=setTimeout(z,J)},Z=()=>{var _;let D;b.selectLabel.use?D=m:b.selectSeries.use&&(D=g);const z=(_=t.options.realTimeScatter)!=null&&_.use?{...t.data,groups:[],labels:[]}:C;n=new gs(w.value,z,b,u,f,D,l)},N=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&S(),b.legend.show&&b.legend.external&&n.emitLegendData())};o.watch(()=>t.options,D=>{var te,U;const z=y(D),_=((U=(te=n.options)==null?void 0:te.legend)==null?void 0:U.show)??!1,ee=!Fe(z.legend.table,n.options.legend.table),J=z.tooltip.use&&!Fe(z.tooltip,n.options.tooltip);n.options=z,X({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:ee,updateTooltip:J}),z.legend.show&&z.legend.external&&!_&&n.emitLegendData(),s||L(z)},{deep:!b.shallowOptionsWatch,flush:"post"}),o.watch(()=>t.data,D=>{var Q,$;const z=(Q=t.options.realTimeScatter)!=null&&Q.use?{...D,groups:[],labels:[]}:p(D),_=!Fe(z.series,n.data.series),ee=!Fe(z.groups,n.data.groups),J=n.prunedRealTimeScatterSeries,te=!!(J!=null&&J.size)&&Object.keys(z.data??{}).some(j=>{var he;return J.has(j)&&((he=z.data[j])==null?void 0:he.length)}),U=_||ee||te||t.options.type==="heatMap",ne=_||ee||!Fe(z.labels,n.data.labels)||!Fe(z.data,n.data.data);n.data=($=t.options.realTimeScatter)!=null&&$.use?z:Qo(z),X({updateSeries:U,updateSelTip:{update:!0,keepDomain:!1},updateData:ne}),!s&&ne&&I(z)},{deep:!b.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(D,z)=>{if(k!=null&&k.value)for(let _=0;_<k.value.dataIndex.length;_++)D>=(z??0)?k.value.dataIndex[_]-=D-(z??0):k.value.dataIndex[_]+=z-D;else T!=null&&T.value&&(D>=(z??0)?T.value.dataIndex-=D-(z??0):T.value.dataIndex+=z-D)}),o.watch(()=>T.value,D=>{const z=t.options.type;n.selectItemByData(D,z)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??k.value,D=>{D!=null&&D.dataIndex&&n.selectLabelByData(D.dataIndex,D==null?void 0:D.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>t.selectedSeries,D=>{var z;(z=b.selectSeries)!=null&&z.use?D.seriesId&&n.selectSeriesByData(D.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||o.watch(()=>[t.zoomStartIdx,t.zoomEndIdx],([D,z])=>{v(D,z)}),o.watch(()=>t.realTimeScatterReset,D=>{var z;D&&(Object.keys(n.dataSet??{}).forEach(_=>{n.dataSet[_]&&(n.dataSet[_].dataGroup=[])}),(z=n.prunedRealTimeScatterSeries)==null||z.clear(),e("update:realTimeScatterReset",!1))}),o.watch(()=>{var D;return(D=t.options.realTimeScatter)==null?void 0:D.use},D=>{n.options.realTimeScatter.use=D??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,D=>{D&&t.options.syncHover!==!1&&(D.label==null?n.overlayClear():n.drawSyncedIndicator(D))},{deep:!0,flush:"post"}),o.onMounted(async()=>{d!=null&&d.value&&d.value.push(t),await Z(),await N(),i.value=!0}),o.onBeforeUnmount(()=>{var D;clearTimeout(R),G=null,R=null,n&&"destroy"in n&&n.destroy(),(D=d==null?void 0:d.value)!=null&&D.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const P=D=>{n==null||n.toggleSeries(D)},B=D=>{n==null||n.highlightSeries(D)},Y=()=>{n==null||n.unhighlightSeries()},H=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},K=ns(()=>{n&&"resize"in n&&n.resize()},t.resizeTimeout);return o.onActivated(()=>{i.value&&K()}),{wrapper:w,wrapperStyle:M,onResize:K,redraw:H,toggleSeries:P,highlightSeries:B,unhighlightSeries:Y,evChartToolbarRef:x,injectIsChartGroup:s,onClickToolbar:W,normalizedOptions:b,zoomOptions:o.toRef(V??{zoom:{}},"zoom")}}},z1={key:0,ref:"evChartToolbarRef"};function A1(t,e,n,i,s,l){var c;const a=o.resolveComponent("ev-chart-toolbar"),r=o.resolveDirective("resize");return o.openBlock(),o.createElementBlock(o.Fragment,null,[(c=i.zoomOptions.toolbar)!=null&&c.show&&!i.injectIsChartGroup?(o.openBlock(),o.createElementBlock("div",z1,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{ref:"wrapper",style:o.normalizeStyle(i.wrapperStyle),class:"ev-chart"},null,4),[[r,i.onResize]])],64)}const xi=ce(F1,[["render",A1]]);xi.install=t=>{t.component(xi.name,xi)};const K1={zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}}},_1=()=>{const t=o.ref(!1),e=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:a=>Xe({},a,K1),isExecuteZoom:t,brushSeries:i,evChartGroupRef:e,evChartPropsInGroup:n,groupInteraction:{deferUntil:0}}},U1={name:"EvChartGroup",components:{evChartToolbar:lc},props:{options:{type:Object,default:()=>({})},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},groupSelectedLabel:{type:Object,default:null}},emits:["update:groupSelectedLabel","update:zoomStartIdx","update:zoomEndIdx","update:groupHoveredLabel"],setup(t,{emit:e}){const{getNormalizedOptions:n,isExecuteZoom:i,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a,groupInteraction:r}=_1(),c=n(t.options);o.provide("isExecuteZoom",i),o.provide("isChartGroup",!0),o.provide("brushSeries",s),o.provide("evChartPropsInGroup",a),o.provide("groupInteraction",r);const d=2e3,h=800,u=()=>typeof performance<"u"?performance.now():Date.now(),f=(S=h)=>{const L=Number.isFinite(S)?Math.min(Math.max(S,0),d):h,I=u();r.deferUntil=Math.min(Math.max(r.deferUntil,I+L),I+d)};o.provide("deferPollingRedraw",f);const m=o.computed({get:()=>t.groupSelectedLabel,set:S=>e("update:groupSelectedLabel",S)});o.provide("groupSelectedLabel",m);const g=o.ref(null);o.provide("groupHoveredLabel",g),o.watch(()=>t.options.syncHover,S=>{S?g.value={label:"",horizontal:!1}:g.value=null},{immediate:!0});const{evChartZoomOptions:p,evChartInfo:y,evChartToolbarRef:C,evChartClone:b,brushIdx:k,createEvChartZoom:T,setOptionsForUseZoom:w,setDataForUseZoom:M,controlZoomIdx:V,onClickToolbar:x}=cc(c,{wrapper:null,evChartGroupRef:l},m,a);return o.provide("evChartClone",b),o.provide("evChartInfo",y),o.provide("brushIdx",k),o.onMounted(()=>{T()}),o.watch(()=>y.props.data,S=>{M(S)},{deep:!0}),o.watch(()=>t.options,S=>{const L=n(S);w(L)},{deep:!0}),o.watch(()=>[t.zoomStartIdx,t.zoomEndIdx],([S,L])=>{k.isUseButton||k.isUseScroll||V(S,L)}),{evChartGroupRef:l,evChartToolbarRef:C,zoomOptions:o.toRef(p,"zoom"),onClickToolbar:x,deferPollingRedraw:f}}},J1={key:0,ref:"evChartToolbarRef"},j1={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function Q1(t,e,n,i,s,l){const a=o.resolveComponent("ev-chart-toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[i.zoomOptions.toolbar.show?(o.openBlock(),o.createElementBlock("div",J1,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.createElementVNode("div",j1,[o.renderSlot(t.$slots,"default",{},void 0,!0)],512)],64)}const Si=ce(U1,[["render",Q1],["__scopeId","data-v-dda98b9e"]]);Si.install=t=>{t.component(Si.name,Si)};const Me={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},De={LEFT:"leftX",RIGHT:"rightX"};let $1=class{constructor(e,n,i,s,l){this.evChart=e,this.evChartBrushOptions=i,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,i.value.useDebounce&&(this.debounceBrushIdx={start:s.start,end:s.end})}init(e){var n;if(this.brushIdx.start>this.brushIdx.end){this.removeBrushCanvas();return}if((n=this.evChartBrushRef)!=null&&n.value){const i=this.evChartBrushRef.value.querySelector(".brush-canvas");if(i)this.drawBrushRect({brushCanvas:i,isResize:e});else{const s=document.createElement("canvas");s.setAttribute("class","brush-canvas"),s.setAttribute("style","display: block; z-index: 1;");const l=this.evChartBrushRef.value.querySelector(".ev-chart-brush-container");l&&(this.brushCanvas=s,l.appendChild(s),this.evChartBrushContainer=l,this.drawBrushRect({brushCanvas:s}),this.addEvent(s))}}}drawBrushRect({brushCanvas:e,isResize:n,isDebounce:i,mode:s,offsetX:l}){const{chartRect:a,labelOffset:r}=this.evChart;if(!a&&!r)return;const c=this.evChartData.value.labels.length-1;this.labelEndIdx=c;const d={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},h=this.setCanvasWidthHeight(d,e);if(!(n&&this.isEqualWidth)&&c>=0){const u=this.setBrushXAndWidth(h,l,i,s);h&&u&&this.drawBrush(h,u,d,e)}}setCanvasWidthHeight(e,n){const s=e.x2-e.x1+6,l=e.y2-e.y1,a=(e.x2-e.x1)/this.labelEndIdx,r=window.devicePixelRatio||1;return this.isEqualWidth=n.width===Math.floor(s*r),{brushButtonWidth:6,brushCanvasHeight:l,brushCanvasWidth:s,axesXInterval:a,pixelRatio:r}}setBrushXAndWidth(e,n=0,i,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=e;!i&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case Me.BUTTON.INCREASE:case Me.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===De.LEFT?(this.brushRectWidth=this.beforeBrushRectWidth?this.beforeBrushRectWidth-n:this.brushRectWidth-n,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=n*c,this.beforeBrushRectX=this.brushRectX)):this.curBrushButtonType===De.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case Me.GRAB.UP:case Me.GRAB.DOWN:this.brushRectX<=0&&s===Me.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===Me.GRAB.UP?this.offsetXAndRectXInterval=null:(this.offsetXAndRectXInterval||(this.offsetXAndRectXInterval=n-this.brushRectX),this.brushRectX=n-this.offsetXAndRectXInterval);break;default:n||(this.brushRectX=d.start*r*c,this.brushRectWidth=(a-(this.labelEndIdx-(d.end-d.start))*r)*c,this.beforeBrushRectX=this.brushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX);break}const h=a*c;return s===Me.BUTTON.INCREASE||s===Me.BUTTON.DECREASE?(this.brushRectX<0&&(this.brushRectWidth+=this.brushRectX,this.brushRectX=0),this.brushRectX+this.brushRectWidth>h&&(this.brushRectWidth=h-this.brushRectX)):this.brushRectX<0?this.brushRectX=0:this.brushRectX+this.brushRectWidth>h&&(this.brushRectX=h-this.brushRectWidth),this.brushRectWidth>h&&(this.brushRectWidth=h),{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(e,n,i,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=e,{brushRectX:h,brushRectWidth:u}=n,{height:f,selection:{fillColor:m,opacity:g}}=this.evChartBrushOptions.value,p=f-i.y1,y=h,C=h+u;s.style.position||(s.style.position="absolute",s.style.top=`${i.y1}px`,s.style.left=`${i.x1-l/2}px`),this.isEqualWidth||(s.width=r*d,s.style.width=`${r}px`,s.height=a*d,s.style.height=`${a}px`);const b=s.getContext("2d");b.clearRect(0,0,r*d,a*d),b.fillStyle=m,b.globalAlpha=g,b.fillRect(h,0,u,p),b.fillRect(y,0,l,p),b.fillRect(C-l,0,l,p),this.brushPosInfo={leftX:y/d,rightX:C/d,buttonWidth:l,axesXInterval:c,...e,...n}}getCanvasOffsetX(e){const n=this.brushCanvas.getBoundingClientRect();return e.clientX-n.left}addEvent(){let e;const n=l=>{if(this.isDragMode){const a=this.getCanvasOffsetX(l);this.mouseDownAndMove({offsetX:a})}};this.onDocumentMouseMove=ss(n,5),this.onDocumentMouseUp=()=>{document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.initEventState()},this.onMouseDown=l=>{l.preventDefault(),e.isInsideButton?this.isDragMode="button":e.isInsideBrush?(this.clickBrushInsideX=l.offsetX,this.isDragMode="grab"):e.isOutsideBrush&&this.teleportBrush(l),this.isDragMode&&(document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp))};const i=l=>{this.isDragMode||(e=this.getMousePosition(l),this.changeCursor(e))};this.onMouseMove=ss(i,5),this.onWheel=l=>{l.preventDefault();const a=l.deltaY>0?Me.WHEEL.DOWN:Me.WHEEL.UP;this.updateBrushIdx(a),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:a}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()};const s=()=>{this.initEventState()};this.onWheelDebounce=ns(s,100),this.setEventListener("addEventListener")}getMousePosition(e){const n=d=>Math.abs(this.brushPosInfo[d]-e.offsetX),i=n(De.RIGHT)>n(De.LEFT)?De.LEFT:De.RIGHT,s=d=>e.offsetX>this.brushPosInfo[d],l=d=>e.offsetX<this.brushPosInfo[d],a=l(De.LEFT)||s(De.RIGHT),r=s(De.LEFT)&&l(De.RIGHT),c=e.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[i]&&e.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[i];return this.curBrushButtonType=c&&i,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.brushCanvas=null),this.evChartBrushContainer){const e=this.evChartBrushContainer;for(;e.hasChildNodes();)e.removeChild(e.firstChild)}}setEventListener(e){this.brushCanvas[e]("mousemove",this.onMouseMove),this.brushCanvas[e]("mousedown",this.onMouseDown),this.brushCanvas[e]("mouseup",this.onMouseUp),this.evChartBrushOptions.value.useWheelMove&&(this.brushCanvas[e]("wheel",this.onWheel),this.brushCanvas[e]("wheel",this.onWheelDebounce))}removeBrushWrapper(){if(this.evChartBrushRef.value){const e=this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");e&&this.evChartBrushRef.value.removeChild(e)}}removeBrushCanvas(){if(this.evChartBrushContainer){const e=this.evChartBrushContainer.querySelector(".brush-canvas");e&&this.evChartBrushContainer.removeChild(e)}}teleportBrush(e){const n=this.debounceBrushIdx??this.brushIdx,i=(n.end-n.start)/2;let s,l,a;i>.5?(n.end-n.start)%2===0?(a=Math.round(e.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.ceil(e.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.floor(e.offsetX/this.brushPosInfo.axesXInterval),e.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(i),l=Math.ceil(i)):(s=Math.ceil(i),l=Math.floor(i),i<1&&(a+=1))),a-s<=0?(n.start=0,n.end=l+s):a+l>=this.labelEndIdx?(n.start=this.labelEndIdx-l-s,n.end=this.labelEndIdx):(n.start=a-s,n.end=a+l),this.brushIdx.isUseScroll=!0}changeCursor(e){e.isOutsideBrush?this.brushCanvas.style.cursor="pointer":e.isInsideBrush&&(e.isInsideButton?this.brushCanvas.style.cursor="ew-resize":this.brushCanvas.style.cursor="grab")}mouseDownAndMove(e){const n=this.debounceBrushIdx?0:this.brushPosInfo.axesXInterval/3;let i;e.offsetX>this.beforeMouseXPos?this.isDragMode==="grab"?this.clickBrushInsideX<e.offsetX-n&&(i=Me.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=e.offsetX+n):e.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(i=this.curBrushButtonType===De.LEFT?Me.BUTTON.DECREASE:Me.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):e.offsetX<this.beforeMouseXPos&&(this.isDragMode==="grab"?this.clickBrushInsideX>e.offsetX+n&&(i=Me.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=e.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-e.offsetX>n&&(i=this.curBrushButtonType===De.LEFT?Me.BUTTON.INCREASE:Me.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:i,offsetX:e.offsetX}):this.updateBrushIdx(i),this.beforeMouseXPos=e.offsetX}updateBrushIdx(e){const n=this.debounceBrushIdx??this.brushIdx;switch(e){case Me.WHEEL.UP:case Me.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case Me.WHEEL.DOWN:case Me.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case Me.BUTTON.INCREASE:if(this.curBrushButtonType===De.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case Me.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===De.LEFT?n.start+=1:n.end-=1;break}}updateBrushIdxUseXPos(){if(!this.debounceBrushIdx)return;const e=()=>{let s,l;if(this.brushPosInfo){const{brushRectX:a,brushRectWidth:r,brushCanvasWidth:c,axesXInterval:d}=this.brushPosInfo;if(this.brushIdx.isUseButton||this.isUseBrushGrab){if(s=a/d,l=this.labelEndIdx-(c-(a+r))/d,this.curBrushButtonType===De.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===De.RIGHT?(s=this.brushIdx.start,l=Math.round(l),s===l&&(l+=1)):(s=Math.round(s),l=Math.round(l)),l>this.labelEndIdx){const h=l-this.labelEndIdx;s-=h,l-=h}if(s<0){const h=Math.abs(s);s=0,l+=h}}}return{brushStartIdx:s,brushEndIdx:l}},{brushStartIdx:n,brushEndIdx:i}=e();this.brushIdx.start===n&&this.brushIdx.end===i&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=i??this.debounceBrushIdx.end}initEventState(){if(this.isCleaningUp)return;this.isCleaningUp=!0,new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.isDragMode=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1),this.isCleaningUp=!1})}};const q1={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},ek=()=>({getNormalizedBrushOptions:e=>Xe({},e,q1)}),tk={name:"EvChartBrush",directives:{resize:Wn},props:{options:{type:Object,default:()=>({})}},setup(t){let e=null,n=null;const i=o.ref(!1),s=o.inject("evChartClone",{data:[]}),l=o.inject("evChartInfo",{props:{options:[]}}),a=o.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=o.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=ek(),d=o.computed(()=>c(t.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:m,getNormalizedData:g,getNormalizedOptions:p}=ac(),y=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var I,v;const S=l.props.options[d.value.chartIdx],L={...S,brush:{use:!0,...d.value},height:d.value.height,zoom:{use:!1},dragSelection:{use:!1},title:{show:!1},tooltip:{use:!1},legend:{show:!1},selectLabel:{use:!1},selectSeries:{use:!1},axesX:[{...(I=S==null?void 0:S.axesX)==null?void 0:I[0],title:{use:!1}}],axesY:[{...(v=S==null?void 0:S.axesY)==null?void 0:v[0],title:{use:!1}}]};return p(L)}),{wrapper:b,wrapperStyle:k}=rc(C.value);o.watch(()=>r.list,()=>{b.value&&r.chartIdx===d.value.chartIdx&&(e.seriesList=r.list[d.value.chartIdx],e.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}}))}),o.watch(C,(S,L)=>{var I;S.brush.chartIdx<=((I=s.data)==null?void 0:I.length)-1?n&&!Fe(L.brush,S.brush)?n.removeBrushWrapper():e&&!Fe(S,L)&&(e.options=Re(S),e.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(e.data=Re(y.value),e.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),o.watch(()=>s.data,S=>{if(e){const L=S[d.value.chartIdx];if(L){const I=!Fe(L.series,e.data.series),v=r.list[d.value.chartIdx];typeof v=="object"&&Object.keys(v).length&&Object.keys(L.series).forEach(W=>{var E;"show"in L.series[W]||(L.series[W].show=((E=v[W])==null?void 0:E.show)??!0)}),e.data=Re(g(L)),e.update({updateSeries:I,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const T=()=>{let S;C.value.selectLabel.use?S=f:C.value.selectSeries.use&&(S=m),e=new gs(b.value,y.value,C.value,h,u,S)},w=()=>{n=new $1(e,y,d,a,b)},M=()=>{e&&e.init()},V=S=>{n&&n.init(S)};o.watch(()=>[a.start,a.end],()=>{var S;b.value&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1&&V()}),o.onMounted(async()=>{d.value.show&&(await T(),await M(),w(),V()),i.value=!0}),o.onUpdated(async()=>{var S;if(d.value.show&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1){const L=r.list[d.value.chartIdx];typeof L=="object"&&Object.keys(L).length&&Object.keys(y.value.series).forEach(I=>{var v;"show"in y.value.series[I]||(y.value.series[I].show=((v=L[I])==null?void 0:v.show)??!0)}),await T(),await M(),w(),V()}}),o.onBeforeUnmount(()=>{e&&"destroy"in e&&e.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{e&&"hideTooltip"in e&&e.hideTooltip()});const x=ns(()=>{e&&"resize"in e&&new Promise(L=>e.resize(L)).then(L=>{L&&V(L)})},0);return o.onActivated(()=>{i.value&&x()}),{evChartBrushOptions:d,evChartBrushRef:b,evChartBrushStyle:k,onResize:x}}};function nk(t,e,n,i,s,l){const a=o.resolveDirective("resize");return i.evChartBrushOptions.show?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:o.normalizeStyle(i.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,i.onResize]]):o.createCommentVNode("",!0)}const Ci=ce(tk,[["render",nk]]);Ci.install=t=>{t.component(Ci.name,Ci)};const ik={name:"TreeGridNode",components:{GridOptionButton:Fo},props:{dataIndex:{type:Number,default:0},nodeData:{type:Object,default:()=>({})},selectedData:{type:Object,default:()=>({})},useCheckbox:{type:Object,default:()=>({})},orderedColumns:{type:[Array],default:()=>[]},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},parentIcon:{type:String,default:""},childIcon:{type:String,default:""},customContextMenu:{type:[Array],default:()=>[]},menuRef:{type:Object,default:null},rowHeight:{type:Number,default:35},minWidth:{type:Number,default:40},borderStyle:{type:String,default:""},highlightIndex:{type:Number,default:-1}},emits:{"check-tree-data":null,"expand-tree-data":null,"click-tree-data":null,"dbl-click-tree-data":null,"context-menu":null},setup(t,{emit:e}){const n=(b,k)=>{e("check-tree-data",b,k)},i=b=>{e("expand-tree-data",b)},s=(b,k)=>{e("click-tree-data",b,k)},l=(b,k)=>{e("dbl-click-tree-data",b,k)},a=b=>{e("context-menu",b)},r=b=>{const k=t.expandIcon?t.expandIcon:"",T=t.expandIcon?t.collapseIcon:"";return b.expand?T:k},c=o.computed(()=>t.nodeData||{}),d=o.computed(()=>t.parentIcon||"tree-parent-icon"),h=o.computed(()=>t.childIcon||"tree-child-icon"),u=o.computed(()=>d.value!=="none"||h.value!=="none"),f=o.computed(()=>{const b=t.orderedColumns||[],k=b.findIndex(w=>w.expandColumn&&!w.hide&&!w.hiddenDisplay);if(k!==-1)return k;const T=b.findIndex(w=>!w.hide&&!w.hiddenDisplay);return T!==-1?T:0}),m=b=>({row:!0,"tree-row":!0,[`tree-row--level-${b==null?void 0:b.level}`]:!0,highlight:(b==null?void 0:b.index)===t.highlightIndex,selected:b.selected,"non-border":!!t.borderStyle&&t.borderStyle!=="rows"}),g=o.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!t.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:u,checkboxClass:g,expandColumnIdx:f,onCheck:n,onExpand:i,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:m,getColumnClass:(b,k)=>({cell:!0,"tree-td":k===0,[b.type]:b.type,[b.align]:b.align,[b.field]:b.field,"non-border":!!t.borderStyle}),getColumnStyle:(b,k)=>({width:`${b.width}px`,height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,"min-width":`${t.minWidth}px`,"border-right":t.orderedColumns.length-1===k?"none":"1px solid #CFCFCF"}),getDepthStyle:b=>({"margin-left":`${b*13}px`})}}},sk=["data-index"],ok=["data-name","data-index"],lk={class:"td-content__wrapper"},ak=["title"],rk={class:"td-content"};function ck(t,e,n,i,s,l){var d;const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-icon"),c=o.resolveComponent("grid-option-button");return o.openBlock(),o.createElementBlock("tr",{"data-index":i.node.index,class:o.normalizeClass(i.getRowClass(i.node)),onClick:e[7]||(e[7]=h=>i.onClick(h,i.node)),onDblclick:e[8]||(e[8]=h=>i.onDblClick(h,i.node))},[n.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass(i.checkboxClass),style:o.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:i.node.checked,"onUpdate:modelValue":e[0]||(e[0]=h=>i.node.checked=h),disabled:i.node.uncheckable,indeterminate:i.node.indeterminate,class:"row-checkbox-input",onChange:e[1]||(e[1]=h=>i.onCheck(h,i.node))},null,8,["modelValue","disabled","indeterminate"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.orderedColumns,(h,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:u},[!h.hide&&!h.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":h.field,"data-index":i.node.index,class:o.normalizeClass(i.getColumnClass(h,u)),style:o.normalizeStyle(i.getColumnStyle(h,u))},[o.createElementVNode("div",lk,[u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(i.getDepthStyle(i.node.level))},null,4)):o.createCommentVNode("",!0),u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[i.node.hasChild?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.expandIconClasses(i.node)?(o.openBlock(),o.createBlock(r,{key:0,icon:i.expandIconClasses(i.node),style:{display:"block"},onClick:e[2]||(e[2]=f=>i.onExpand(i.node))},null,8,["icon"])):(o.openBlock(),o.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:e[3]||(e[3]=o.withModifiers(f=>i.onExpand(i.node),["stop"]))},[...e[9]||(e[9]=[o.createElementVNode("i",null,null,-1)])]))],64)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),u===i.expandColumnIdx&&i.isDataIcon?(o.openBlock(),o.createElementBlock("span",{key:2,title:i.node[h.field],class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[o.createElementVNode("span",{class:o.normalizeClass(i.node.hasChild?i.parentIconMV:i.childIconMV)},[...e[10]||(e[10]=[o.createElementVNode("i",null,null,-1)])],2)],10,ak)):o.createCommentVNode("",!0),o.createElementVNode("div",rk,[t.$slots[h.field+"Node"]?o.renderSlot(t.$slots,h.field+"Node",{key:0,item:{data:i.node.data}},void 0,!0):o.createCommentVNode("",!0)])])],14,ok)):o.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[t.$slots.contextmenuIconNode?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[e[4]||(e[4]=h=>i.onContextMenu(h)),e[5]||(e[5]=o.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[o.renderSlot(t.$slots,"contextmenuIconNode",{},void 0,!0)])):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[e[6]||(e[6]=h=>i.onContextMenu(h)),o.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):o.createCommentVNode("",!0)],42,sk)}const dk=ce(ik,[["render",ck],["__scopeId","data-v-faab3696"]]),hk={name:"EvTreeGridToolbar"},uk={class:"tree-grid-toolbar"};function fk(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",uk,[o.renderSlot(t.$slots,"toolbarWrapper")])}const mk=ce(hk,[["render",fk]]),pk=t=>{const{props:e}=o.getCurrentInstance(),{checkInfo:n}=t;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=m=>m.charAt(0).toUpperCase()+m.slice(1),u="Renderer";let f="";if(d.indexOf("_")!==-1){const m=d.split("_");for(let g=0;g<m.length;g++)f+=h(m[g])}else f=h(d);return f+u},getConvertValue:(d,h)=>{let u=d.type==="number"||d.type==="float"?Number(h):h;return d.type==="number"?(u=Qt(h),u=u===!1?h:u):d.type==="float"&&(u=u.toFixed(d.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),u},getColumnIndex:d=>e.columns.findIndex(h=>h.field===d),setPixelUnit:d=>{let h=d;const u=h.toString().indexOf("px")>=0,f=h.toString().indexOf("%")>=0;return!u&&!f&&(h=`${h}px`),h},checkHeader:d=>{n.isHeaderChecked=!!d.length&&d.every(u=>u.checked);const h=d.filter(u=>u.uncheckable);if(h.length){const u=d.filter(m=>m.checked),f=d.every(m=>h.includes(m));n.isHeaderChecked=!f&&h.length+u.length===d.length,n.isHeaderUncheckable=f}n.isHeaderIndeterminate=!!d.length&&d.some(u=>u.checked||u.indeterminate)&&!n.isHeaderChecked}}},bs=t=>{const{originColumns:e,filteredColumns:n}=t;return e.map(i=>{const s=n.find(l=>l.index===i.index)??{};return{...i,...s}})},gk=t=>{const{scrollInfo:e,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=t,d=f=>{let m=n.showTreeStore;l.isClientPaging&&(m=r());const g=i.body;if(g){const p=s.rowHeight,y=g.clientHeight>p?Math.ceil(g.clientHeight/p):m.length,C=m.length*p;let b=Math.floor(g.scrollTop/p);b>m.length-1&&(b=0);const k=b+y+1,T=Math.max(b,0),w=k,M=i.table;n.viewStore=m.slice(T,w),e.hasVerticalScrollBar=y<m.length||g.clientHeight<M.clientHeight,e.vScrollTopHeight=T*p,e.vScrollBottomHeight=C-n.viewStore.length*p-e.vScrollTopHeight,f&&l.isInfinite&&e.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(w/l.perPage)+1,l.startIndex=w,c({onScrollEnd:!0}))}},h=()=>{const f=i.header,m=i.body,g=i.table;f.scrollLeft=m.scrollLeft,a.value=m.scrollLeft,e.hasHorizontalScrollBar=m.clientWidth<g.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const f=i.body,m=f.scrollTop,g=f.scrollLeft,p=e.lastScroll.top,y=e.lastScroll.left,C=g!==y;m!==p&&f.clientHeight&&d(!0),C&&h(),e.lastScroll.top=m,e.lastScroll.left=g}}},bk=t=>{const{props:e,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,stores:a,isRenderer:r,updateVScroll:c,updateHScroll:d,contextInfo:h}=t,u=()=>{a.viewStore=a.showTreeStore;const p=a.viewStore;let y=i.columnWidth;i.columnWidth>0&&(y=i.columnWidth),y=i.columnWidth;let C=0;if(i.adjust&&s.body){const b=s.body;let k=b.offsetWidth;const T=b.offsetHeight,w=a.orderedColumns.reduce((M,V)=>(V.hide||V.hiddenDisplay||(V.width?M.totalWidth+=V.width:M.emptyCount++),M),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(i.rowHeight*p.length>T-i.scrollWidth&&(k-=i.scrollWidth),l.useCheckbox.use&&(k-=i.minWidth),y=k-w.totalWidth,y>0){const M=w.emptyCount===0?0:Math.floor(y/w.emptyCount);C=y-M*w.emptyCount,y=w.emptyCount!==0?M:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(a.orderedColumns.forEach(b=>{const k=r(b)?i.rendererMinWidth:i.minWidth;b.width&&b.width<k&&(b.width=k),!b.width&&!b.hide&&(b.width=y)}),C&&a.orderedColumns.length){let b=a.orderedColumns.length-1,k=a.orderedColumns[b];for(;b>0&&k&&(k.hide||k.hiddenDisplay);)b-=1,k=a.orderedColumns[b];k&&(k.width+=C)}i.isResize=!i.isResize},f=()=>{o.nextTick(()=>{var p,y;i.adjust&&a.orderedColumns.forEach(C=>{var k;const b=C;return!((k=e.columns[C.index])!=null&&k.width)&&!b.resized&&(b.width=0),b},void 0),u(),(p=s.body)!=null&&p.clientHeight&&c(),(y=s.body)!=null&&y.clientWidth&&d()})};return{calculatedColumn:u,onResize:f,onShow:p=>{p&&f()},onColumnResize:(p,y)=>{const C=s.header,b=s.body,k=C.getBoundingClientRect().left,T=C.querySelector(`li[data-index="${p}"]`),w=r(a.orderedColumns[p])?i.rendererMinWidth:i.minWidth,M=T.getBoundingClientRect(),V=b.getBoundingClientRect().right-k,x=s.resizeLine,S=M.left-k+w,L=M.right-k,I=y.clientX,v=M.left-k;b.style.overflow="auto",x.style.left=`${L}px`,i.showResizeLine=!0;const W=G=>{const R=G.clientX-I,X=L+R;let Z=Math.max(S,X);Z=Math.min(V,Z),x.style.left=`${Z}px`},E=()=>{const R=parseInt(x.style.left,10)-v;a.orderedColumns[p]&&(a.orderedColumns[p].width=R,a.orderedColumns[p].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",W),f();const X=bs(a);n("resize-column",{column:a.orderedColumns[p],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",W),document.addEventListener("mouseup",E,{once:!0})}}},yk=t=>{const{emit:e}=o.getCurrentInstance(),n=t,i=(r,c)=>{var u;const d=r.target.tagName.toLowerCase();let h={};return r.target.offsetParent&&(d==="td"?h=r.target.dataset:h=((u=r.target.closest("td"))==null?void 0:u.dataset)??{}),{event:r,rowData:c,rowIndex:c.index,cellName:h.name,cellIndex:h.index}};let s=null;return{onRowClick:(r,c)=>{var d,h;return r.target&&r.target.parentElement&&(r.target.parentElement.classList.contains("row-checkbox-input")||(h=(d=r.target.closest("td"))==null?void 0:d.classList)!=null&&h.contains("row-contextmenu"))?!1:(clearTimeout(s),s=setTimeout(()=>{n.useSelect&&(c.selected?(c.selected=!1,n.multiple?r.ctrlKey?n.selectedRow=n.selectedRow.filter(u=>u.index!==c.index):n.selectedRow=[c]:n.selectedRow=[]):(c.selected=!0,r.ctrlKey&&n.multiple&&(!n.limitCount||n.limitCount>n.selectedRow.length)?n.selectedRow.push(c):n.selectedRow=[c]),e("update:selected",n.selectedRow),e("click-row",i(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),e("dblclick-row",i(r,c))}}},xk=t=>{const{checkInfo:e,stores:n,checkHeader:i,pageInfo:s,getPagingData:l}=t,{emit:a}=o.getCurrentInstance(),r=()=>e.useCheckbox.mode==="each",c=m=>{const g=n.treeStore.findIndex(p=>p.index===m.index);g!==-1&&(n.treeStore[g].checked=m.checked)},d=m=>{r()||m.hasChild&&m.children.forEach(g=>{const p=g;m.checked&&!p.checked&&!p.uncheckable&&e.checkedRows.push(p),m.checked||(e.checkedRows=e.checkedRows.filter(y=>y.index!==p.index)),p.checked=m.checked&&!p.uncheckable,p.hasChild&&d(p)})},h=m=>{if(r())return;const g=m.parent;if(g){const p=g.children.every(C=>C.checked);g.checked=p&&!g.uncheckable;const y=g.children.filter(C=>C.uncheckable);if(y.length){const C=g.children.filter(b=>b.checked);y.length+C.length===g.children.length&&(g.checked=!0)}g.indeterminate=!p&&g.children.some(C=>C.checked||C.indeterminate),g.checked?e.checkedRows.push(g):e.checkedRows=e.checkedRows.filter(C=>C.index!==g.index),g.parent&&h(g)}};return{onCheck:(m,g)=>{let p=n.store;s.isClientPaging&&(p=l());const y=()=>e.useCheckbox.mode==="single",C=()=>{e.isHeaderChecked&&(e.isHeaderChecked=!1)},b=()=>{y()&&e.checkedRows.length>0&&(e.prevCheckedRow.checked=!1,c(e.prevCheckedRow))},k=w=>{if(y()){e.checkedRows=[w];return}d(w),h(w),e.checkedRows.push(w),w.indeterminate=!1},T=w=>{if(y()){e.checkedRows=[];return}e.checkedRows=e.checkedRows.filter(M=>M.index!==w.index)};b(),g.checked?(k(g),i(p)):(C(),T(g),d(g),h(g)),e.prevCheckedRow=g,a("update:checked",e.checkedRows),a("check-row",m,g.index,g)},onCheckAll:m=>{var y;const g=e.isHeaderChecked;let p=(y=n.store)==null?void 0:y.filter(C=>C.isFilter);s.isClientPaging&&(p=l()),p.forEach(C=>{C.checked=g&&!C.uncheckable,C.checked?e.checkedRows.find(b=>b.index===C.index)||e.checkedRows.push(C):e.checkedRows=e.checkedRows.filter(b=>b.index!==C.index),C.indeterminate=!1}),e.isHeaderIndeterminate=!1,a("update:checked",e.checkedRows),a("check-all",m,e.checkedRows)}}},Sk=t=>{const{emit:e}=o.getCurrentInstance(),{contextInfo:n,stores:i,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=t,d=(m=!0)=>{const g=[];if(m&&n.customContextMenu.length){const p=s.selectedRow,y=n.customContextMenu.map(C=>{const b=C;return b.validate&&(b.disabled=!b.validate(b.itemId,p)),b.selectedRow=p??[],b});g.push(...y)}n.contextMenuItems=g};return{setContextMenu:d,onContextMenu:m=>{var y,C;const p=(C=(y=m.target.closest(".row"))==null?void 0:y.dataset)==null?void 0:C.index;if(p){const b=i.viewStore.findIndex(T=>T.index===Number(p)),k=i.viewStore[b];s.selectedRow=[k],d(),e("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),e("update:selected",[])},onColumnContextMenu:(m,g)=>{var p,y,C,b,k,T;if(m.target.className.includes("column-name")){const w=!!g.sortable;n.columnMenuItems=[{text:((p=n.columnMenuTextInfo)==null?void 0:p.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||i.orderedColumns.length===1||!!g.fixed,hidden:((y=n.hiddenColumnMenuItem)==null?void 0:y.hide)||!l.value,click:()=>{r(g.field),e("change-column-status",{columns:i.updatedColumns}),e("change-column-info",{type:"display",columns:i.updatedColumns})}},{text:((C=n.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!w,hidden:(b=n.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>c(g,"asc")},{text:((k=n.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!w,hidden:(T=n.hiddenColumnMenuItem)==null?void 0:T.descending,click:()=>c(g,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:m=>{const{useDefaultColumnSetting:g,columnSettingTextInfo:p}=a,y={text:(p==null?void 0:p.title)??"Column List",isShowMenu:!0,click:()=>{a.isShowColumnSetting=!0,n.isShowMenuOnClick=!0}};n.customGridSettingContextMenu.length&&(n.gridSettingContextMenuItems=[...n.customGridSettingContextMenu]),g&&n.gridSettingContextMenuItems.push(y),n.gridSettingMenu.show(m)}}},Ck=t=>{const{emit:e}=o.getCurrentInstance(),{stores:n,onResize:i}=t,s=()=>{let r=0;const c=[];function d(u){const f={};return Object.keys(u).forEach(m=>{m!=="children"&&(f[m]=u[m])}),f}function h(u){const{node:f,level:m,isShow:g,parent:p,uncheckable:y}=u;f!==null&&typeof f=="object"&&(f.index=r++,f.level=m,Object.hasOwnProperty.call(f,"checked")||(f.checked=!1),Object.hasOwnProperty.call(f,"selected")||(f.selected=!1),Object.hasOwnProperty.call(f,"show")||(f.show=g),Object.hasOwnProperty.call(f,"expand")||(f.expand=!0),Object.hasOwnProperty.call(f,"isFilter")||(f.isFilter=!1),Object.hasOwnProperty.call(f,"uncheckable")||(f.uncheckable=y),Object.hasOwnProperty.call(f,"indeterminate")||(f.indeterminate=!1),Object.hasOwnProperty.call(f,"data")||(f.data=d(f)),c.push(f),Object.hasOwnProperty.call(f,"parent")||(f.parent=p),f.children&&(f.hasChild=!0,f.children.forEach(C=>h({node:C,level:m+1,isShow:f.show&&f.expand,parent:f,uncheckable:f.uncheckable}))))}return n.treeRows.forEach(u=>{h({node:u,level:0,isShow:!0,parent:void 0,uncheckable:!1})}),c},l=(r,c,d)=>{r.forEach(h=>{const u=h;u.show=d&&c?u.isFilter:c,u.hasChild&&l(u.children,u.show&&u.expand,u.isFilter)})};return{setTreeNodeStore:s,handleExpand:r=>{const c=!r.expand,d=r;d.expand=!d.expand,l(d.children,d.expand,d.isFilter),e("toggle-row",{row:d,isExpand:c}),i()}}},kk=t=>{const{stores:e,filterInfo:n,pageInfo:i,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=t,d=m=>{if(!(m!=null&&m.parent))return;const{parent:g}=m;g.show=!0,g.isFilter=!0,d(g)},h=m=>{if(!(m!=null&&m.children))return;const{children:g}=m;g.forEach(p=>{const y=p;y.parent.show&&y.parent.expand?y.show=!0:y.show=!1,y.isFilter=!0,y.hasChild&&h(y)})};let u=null;return{onSearch:m=>{u&&clearTimeout(u),u=setTimeout(()=>{n.isSearch=!1,n.searchWord=m;const g=e.treeStore;g.forEach(p=>{p.show=!1,p.isFilter=!1}),m?(g.filter(y=>{let C=!1;for(let b=0;b<e.orderedColumns.length;b++){const k=e.orderedColumns[b]||{};let T=y[k.field]??null;if(k.type=k.type||"string",T!==null&&!k.hide&&((k==null?void 0:k.searchable)===void 0||k!=null&&k.searchable)&&(T=s(k,T).toString(),C=T.toLowerCase().includes(m.toString().toLowerCase()),C))break}return C}).forEach(y=>{y.show=!0,y.parent&&!y.parent.expand&&(y.show=!1),y.isFilter=!0,d(y),h(y)}),n.isSearch=!0):(g.forEach(p=>{p.show=!0,p.isFilter=!1}),g.forEach(p=>{d(p),h(p)})),!m&&i.isClientPaging&&i.prevPage&&(i.currentPage=1,e.pagingStore=r()),c({onSearch:!0}),a(e.store),l()},500)}}},wk=t=>{const{emit:e}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=t,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.showTreeStore.slice(u,f)},d=u=>{e("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.showTreeStore.length<=i.perPage)n.pagingStore=n.showTreeStore;else{const f=(i.currentPage-1)*i.perPage,m=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.showTreeStore.slice(f,m),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},Ik=({sortInfo:t,stores:e})=>{const{emit:n}=o.getCurrentInstance(),i=(u=!0)=>u?["asc","desc","init"]:["asc","desc"];function s(){this.orders=i(),this.dequeue=()=>this.orders.shift(),this.enqueue=u=>this.orders.push(u)}const l=(u,f="init")=>{e.orderedColumns.forEach(m=>{m.index===(u==null?void 0:u.index)&&f?m.sortOption={sortType:f}:m.sortOption={sortType:"init"}})},a=()=>{const u=e.originColumns.filter(f=>f.hiddenDisplay||f.hide);u.length&&u.forEach(f=>{f.sortOption={sortType:"init"}})},r=new s;return{onSort:(u,f)=>{if(u.sortable===void 0?!0:u.sortable){t.sortColumn=u,t.sortField!==(u==null?void 0:u.field)&&(r.orders=i(),t.sortField=u==null?void 0:u.field),f&&(r.orders=i(),f==="desc"&&(t.sortOrder=r.dequeue(),r.enqueue(t.sortOrder))),t.sortOrder=r.dequeue(),r.enqueue(t.sortOrder),a(),l(u,t.sortOrder);const g=bs(e);n("sort-column",{field:t.sortField,order:t.sortOrder,column:t.sortColumn,columns:g}),n("change-column-info",{type:"sort",columns:g})}},setSortInfo:(u,f=!0)=>{const m=u==null?void 0:u.findIndex(y=>{var C;return(y==null?void 0:y.sortable)&&((C=y==null?void 0:y.sortOption)==null?void 0:C.sortType)&&y.sortOption.sortType!=="init"}),g=u[m];m>-1&&(g.index=m);const{sortType:p}=(g==null?void 0:g.sortOption)||{};t.sortColumn=g,t.sortField=g==null?void 0:g.field,t.isSorting=!!p,t.sortOrder=p,l(g,p),f&&n("change-column-info",{type:"sort",columns:bs(e)})},initSortInfo:u=>{t.isSorting=!1,t.sortOrder="init",u.forEach(f=>{var m;(m=f==null?void 0:f.sortOption)!=null&&m.sortType&&f.sortOption.sortType!=="init"&&(f.sortOption.sortType="init")})}}},Lk={name:"EvTreeGrid",components:{TreeGridNode:dk,Toolbar:mk,GridPagination:Vr,GridSummary:Xr,ColumnSetting:Nr,GridSortButton:Pr,GridOptionButton:Fo},directives:{observeVisibility:qs,resize:Wn},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array,Object],default:()=>null},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""}},emits:{"update:selected":null,"update:checked":null,"click-row":null,"dblclick-row":null,"check-row":null,"check-all":null,"page-change":null,"sort-column":null,"toggle-row":null,"resize-column":({column:t,columns:e})=>({column:t,columns:e}),"change-column-status":({columns:t})=>({columns:t}),"change-column-info":({type:t,columns:e})=>({type:t,columns:e})},setup(t){var ys,xs,Ss,Cs,ks,ws,Is,on,Ln;const e=o.ref(null),n=o.computed(()=>{var A,se;return((se=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:se.use)||!1}),i=o.computed(()=>{var A;return((A=t.option)==null?void 0:A.useSummary)||!1}),s=o.computed(()=>t.option.emptyText??"No records"),l=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=o.reactive({isSearch:!1,searchWord:""}),r=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var A,se;return((se=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:se.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((xs=(ys=t.option)==null?void 0:ys.useGridSetting)==null?void 0:xs.columnMenuText)??"Column List",search:((Cs=(Ss=t.option)==null?void 0:Ss.useGridSetting)==null?void 0:Cs.searchText)??"Search",empty:((ws=(ks=t.option)==null?void 0:ks.useGridSetting)==null?void 0:ws.emptyText)??"No records",ok:((on=(Is=t.option)==null?void 0:Is.useGridSetting)==null?void 0:on.okBtnText)??"OK"}}),c=o.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:o.computed(()=>c.treeStore.filter(A=>A.show)),searchStore:o.computed(()=>c.treeStore.filter(A=>A.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:t.rows,filteredColumns:[],originColumns:o.computed(()=>t.columns.map((A,se)=>{var fe;return{index:se,hiddenDisplay:!1,...A,width:isFinite(A.width)?A.width:void 0,sortOption:{sortType:((fe=A==null?void 0:A.sortOption)==null?void 0:fe.sortType)||"init"}}})),orderedColumns:o.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:o.computed(()=>bs(c))}),d=o.reactive({usePage:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.use)||!1}),useClient:((Ln=t.option.page)==null?void 0:Ln.useClient)||!1,isInfinite:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.total)||0}),perPage:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.perPage)||20}),visiblePage:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.visiblePage)||8}),order:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.order)||"center"}),showPageInfo:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.showPageInfo)||!1}),isClientPaging:o.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:t.checked,useCheckbox:o.computed(()=>t.option.useCheckbox||{})}),{isRenderer:u,getComponentName:f,getConvertValue:m,getColumnIndex:g,setPixelUnit:p,checkHeader:y}=pk({checkInfo:h}),C=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),b=o.reactive({selectedRow:t.selected,useSelect:o.computed(()=>{var A,se;return((se=(A=t.option)==null?void 0:A.useSelection)==null?void 0:se.use)??!0}),limitCount:o.computed(()=>{var se,fe;let A=(fe=(se=t.option)==null?void 0:se.useSelection)==null?void 0:fe.limitCount;return A=A&&A>=2?A:0,A}),multiple:o.computed(()=>{var A,se;return((se=(A=t.option)==null?void 0:A.useSelection)==null?void 0:se.multiple)??!1})}),k=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:t.option.customAscFunction??{}}),T=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:t.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:t.option.columnMenuText||{},hiddenColumnMenuItem:t.option.hiddenColumnMenuItem||{},customContextMenu:t.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var A,se;return((se=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:se.customContextMenu)||[]}),isShowMenuOnClick:!1}),w=o.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:t.option.adjust||!1,columnWidth:t.option.columnWidth||80,scrollWidth:t.option.scrollWidth||17,rowHeight:o.computed(()=>t.option.rowHeight||35),gridWidth:o.computed(()=>t.width?p(t.width):"100%"),gridHeight:o.computed(()=>t.height?p(t.height):"100%"),isResize:!1}),M=o.reactive({showHeader:o.computed(()=>t.option.showHeader===void 0?!0:t.option.showHeader),stripeStyle:o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.stripe)||!1}),borderStyle:o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.border)||""}),highlightIdx:o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.highlight)??-1})}),V=()=>{b.selectedRow.length=0,c.store.forEach(A=>{A.selected=!1})},x=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(A=>{A.checked=!1,A.indeterminate=!1})},{getPagingData:S,updatePagingInfo:L,changePage:I}=wk({stores:c,pageInfo:d,sortInfo:k,filterInfo:a,elementInfo:l,clearCheckInfo:x}),v=o.ref(0),{updateVScroll:W,updateHScroll:E,onScroll:G}=gk({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:w,pageInfo:d,summaryScroll:v,getPagingData:S,updatePagingInfo:L}),{onRowClick:R,onRowDblClick:X}=yk(b),{onCheck:Z,onCheckAll:N}=xk({checkInfo:h,stores:c,checkHeader:y,pageInfo:d,getPagingData:S}),{calculatedColumn:P,onResize:B,onShow:Y,onColumnResize:H}=bk({resizeInfo:w,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:W,updateHScroll:E,contextInfo:T}),{setTreeNodeStore:K,handleExpand:D}=Ck({stores:c,onResize:B}),{onSort:z,initSortInfo:_,setSortInfo:ee}=Ik({sortInfo:k,stores:c}),{onSearch:J}=kk({stores:c,filterInfo:a,pageInfo:d,getConvertValue:m,onResize:B,checkHeader:y,getPagingData:S,updatePagingInfo:L}),{setPositionColumnSetting:te,initColumnSettingInfo:U,onApplyColumn:ne,setColumnHidden:Q}=Br({stores:c,columnSettingInfo:r,contextInfo:T,onSearch:J,onResize:B}),{setContextMenu:$,onContextMenu:j,onColumnContextMenu:he,onGridSettingContextMenu:me}=Sk({contextInfo:T,stores:c,selectInfo:b,useGridSetting:n,columnSettingInfo:r,setColumnHidden:Q,onSort:z}),ae=A=>{T.gridSettingContextMenuItems.length=0,T.customGridSettingContextMenu.length?me(A):r.isShowColumnSetting=!0},xe=A=>{var se,fe,ke,Ve,ze,Qe;A.type==="wheel"&&((se=T.menu)==null||se.hide(A)),A.type==="scroll"&&!((fe=A.target.classList)!=null&&fe.contains("table-body"))&&!((Ve=(ke=A.target.offsetParent)==null?void 0:ke.classList)!=null&&Ve.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,T.isShowMenuOnClick=!1,(ze=T.columnMenu)==null||ze.hide(A),(Qe=T.gridSettingMenu)==null||Qe.hide())};o.onMounted(()=>{var A;if(c.treeStore=K(),c.originStore=Re(c.treeStore),(A=t.option)!=null&&A.useSort)ee(t.columns,!1);else{const se=T.hiddenColumnMenuItem;se.ascending=!0,se.descending=!0}document.addEventListener("wheel",xe,{capture:!1}),document.addEventListener("scroll",xe,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",xe,{capture:!1}),document.removeEventListener("scroll",xe,{capture:!0})}),o.onActivated(()=>{B()}),o.watch(()=>{var A;return(A=t.option)==null?void 0:A.useSort},A=>{const se=t.option.hiddenColumnMenuItem,fe=T.hiddenColumnMenuItem;A?(fe.ascending=(se==null?void 0:se.ascending)??!1,fe.descending=(se==null?void 0:se.descending)??!1,ee(t.columns,!1)):(fe.ascending=!0,fe.descending=!0,_(t.columns))}),o.watch(()=>r.isShowColumnSetting,A=>{var se;if(!A){(se=T.gridSettingMenu)==null||se.hide();return}te(e.value)}),o.watch(()=>t.columns,()=>{U()},{deep:!0,immediate:!0}),o.watch(()=>t.checked,A=>{h.checkedRows=A}),o.watch(()=>h.checkedRows,A=>{h.isHeaderChecked=!1;let se=c.store;d.isClientPaging&&(se=S()),se.length&&(se.forEach(fe=>{fe.checked=!!A.find(ke=>ke.index===fe.index)}),y(se)),W()}),o.watch(()=>t.selected,A=>{b.useSelect&&(b.selectedRow=A)}),o.watch(()=>b.selectedRow,A=>{b.useSelect&&(c.store.forEach(se=>{se.selected=!!A.find(fe=>fe.index===se.index)}),W())},{deep:!0}),o.watch(()=>M.highlightIdx,async A=>{await o.nextTick();const se=ke=>{if(!(ke!=null&&ke.children))return;const{children:Ve}=ke;Ve.forEach(ze=>{const Qe=ze;Qe.parent.show&&Qe.parent.expand?Qe.show=!0:Qe.show=!1,Qe.isFilter=!0,Qe.hasChild&&se(Qe)})},fe=ke=>{if(!(ke!=null&&ke.parent)){se(ke);return}const{parent:Ve}=ke;Ve.show=!0,Ve.isFilter=!0,Ve.expand=!0,se(Ve),fe(Ve)};if(A>=0){const ke=c.store.find(ze=>ze.index===A);if(!ke)return;ke.show=!0,ke.isFilter=!0,fe(ke);const Ve=c.showTreeStore.map(ze=>ze.index).indexOf(ke.index);if(d.usePage&&!d.isInfinite){const ze=Math.ceil(Ve/d.perPage);if(d.highlightPage=Ve===d.perPage?ze+1:ze||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=w.rowHeight*Ve}}),o.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),o.watch(()=>b.useSelect,()=>{V()}),o.watch(()=>b.multiple,()=>{V()}),o.watch(()=>t.rows,A=>{c.treeRows=A,c.treeStore=K(),B()},{deep:!0}),o.watch(()=>c.treeStore.length,()=>{y(c.store)}),o.watch(()=>[t.width,t.height,t.option.columnWidth],()=>{t.option.columnWidth!=null&&(w.columnWidth=t.option.columnWidth),c.orderedColumns.map(A=>{var fe;const se=A;return!((fe=t.columns[A.index])!=null&&fe.width)&&!se.resized&&(se.width=0),se}),B()}),o.watch(()=>t.option.searchValue,A=>{o.nextTick(()=>{A!==void 0&&(J((A==null?void 0:A.value)??A),d.isClientPaging&&(x(),V()))})},{immediate:!0}),o.watch(()=>{var A;return(A=t.option.page)==null?void 0:A.currentPage},A=>{var fe;const se=A||1;d.currentPage=(fe=t.option.page)!=null&&fe.isInfinite?1:se},{immediate:!0}),o.watch(()=>d.currentPage,(A,se)=>{o.nextTick(()=>{if(I(se),d.isClientPaging&&A!==se&&(x(),V()),W(),A===d.highlightPage&&d.isHighlight){const fe=c.pagingStore.map(ke=>ke.index).indexOf(M.highlightIdx);l.body.scrollTop=w.rowHeight*fe,d.isHighlight=!d.isHighlight}})});const be=()=>({"column-sort__icon":!0,"column-sort__icon--asc":k.sortOrder==="asc","column-sort__icon--desc":k.sortOrder==="desc"}),oe=o.computed(()=>({width:w.gridWidth,height:w.gridHeight})),re=o.computed(()=>({"table-body":!0,stripe:M.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!M.borderStyle})),pe=o.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:w.adjust,"non-header":!M.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),Ie=o.computed(()=>({"table-header":!0,"non-border":!!M.borderStyle})),Ee=o.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!M.borderStyle})),kt=o.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Vt=A=>({column:!0,render:u(A),"non-border":!!M.borderStyle,[A.field]:A.field}),$o=(A,se)=>{const fe=u(A);return{width:`${A.width}px`,"min-width":fe?`${w.rendererMinWidth}px;`:`${w.minWidth}px`,"margin-right":c.orderedColumns.length-1===se&&C.hasVerticalScrollBar&&C.hasHorizontalScrollBar?`${w.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===se?"none":"1px solid #CFCFCF"}},qo=A=>`${A}Node`;return{summaryScroll:v,gridStyle:oe,gridClass:pe,headerClass:Ie,headerCheckboxClass:Ee,isHeaderCheckbox:kt,bodyStyle:re,useSummary:i,useGridSetting:n,toolbarRef:e,stores:c,emptyText:s,...o.toRefs(M),...o.toRefs(l),...o.toRefs(c),...o.toRefs(a),...o.toRefs(C),...o.toRefs(w),...o.toRefs(b),...o.toRefs(h),...o.toRefs(k),...o.toRefs(T),...o.toRefs(d),...o.toRefs(r),isRenderer:u,getComponentName:f,getConvertValue:m,getColumnIndex:g,setPixelUnit:p,updateVScroll:W,updateHScroll:E,onScroll:G,calculatedColumn:P,onResize:B,onShow:Y,onColumnResize:H,onRowClick:R,onRowDblClick:X,onCheck:Z,onCheckAll:N,setContextMenu:$,onContextMenu:j,onSearch:J,handleExpand:D,getColumnClass:Vt,getColumnStyle:$o,getSlotName:qo,setGridSetting:ae,onApplyColumn:ne,onColumnContextMenu:he,onSort:z,sortIconClass:be}}},Tk={class:"column-list"},Mk=["data-index"],vk=["title","onClick"],Rk=["onClick"],Vk=["onMousedown"],Ek={ref:"table"},Wk=["title"],Gk={key:0},Zk={class:"is-empty"},Xk={ref:"resizeLine",class:"table-resize-line"};function Nk(t,e,n,i,s,l){var C;const a=o.resolveComponent("grid-option-button"),r=o.resolveComponent("toolbar"),c=o.resolveComponent("ev-checkbox"),d=o.resolveComponent("grid-sort-button"),h=o.resolveComponent("tree-grid-node"),u=o.resolveComponent("ev-context-menu"),f=o.resolveComponent("grid-summary"),m=o.resolveComponent("grid-pagination"),g=o.resolveComponent("column-setting"),p=o.resolveDirective("resize"),y=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[t.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${t.gridWidth};`)},[o.createVNode(r,null,{toolbarWrapper:o.withCtx(()=>[i.useGridSetting?(o.openBlock(),o.createBlock(a,{key:0,class:"grid-setting__icon",onClick:i.setGridSetting},null,8,["onClick"])):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"grid-wrapper",style:o.normalizeStyle(i.gridStyle)},[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass(i.gridClass)},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass(i.headerClass)},[o.createElementVNode("ul",Tk,[t.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(i.headerCheckboxClass),style:o.normalizeStyle({width:`${t.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[i.isHeaderCheckbox?(o.openBlock(),o.createBlock(c,{key:0,modelValue:t.isHeaderChecked,"onUpdate:modelValue":e[0]||(e[0]=b=>t.isHeaderChecked=b),disabled:t.isHeaderUncheckable,indeterminate:t.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(b,k)=>{var T,w;return o.openBlock(),o.createElementBlock(o.Fragment,{key:k},[!b.hide&&!b.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":k,class:o.normalizeClass(i.getColumnClass(b)),style:o.normalizeStyle(i.getColumnStyle(b,k))},[b.customHeader&&t.$slots.customHeader?o.renderSlot(t.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:b.caption,class:o.normalizeClass(["column-name",{"column-name--click":i.useGridSetting}]),onClick:[M=>i.onColumnContextMenu(M,b),e[1]||(e[1]=o.withModifiers((...M)=>t.columnMenu.show&&t.columnMenu.show(...M),["prevent"]))]},[o.createTextVNode(o.toDisplayString(b.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(M=>i.onSort(b),["stop"])},[t.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(T=t.$props.option)!=null&&T.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),t.sortField===b.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(i.sortIconClass(b)),style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},[o.renderSlot(t.$slots,`sortIcon_${t.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(w=t.$props.option)!=null&&w.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),t.sortField===b.field?(o.openBlock(),o.createBlock(d,{key:1,class:o.normalizeClass(i.sortIconClass(b)),icon:t.sortOrder,style:o.normalizeStyle({height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,visibility:t.sortOrder?b.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,Rk)],10,vk)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(k,M),["stop","left"])},null,40,Vk)],14,Mk)):o.createCommentVNode("",!0)],64)}),128)),(C=t.$props.option.customContextMenu)!=null&&C.length?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!t.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":t.hasVerticalScrollBar||t.hasHorizontalScrollBar?`${t.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,t.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass(i.bodyStyle),onScroll:e[2]||(e[2]=(...b)=>i.onScroll&&i.onScroll(...b)),onContextmenu:[e[3]||(e[3]=b=>i.onContextMenu(b)),e[4]||(e[4]=o.withModifiers((...b)=>t.menu.show&&t.menu.show(...b),["prevent"]))]},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",Ek,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.viewStore,(b,k)=>(o.openBlock(),o.createBlock(h,{key:k,"selected-data":t.selectedRow,"node-data":b,"use-checkbox":t.useCheckbox,"ordered-columns":t.orderedColumns,"expand-icon":n.option.expandIcon,"collapse-icon":n.option.collapseIcon,"parent-icon":n.option.parentIcon,"child-icon":n.option.childIcon,"custom-context-menu":t.customContextMenu,"menu-ref":t.menu,"is-resize":t.isResize,"row-height":t.rowHeight,"min-width":t.minWidth,"highlight-index":t.highlightIdx,"border-style":t.borderStyle,onCheckTreeData:i.onCheck,onExpandTreeData:i.handleExpand,onClickTreeData:i.onRowClick,onDblClickTreeData:i.onRowDblClick,onContextMenu:i.onContextMenu},o.createSlots({_:2},[o.renderList(t.orderedColumns,(T,w)=>({name:i.getSlotName(T.field),fn:o.withCtx(({item:M})=>[t.$slots[T.field]?o.renderSlot(t.$slots,T.field,{key:0,item:{data:M.data,fieldName:T.field}},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:i.getConvertValue(T,b[T.field])},o.toDisplayString(i.getConvertValue(T,b[T.field])),9,Wk))])})),t.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:o.withCtx(()=>[o.renderSlot(t.$slots,"contextmenuIcon",{},void 0,!0)]),key:"0"}:void 0]),1032,["selected-data","node-data","use-checkbox","ordered-columns","expand-icon","collapse-icon","parent-icon","child-icon","custom-context-menu","menu-ref","is-resize","row-height","min-width","highlight-index","border-style","onCheckTreeData","onExpandTreeData","onClickTreeData","onDblClickTreeData","onContextMenu"]))),128)),t.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",Gk,[o.createElementVNode("td",Zk,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${t.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(u,{ref:"menu","custom-class":t.contextMenuClass,items:t.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(u,{ref:"columnMenu",items:t.columnMenuItems},null,8,["items"]),o.createVNode(u,{ref:"gridSettingMenu",items:t.gridSettingContextMenuItems,"is-show-menu-on-click":t.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",Xk,null,512),[[o.vShow,t.showResizeLine]])],2)],4)),[[p,i.onResize],[y,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(f,{key:1,"is-tree":!0,"ordered-columns":t.orderedColumns,stores:i.stores,"use-checkbox":t.useCheckbox.use,"style-option":{borderStyle:t.borderStyle,minWidth:t.minWidth,rowHeight:t.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),t.usePage&&!t.isInfinite?(o.openBlock(),o.createBlock(m,{key:2,modelValue:t.currentPage,"onUpdate:modelValue":e[5]||(e[5]=b=>t.currentPage=b),total:t.showTreeStore.length,"per-page":t.perPage,"visible-page":t.visiblePage,"show-page-info":t.showPageInfo,order:t.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(g,{"is-show":t.isShowColumnSetting,"onUpdate:isShow":e[6]||(e[6]=b=>t.isShowColumnSetting=b),"is-show-menu-on-click":t.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":e[7]||(e[7]=b=>t.isShowMenuOnClick=b),columns:t.updatedColumns,"hidden-column":t.hiddenColumn,position:t.columnSettingPosition,"text-info":t.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const ki=ce(Lk,[["render",Nk],["__scopeId","data-v-9ed705b7"]]);ki.install=t=>{t.component(ki.name,ki)};const Pk={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},Bk=["aria-current"];function Dk(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("span",o.mergeProps({class:{"is-current":n.page.isCurrent,"is-disabled":n.disabled||n.page.disabled,[n.page.class]:!0}},t.$attrs,{"aria-current":n.page.isCurrent,onClick:e[0]||(e[0]=o.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[o.renderSlot(t.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(n.page.number),1)])],16,Bk)}const Yk={name:"EvPagination",components:{EvIcon:Cn,pageButton:ce(Pk,[["render",Dk]])},props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:t=>["left","right","center"].includes(t)},pagePerJump:{type:[Number,void 0],default:void 0}},emits:{"update:modelValue":null,change:null},setup(t,{emit:e}){const n=o.computed(()=>t.visiblePage>7?t.visiblePage:7),i=o.computed(()=>t.modelValue),s=o.computed(()=>t.total===0?1:Math.ceil(t.total/t.perPage)),l=o.computed(()=>i.value>1),a=o.computed(()=>i.value<s.value),r=o.computed(()=>Math.max(i.value-t.pagePerJump,1)),c=o.computed(()=>Math.min(i.value+t.pagePerJump,s.value)),d=o.computed(()=>{const p=i.value*t.perPage-t.perPage+1;return p>=0?p:0}),h=(p,y)=>{i.value===p||p<1||p>s.value||(e("update:modelValue",p),e("change",p),y&&y.target&&o.nextTick(()=>y.target.focus()))},u=(p,y={})=>({number:p,isCurrent:y.isCurrent??i.value===p,click:C=>h(p,C),input:(C,b)=>h(+b,C),disabled:y.disabled||!1,class:y.class||""}),f=(p,y)=>{const C=[],b=p>0?p:1;for(let k=b;k<=y;k++)C.push(u(k));return C},m=o.computed(()=>{const p=parseInt(n.value,10);if(p===0)return[];const y=Math.min(Math.max(0,p)||s.value,s.value);if(s.value<=y)return f(1,s.value);const C=y%2===0?1:0,b=Math.floor(y/2),k=s.value-b+1+C;if(i.value>b&&i.value<k){const w=s.value,M=i.value-b+2,V=i.value+b-2-C,x=M-1===2?2:-1,S=V+1===w-1?V+1:-1;return[u(1),u(x),...f(M,V),u(S),u(s.value)]}else if(i.value===b){const T=i.value+b-1-C;return[...f(1,T),u(-1),u(s.value)]}else if(i.value===k){const T=i.value-b+1;return[u(1),u(-1),...f(T,s.value)]}return[...f(1,b),u(-1),...f(k,s.value)]}),g=o.computed(()=>({"justify-content":t.order,flex:"3 1 0%"}));return o.watch(()=>s.value,p=>{i.value>p&&h(p)}),o.watch(()=>i.value,(p,y)=>{s.value<p&&h(y)}),{pageCount:s,pagesInRange:m,hasPrev:l,hasNext:a,listClasses:g,firstData:d,current:i,changePage:h,getPage:u,prevJumpPage:r,nextJumpPage:c}}},Ok={class:"pagination"},Hk={key:0,class:"pagination-info"},Fk={key:0,class:"pagination-ellipsis"},zk=["onClick"];function Ak(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",Ok,[n.showPageInfo?(o.openBlock(),o.createElementBlock("small",Hk,[n.perPage===1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.firstData)+" / "+o.toDisplayString(n.total),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(i.firstData)+" - "+o.toDisplayString(Math.min(i.current*n.perPage,n.total))+" / "+o.toDisplayString(n.total),1)],64))])):o.createCommentVNode("",!0),o.createElementVNode("ul",{class:"pagination-list",style:o.normalizeStyle(i.listClasses)},[t.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.prevJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.current-1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.pagesInRange,(c,d)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:d},[c.number===-1?(o.openBlock(),o.createElementBlock("li",Fk,[...e[0]||(e[0]=[o.createElementVNode("span",null,"…",-1)])])):(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[o.createVNode(r,{page:c},null,8,["page"])],10,zk))],64))),128)),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-next",disabled:!i.hasNext,page:i.getPage(i.current+1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),t.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasNext,page:i.getPage(i.nextJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0)],4)])}const wi=ce(Yk,[["render",Ak]]);wi.install=t=>{t.component(wi.name,wi)};const Kk="3.14.0",_k=[Gn,Zn,fn,Xn,mn,pn,Nn,Pn,Dn,Yn,On,zn,qn,Cn,ni,ii,si,oi,li,ai,ri,ci,di,hi,fi,xi,Si,Ci,rs,ds,hs,ki,wi],Uk={version:Kk,install:t=>{t&&_k.forEach(e=>{t.use(e)})}};le.EvButton=fn,le.EvButtonGroup=Xn,le.EvCalendar=ni,le.EvChart=xi,le.EvChartBrush=Ci,le.EvChartGroup=Si,le.EvCheckbox=mn,le.EvCheckboxGroup=pn,le.EvContextMenu=oi,le.EvDatePicker=ii,le.EvGrid=fi,le.EvIcon=Cn,le.EvInputNumber=zn,le.EvLoading=ai,le.EvMenu=ci,le.EvMessage=rs,le.EvMessageBox=hs,le.EvNotification=ds,le.EvPagination=wi,le.EvProgress=ri,le.EvRadio=Nn,le.EvRadioGroup=Pn,le.EvScheduler=si,le.EvSelect=Dn,le.EvSlider=qn,le.EvTabPanel=Zn,le.EvTabs=Gn,le.EvTextField=On,le.EvTimePicker=hi,le.EvToggle=Yn,le.EvTree=di,le.EvTreeGrid=ki,le.EvWindow=li,le.default=Uk,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|