evui 3.19.1 → 3.20.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.
@@ -1,8 +1,8 @@
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 kc(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 nl=()=>{},wc=/^on[^a-z]/,Ic=t=>wc.test(t),lt=Object.assign,Lc=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Tc=Object.prototype.hasOwnProperty,Li=(t,e)=>Tc.call(t,e),Se=Array.isArray,an=t=>Mi(t)==="[object Map]",Mc=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",vc=t=>(Ae(t)||Be(t))&&Be(t.then)&&Be(t.catch),Rc=Object.prototype.toString,Mi=t=>Rc.call(t),il=t=>Mi(t).slice(8,-1),Vc=t=>Mi(t)==="[object Object]",vs=t=>pt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ec=(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),Wc=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})};let sl;const Rs=()=>sl||(sl=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)?Nc(i):Vs(i);if(s)for(const l in s)e[l]=s[l]}return e}if(pt(t)||Ae(t))return t}const Gc=/;(?![^(]*\))/g,Zc=/:([^]+)/,Xc=/\/\*[^]*?\*\//g;function Nc(t){const e={};return t.replace(Xc,"").split(Gc).forEach(n=>{if(n){const i=n.split(Zc);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 ol(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let ll;const Ws=t=>{const e=new Set(t);return e.w=0,e.n=0,e},al=t=>(t.w&Wt)>0,rl=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 Pc{constructor(e,n=null,i){this.fn=e,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=ll){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):cl(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];al(r)&&!rl(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&&(cl(this),this.onStop&&this.onStop(),this.active=!1)}}function cl(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 dl=[];function hl(){dl.push(At),At=!1}function ul(){const t=dl.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?rl(l)||(l.n|=Wt,r=!al(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&&fl(i,e);for(const i of n)i.computed||fl(i,e)}function fl(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 Bc=kc("__proto__,__v_isRef,__isVue"),ml=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ti)),pl=Dc();function Dc(){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){hl();const i=ge(this)[e].apply(this,n);return ul(),i}}),t}function Yc(t){const e=ge(this);return $e(e,"has",t),e.hasOwnProperty(t)}class gl{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?Ll:Il:l?qc:wl).get(e))return e;const a=Se(e);if(!s){if(a&&Li(pl,n))return Reflect.get(pl,n,i);if(n==="hasOwnProperty")return Yc}const r=Reflect.get(e,n,i);return(Ti(n)?ml.has(n):Bc(n))?r:(s||$e(e,"get",n),l?r:_e(r)?a&&vs(n)?r:r.value:Ae(r)?s?Ml(r):Tl(r):r)}}class Oc extends gl{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)&&ml.has(n)||$e(e,"has",n),i}ownKeys(e){return $e(e,"iterate",Se(e)?"length":zt),Reflect.ownKeys(e)}}class bl extends gl{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&ol(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&ol(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Hc=new Oc,Fc=new bl,zc=new bl(!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 yl(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 xl(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"&&kl(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 Sl(t){const e=ge(this),{has:n,get:i}=Ri(e);let s=n.call(e,t);s?process.env.NODE_ENV!=="production"&&kl(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 Cl(){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(`${Ec(t)} operation ${n}failed: target is readonly.`,ge(this))}return t!=="delete"&&(t==="clear"?void 0:this)}}function Ac(){const t={get(s){return Vi(this,s)},get size(){return Wi(this)},has:Ei,add:yl,set:xl,delete:Sl,clear:Cl,forEach:Gi(!1,!1)},e={get(s){return Vi(this,s,!1,!0)},get size(){return Wi(this)},has:Ei,add:yl,set:xl,delete:Sl,clear:Cl,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[Kc,_c,Uc,Jc]=Ac();function Ps(t,e){const n=e?t?Jc:Uc:t?_c:Kc;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 jc={get:Ps(!1,!1)},Qc={get:Ps(!0,!1)},$c={get:Ps(!0,!0)};function kl(t,e,n){const i=ge(n);if(i!==n&&e.call(t,i)){const s=il(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 wl=new WeakMap,qc=new WeakMap,Il=new WeakMap,Ll=new WeakMap;function Tl(t){return _t(t)?t:Bs(t,!1,Hc,jc,wl)}function Ml(t){return Bs(t,!0,Fc,Qc,Il)}function Xi(t){return Bs(t,!0,zc,$c,Ll)}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}}(il(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)?Tl(t):t,Hs=t=>Ae(t)?Ml(t):t;function _e(t){return!(!t||t.__v_isRef!==!0)}const ed={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;hl();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 <${Ql(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 kc(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 nl=()=>{},wc=/^on[^a-z]/,Ic=t=>wc.test(t),lt=Object.assign,Lc=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Tc=Object.prototype.hasOwnProperty,Li=(t,e)=>Tc.call(t,e),Se=Array.isArray,an=t=>Mi(t)==="[object Map]",Mc=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",vc=t=>(Ae(t)||Be(t))&&Be(t.then)&&Be(t.catch),Rc=Object.prototype.toString,Mi=t=>Rc.call(t),il=t=>Mi(t).slice(8,-1),Vc=t=>Mi(t)==="[object Object]",vs=t=>pt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ec=(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),Wc=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})};let sl;const Rs=()=>sl||(sl=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)?Nc(i):Vs(i);if(s)for(const l in s)e[l]=s[l]}return e}if(pt(t)||Ae(t))return t}const Gc=/;(?![^(]*\))/g,Zc=/:([^]+)/,Xc=/\/\*[^]*?\*\//g;function Nc(t){const e={};return t.replace(Xc,"").split(Gc).forEach(n=>{if(n){const i=n.split(Zc);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 ol(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let ll;const Ws=t=>{const e=new Set(t);return e.w=0,e.n=0,e},al=t=>(t.w&Wt)>0,rl=t=>(t.n&Wt)>0,Gs=new WeakMap;let Tn=0,Wt=1;const Zs=30;let Ke;const Ft=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Xs=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class Pc{constructor(e,n=null,i){this.fn=e,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=ll){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):cl(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];al(r)&&!rl(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&&(cl(this),this.onStop&&this.onStop(),this.active=!1)}}function cl(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 dl=[];function hl(){dl.push(At),At=!1}function ul(){const t=dl.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?rl(l)||(l.n|=Wt,r=!al(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(Ft)),an(t)&&r.push(a.get(Xs)));break;case"delete":Se(t)||(r.push(a.get(Ft)),an(t)&&r.push(a.get(Xs)));break;case"set":an(t)&&r.push(a.get(Ft))}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&&fl(i,e);for(const i of n)i.computed||fl(i,e)}function fl(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 Bc=kc("__proto__,__v_isRef,__isVue"),ml=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ti)),pl=Dc();function Dc(){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){hl();const i=ge(this)[e].apply(this,n);return ul(),i}}),t}function Oc(t){const e=ge(this);return $e(e,"has",t),e.hasOwnProperty(t)}class gl{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?Ll:Il:l?qc:wl).get(e))return e;const a=Se(e);if(!s){if(a&&Li(pl,n))return Reflect.get(pl,n,i);if(n==="hasOwnProperty")return Oc}const r=Reflect.get(e,n,i);return(Ti(n)?ml.has(n):Bc(n))?r:(s||$e(e,"get",n),l?r:_e(r)?a&&vs(n)?r:r.value:Ae(r)?s?Ml(r):Tl(r):r)}}class Yc extends gl{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)&&ml.has(n)||$e(e,"has",n),i}ownKeys(e){return $e(e,"iterate",Se(e)?"length":Ft),Reflect.ownKeys(e)}}class bl extends gl{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&ol(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&ol(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const zc=new Yc,Hc=new bl,Fc=new bl(!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?zs:Ys;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",Ft),Reflect.get(t,"size",t)}function yl(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 xl(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"&&kl(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 Sl(t){const e=ge(this),{has:n,get:i}=Ri(e);let s=n.call(e,t);s?process.env.NODE_ENV!=="production"&&kl(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 Cl(){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?zs:Ys;return!t&&$e(a,"iterate",Ft),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?zs:Ys;return!e&&$e(l,"iterate",c?Xs:Ft),{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(`${Ec(t)} operation ${n}failed: target is readonly.`,ge(this))}return t!=="delete"&&(t==="clear"?void 0:this)}}function Ac(){const t={get(s){return Vi(this,s)},get size(){return Wi(this)},has:Ei,add:yl,set:xl,delete:Sl,clear:Cl,forEach:Gi(!1,!1)},e={get(s){return Vi(this,s,!1,!0)},get size(){return Wi(this)},has:Ei,add:yl,set:xl,delete:Sl,clear:Cl,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[Kc,_c,Uc,Jc]=Ac();function Ps(t,e){const n=e?t?Jc:Uc:t?_c:Kc;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 jc={get:Ps(!1,!1)},Qc={get:Ps(!0,!1)},$c={get:Ps(!0,!0)};function kl(t,e,n){const i=ge(n);if(i!==n&&e.call(t,i)){const s=il(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 wl=new WeakMap,qc=new WeakMap,Il=new WeakMap,Ll=new WeakMap;function Tl(t){return _t(t)?t:Bs(t,!1,zc,jc,wl)}function Ml(t){return Bs(t,!0,Hc,Qc,Il)}function Xi(t){return Bs(t,!0,Fc,$c,Ll)}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}}(il(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 Os(t){return Kt(t)||_t(t)}function ge(t){const e=t&&t.__v_raw;return e?ge(e):t}const Ys=t=>Ae(t)?Tl(t):t,zs=t=>Ae(t)?Ml(t):t;function _e(t){return!(!t||t.__v_isRef!==!0)}const ed={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;hl();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 <${Ql(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 <${Ql(h.component,h.type,m)}`,p=">"+f;return h.props?[g,...td(h.props),p]:[g+p]}(c))}),r}(s)),console.warn(...l)}ul()}function td(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(i=>{e.push(...vl(i,t[i]))}),n.length>3&&e.push(" ..."),e}function vl(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=vl(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 Rl={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){Vl(l,e,n)}return s}function Fs(t,e,n,i){if(Be(t)){const l=Jt(t,e,n,i);return l&&vc(l)&&l.catch(a=>{Vl(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 Vl(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"?Rl[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=Rl[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 El=Promise.resolve();let As=null;const nd=100;function Wl(t){const e=As||El;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),Gl())}function Gl(){Ni||zs||(zs=!0,As=El.then(Xl))}function Zl(t){Se(t)?cn.push(...t):bt&&bt.includes(t,t.allowRecurse?Nt+1:Nt)||cn.push(t),Gl()}const Mn=t=>t.id==null?1/0:t.id,id=(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 Xl(t){zs=!1,Ni=!0,process.env.NODE_ENV!=="production"&&(t=t||new Map),at.sort(id);const e=process.env.NODE_ENV!=="production"?n=>Nl(t,n):nl;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"&&Nl(n,bt[Nt])||bt[Nt]();bt=null,Nt=0}}(t),Ni=!1,As=null,(at.length||cn.length)&&Xl(t)}}function Nl(t,e){if(t.has(e)){const n=t.get(e);if(n>nd){const i=e.ownerInstance,s=i&&jl(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),Pl(n.initialDef,e);const i=[...n.instances];for(const s of i){const l=Rn(s.type);vn.has(l)||(l!==n.initialDef&&Pl(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.")}Zl(()=>{for(const s of i)vn.delete(Rn(s.type))})})});const Pi=new Map;function Rn(t){return $l(t)?t.__vccOpts:t}function Pl(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,sd=null;const od=Symbol.for("v-ndc"),Bi={};function ld(t,e,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Ms){var r;process.env.NODE_ENV==="production"||e||(n!==void 0&&gt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&gt('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=ll===((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=nl,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=()=>Hl(y,d&&d.suspense):(y.pre=!0,d&&(y.id=d.uid),C=()=>Ks(y));const b=new Pc(h,C);return process.env.NODE_ENV!=="production"&&(b.onTrack=l,b.onTrigger=a),e?n?y():p=b.run():s==="post"?Hl(b.run.bind(b),d&&d.suspense):b.run(),()=>{b.stop(),d&&d.scope&&Lc(d.scope.effects,b)}}function ad(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=ld(s,l.bind(i),n);return a?Jl(a):fd(),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(Mc(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,Wc(i,"__v_skip",!0),Kt(n=i)?n:new Proxy(n,ed)),{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=Wl.bind(t.proxy)),$watch:t=>ad.bind(t)});function Bl(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"&&gt('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=rd[a]||n&&n[a];t[a]=r?r(t[a],e[a]):e[a]}return t}const rd={data:Dl,props:Ol,emits:Ol,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:Dl,inject:function(t,e){return En(Yl(t),Yl(e))}};function Dl(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 Yl(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 Ol(t,e){return t?Se(t)&&Se(e)?[...new Set([...t,...e])]:lt(Object.create(null),Bl(t),Bl(e??{})):e}const Hl=function(t,e){e&&e.pendingBranch?Se(t)?e.effects.push(...t):e.effects.push(t):Zl(t)},Fl=Symbol.for("v-fgt"),cd=Symbol.for("v-txt"),dd=Symbol.for("v-cmt"),zl="__vInternal",Al=({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),hd=process.env.NODE_ENV!=="production"?(...t)=>Kl(...t):Kl;function Kl(t,e=null,n=null,i=0,s=null,l=!1){if(t&&t!==od||(process.env.NODE_ENV==="production"||t||gt(`Invalid vnode type when creating vnode: ${t}.`),t=dd),(a=t)&&a.__v_isVNode===!0){const c=Oi(t,e,!0);return n&&js(c,n),c.patchFlag|=-2,c}var a;if($l(t)&&(t=t.__vccOpts),e){e=function(h){return h?Ys(h)||zl 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)&&gt("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===Fl?0:1,g=!1,p=!1){const y={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Al(d),ref:d&&Yi(d),scopeId:sd,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&&gt("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(Ic(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&&Al(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(_l):a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Fl?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 _l(t){const e=Oi(t);return Se(t.children)&&(e.children=t.children.map(_l)),e}function ud(t=" ",e=0){return hd(cd,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||zl in e||(e._ctx=Vn)}}else Be(e)?(e={default:e,_ctx:Vn},n=32):(e=String(e),64&i?(n=16,e=[ud(e)]):n=8);t.children=e,t.shapeFlag|=n}let Qs,hn,un=null,Ul="__VUE_INSTANCE_SETTERS__";(hn=Rs()[Ul])||(hn=Rs()[Ul]=[]),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()},fd=()=>{un&&un.scope.off(),Qs(null)},md=/(?:^|[-_])(\w)/g,pd=t=>t.replace(md,e=>e.toUpperCase()).replace(/[-_]/g,"");function jl(t,e=!0){return Be(t)?t.displayName||t.name:t.name||e&&t.__name}function Ql(t,e,n=!1){let i=jl(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?pd(i):n?"App":"Anonymous"}function $l(t){return Be(t)&&"__vccOpts"in t}function $s(t){return!(!t||!t.__v_isShallow)}function ql(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 ea(t,e){if(t===e)return!0;if(typeof t=="object"){for(var n in t)if(!ea(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 gd=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,ql([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,ql([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 gd(t,n))},updated:function(t,e){var n=e.value;if(!ea(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},bd={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=()=>{if(!h.value||!d.value||!c.value)return;const x=a.value.findIndex(D=>D.value===s.value);if(x<0)return;const I=d.value.children[x];if(!I)return;const L=c.value.offsetWidth,v=d.value.offsetWidth,W=L-v,E=I.offsetLeft,G=E+I.offsetWidth,V=-u.x,X=V+L,Z=a.value.length-1;let N=u.x;E<V?N=x===0?0:-E:G>X&&(N=x===Z?W:L-G),u.x=Math.min(0,Math.max(W,N))},g=()=>{const x=c.value.offsetWidth,I=d.value.offsetWidth;if(h.value=x<I,h.value){const L=x-I;L>u.x&&(u.x=L),o.nextTick(m)}else u.x=0};o.watch(s,()=>{o.nextTick(m)}),o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let x,I;r.length>l.value.length?(x=r,I=l.value.map(v=>v.value)):(x=l.value.map(v=>v.value),I=r);const L=x.filter(v=>!I.includes(v))[0];if(s.value===L){const v=r.findIndex(W=>W===L);v===0?s.value=l.value[0].value:s.value=l.value[v-1].value}}});const p=x=>{s.value=x},y=x=>{if(l.value.length<2)return;const I=l.value.findIndex(L=>L.value===x);if(I<0){s.value=l.value[0].value;return}x===s.value&&(I===0?s.value=l.value[1].value:s.value=l.value[I-1].value),l.value.splice(I,1),o.nextTick(()=>{r.splice(I,1)}),o.triggerRef(l)},C=(x,I=100)=>{const L=c.value.offsetWidth,v=d.value.offsetWidth,W=L-v;x==="next"&&u.x!==W?W>=u.x-I?u.x=W:u.x-=I:x==="prev"&&u.x!==0&&(I*-1<=u.x?u.x=0:u.x+=I)},b=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:p,removeTab:y,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:C,dragstartTab:(x,I)=>{t.draggable&&(i.value=[...l.value],b.item=x,b.idx=I,n.value=!0)},dragoverTab:x=>{var v;if(!t.draggable||((v=b.item)==null?void 0:v.value)===x)return;const I=i.value.findIndex(W=>{var E;return W.value===((E=b.item)==null?void 0:E.value)}),L=i.value.findIndex(W=>W.value===x);i.value.splice(I,1),i.value.splice(L,0,b.item)},dragendTab:()=>{t.draggable&&(l.value=[...i.value],b.item={},b.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:x=>{var I;return t.draggable&&((I=b.item)==null?void 0:I.value)===x},selectIdxCls:x=>t.draggable&&b.idx===x,onResize:()=>{g()}}}},yd={class:"ev-tabs-header"},xd={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},Sd=["onClick","onDragstart","onDragover"],Cd=["title"],kd=["onClick"],wd={class:"ev-tabs-body"};function Id(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",yd,[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",xd,[o.withDirectives((o.openBlock(),o.createElementBlock("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,Cd),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,kd)):o.createCommentVNode("",!0)],16,Sd))),128))],4)),[[a,i.onResize]])],512)],2)]),o.createElementVNode("div",wd,[o.renderSlot(t.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Gn=ce(bd,[["render",Id]]);Gn.install=t=>{t.component(Gn.name,Gn)};const Ld={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}}},Td={key:0,class:"ev-tab-panel"};function Md(t,e,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",Td,[o.renderSlot(t.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const Zn=ce(Ld,[["render",Md]]);Zn.install=t=>{t.component(Zn.name,Zn)};const vd={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}}},Rd=["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,Rd)}const fn=ce(vd,[["render",Vd]]);fn.install=t=>{t.component(fn.name,fn)};const Ed={name:"EvButtonGroup"},Wd={class:"ev-button-group"};function Gd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Wd,[o.renderSlot(t.$slots,"default")])}const Xn=ce(Ed,[["render",Gd]]);Xn.install=t=>{t.component(Xn.name,Xn)};const Zd={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}}},Xd=["disabled","value","readonly"],Nd={ref:"checkboxLabel",class:"ev-checkbox-label"};function Pd(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,Xd),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",Nd,[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(Zd,[["render",Pd]]);mn.install=t=>{t.component(mn.name,mn)};const Bd={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 Dd(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(Bd,[["render",Dd]]);pn.install=t=>{t.component(pn.name,pn)};const Yd={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}}},Od=["value","disabled"],Hd={class:"ev-radio-label"};function Fd(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,Od),[[o.vModelRadio,i.mv]]),o.createElementVNode("span",Hd,[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(Yd,[["render",Fd]]);Nn.install=t=>{t.component(Nn.name,Nn)};const zd={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 Ad(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(zd,[["render",Ad]]);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}},Kd={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}},_d={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={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},ta=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],na=[["ㄱ","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 ia(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 Ud(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=ia(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]&&ta.indexOf(d)===-1?Bt[d]:d,Bt[h]&&ta.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))},{}),sa=function(t){return typeof t<"u"};function Jd(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 jd(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(sa).forEach(function(p){return s.push([p])}),s.push([f,c,m].filter(Boolean)),g.filter(sa).forEach(function(p){return s.push([p])})}}),s.map(Jd).join("")}var Qd=Object.values(na).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[s]=i,n))},{});function oa(t){return jd(t.split("").map(function(e){return Qd[e]||e}).join(""))}var la=/[\\^$.*+?()[\]{}|]/g,$d=RegExp(la.source);function to(t){return t&&$d.test(t)?t.replace(la,"\\$&"):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},aa="__".concat(parseInt("fuzzy",36),"__"),ra="__".concat(parseInt("ignorespace",36),"__"),qd=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 R=n,S=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var x=oa(n.trim());x.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(R=x,S.push(to(n.trim())))}var I=R.split(""),L=I.slice(-1)[0],v="",W=ia(L||"");if(W.initialOffset!==-1){I=I.slice(0,-1);var E=W.initial,G=W.medial,V=W.finale,X=W.initialOffset,Z=W.medialOffset,N=X*Oe.length*We.length+Fi,D=[];switch(!0){case V!=="":{D.push(L),Bn.includes(V)&&D.push("".concat(String.fromCharCode(N+Z*We.length)).concat(zi(V))),Bt[V]&&D.push("".concat(String.fromCharCode(N+Z*We.length+We.join("").search(Bt[V][0])+1)).concat(zi(Bt[V][1])));break}case G!=="":{var Y=void 0,H=void 0;eo[G]?(Y=N+Oe.join("").search(eo[G][0])*We.length,H=N+Oe.join("").search(eo[G][1])*We.length+We.length-1):(Y=N+Z*We.length,H=Y+We.length-1),D.push("[".concat(String.fromCharCode(Y),"-").concat(String.fromCharCode(H),"]"));break}case E!=="":{D.push(zi(E,!0));break}}v=D.length>1?T?"(?:".concat(D.join("|"),")"):"(".concat(D.join("|"),")"):D[0]}var B=b?aa:f?ra:"",O=a?I.map(function(Q){return Q.search(/[ㄱ-ㅎ]/)!==-1?zi(Q,!0):to(Q)}).join(B):to(I.join(B)),P=O.trim()!==""&&v.trim()!=="",F=P?"".concat(O).concat(B).concat(v):"".concat(O).concat(v),K=(c?"^":"")+F+(h?"$":"");return B&&(K=K.replace(RegExp(aa,"g"),".*").replace(RegExp(ra,"g"),"\\s*")),S.length>0&&(K=gn(gn([],S,!0),[K],!1).map(function(Q){return"(".concat(Q,")")}).join("|")),e=RegExp(K,(y?"g":"")+(g?"i":"")),e}}(),eh=Object.values(na).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[i]=s,n))},{});function th(t){return t.split("").map(function(e){return Ud(e,{grouped:!1}).map(function(n){return eh[n]||n})}).flat().join("")}const ca=new Set,da=(t,...e)=>{ca.has(t)||(ca.add(t),console.warn(...e))},nh=(t,e="Component")=>{if(!t)return"body";const n=`${e}::${t}`;try{const i=document.querySelector(t);return i||(da(n,`[${e}] teleport selector "${t}" did not match any element. Falling back to document.body.`),document.body)}catch(i){return da(n,`[${e}] teleport selector "${t}" is invalid. Falling back to document.body.`,i),document.body}},ih=()=>{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}},sh=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,left:"auto"}),m=o.ref(!1),g=o.ref("body"),p=(B,O)=>B?[B,oa(B),th(B)].filter(Boolean).map(P=>qd(P,O)):[],y=o.computed(()=>{var P;const B=(P=l.value)==null?void 0:P.trim();if(!B||!e.filterable)return e.items;const O=p(B);return e.items.filter(({name:F})=>O.some(K=>F.search(K)>-1))}),C=o.computed(()=>{var B,O;return!!((B=e.highlight)!=null&&B.match)&&e.filterable&&!!((O=l.value)!=null&&O.trim())}),b=o.computed(()=>{var B;return p((B=l.value)==null?void 0:B.trim(),{global:!0})}),k=B=>{const O=[{text:B,matched:!1}];if(typeof B!="string"||!B)return O;const P=[];if(b.value.forEach(U=>{U.lastIndex=0;let j=U.exec(B);for(;j;)j[0].length?P.push([j.index,j.index+j[0].length]):U.lastIndex+=1,j=U.exec(B)}),!P.length)return O;P.sort((U,j)=>U[0]-j[0]);const F=[P[0]];P.slice(1).forEach(([U,j])=>{const J=F[F.length-1];U<=J[1]?J[1]=Math.max(J[1],j):F.push([U,j])});const K=[];let Q=0;return F.forEach(([U,j])=>{U>Q&&K.push({text:B.slice(Q,U),matched:!1}),K.push({text:B.slice(U,j),matched:!0}),Q=j}),Q<B.length&&K.push({text:B.slice(Q),matched:!1}),K},T=o.computed(()=>C.value?y.value.map(({name:B})=>k(B)):[]),w=o.computed(()=>{var B;return(B=e.highlight)!=null&&B.color?{color:e.highlight.color}:null}),M=B=>{var O;l.value=(O=B==null?void 0:B.target)==null?void 0:O.value},R=B=>{let O=B==null?void 0:B.parentElement;for(;O&&O!==document.documentElement;){const P=window.getComputedStyle(O);if(/(auto|scroll|overlay|hidden|clip)/.test(P.overflowY))return O;O=O.parentElement}return document.documentElement},S=async({recomputeDirection:B=!1}={})=>{if(await o.nextTick(),!r.value||!c.value)return;const O=r.value.getBoundingClientRect(),P=O.height,F=O.y,K=c.value.getBoundingClientRect().height;if(e.teleport){const Q=document.documentElement.clientHeight;if(B){const U=O.top,j=Q-O.bottom,J=K>j;m.value=J&&U>j&&U>=K}f.top=m.value?`${O.top-K}px`:`${O.bottom}px`,f.left=`${O.left}px`;return}if(B){const Q=R(r.value),U=Q===document.documentElement,j=Q.getBoundingClientRect(),J=document.documentElement.clientHeight,ne=U?J:Math.min(j.bottom,J),q=U?0:Math.max(j.top,0),ee=F-q,$=ne-(F+P),de=K>$;m.value=de&&ee>$&&ee>=K}m.value?f.top=`-${K}px`:f.top=`${P}px`,f.left="auto"},x=()=>{var K,Q,U;if(!((U=(Q=(K=d.value)==null?void 0:K.children[0])==null?void 0:Q.children)!=null&&U.length))return;const B="selected",O=d.value.children[0].children,P=d.value.offsetTop;let F=null;for(let j=0;j<O.length;j++)if(F=O[j],F.classList.contains(B)){if(!F.offsetTop)return;d.value.scrollTop=F.offsetTop-P;break}},I=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth),e.teleport||(h.value=`${u.value}px`,await o.nextTick());const B=d.value.querySelectorAll(".ev-select-dropbox-item");let O=0;B.forEach(ee=>{const $=ee.scrollWidth;$>O&&(O=$)});const{borderLeftWidth:P,borderRightWidth:F}=window.getComputedStyle(c.value),K=parseInt(P)+parseInt(F),Q=d.value.offsetWidth-d.value.clientWidth;O+=Q+K;const U=window.innerWidth,J=c.value.getBoundingClientRect().left,ne=U-J-20,q=Math.max(Math.min(O,ne),u.value);h.value=`${q}px`}else h.value="100%"};o.watch(()=>s.value,async B=>{B&&(await x(),await I())}),o.watch(()=>y.value,async()=>{await S()});const L=async()=>{if(e.items.length&&!e.disabled&&(s.value=!s.value,s.value)){if(e.teleport&&(g.value=nh(e.teleport,"EvSelect"),r.value)){const B=r.value.getBoundingClientRect();h.value=`${B.width}px`,f.top=`${B.bottom}px`,f.left=`${B.left}px`}await S({recomputeDirection:!0})}},v=()=>{e.filterable&&(l.value=""),s.value=!1},W=o.ref(!1),E=B=>{B||(W.value=!W.value),W.value?n.value=y.value.filter(O=>!O.disabled).map(O=>O.value):n.value=[]},G=B=>{e.filterable&&(l.value=""),s.value=!1,n.value!==B&&(n.value=B,i())},V=B=>{if(e.filterable&&(l.value=""),!n.value.includes(B))n.value.push(B);else{const O=n.value.indexOf(B);n.value.splice(O,1)}W.value=n.value.length===y.value.filter(O=>!O.disabled).length,n.value=[...n.value],i()},X=e.multiple?V:G,Z=B=>B===n.value,N=B=>n.value.includes(B),D=e.multiple?N:Z;o.watch(()=>n.value,B=>{e.multiple&&e.checkable&&(B.length===0?W.value=!1:W.value=B.length===y.value.filter(O=>!O.disabled).length,S())});const Y=()=>{if(s.value){if(e.teleport){v();return}I(),S({recomputeDirection:!0})}},H=B=>{var F,K;if(!s.value)return;const O=B.target;O instanceof Element&&((F=c.value)!=null&&F.contains(O)||(K=a.value)!=null&&K.contains(O))||v()};return o.onMounted(()=>{window.addEventListener("resize",Y)}),o.onUnmounted(()=>{window.removeEventListener("resize",Y)}),o.watch(()=>!!e.teleport&&s.value,(B,O,P)=>{B&&(window.addEventListener("scroll",H,{capture:!0,passive:!0}),P(()=>{window.removeEventListener("scroll",H,{capture:!0})}))}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:y,isHighlightMatch:C,itemChunks:T,highlightStyle:w,clickSelectInput:L,clickOutsideDropbox:v,changeFilterText:M,changeDropboxPosition:S,clickItem:X,selectedItemClass:D,allCheck:W,changeAllCheck:E,dropboxWidth:h,teleportTarget:g}},oh={name:"EvSelect",components:{EvCheckbox:mn,EvCheckboxGroup:pn},directives:{clickoutside:Kd},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"},teleport:{type:String,default:""},tagMaxRows:{type:Number,default:0,validator:t=>Number.isInteger(t)&&t>=0},highlight:{type:Object,default:()=>({}),validator:t=>(t.match===void 0||typeof t.match=="boolean")&&(t.color===void 0||typeof t.color=="string")&&Object.keys(t).every(e=>["match","color"].includes(e))}},emits:{"update:modelValue":null,change:null},setup(t){const e=o.computed(()=>t.tagMaxRows>0),{mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c}=ih(),{select:d,selectWrapper:h,dropbox:u,itemWrapper:f,isDropbox:m,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:T,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:R,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:L,dropboxWidth:v,teleportTarget:W}=sh({mv:n,changeMv:a});return{hasMaxRows:e,mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c,select:d,selectWrapper:h,dropbox:u,itemWrapper:f,isDropbox:m,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:T,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:R,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:L,dropboxWidth:v,teleportTarget:W}}},lh={ref:"selectWrapper",class:"ev-select__wrapper"},ah=["placeholder","disabled"],rh=["tabindex","placeholder","disabled"],ch={class:"ev-tag-name"},dh=["onClick"],hh={class:"ev-tag-name"},uh={class:"ev-tag-name"},fh={class:"ev-select-dropbox-wrapper"},mh=["placeholder","value"],ph={ref:"itemWrapper",class:"ev-select-dropbox-list"},gh={key:0,class:"ev-select-dropbox-ul"},bh=["title","onClick"],yh={key:1},xh={class:"ev-select-dropbox-item disabled"},Sh={key:0,class:"ev-select-dropbox-ul"},Ch=["title","onClick"],kh={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},wh={key:0,class:"ev-select-dropbox-ul"},Ih=["title","onClick"],Lh={key:1},Th={class:"ev-select-dropbox-item disabled"};function Mh(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",lh,[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-select-tag-wrapper",{"has-max-rows":i.hasMaxRows}]),style:o.normalizeStyle(i.hasMaxRows?{"--ev-select-tag-max-rows":n.tagMaxRows}:null),onClick:e[9]||(e[9]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:e[3]||(e[3]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},[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:"",tabindex:i.hasMaxRows?-1:null,placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:e[4]||(e[4]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},null,8,rh),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-select-tag",onClick:e[7]||(e[7]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",hh,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:e[6]||(e[6]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...e[17]||(e[17]=[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",{key:1,class:"ev-select-tag num",onClick:e[8]||(e[8]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",uh," + "+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",onClick:e[5]||(e[5]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",ch,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...e[16]||(e[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,dh)]))),128))],6)):(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,ah),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:e[10]||(e[10]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...e[18]||(e[18]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",fh,[(o.openBlock(),o.createBlock(o.Teleport,{to:i.teleportTarget,disabled:!n.teleport},[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-select-dropbox",{teleported:!!n.teleport}]),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[11]||(e[11]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,mh)]):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[14]||(e[14]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":e[12]||(e[12]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:e[13]||(e[13]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",ph,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":e[15]||(e[15]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",gh,[(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),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["label","disabled"])],10,bh))),128))])):(o.openBlock(),o.createElementBlock("ul",yh,[o.createElementVNode("li",xh,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",Sh,[(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),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["model-value","disabled"])],10,Ch))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",kh,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",wh,[(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),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))],10,Ih))),128))])):(o.openBlock(),o.createElementBlock("ul",Lh,[o.createElementVNode("li",Th,o.toDisplayString(n.noMatchingText),1)]))],512))],6)):o.createCommentVNode("",!0)],8,["to","disabled"]))])],512)],2)),[[c,i.clickOutsideDropbox]])}const Dn=ce(oh,[["render",Mh]]);Dn.install=t=>{t.component(Dn.name,Dn)};const vh={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 Rh(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(vh,[["render",Rh]]);Yn.install=t=>{t.component(Yn.name,Yn)};const Vh={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}}},Eh={class:"ev-text-field-wrapper"},Wh=["placeholder","disabled","readonly","autocomplete","maxlength"],Gh=["type","placeholder","disabled","readonly","autocomplete","maxlength"],Zh={key:3,class:"ev-text-field-icon icon-suffix"},Xh={key:4,class:"ev-text-field-icon icon-prefix"},Nh={key:0,class:"ev-text-field-error"},Ph={class:"curr-length"};function Bh(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",Eh,[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,Wh)),[[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,Gh),[[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",Zh,[o.renderSlot(t.$slots,"icon-suffix")])):o.createCommentVNode("",!0),t.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",Xh,[o.renderSlot(t.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",Nh,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",Ph,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(Vh,[["render",Bh]]);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 ha(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 Dh(t){return yt(t)?1e6*t:0}function Yh(t){return yt(t)?1e9*t:0}function Oh(t){return yt(t)?1e12*t:0}function Hh(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 no(t){return t==null}function Fh(){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 zh(){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 Ah(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 Kh(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 _h={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}=zh(),{stepValue:l}=Ah({currentValue:t,validateValue:e});return Kh({currentValue:t,validateValue:e}),{currentValue:t,validateValue:e,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},Uh={class:"ev-input-number__wrapper"},Jh=["onClick"],jh=["placeholder","disabled","readonly"];function Qh(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",Uh,[(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,Jh)),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(_h,[["render",Qh]]);zn.install=t=>{t.component(zn.name,zn)};var ua=typeof global=="object"&&global&&global.Object===Object&&global,$h=typeof self=="object"&&self&&self.Object===Object&&self,rt=ua||$h||Function("return this")(),xt=rt.Symbol,fa=Object.prototype,qh=fa.hasOwnProperty,eu=fa.toString,An=xt?xt.toStringTag:void 0;function tu(t){var e=qh.call(t,An),n=t[An];try{t[An]=void 0;var i=!0}catch{}var s=eu.call(t);return i&&(e?t[An]=n:delete t[An]),s}var nu=Object.prototype,iu=nu.toString;function su(t){return iu.call(t)}var ou="[object Null]",lu="[object Undefined]",ma=xt?xt.toStringTag:void 0;function Dt(t){return t==null?t===void 0?lu:ou:ma&&ma in Object(t)?tu(t):su(t)}function ct(t){return t!=null&&typeof t=="object"}var au="[object Symbol]";function Ai(t){return typeof t=="symbol"||ct(t)&&Dt(t)==au}function ru(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,pa=xt?xt.prototype:void 0,ga=pa?pa.toString:void 0;function ba(t){if(typeof t=="string")return t;if(qe(t))return ru(t,ba)+"";if(Ai(t))return ga?ga.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var cu=/\s/;function du(t){for(var e=t.length;e--&&cu.test(t.charAt(e)););return e}var hu=/^\s+/;function uu(t){return t&&t.slice(0,du(t)+1).replace(hu,"")}function He(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ya=NaN,fu=/^[-+]0x[0-9a-f]+$/i,mu=/^0b[01]+$/i,pu=/^0o[0-7]+$/i,gu=parseInt;function Ki(t){if(typeof t=="number")return t;if(Ai(t))return ya;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=uu(t);var n=mu.test(t);return n||pu.test(t)?gu(t.slice(2),n?2:8):fu.test(t)?ya:+t}var xa=1/0,bu=17976931348623157e292;function Sa(t){if(!t)return t===0?t:0;if(t=Ki(t),t===xa||t===-xa){var e=t<0?-1:1;return e*bu}return t===t?t:0}function io(t){return t}var yu="[object AsyncFunction]",xu="[object Function]",Su="[object GeneratorFunction]",Cu="[object Proxy]";function Kn(t){if(!He(t))return!1;var e=Dt(t);return e==xu||e==Su||e==yu||e==Cu}var so=rt["__core-js_shared__"],Ca=function(){var t=/[^.]+$/.exec(so&&so.keys&&so.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ku(t){return!!Ca&&Ca in t}var wu=Function.prototype,Iu=wu.toString;function qt(t){if(t!=null){try{return Iu.call(t)}catch{}try{return t+""}catch{}}return""}var Lu=/[\\^$.*+?()[\]{}|]/g,Tu=/^\[object .+?Constructor\]$/,Mu=Function.prototype,vu=Object.prototype,Ru=Mu.toString,Vu=vu.hasOwnProperty,Eu=RegExp("^"+Ru.call(Vu).replace(Lu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wu(t){if(!He(t)||ku(t))return!1;var e=Kn(t)?Eu:Tu;return e.test(qt(t))}function Gu(t,e){return t==null?void 0:t[e]}function en(t,e){var n=Gu(t,e);return Wu(n)?n:void 0}var oo=en(rt,"WeakMap"),ka=Object.create,Zu=function(){function t(){}return function(e){if(!He(e))return{};if(ka)return ka(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function wa(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 Xu(){}function Nu(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var Pu=800,Bu=16,Du=Date.now;function Yu(t){var e=0,n=0;return function(){var i=Du(),s=Bu-(i-n);if(n=i,s>0){if(++e>=Pu)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ou(t){return function(){return t}}var _i=function(){try{var t=en(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Hu=_i?function(t,e){return _i(t,"toString",{configurable:!0,enumerable:!1,value:Ou(e),writable:!0})}:io,Fu=Yu(Hu);function zu(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}function Au(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 Ku(t){return t!==t}function _u(t,e,n){for(var i=n-1,s=t.length;++i<s;)if(t[i]===e)return i;return-1}function Uu(t,e,n){return e===e?_u(t,e,n):Au(t,Ku,n)}function Ju(t,e){var n=t==null?0:t.length;return!!n&&Uu(t,e,0)>-1}var ju=9007199254740991,Qu=/^(?:0|[1-9]\d*)$/;function lo(t,e){var n=typeof t;return e=e??ju,!!e&&(n=="number"||n!="symbol"&&Qu.test(t))&&t>-1&&t%1==0&&t<e}function ao(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 $u=Object.prototype,qu=$u.hasOwnProperty;function Ia(t,e,n){var i=t[e];(!(qu.call(t,e)&&yn(i,n))||n===void 0&&!(e in t))&&ao(t,e,n)}function ef(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?ao(n,r,c):Ia(n,r,c)}return n}var La=Math.max;function tf(t,e,n){return e=La(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,l=La(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),wa(t,this,r)}}function ro(t,e){return Fu(tf(t,e,io),t+"")}var nf=9007199254740991;function co(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=nf}function Ui(t){return t!=null&&co(t.length)&&!Kn(t)}function Ta(t,e,n){if(!He(n))return!1;var i=typeof e;return(i=="number"?Ui(n)&&lo(e,n.length):i=="string"&&e in n)?yn(n[e],t):!1}function Ma(t){return ro(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&&Ta(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 sf=Object.prototype;function ho(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||sf;return t===n}function of(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}var lf="[object Arguments]";function va(t){return ct(t)&&Dt(t)==lf}var Ra=Object.prototype,af=Ra.hasOwnProperty,rf=Ra.propertyIsEnumerable,Ji=va(function(){return arguments}())?va:function(t){return ct(t)&&af.call(t,"callee")&&!rf.call(t,"callee")};function cf(){return!1}var Va=typeof le=="object"&&le&&!le.nodeType&&le,Ea=Va&&typeof module=="object"&&module&&!module.nodeType&&module,df=Ea&&Ea.exports===Va,Wa=df?rt.Buffer:void 0,hf=Wa?Wa.isBuffer:void 0,_n=hf||cf,uf="[object Arguments]",ff="[object Array]",mf="[object Boolean]",pf="[object Date]",gf="[object Error]",bf="[object Function]",yf="[object Map]",xf="[object Number]",Sf="[object Object]",Cf="[object RegExp]",kf="[object Set]",wf="[object String]",If="[object WeakMap]",Lf="[object ArrayBuffer]",Tf="[object DataView]",Mf="[object Float32Array]",vf="[object Float64Array]",Rf="[object Int8Array]",Vf="[object Int16Array]",Ef="[object Int32Array]",Wf="[object Uint8Array]",Gf="[object Uint8ClampedArray]",Zf="[object Uint16Array]",Xf="[object Uint32Array]",Ce={};Ce[Mf]=Ce[vf]=Ce[Rf]=Ce[Vf]=Ce[Ef]=Ce[Wf]=Ce[Gf]=Ce[Zf]=Ce[Xf]=!0,Ce[uf]=Ce[ff]=Ce[Lf]=Ce[mf]=Ce[Tf]=Ce[pf]=Ce[gf]=Ce[bf]=Ce[yf]=Ce[xf]=Ce[Sf]=Ce[Cf]=Ce[kf]=Ce[wf]=Ce[If]=!1;function Nf(t){return ct(t)&&co(t.length)&&!!Ce[Dt(t)]}function uo(t){return function(e){return t(e)}}var Ga=typeof le=="object"&&le&&!le.nodeType&&le,Un=Ga&&typeof module=="object"&&module&&!module.nodeType&&module,Pf=Un&&Un.exports===Ga,fo=Pf&&ua.process,xn=function(){try{var t=Un&&Un.require&&Un.require("util").types;return t||fo&&fo.binding&&fo.binding("util")}catch{}}(),Za=xn&&xn.isTypedArray,mo=Za?uo(Za):Nf,Bf=Object.prototype,Df=Bf.hasOwnProperty;function Xa(t,e){var n=qe(t),i=!n&&Ji(t),s=!n&&!i&&_n(t),l=!n&&!i&&!s&&mo(t),a=n||i||s||l,r=a?of(t.length,String):[],c=r.length;for(var d in t)(e||Df.call(t,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lo(d,c)))&&r.push(d);return r}function Na(t,e){return function(n){return t(e(n))}}var Yf=Na(Object.keys,Object),Of=Object.prototype,Hf=Of.hasOwnProperty;function Ff(t){if(!ho(t))return Yf(t);var e=[];for(var n in Object(t))Hf.call(t,n)&&n!="constructor"&&e.push(n);return e}function Pa(t){return Ui(t)?Xa(t):Ff(t)}function zf(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var Af=Object.prototype,Kf=Af.hasOwnProperty;function _f(t){if(!He(t))return zf(t);var e=ho(t),n=[];for(var i in t)i=="constructor"&&(e||!Kf.call(t,i))||n.push(i);return n}function po(t){return Ui(t)?Xa(t,!0):_f(t)}var Uf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jf=/^\w*$/;function go(t,e){if(qe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ai(t)?!0:Jf.test(t)||!Uf.test(t)||e!=null&&t in Object(e)}var Jn=en(Object,"create");function jf(){this.__data__=Jn?Jn(null):{},this.size=0}function Qf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $f="__lodash_hash_undefined__",qf=Object.prototype,em=qf.hasOwnProperty;function tm(t){var e=this.__data__;if(Jn){var n=e[t];return n===$f?void 0:n}return em.call(e,t)?e[t]:void 0}var nm=Object.prototype,im=nm.hasOwnProperty;function sm(t){var e=this.__data__;return Jn?e[t]!==void 0:im.call(e,t)}var om="__lodash_hash_undefined__";function lm(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jn&&e===void 0?om: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=Qf,tn.prototype.get=tm,tn.prototype.has=sm,tn.prototype.set=lm;function am(){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 rm=Array.prototype,cm=rm.splice;function dm(t){var e=this.__data__,n=ji(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():cm.call(e,n,1),--this.size,!0}function hm(t){var e=this.__data__,n=ji(e,t);return n<0?void 0:e[n][1]}function um(t){return ji(this.__data__,t)>-1}function fm(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=am,It.prototype.delete=dm,It.prototype.get=hm,It.prototype.has=um,It.prototype.set=fm;var jn=en(rt,"Map");function mm(){this.size=0,this.__data__={hash:new tn,map:new(jn||It),string:new tn}}function pm(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 pm(e)?n[typeof e=="string"?"string":"hash"]:n.map}function gm(t){var e=Qi(this,t).delete(t);return this.size-=e?1:0,e}function bm(t){return Qi(this,t).get(t)}function ym(t){return Qi(this,t).has(t)}function xm(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=mm,Lt.prototype.delete=gm,Lt.prototype.get=bm,Lt.prototype.has=ym,Lt.prototype.set=xm;var Sm="Expected a function";function bo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Sm);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(bo.Cache||Lt),n}bo.Cache=Lt;var Cm=500;function km(t){var e=bo(t,function(i){return n.size===Cm&&n.clear(),i}),n=e.cache;return e}var wm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Im=/\\(\\)?/g,Lm=km(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(wm,function(n,i,s,l){e.push(s?l.replace(Im,"$1"):i||n)}),e});function Tm(t){return t==null?"":ba(t)}function Ba(t,e){return qe(t)?t:go(t,e)?[t]:Lm(Tm(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 Da(t,e){e=Ba(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 Mm(t,e,n){var i=t==null?void 0:Da(t,e);return i===void 0?n:i}function vm(t,e){for(var n=-1,i=e.length,s=t.length;++n<i;)t[s+n]=e[n];return t}var Ya=Na(Object.getPrototypeOf,Object),Rm="[object Object]",Vm=Function.prototype,Em=Object.prototype,Oa=Vm.toString,Wm=Em.hasOwnProperty,Gm=Oa.call(Object);function Zm(t){if(!ct(t)||Dt(t)!=Rm)return!1;var e=Ya(t);if(e===null)return!0;var n=Wm.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Oa.call(n)==Gm}function Xm(){this.__data__=new It,this.size=0}function Nm(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Pm(t){return this.__data__.get(t)}function Bm(t){return this.__data__.has(t)}var Dm=200;function Ym(t,e){var n=this.__data__;if(n instanceof It){var i=n.__data__;if(!jn||i.length<Dm-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=Xm,dt.prototype.delete=Nm,dt.prototype.get=Pm,dt.prototype.has=Bm,dt.prototype.set=Ym;var Ha=typeof le=="object"&&le&&!le.nodeType&&le,Fa=Ha&&typeof module=="object"&&module&&!module.nodeType&&module,Om=Fa&&Fa.exports===Ha,za=Om?rt.Buffer:void 0,Aa=za?za.allocUnsafe:void 0;function Ka(t,e){if(e)return t.slice();var n=t.length,i=Aa?Aa(n):new t.constructor(n);return t.copy(i),i}function Hm(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 Fm(){return[]}var zm=Object.prototype,Am=zm.propertyIsEnumerable,_a=Object.getOwnPropertySymbols,Km=_a?function(t){return t==null?[]:(t=Object(t),Hm(_a(t),function(e){return Am.call(t,e)}))}:Fm;function _m(t,e,n){var i=e(t);return qe(t)?i:vm(i,n(t))}function yo(t){return _m(t,Pa,Km)}var xo=en(rt,"DataView"),So=en(rt,"Promise"),Sn=en(rt,"Set"),Ua="[object Map]",Um="[object Object]",Ja="[object Promise]",ja="[object Set]",Qa="[object WeakMap]",$a="[object DataView]",Jm=qt(xo),jm=qt(jn),Qm=qt(So),$m=qt(Sn),qm=qt(oo),ht=Dt;(xo&&ht(new xo(new ArrayBuffer(1)))!=$a||jn&&ht(new jn)!=Ua||So&&ht(So.resolve())!=Ja||Sn&&ht(new Sn)!=ja||oo&&ht(new oo)!=Qa)&&(ht=function(t){var e=Dt(t),n=e==Um?t.constructor:void 0,i=n?qt(n):"";if(i)switch(i){case Jm:return $a;case jm:return Ua;case Qm:return Ja;case $m:return ja;case qm:return Qa}return e});var ep=Object.prototype,tp=ep.hasOwnProperty;function np(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&tp.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var qi=rt.Uint8Array;function Co(t){var e=new t.constructor(t.byteLength);return new qi(e).set(new qi(t)),e}function ip(t,e){var n=Co(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var sp=/\w*$/;function op(t){var e=new t.constructor(t.source,sp.exec(t));return e.lastIndex=t.lastIndex,e}var qa=xt?xt.prototype:void 0,er=qa?qa.valueOf:void 0;function lp(t){return er?Object(er.call(t)):{}}function tr(t,e){var n=e?Co(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var ap="[object Boolean]",rp="[object Date]",cp="[object Map]",dp="[object Number]",hp="[object RegExp]",up="[object Set]",fp="[object String]",mp="[object Symbol]",pp="[object ArrayBuffer]",gp="[object DataView]",bp="[object Float32Array]",yp="[object Float64Array]",xp="[object Int8Array]",Sp="[object Int16Array]",Cp="[object Int32Array]",kp="[object Uint8Array]",wp="[object Uint8ClampedArray]",Ip="[object Uint16Array]",Lp="[object Uint32Array]";function Tp(t,e,n){var i=t.constructor;switch(e){case pp:return Co(t);case ap:case rp:return new i(+t);case gp:return ip(t);case bp:case yp:case xp:case Sp:case Cp:case kp:case wp:case Ip:case Lp:return tr(t,n);case cp:return new i;case dp:case fp:return new i(t);case hp:return op(t);case up:return new i;case mp:return lp(t)}}function nr(t){return typeof t.constructor=="function"&&!ho(t)?Zu(Ya(t)):{}}var Mp="[object Map]";function vp(t){return ct(t)&&ht(t)==Mp}var ir=xn&&xn.isMap,Rp=ir?uo(ir):vp,Vp="[object Set]";function Ep(t){return ct(t)&&ht(t)==Vp}var sr=xn&&xn.isSet,Wp=sr?uo(sr):Ep,Gp=1,or="[object Arguments]",Zp="[object Array]",Xp="[object Boolean]",Np="[object Date]",Pp="[object Error]",lr="[object Function]",Bp="[object GeneratorFunction]",Dp="[object Map]",Yp="[object Number]",ar="[object Object]",Op="[object RegExp]",Hp="[object Set]",Fp="[object String]",zp="[object Symbol]",Ap="[object WeakMap]",Kp="[object ArrayBuffer]",_p="[object DataView]",Up="[object Float32Array]",Jp="[object Float64Array]",jp="[object Int8Array]",Qp="[object Int16Array]",$p="[object Int32Array]",qp="[object Uint8Array]",eg="[object Uint8ClampedArray]",tg="[object Uint16Array]",ng="[object Uint32Array]",ye={};ye[or]=ye[Zp]=ye[Kp]=ye[_p]=ye[Xp]=ye[Np]=ye[Up]=ye[Jp]=ye[jp]=ye[Qp]=ye[$p]=ye[Dp]=ye[Yp]=ye[ar]=ye[Op]=ye[Hp]=ye[Fp]=ye[zp]=ye[qp]=ye[eg]=ye[tg]=ye[ng]=!0,ye[Pp]=ye[lr]=ye[Ap]=!1;function Qn(t,e,n,i,s,l){var a,r=e&Gp;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=np(t);else{var d=ht(t),h=d==lr||d==Bp;if(_n(t))return Ka(t,r);if(d==ar||d==or||h&&!s)a=h?{}:nr(t);else{if(!ye[d])return s?t:{};a=Tp(t,d,r)}}l||(l=new dt);var u=l.get(t);if(u)return u;l.set(t,a),Wp(t)?t.forEach(function(g){a.add(Qn(g,e,n,g,t,l))}):Rp(t)&&t.forEach(function(g,p){a.set(p,Qn(g,e,n,p,t,l))});var f=yo,m=c?void 0:f(t);return zu(m||t,function(g,p){m&&(p=g,g=t[p]),Ia(a,p,Qn(g,e,n,p,t,l))}),a}var ig=1,sg=4;function Re(t){return Qn(t,ig|sg)}var og=1,lg=4;function rr(t,e){return e=typeof e=="function"?e:void 0,Qn(t,og|lg,e)}var ag="__lodash_hash_undefined__";function rg(t){return this.__data__.set(t,ag),this}function cg(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=rg,$n.prototype.has=cg;function dg(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 cr(t,e){return t.has(e)}var hg=1,ug=2;function dr(t,e,n,i,s,l){var a=n&hg,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&ug?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(!dg(e,function(C,b){if(!cr(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 fg(t){var e=-1,n=Array(t.size);return t.forEach(function(i,s){n[++e]=[s,i]}),n}function ko(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}var mg=1,pg=2,gg="[object Boolean]",bg="[object Date]",yg="[object Error]",xg="[object Map]",Sg="[object Number]",Cg="[object RegExp]",kg="[object Set]",wg="[object String]",Ig="[object Symbol]",Lg="[object ArrayBuffer]",Tg="[object DataView]",hr=xt?xt.prototype:void 0,wo=hr?hr.valueOf:void 0;function Mg(t,e,n,i,s,l,a){switch(n){case Tg:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Lg:return!(t.byteLength!=e.byteLength||!l(new qi(t),new qi(e)));case gg:case bg:case Sg:return yn(+t,+e);case yg:return t.name==e.name&&t.message==e.message;case Cg:case wg:return t==e+"";case xg:var r=fg;case kg:var c=i&mg;if(r||(r=ko),t.size!=e.size&&!c)return!1;var d=a.get(t);if(d)return d==e;i|=pg,a.set(t,e);var h=dr(r(t),r(e),i,s,l,a);return a.delete(t),h;case Ig:if(wo)return wo.call(t)==wo.call(e)}return!1}var vg=1,Rg=Object.prototype,Vg=Rg.hasOwnProperty;function Eg(t,e,n,i,s,l){var a=n&vg,r=yo(t),c=r.length,d=yo(e),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in e:Vg.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 Wg=1,ur="[object Arguments]",fr="[object Array]",es="[object Object]",Gg=Object.prototype,mr=Gg.hasOwnProperty;function Zg(t,e,n,i,s,l){var a=qe(t),r=qe(e),c=a?fr:ht(t),d=r?fr:ht(e);c=c==ur?es:c,d=d==ur?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||mo(t)?dr(t,e,n,i,s,l):Mg(t,e,c,n,i,s,l);if(!(n&Wg)){var m=h&&mr.call(t,"__wrapped__"),g=u&&mr.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),Eg(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:Zg(t,e,n,i,ts,s)}var Xg=1,Ng=2;function Pg(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,Xg|Ng,i,h):u))return!1}}return!0}function pr(t){return t===t&&!He(t)}function Bg(t){for(var e=Pa(t),n=e.length;n--;){var i=e[n],s=t[i];e[n]=[i,s,pr(s)]}return e}function gr(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Dg(t){var e=Bg(t);return e.length==1&&e[0][2]?gr(e[0][0],e[0][1]):function(n){return n===t||Pg(n,t,e)}}function Yg(t,e){return t!=null&&e in Object(t)}function Og(t,e,n){e=Ba(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&&co(s)&&lo(a,s)&&(qe(t)||Ji(t)))}function Hg(t,e){return t!=null&&Og(t,e,Yg)}var Fg=1,zg=2;function Ag(t,e){return go(t)&&pr(e)?gr($i(t),e):function(n){var i=Mm(n,t);return i===void 0&&i===e?Hg(n,t):ts(e,i,Fg|zg)}}function Kg(t){return function(e){return e==null?void 0:e[t]}}function _g(t){return function(e){return Da(e,t)}}function Ug(t){return go(t)?Kg($i(t)):_g(t)}function Jg(t){return typeof t=="function"?t:t==null?io:typeof t=="object"?qe(t)?Ag(t[0],t[1]):Dg(t):Ug(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 Qg=jg(),Io=function(){return rt.Date.now()},$g="Expected a function",qg=Math.max,eb=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($g);e=Ki(e)||0,He(n)&&(h=!!n.leading,u="maxWait"in n,l=u?qg(Ki(n.maxWait)||0,e):l,f="trailing"in n?!!n.trailing:f);function m(M){var R=i,S=s;return i=s=void 0,d=M,a=t.apply(S,R),a}function g(M){return d=M,r=setTimeout(C,e),h?m(M):a}function p(M){var R=M-c,S=M-d,x=e-R;return u?eb(x,l-S):x}function y(M){var R=M-c,S=M-d;return c===void 0||R>=e||R<0||u&&S>=l}function C(){var M=Io();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(Io())}function w(){var M=Io(),R=y(M);if(i=arguments,s=this,c=M,R){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 br=Object.prototype,tb=br.hasOwnProperty,nb=ro(function(t,e){t=Object(t);var n=-1,i=e.length,s=i>2?e[2]:void 0;for(s&&Ta(e[0],e[1],s)&&(i=1);++n<i;)for(var l=e[n],a=po(l),r=-1,c=a.length;++r<c;){var d=a[r],h=t[d];(h===void 0||yn(h,br[d])&&!tb.call(t,d))&&(t[d]=l[d])}return t});function Lo(t,e,n){(n!==void 0&&!yn(t[e],n)||n===void 0&&!(e in t))&&ao(t,e,n)}function ib(t){return ct(t)&&Ui(t)}function To(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function sb(t){return ef(t,po(t))}function ob(t,e,n,i,s,l,a){var r=To(t,n),c=To(e,n),d=a.get(c);if(d){Lo(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&&mo(c);h=c,f||m||g?qe(r)?h=r:ib(r)?h=Nu(r):m?(u=!1,h=Ka(c,!0)):g?(u=!1,h=tr(c,!0)):h=[]:Zm(c)||Ji(c)?(h=r,Ji(r)?h=sb(r):(!He(r)||Kn(r))&&(h=nr(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),Lo(t,n,h)}function is(t,e,n,i,s){t!==e&&Qg(e,function(l,a){if(s||(s=new dt),He(l))ob(t,e,a,n,is,i,s);else{var r=i?i(To(t,a),l,a+"",t,e,s):void 0;r===void 0&&(r=l),Lo(t,a,r)}},po)}function yr(t,e,n,i,s,l){return He(t)&&He(e)&&(l.set(e,t),is(t,e,void 0,yr,l),l.delete(e)),t}var lb=Ma(function(t,e,n,i){is(t,e,n,i)}),Xe=ro(function(t){return t.push(void 0,yr),wa(lb,void 0,t)}),ab=Math.max,rb=Math.min;function cb(t,e,n){return t>=rb(e,n)&&t<ab(e,n)}function St(t,e,n){return e=Sa(e),n===void 0?(n=e,e=0):n=Sa(n),t=Ki(t),cb(t,e,n)}function Fe(t,e){return ts(t,e)}var db="[object Number]";function hb(t){return typeof t=="number"||ct(t)&&Dt(t)==db}function Yt(t){return t==null}function ub(t){return t===void 0}var Mo=Ma(function(t,e,n){is(t,e,n)}),fb=Array.prototype,mb=fb.reverse;function pb(t){return t==null?t:mb.call(t)}var gb="Expected a function";function ss(t,e,n){var i=!0,s=!0;if(typeof t!="function")throw new TypeError(gb);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 bb=1/0,yb=Sn&&1/ko(new Sn([,-0]))[1]==bb?function(t){return new Sn(t)}:Xu,xb=200;function Sb(t,e,n){var i=-1,s=Ju,l=t.length,a=!0,r=[],c=r;if(l>=xb){var d=e?null:yb(t);if(d)return ko(d);a=!1,s=cr,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 Cb(t,e){return t&&t.length?Sb(t,Jg(e)):[]}const kb=()=>{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)=>{hb(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}},wb=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}},Ib=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)}}},Lb=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()})},Tb={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}=kb(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m}=wb({state:e,slider:n}),{startDrag:g,clickSlider:p,changeInput:y}=Ib({currentValue:t,state:e,slider:n,updateSliderInfo:l,setSliderValue:a});return Lb({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}}},Mb={class:"ev-slider-wrapper"},vb={ref:"sliderLine",class:"ev-slider-line"},Rb={key:0,class:"ev-slider-step-wrapper"},Vb={key:2,class:"ev-slider-mark-wrapper"},Eb={class:"ev-slider-mark-label"},Wb=["innerHTML"],Gb=["innerHTML"];function Zb(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",Mb,[o.createElementVNode("div",vb,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",Rb,[(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",Vb,[(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",Eb,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,Wb)],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,Gb)],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(Tb,[["render",Zb]]);qn.install=t=>{t.component(qn.name,qn)};const Xb={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 Nb(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(Xb,[["render",Nb]]);Cn.install=t=>{t.component(Cn.name,Cn)};const vo=6,Ro=7,Vo=4,Eo=3,Wo=5,Go=4,je=12,Pb=24,Bb=60,Db=60,ut=12,xr=4,Zo=20,Xo={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월"]},Yb={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"),Sr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Cr=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]/),Ob=(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)),Hb=(t,e)=>new Date(`${t}-${e}-1`).getDay(),No=(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=Ob(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},kr=(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(),wr=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/Zo)*Zo,l=s+Zo-1;return{start:s,end:l}},Fb=()=>{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&&Sr.exec((y=t.modelValue)==null?void 0:y.toString())||t.modelValue.length===19&&Cr.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&&Sr.exec(b)||b.length===19&&Cr.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(()=>wr(c.main.year)),expanded:o.computed(()=>wr(c.expanded.year))}),h=o.computed(()=>Xo[t.monthNotation][c.main.month-1]),u=o.computed(()=>Xo[t.monthNotation][c.expanded.month-1]),f=o.reactive({main:h,expanded:u}),m=o.computed(()=>Yb[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}},zb=t=>{const{props:e}=o.getCurrentInstance(),{selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:s}=t,l=o.reactive({main:kn(Wo,Go),expanded:kn(Wo,Go)}),a=o.reactive({main:kn(Vo,Eo),expanded:kn(Vo,Eo)}),r=o.reactive({main:kn(vo,Ro),expanded:kn(vo,Ro)}),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,R=Hb(p.year,p.month),S=No(p.month===1?p.year-1:p.year,(je+p.month-1)%je||je),x=No(p.year,p.month);let I="";e.mode.includes("Time")&&(e.mode==="dateTime"?I=n.value:I=g==="main"?n.value[0]:n.value[1]);let L=0,v=0,W=0,E=0,G="";const V=(X,Z,N)=>{var F,K,Q;G=ei({year:v,month:W,date:E});const D=(I==null?void 0:I.split(" ")[1])??"",Y=C&&!y&&as(e.mode,g,G,n.value)||+new Date(`${G} ${D}`)<ls,H=y&&y(new Date(`${G} ${D}`))||Y,B=+(g!=="main"),O=C&&n.value.length>B&&((K=(F=n.value)==null?void 0:F[B])==null?void 0:K.includes(G)),P=!H&&(C?O:(Q=n.value)==null?void 0:Q.includes(G));r[g][Z][N]={monthType:`${X}${H?" disabled":""}`,isToday:b===G,isSelected:P,year:v,month:W,date:E}};for(let X=0;X<vo;X++)for(let Z=0;Z<Ro;Z++)X===0?R!==0?Z<R?(v=w,W=k,E=S-R+1+Z,V("prev",X,Z)):(L++,v=p.year,W=p.month,E=L,V("",X,Z)):(v=w,W=k,E=S-6+Z,V("prev",X,Z)):x<=L?(L++,v=M,W=T,E=L-x,V("next",X,Z)):(L++,v=p.year,W=p.month,E=L,V("",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<Vo;T++)for(let w=0;w<Eo;w++)a[g][T][w]={label:Xo.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<Wo;b++)for(let k=0;k<Go;k++)l[g][b][k]={label:p,value:p,today:p===y,isSelected:p===i[g].year,disabled:p<C},p++},setHmsTime:()=>{var R,S;const g=(R=e.options)==null?void 0:R.timeFormat,p=(S=e.options)==null?void 0:S.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=(x,I,L)=>{const v=x==="main"?b:k,W=x==="main"?T:w;if(!v)return!1;const E=v.split(" ")[0];let G=Ze(v,"hour"),V=Ze(v,"min"),X=Ze(v,"sec");I==="hour"?G=L:I==="min"?V=L:I==="sec"&&(X=L);const Z=`${E} ${Ge(G)}:${Ge(V)}:${Ge(X)}`;return W&&W(new Date(Z))?!0:!W&&as(e.mode,x,Z,n.value)};["hour","min","sec"].forEach(x=>{let I=Db;x==="hour"?I=Pb:x==="min"&&(I=Bb);const L=b&&b.length>0?ti(y,b,x):-1,v=k&&k.length>0?ti(C,k,x):-1;for(let W=0;W<I;W++){let E=e.mode==="dateTimeRange"&&M("main",x,W);c.main[x][W]={timeType:x,num:W,isSelected:!E&&L===W,isDisabled:E},e.mode==="dateTimeRange"&&(E=M("expanded",x,W),c.expanded[x][W]={timeType:x,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,R=T*ut+w*xr+M;return k[g][R]}}},Ab=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=(V,X)=>{const Z=l[V],{year:N,month:D,hour:Y,min:H,sec:B}=X;N&&(Z.year=N),D&&(Z.month=D),Y&&(Z.hour=Y),H&&(Z.min=H),B&&(Z.sec=B)},b=V=>{V==null||V.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=(V,X)=>{const Z=u[V]===et.MONTH?1:20,N=X==="prev"?-Z:Z,D=new Date(ls).getFullYear(),Y=l[V].year+N;l[V].year=Y<D?D:Y},T=(V,X)=>{const Z=l[V];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=(V,X)=>{switch(u[V]){case et.DATE:{T(V,X),r(V);break}case et.MONTH:k(V,X),c(V);break;case et.YEAR:k(V,X),d(V);break}},M=(V,X)=>{X===et.DATE?r(V):X===et.MONTH?c(V):X===et.YEAR&&d(V),u[V]=X},R=(V,X)=>{const{value:Z}=X;X.disabled||(u[V]===et.YEAR?(l[V].year=Z,u[V]=et.MONTH,c(V)):(l[V].month=Z,u[V]=et.DATE,r(V)))},S=(V,X)=>{var J,ne,q,ee;const{year:Z,month:N,date:D,monthType:Y}=X,H=ei({year:Z,month:N,date:D}),B=e.modelValue?(Array.isArray(e.modelValue)?((J=e.modelValue)==null?void 0:J.map($=>$==null?void 0:$.split(" ")[0]))??[]:e.modelValue.split(" ")[0]).includes(H):!1;let O=e.options.disabledDate;if(O&&Array.isArray(O)&&(O=V==="main"?O[0]:O[1]),O&&O(new Date(H))&&!B)return;if(!O&&["dateRange","dateTimeRange"].includes(e.mode)&&as(e.mode,V,H,s.value))return;const P=l[V],F=(je+P.month-1)%je||je,K=P.month===1?P.year-1:P.year,Q=(P.month+1)%je||je,U=P.month===12?P.year+1:P.year,j=()=>{Y.includes("prev")?(P.year=K,P.month=F):Y.includes("next")&&(P.year=U,P.month=Q)};switch(e.mode){case"date":n("update:modelValue",H);break;case"dateTime":{const de=!!((ne=s.value)!=null&&ne.split(" ")[1])?(q=s.value)==null?void 0:q.split(" ")[1]:"00:00:00",me=Te(i,`${H} ${de}`);n("update:modelValue",me);break}case"dateMulti":{const $=e.options.multiType,de=e.options.multiDayLimit;if($==="date"){const me=s.value.indexOf(H);me>-1?(s.value.splice(me,1),n("update:modelValue",[...s.value])):s.value.length<de&&(s.value.push(H),j(),n("update:modelValue",[...s.value]))}else if($==="week"||$==="weekday"){const me=$==="week"?7:5,ae=$==="week"?6:5,xe=new Date(`${H} 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),j();(!O||!O(new Date(Vt)))&&s.value.unshift(Vt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let $=[...s.value];if(!s.value.length)$=[H,H];else{const de=+(V==="expanded");$[de]=H}n("update:modelValue",$);break}case"dateTimeRange":{let $=[...s.value];if($.length){const de=+(V==="expanded"),me=((ee=$[de])==null?void 0:ee.split(" ")[1])||"00:00:00";let ae=`${H} ${me}`;i&&i.length&&(ae=Te(i[de],ae)),$[de]=ae}else{let de=`${H} 00:00:00`,me=`${H} 00:00:00`;i&&i.length&&(de=Te(i[0],de),me=Te(i[1],me)),$=[de,me]}n("update:modelValue",$);break}}},x=(V,X,Z)=>{if(y[V][X])return;const N=l[V],D=1;X==="hour"?Z==="down"&&N.hour<2?N.hour++:Z==="up"&&N.hour>D&&N.hour--:X==="min"?Z==="down"&&N.min<5?N.min++:Z==="up"&&N.min>D&&N.min--:X==="sec"&&(Z==="down"&&N.sec<5?N.sec++:Z==="up"&&N.sec>D&&N.sec--)},I=(V,X,Z,N)=>{var ne;if(y[V][X])return;const D=l[V],Y=a[V],H=D[X]-1,B=Z-1,O=N-1,P=H*ut+B*xr+O;if((ne=Y[X][P])!=null&&ne.isDisabled)return;const F=new Date,K={year:F.getFullYear(),month:F.getMonth()+1,date:F.getDate()};let Q=!0,U=[];const j=()=>{let q;return X==="hour"?q=`${Ge(P)}:00:00'`:X==="min"?q=`00:${Ge(P)}:00`:X==="sec"&&(q=`00:00:${Ge(P)}`),`${ei(K)} ${q}`},J=q=>{let ae=11;return X==="min"?ae=14:X==="sec"&&(ae=17),`${q==null?void 0:q.substr(0,ae)}${Ge(P)}${q==null?void 0:q.substr(ae+2)}`};if(e.mode==="dateTime"){let q;e.modelValue?q=Te(i,J(e.modelValue)):(Q=!1,q=Te(i,j())),n("update:modelValue",q),U.push(q)}else{const q=V!=="main"|0;let ee=[...s.value];if(e.modelValue.length){let $=J(e.modelValue[q]);i&&i.length&&($=Te(i[q],$)),ee[q]=$}else{const $=j();ee=[$,$],i&&i.length&&(ee=[...ee.map((de,me)=>Te(i[me],de))]),Q=!1,U=ee}n("update:modelValue",ee)}h(),Q||b(U)},L=(V,X)=>{w(V,X.deltaY>0?"next":"prev")},v=(V,X,Z)=>{y[V][X]||x(V,X,Z.deltaY>0?"down":"up")},W=ss((V,X)=>{const Z=X.target.tagName==="TD"?X.target:X.target.parentElement,N=Z.classList.contains("disabled"),D=Z.classList.contains("prev"),Y=Z.classList.contains("next");if(Z.classList.length>0&&!N){const H=l[V];let B={year:+H.year,month:+H.month,date:X.target.innerText};D?B={...B,...kr("prev",B.year,B.month)}:Y&&(B={...B,...kr("next",B.year,B.month)});const O=f.value,P=ei({year:B.year,month:B.month,date:B.date});wn(P)<wn(O)?(s.value[0]=P,s.value[1]=O):(s.value[0]=O,s.value[1]=P),r("main"),r("expanded")}},10),E=V=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode),Z=e.options.disabledDate;if(X){const[N,D]=s.value;let[Y,H]=[Z,Z];if(Z&&Array.isArray(Z)&&([Y,H]=Z),V[0]&&V[0]!==N&&Y&&Y(new Date(V[0])))return!0;if(V[1]&&V[1]!==D&&H&&H(new Date(V[1])))return!0;if(!Z&&as(e.mode,"main",V[0],V))return!0}else{if(e.mode==="dateMulti")return V.some(N=>Z&&Z(new Date(N)));if(Z&&Z(new Date(V)))return!0}return!1};return o.watch(()=>e.modelValue,V=>{if(E(V)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode);if(s.value=X?[...V]:V,e.mode==="dateRange")b(V);else if(e.mode.includes("Time")){let Z=[];e.mode==="dateTime"?Z=[V]:e.mode==="dateTimeRange"&&(Z=V),b(Z),h()}else e.mode==="date"&&b([V])}),{clickYearMonthBtn:M,clickPrevNextBtn:w,clickDate:S,clickYearMonth:R,clickHmsBtn:x,clickTime:I,wheelMonth:L,wheelTime:v,calendarEventName:m,onMousemoveDate:W,preventTimeEventType:y}},Kb={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}=Fb(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p,getTimeInfo:y}=zb({selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:a}),{clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:T,clickHmsBtn:w,clickTime:M,wheelMonth:R,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:L}=Ab({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:R,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:L}}},_b={class:"ev-calendar-wrapper"},Ub={class:"ev-calendar-date-area"},Jb={class:"ev-calendar-header"},jb=["onClick"],Qb={class:"ev-calendar-year-month-wrapper"},$b={key:0,class:"ev-calendar-year-range"},qb=["onClick"],ey=["onClick"],ty=["onClick"],ny={class:"ev-calendar-body"},iy=["onWheel"],sy=["onClick"],oy=["onWheel"],ly=["onClick"],ay={key:2,class:"ev-calendar-selector-btn-wrapper"},ry={key:0,class:"ev-calendar-time-area"},cy={key:0,class:"ev-calendar-time-area-disabled"},dy={class:"ev-calendar-time-side"},hy={class:"ev-calendar-time-center"},uy=["onWheel"],fy=["onClick"],my={class:"ev-calendar-time-side"},py=["onClick"];function gy(t,e,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",_b,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",Ub,[o.createElementVNode("div",Jb,[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",Qb,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",$b,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,qb),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,ey)):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,ty)]),o.createElementVNode("div",ny,[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,sy))),128))]))),128))],40,iy)])):(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,ly))),128))]))),128))],40,oy)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",ay,[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",ry,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",cy)):o.createCommentVNode("",!0),o.createElementVNode("div",dy,[(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",hy,[(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,fy)),64))])),64))],40,uy)])),64))]),o.createElementVNode("div",my,[(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,py)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const ni=ce(Kb,[["render",gy]]);ni.install=t=>{t.component(ni.name,ni)};const by=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),yy=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]/),xy=()=>{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&&by.exec(b)),p=b=>!!(b.length===19&&yy.exec(b)),y=b=>{const k=b.split(" ")[0],T=+k.split("-")[0],w=+k.split("-")[1],M=+k.split("-")[2],R=No(T,w);return+M<=R&&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]}}}},Sy=()=>{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}},Cy=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[R,S]=M(),[x,I]=b,L=Te(x,h(R)),v=Te(I,h(S)),W=L===h(k),E=v===h(T);return W&&E}):w=l.find(({shortcutDate:M})=>{const[R,S]=M(),x=e.mode==="dateTimeRange"?h:d,I=x(R)===x(k),L=x(S)===x(T);return I&&L}),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,R]=b;n.value=[Te(M,h(T)),Te(R,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}},ky={name:"EvDatePicker",directives:{clickoutside:_d},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}=xy(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p}=Sy(),{usedShortcuts:y,clickShortcut:C,setActiveShortcut:b}=Cy({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}}},wy={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},Iy=["placeholder","readonly","disabled"],Ly=["placeholder","disabled"],Ty={class:"ev-tag-name"},My=["onClick"],vy={key:0,class:"ev-select-tag num"},Ry={class:"ev-tag-name"},Vy={class:"ev-select-tag num"},Ey={class:"ev-tag-name"},Wy={class:"ev-date-picker-dropbox-wrapper"},Gy={key:0,class:"ev-date-picker-dropbox__button-layout"},Zy={key:1,class:"ev-date-picker-dropbox__divider"};function Xy(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",wy,[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,Iy),[[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,Ly),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",Ty,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,My)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",vy,[o.createElementVNode("span",Ry,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",Vy,[o.createElementVNode("span",Ey,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",Wy,[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",Gy,[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",Zy)):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(ky,[["render",Xy]]);ii.install=t=>{t.component(ii.name,ii)};const Ny={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}}},Py={key:0,class:"ev-message-icon"},By=["innerHTML"],Dy={key:2,class:"ev-message-content"};function Yy(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",Py,[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,By)):(o.openBlock(),o.createElementBlock("div",Dy,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 Oy=ce(Ny,[["render",Yy]]),Hy=o.defineComponent(Oy),Ir="ev-message-modal",Lr=document.createElement("div");Lr.id=Ir;const rs=(t={})=>{document.getElementById(Ir)||document.body.appendChild(Lr);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof t=="string"?{message:t,unmount:i}:{...t,unmount:i},l=o.h(Hy,s);return o.render(l,n),l.component.exposed};rs.install=t=>{const e=t.config.globalProperties;e.$message=rs};const Fy={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)}}},zy={key:0,class:"ev-notification-icon"},Ay={class:"ev-notification-content"},Ky={key:0,class:"title"},_y=["innerHTML"],Uy={key:2,class:"message"};function Jy(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",zy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ay,[n.title?(o.openBlock(),o.createElementBlock("p",Ky,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,_y)):(o.openBlock(),o.createElementBlock("p",Uy,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(Fy,[["render",Jy]]),Qy=o.defineComponent(jy),Tr="ev-notification-modal",cs=document.createElement("div");cs.id=Tr;const $y=["top-left","top-right","bottom-left","bottom-right"],ds=(t={})=>{const e=t.position||"top-right";if(!$y.includes(e)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(Tr)||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(Qy,r);o.render(c,l),i.appendChild(c.el)};ds.install=t=>{const e=t.config.globalProperties;e.$notify=ds};const qy={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}}},ex={key:0,class:"ev-message-box-icon"},tx={class:"ev-message-box-content"},nx={key:0,class:"ev-message-box-title"},ix=["innerHTML"],sx={key:2,class:"ev-message-box-message"},ox={class:"ev-message-box-btn"};function lx(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",ex,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",tx,[n.title?(o.openBlock(),o.createElementBlock("p",nx,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,ix)):(o.openBlock(),o.createElementBlock("p",sx,o.toDisplayString(n.message),1))]),o.createElementVNode("div",ox,[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 ax=ce(qy,[["render",lx]]),rx=o.defineComponent(ax),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(rx,i);o.render(s,e)};hs.install=t=>{const e=t.config.globalProperties;e.$messagebox=hs};const Mr=(t,e)=>Array.from(Array(t),()=>Array(e).fill(!1)),cx=()=>{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?Mr(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=[...Mr(t.rowLabels.length,t.colLabels.length)])}}},dx=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]}}},hx={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}=cx();e();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=dx({mv:t});return{mv:t,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},ux={class:"ev-scheduler-header"},fx=["onClick","innerHTML"],mx=["onClick","innerHTML"],px=["onMousedown","onMouseup"];function gx(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",ux,[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,fx))),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,mx)),(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,px))),128))]))),128))],32)],2)}const si=ce(hx,[["render",gx]]);si.install=t=>{t.component(si.name,si)};const bx=()=>{const t=o.defineComponent(vr),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)}}},yx=()=>{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)}}},xx=()=>{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 L,v,W;const m=document.documentElement.clientWidth,g=document.documentElement.clientHeight,p=20,y=(L=f.target.parentElement)==null?void 0:L.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:R}=w,S=f.target.offsetTop,x=g<b+S+R,I=m<C+k+M+p;x?r.top=`${T-R}px`:r.top=`${S}px`,I?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}},Sx={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}=xx();return{isExistChild:t,computedIsShow:e,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},Cx={class:"ev-menu-list"},kx={class:"ev-menu-ul"},wx=["onClick","onMouseenter"],Ix={class:"ev-menu-li-text"},Lx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function Tx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Cx,[o.createElementVNode("ul",kx,[(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",Ix,[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",Lx)):o.createCommentVNode("",!0)],42,wx)),[[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 vr=ce(Sx,[["render",Tx]]),Mx={name:"EvContextMenu",directives:{clickoutside:Hi},components:{MenuList:vr},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}=bx(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=yx();return o.onBeforeMount(()=>e()),{isShow:n,rootMenuList:i,menuStyle:s,comp:t,show:l,hide:a}}};function vx(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(Mx,[["render",vx]]);oi.install=t=>{t.component(oi.name,oi)};const Rx=()=>window.innerWidth-document.documentElement.clientWidth,Vx=()=>{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=Rx();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}},Ex=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=(L,v)=>{if(L==null||v==null)return!1;const W=i.value.getBoundingClientRect(),E=+L-W.left,G=+v-W.top,V=s.value.style,X={top:r(V.paddingTop,"vertical"),left:r(V.paddingLeft,"horizontal"),right:r(V.paddingRight,"horizontal")},Z=X.left,N=W.width-X.right,D=X.top,Y=D+s.value.offsetHeight;return E>Z&&E<N&&G>D&&G<Y},y=L=>{if(L===null||typeof L!="object")return;let v,W,E,G,V,X;const Z=i.value,N=Object.prototype.hasOwnProperty;N.call(L,"top")?v=L.top:v=u.top,N.call(L,"left")?W=L.left:W=u.left,N.call(L,"width")?E=L.width:E=Z.offsetWidth,N.call(L,"height")?G=L.height:G=Z.offsetHeight,N.call(L,"minWidth")?V=L.minWidth:V=e.minWidth,N.call(L,"minHeight")?X=L.minHeight:X=e.minHeight,E=r(E,"horizontal")>r(V,"horizontal")?E:V,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(V),h.minHeight=a(X)},C=L=>{if(!(!i.value||u.pressedSpot))if(e.resizable){const v=i.value.getBoundingClientRect(),W=L.clientX-v.left,E=L.clientY-v.top,G=E<d,V=W<d,X=W>=v.width-d,Z=E>=v.height-d;G&&V||Z&&X?i.value.style.cursor="nwse-resize":G&&X||Z&&V?i.value.style.cursor="nesw-resize":X||V?i.value.style.cursor="ew-resize":Z||G?i.value.style.cursor="ns-resize":e.draggable&&p(L.clientX,L.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else e.draggable&&p(L.clientX,L.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},b=L=>{const v=window.innerWidth,W=window.innerHeight,E=m.top,G=m.left,V=m.right,X=m.bottom,Z=r(e.minWidth,"horizontal"),N=r(e.minHeight,"vertical"),D=L.clientX>=v?v:L.clientX;let Y=L.clientY>=W?W:L.clientY;Y=L.clientY>0?Y:0;const H=D-u.clientX,B=Y-u.clientY;let O=u.top,P=u.left,F=u.width,K=u.height;const Q=O+u.height-N,U=P+u.width-Z;E&&(O=u.top+B,K=u.height-B,O>Q&&(O=Q)),G&&(P=u.left+H,F=u.width-H,P>U&&(P=U)),V&&(F=u.width+H),X&&(K=u.height+B),F=Math.min(Math.max(F,Z),v),K=Math.min(Math.max(K,N),W);const j={top:O,left:P,width:F,height:K};y(j),n("resize",L,{...j})},k=(L,v)=>{let W=v;return W<0?W=0:W>L-c&&(W=Math.floor(L-c)),W},T=(L,v)=>{let W=v;return W<-(u.width-c)?W=-Math.floor(u.width-c):W>L-c&&(W=Math.floor(L-c)),W},w=L=>{if(L.preventDefault(),u.state="mousedown-mousemove",e.draggable&&u.pressedSpot==="header"){const v=document.documentElement.clientWidth,W=document.documentElement.clientHeight,E=L.clientY-u.clientY,G=L.clientX-u.clientX;let V=u.top+E,X=u.left+G;V=k(W,V),X=T(v,X),y({top:`${V}px`,left:`${X}px`,width:h.width??e.width,height:h.height??e.height})}else e.resizable&&u.pressedSpot==="border"&&b(L);n("mousedown-mousemove",L)},M=L=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",L),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",M)},R=L=>{if(!i.value||!e.resizable&&!e.draggable)return;let v="";if(e.resizable){const W=i.value.getBoundingClientRect(),E=L.clientX-W.left,G=L.clientY-W.top,V=G<d,X=E<d,Z=E>=W.width-d,N=G>=W.height-d;m.top=V,m.left=X,m.right=Z,m.bottom=N,(V||X||Z||N)&&(v="border")}if(v!=="border"&&p(L.clientX,L.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=L.clientX,u.clientY=L.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=L.clientX,u.clientY=L.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",w),window.addEventListener("mouseup",M)},S=L=>{!e.draggable&&!e.resizable||C(L)},x=()=>{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})})},I=()=>{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(L=>{delete h[L]})};return o.watch(()=>e.visible,L=>{L||I()}),{dragStyle:h,startDrag:R,moveMouse:S,clickExpandBtn:x}},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)}}})(),Wx=t=>{const e=window.getComputedStyle(t).getPropertyValue("z-index").trim();return!e||isNaN(e)?700:parseInt(e)},Po=()=>{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:Wx(n.elem)})).sort(t)},Gx=({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=Po(),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=Po();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=Po(),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}},Zx={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}=Vx(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=Ex({windowRef:t,headerRef:e,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=Gx({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}}},Xx={key:0,ref:"headerRef",class:"ev-window-header"},Nx={key:0,class:"ev-window-icon"},Px={key:1,class:"ev-window-title"},Bx={class:"ev-window-content"},Dx={key:1,class:"ev-window-footer"},Yx={class:"ev-window-top-right-icon"};function Ox(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",Xx,[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",Nx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",Px,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",Bx,[o.renderSlot(t.$slots,"default")]),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",Dx,[o.renderSlot(t.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",Yx,[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(Zx,[["render",Ox]]);li.install=t=>{t.component(li.name,li)};const Hx={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)}}},Fx={class:"ev-loading-spinner"},zx={class:"ev-loading-spinner"};function Ax(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",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)])):(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",zx,[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(Hx,[["render",Ax]]);ai.install=t=>{t.component(ai.name,ai)};const Kx={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}}},_x={class:"ev-progress"},Ux={key:0,class:"ev-progress-inner-text"},Jx={key:0,class:"ev-progress-label"};function jx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",_x,[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",Ux,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),t.$slots.default?(o.openBlock(),o.createElementBlock("div",Jx,[o.renderSlot(t.$slots,"default")])):o.createCommentVNode("",!0)])}const ri=ce(Kx,[["render",jx]]);ri.install=t=>{t.component(ri.name,ri)};const Qx={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)}}}},$x={class:"text"};function qx(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",$x,[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 Rr=ce(Qx,[["render",qx]]),e0={name:"EvMenu",components:{MenuItem:Rr},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:Rr}}},t0={class:"ev-menu"};function n0(t,e,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",t0,[(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(e0,[["render",n0]]);ci.install=t=>{t.component(ci.name,ci)};const i0={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)}}}},s0={class:"ev-tree-children"},o0={class:"ev-tree-node"};function l0(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",s0,[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",o0,[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 Vr=ce(i0,[["render",l0]]),a0={name:"EvTree",components:{TreeNode:Vr},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=Vr;function r(S){const x=i[S].parent;if(typeof x>"u")return;const I=i[S].node,L=i[x].node;if(!(I.checked===L.checked&&I.indeterminate===L.indeterminate)){if(I.checked)L.checked=L.children.every(v=>v.checked),L.indeterminate=!L.checked;else{const v=W=>W.checked||I.indeterminate;L.checked=!1,L.indeterminate=L.children.some(v)}r(x)}}function c(S,x={}){const I=Object.keys(x);for(let L=0;L<I.length;L++)S[I[L]]=x[I[L]];S.children&&S.children.forEach(L=>{c(L,x)})}function d(){let S=0;const x=[],I=[];function L(v,W){const E=v;E.nodeKey=S++,Object.hasOwnProperty.call(E,"selected")||(E.selected=!1),Object.hasOwnProperty.call(E,"visible")||(E.visible=!0),"value"in E&&I.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),I.push(E.value),x[E.nodeKey]={node:E,nodeKey:E.nodeKey},typeof W<"u"&&(x[E.nodeKey].parent=W.nodeKey,x[W.nodeKey].children.push(E.nodeKey)),E.children&&(x[E.nodeKey].children=[],E.children.forEach(G=>L(G,E)))}return n.value.length&&L(n.value[0]),x}i=d();function h(){return i.filter(S=>S.node.checked).map(S=>S.node)}function u(){h().forEach(x=>{c(x,{checked:!0});const I=i[x.nodeKey].parent;if(!I&&I!==0)return;const L=i[I].node;typeof x.checked<"u"&&x.checked&&L.checked!==x.checked&&r(x.nodeKey)})}function f({nodeKey:S,isChecked:x}){const I=i[S].node;I.checked=x,I.indeterminate=!1,r(S),c(I,{checked:x,indeterminate:!1});const L=h();e("check",L),u()}function m(S){const x=i[S].node;for(let I=0;I<i.length;I++)i[I].node.nodeKey!==S&&(i[I].node.selected=!1);e("click-node",{title:x.title,value:x.value})}function g(S){const x=i[S].node;e("dblclick-node",{title:x.title,value:x.value})}const p=S=>{t.contextMenuItems.length&&l&&(s.value.show(S),l=!1)},y=(S,x)=>{l=S,p(x)},C=(S,x)=>S.toLowerCase().includes(x.toLowerCase()),b=S=>{var x;if(S.children){const I=!!((x=S.children.filter(L=>C(L.title,t.searchWord)))!=null&&x.length);S.children.forEach(L=>{b(L),L.visible=I&&C(L.title,t.searchWord)||!I})}};function k(S){S.children&&S.children.forEach(x=>{x.visible=!1,k(x)})}function T(S){if(!S&&S!==0)return;const x=i[S];x.node.visible=!0,x.parent!==void 0&&T(x.parent)}function w(S){i.forEach(I=>{const L=I.node;L.visible=!1}),i.filter(I=>C(I.node.title,S)).forEach(I=>{const L=I.node;L.visible=!0,t.searchIncludeChildren?b(L):k(L);const v=i[L.nodeKey].parent;T(v)})}const M=o.computed(()=>!n.value.length||n.value.every(S=>!S.visible));o.watch(()=>t.data,S=>{n.value=S,i=d()},{deep:!0});let R;return o.watch(()=>t.searchWord,S=>{R&&clearTimeout(R),R=setTimeout(()=>{S?w(S):i.forEach(x=>{const I=x.node;I.visible=!0})},200)}),o.onMounted(()=>{u();const S=h();S.length&&e("check",S)}),o.onBeforeUnmount(()=>{R&&clearTimeout(R)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:f,clickContent:m,dblClickContent:g,showContextMenu:p,getContextMenuFlag:y}}},r0={class:"ev-tree-view"},c0={key:0};function d0(t,e,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",r0,[(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",c0,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(a0,[["render",d0]]);di.install=t=>{t.component(di.name,di)};const h0={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],R=M.value>w[1]?"23:59":w[1];e("update:modelValue",[M,R])}}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}}},u0={class:"ev-time-picker"},f0={key:0,class:"ev-time-picker-range"},m0=["disabled","readonly","placeholder"],p0=["disabled","readonly","placeholder"],g0={key:1,class:"ev-time-picker-single"},b0=["disabled","readonly","placeholder"];function y0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",u0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",f0,[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,m0),[[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,p0),[[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",g0,[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,b0),[[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(h0,[["render",y0]]);hi.install=t=>{t.component(hi.name,hi)};const x0={name:"EvGridToolbar"},S0={class:"gridToolbar"};function C0(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",S0,[o.renderSlot(t.$slots,"toolbarWrapper")])}const k0=ce(x0,[["render",C0]]),w0={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}}},I0={class:"grid-pagination"};function L0(t,e,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",I0,[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 Er=ce(w0,[["render",L0],["__scopeId","data-v-2e265290"]]);var T0=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Bo=Math.ceil,tt=Math.floor,Ue="[BigNumber Error] ",Wr=Ue+"Number primitive has more than 15 significant digits: ",ft=1e14,he=14,Do=9007199254740991,Yo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ot=1e7,Ne=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(S,x){var I,L,v,W,E,G,V,X,Z=this;if(!(Z instanceof b))return new b(S,x);if(x==null){if(S&&S._isBigNumber===!0){Z.s=S.s,!S.c||S.e>u?Z.c=Z.e=null:S.e<h?Z.c=[Z.e=0]:(Z.e=S.e,Z.c=S.c.slice());return}if((G=typeof S=="number")&&S*0==0){if(Z.s=1/S<0?(S=-S,-1):1,S===~~S){for(W=0,E=S;E>=10;E/=10,W++);W>u?Z.c=Z.e=null:(Z.e=W,Z.c=[S]);return}X=String(S)}else{if(!T0.test(X=String(S)))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(x,2,y.length,"Base"),x==10&&C)return Z=new b(S),M(Z,a+Z.e+1,r);if(X=String(S),G=typeof S=="number"){if(S*0!=0)return i(Z,X,G,x);if(Z.s=1/S<0?(X=X.slice(1),-1):1,b.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Wr+S)}else Z.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(I=y.slice(0,x),W=E=0,V=X.length;E<V;E++)if(I.indexOf(L=X.charAt(E))<0){if(L=="."){if(E>W){W=V;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(S),G,x)}G=!1,X=n(X,x,10,Z.s),(W=X.indexOf("."))>-1?X=X.replace(".",""):W=X.length}for(E=0;X.charCodeAt(E)===48;E++);for(V=X.length;X.charCodeAt(--V)===48;);if(X=X.slice(E,++V)){if(V-=E,G&&b.DEBUG&&V>15&&(S>Do||S!==tt(S)))throw Error(Wr+Z.s*S);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)%he,W<0&&(E+=he),E<V){for(E&&Z.c.push(+X.slice(0,E)),V-=he;E<V;)Z.c.push(+X.slice(E,E+=he));E=he-(X=X.slice(E)).length}else E-=V;for(;E--;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(S){var x,I;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(x="DECIMAL_PLACES")&&(I=S[x],we(I,0,Ne,x),a=I),S.hasOwnProperty(x="ROUNDING_MODE")&&(I=S[x],we(I,0,8,x),r=I),S.hasOwnProperty(x="EXPONENTIAL_AT")&&(I=S[x],I&&I.pop?(we(I[0],-Ne,0,x),we(I[1],0,Ne,x),c=I[0],d=I[1]):(we(I,-Ne,Ne,x),c=-(d=I<0?-I:I))),S.hasOwnProperty(x="RANGE"))if(I=S[x],I&&I.pop)we(I[0],-Ne,-1,x),we(I[1],1,Ne,x),h=I[0],u=I[1];else if(we(I,-Ne,Ne,x),I)h=-(u=I<0?-I:I);else throw Error(Ue+x+" cannot be zero: "+I);if(S.hasOwnProperty(x="CRYPTO"))if(I=S[x],I===!!I)if(I)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=I;else throw f=!I,Error(Ue+"crypto unavailable");else f=I;else throw Error(Ue+x+" not true or false: "+I);if(S.hasOwnProperty(x="MODULO_MODE")&&(I=S[x],we(I,0,9,x),m=I),S.hasOwnProperty(x="POW_PRECISION")&&(I=S[x],we(I,0,Ne,x),g=I),S.hasOwnProperty(x="FORMAT"))if(I=S[x],typeof I=="object")p=I;else throw Error(Ue+x+" not an object: "+I);if(S.hasOwnProperty(x="ALPHABET"))if(I=S[x],typeof I=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(I))C=I.slice(0,10)=="0123456789",y=I;else throw Error(Ue+x+" invalid: "+I)}else throw Error(Ue+"Object expected: "+S);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(S){if(!S||S._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var x,I,L=S.c,v=S.e,W=S.s;e:if({}.toString.call(L)=="[object Array]"){if((W===1||W===-1)&&v>=-Ne&&v<=Ne&&v===tt(v)){if(L[0]===0){if(v===0&&L.length===1)return!0;break e}if(x=(v+1)%he,x<1&&(x+=he),String(L[0]).length==x){for(x=0;x<L.length;x++)if(I=L[x],I<0||I>=ft||I!==tt(I))break e;if(I!==0)return!0}}}else if(L===null&&v===null&&(W===null||W===1||W===-1))return!0;throw Error(Ue+"Invalid BigNumber: "+S)},b.maximum=b.max=function(){return T(arguments,-1)},b.minimum=b.min=function(){return T(arguments,1)},b.random=function(){var S=9007199254740992,x=Math.random()*S&2097151?function(){return tt(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(I){var L,v,W,E,G,V=0,X=[],Z=new b(l);if(I==null?I=a:we(I,0,Ne),E=Bo(I/he),f)if(crypto.getRandomValues){for(L=crypto.getRandomValues(new Uint32Array(E*=2));V<E;)G=L[V]*131072+(L[V+1]>>>11),G>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),L[V]=v[0],L[V+1]=v[1]):(X.push(G%1e14),V+=2);V=E/2}else if(crypto.randomBytes){for(L=crypto.randomBytes(E*=7);V<E;)G=(L[V]&31)*281474976710656+L[V+1]*1099511627776+L[V+2]*4294967296+L[V+3]*16777216+(L[V+4]<<16)+(L[V+5]<<8)+L[V+6],G>=9e15?crypto.randomBytes(7).copy(L,V):(X.push(G%1e14),V+=7);V=E/7}else throw f=!1,Error(Ue+"crypto unavailable");if(!f)for(;V<E;)G=x(),G<9e15&&(X[V++]=G%1e14);for(E=X[--V],I%=he,E&&I&&(G=Yo[he-I],X[V]=tt(E/G)*G);X[V]===0;X.pop(),V--);if(V<0)X=[W=0];else{for(W=-1;X[0]===0;X.splice(0,1),W-=he);for(V=1,G=X[0];G>=10;G/=10,V++);V<he&&(W-=he-V)}return Z.e=W,Z.c=X,Z}}(),b.sum=function(){for(var S=1,x=arguments,I=new b(x[0]);S<x.length;)I=I.plus(x[S++]);return I},n=function(){var S="0123456789";function x(I,L,v,W){for(var E,G=[0],V,X=0,Z=I.length;X<Z;){for(V=G.length;V--;G[V]*=L);for(G[0]+=W.indexOf(I.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(I,L,v,W,E){var G,V,X,Z,N,D,Y,H,B=I.indexOf("."),O=a,P=r;for(B>=0&&(Z=g,g=0,I=I.replace(".",""),H=new b(L),D=H.pow(I.length-B),g=Z,H.c=x(vt(it(D.c),D.e,"0"),10,v,S),H.e=H.c.length),Y=x(I,L,v,E?(G=y,S):(G=S,y)),X=Z=Y.length;Y[--Z]==0;Y.pop());if(!Y[0])return G.charAt(0);if(B<0?--X:(D.c=Y,D.e=X,D.s=W,D=e(D,H,O,P,v),Y=D.c,N=D.r,X=D.e),V=X+O+1,B=Y[V],Z=v/2,N=N||V<0||Y[V+1]!=null,N=P<4?(B!=null||N)&&(P==0||P==(D.s<0?3:2)):B>Z||B==Z&&(P==4||N||P==6&&Y[V-1]&1||P==(D.s<0?8:7)),V<1||!Y[0])I=N?vt(G.charAt(1),-O,G.charAt(0)):G.charAt(0);else{if(Y.length=V,N)for(--v;++Y[--V]>v;)Y[V]=0,V||(++X,Y=[1].concat(Y));for(Z=Y.length;!Y[--Z];);for(B=0,I="";B<=Z;I+=G.charAt(Y[B++]));I=vt(I,X,G.charAt(0))}return I}}(),e=function(){function S(L,v,W){var E,G,V,X,Z=0,N=L.length,D=v%Ot,Y=v/Ot|0;for(L=L.slice();N--;)V=L[N]%Ot,X=L[N]/Ot|0,E=Y*V+X*D,G=D*V+E%Ot*Ot+Z,Z=(G/W|0)+(E/Ot|0)+Y*X,L[N]=G%W;return Z&&(L=[Z].concat(L)),L}function x(L,v,W,E){var G,V;if(W!=E)V=W>E?1:-1;else for(G=V=0;G<W;G++)if(L[G]!=v[G]){V=L[G]>v[G]?1:-1;break}return V}function I(L,v,W,E){for(var G=0;W--;)L[W]-=G,G=L[W]<v[W]?1:0,L[W]=G*E+L[W]-v[W];for(;!L[0]&&L.length>1;L.splice(0,1));}return function(L,v,W,E,G){var V,X,Z,N,D,Y,H,B,O,P,F,K,Q,U,j,J,ne,q=L.s==v.s?1:-1,ee=L.c,$=v.c;if(!ee||!ee[0]||!$||!$[0])return new b(!L.s||!v.s||(ee?$&&ee[0]==$[0]:!$)?NaN:ee&&ee[0]==0||!$?q*0:q/0);for(B=new b(q),O=B.c=[],X=L.e-v.e,q=W+X+1,G||(G=ft,X=nt(L.e/he)-nt(v.e/he),q=q/he|0),Z=0;$[Z]==(ee[Z]||0);Z++);if($[Z]>(ee[Z]||0)&&X--,q<0)O.push(1),N=!0;else{for(U=ee.length,J=$.length,Z=0,q+=2,D=tt(G/($[0]+1)),D>1&&($=S($,D,G),ee=S(ee,D,G),J=$.length,U=ee.length),Q=J,P=ee.slice(0,J),F=P.length;F<J;P[F++]=0);ne=$.slice(),ne=[0].concat(ne),j=$[0],$[1]>=G/2&&j++;do{if(D=0,V=x($,P,J,F),V<0){if(K=P[0],J!=F&&(K=K*G+(P[1]||0)),D=tt(K/j),D>1)for(D>=G&&(D=G-1),Y=S($,D,G),H=Y.length,F=P.length;x(Y,P,H,F)==1;)D--,I(Y,J<H?ne:$,H,G),H=Y.length,V=1;else D==0&&(V=D=1),Y=$.slice(),H=Y.length;if(H<F&&(Y=[0].concat(Y)),I(P,Y,F,G),F=P.length,V==-1)for(;x($,P,J,F)<1;)D++,I(P,J<F?ne:$,F,G),F=P.length}else V===0&&(D++,P=[0]);O[Z++]=D,P[0]?P[F++]=ee[Q]||0:(P=[ee[Q]],F=1)}while((Q++<U||P[0]!=null)&&q--);N=P[0]!=null,O[0]||O.splice(0,1)}if(G==ft){for(Z=1,q=O[0];q>=10;q/=10,Z++);M(B,W+(B.e=Z+X*he-1)+1,E,N)}else B.e=X,B.r=+N;return B}}();function k(S,x,I,L){var v,W,E,G,V;if(I==null?I=r:we(I,0,8),!S.c)return S.toString();if(v=S.c[0],E=S.e,x==null)V=it(S.c),V=L==1||L==2&&(E<=c||E>=d)?fs(V,E):vt(V,E,"0");else if(S=M(new b(S),x,I),W=S.e,V=it(S.c),G=V.length,L==1||L==2&&(x<=W||W<=c)){for(;G<x;V+="0",G++);V=fs(V,W)}else if(x-=E+(L===2&&W>E),V=vt(V,W,"0"),W+1>G){if(--x>0)for(V+=".";x--;V+="0");}else if(x+=W-G,x>0)for(W+1==G&&(V+=".");x--;V+="0");return S.s<0&&v?"-"+V:V}function T(S,x){for(var I,L,v=1,W=new b(S[0]);v<S.length;v++)L=new b(S[v]),(!L.s||(I=nn(W,L))===x||I===0&&W.s===x)&&(W=L);return W}function w(S,x,I){for(var L=1,v=x.length;!x[--v];x.pop());for(v=x[0];v>=10;v/=10,L++);return(I=L+I*he-1)>u?S.c=S.e=null:I<h?S.c=[S.e=0]:(S.e=I,S.c=x),S}i=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,I=/^\.([^.]+)$/,L=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(W,E,G,V){var X,Z=G?E:E.replace(v,"");if(L.test(Z))W.s=isNaN(Z)?null:Z<0?-1:1;else{if(!G&&(Z=Z.replace(S,function(N,D,Y){return X=(Y=Y.toLowerCase())=="x"?16:Y=="b"?2:8,!V||V==X?D:N}),V&&(X=V,Z=Z.replace(x,"$1").replace(I,"0.$1")),E!=Z))return new b(Z,X);if(b.DEBUG)throw Error(Ue+"Not a"+(V?" base "+V:"")+" number: "+E);W.s=null}W.c=W.e=null}}();function M(S,x,I,L){var v,W,E,G,V,X,Z,N=S.c,D=Yo;if(N){e:{for(v=1,G=N[0];G>=10;G/=10,v++);if(W=x-v,W<0)W+=he,E=x,V=N[X=0],Z=tt(V/D[v-E-1]%10);else if(X=Bo((W+1)/he),X>=N.length)if(L){for(;N.length<=X;N.push(0));V=Z=0,v=1,W%=he,E=W-he+1}else break e;else{for(V=G=N[X],v=1;G>=10;G/=10,v++);W%=he,E=W-he+v,Z=E<0?0:tt(V/D[v-E-1]%10)}if(L=L||x<0||N[X+1]!=null||(E<0?V:V%D[v-E-1]),L=I<4?(Z||L)&&(I==0||I==(S.s<0?3:2)):Z>5||Z==5&&(I==4||L||I==6&&(W>0?E>0?V/D[v-E]:0:N[X-1])%10&1||I==(S.s<0?8:7)),x<1||!N[0])return N.length=0,L?(x-=S.e+1,N[0]=D[(he-x%he)%he],S.e=-x||0):N[0]=S.e=0,S;if(W==0?(N.length=X,G=1,X--):(N.length=X+1,G=D[he-W],N[X]=E>0?tt(V/D[v-E]%D[E])*G:0),L)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&&(S.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());}S.e>u?S.c=S.e=null:S.e<h&&(S.c=[S.e=0])}return S}function R(S){var x,I=S.e;return I===null?S.toString():(x=it(S.c),x=I<=c||I>=d?fs(x,I):vt(x,I,"0"),S.s<0?"-"+x:x)}return s.absoluteValue=s.abs=function(){var S=new b(this);return S.s<0&&(S.s=1),S},s.comparedTo=function(S,x){return nn(this,new b(S,x))},s.decimalPlaces=s.dp=function(S,x){var I,L,v,W=this;if(S!=null)return we(S,0,Ne),x==null?x=r:we(x,0,8),M(new b(W),S+W.e+1,x);if(!(I=W.c))return null;if(L=((v=I.length-1)-nt(this.e/he))*he,v=I[v])for(;v%10==0;v/=10,L--);return L<0&&(L=0),L},s.dividedBy=s.div=function(S,x){return e(this,new b(S,x),a,r)},s.dividedToIntegerBy=s.idiv=function(S,x){return e(this,new b(S,x),0,1)},s.exponentiatedBy=s.pow=function(S,x){var I,L,v,W,E,G,V,X,Z,N=this;if(S=new b(S),S.c&&!S.isInteger())throw Error(Ue+"Exponent not an integer: "+R(S));if(x!=null&&(x=new b(x)),G=S.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!S.c||!S.c[0])return Z=new b(Math.pow(+R(N),G?S.s*(2-us(S)):+R(S))),x?Z.mod(x):Z;if(V=S.s<0,x){if(x.c?!x.c[0]:!x.s)return new b(NaN);L=!V&&N.isInteger()&&x.isInteger(),L&&(N=N.mod(x))}else{if(S.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(S)?-0:0,N.e>-1&&(W=1/W),new b(V?1/W:W);g&&(W=Bo(g/he+2))}for(G?(I=new b(.5),V&&(S.s=1),X=us(S)):(v=Math.abs(+R(S)),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):L&&(Z=Z.mod(x))}if(v){if(v=tt(v/2),v===0)break;X=v%2}else if(S=S.times(I),M(S,S.e+1,1),S.e>14)X=us(S);else{if(v=+R(S),v===0)break;X=v%2}N=N.times(N),W?N.c&&N.c.length>W&&(N.c.length=W):L&&(N=N.mod(x))}return L?Z:(V&&(Z=l.div(Z)),x?Z.mod(x):W?M(Z,g,r,E):Z)},s.integerValue=function(S){var x=new b(this);return S==null?S=r:we(S,0,8),M(x,x.e+1,S)},s.isEqualTo=s.eq=function(S,x){return nn(this,new b(S,x))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(S,x){return nn(this,new b(S,x))>0},s.isGreaterThanOrEqualTo=s.gte=function(S,x){return(x=nn(this,new b(S,x)))===1||x===0},s.isInteger=function(){return!!this.c&&nt(this.e/he)>this.c.length-2},s.isLessThan=s.lt=function(S,x){return nn(this,new b(S,x))<0},s.isLessThanOrEqualTo=s.lte=function(S,x){return(x=nn(this,new b(S,x)))===-1||x===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(S,x){var I,L,v,W,E=this,G=E.s;if(S=new b(S,x),x=S.s,!G||!x)return new b(NaN);if(G!=x)return S.s=-x,E.plus(S);var V=E.e/he,X=S.e/he,Z=E.c,N=S.c;if(!V||!X){if(!Z||!N)return Z?(S.s=-x,S):new b(N?E:NaN);if(!Z[0]||!N[0])return N[0]?(S.s=-x,S):new b(Z[0]?E:r==3?-0:0)}if(V=nt(V),X=nt(X),Z=Z.slice(),G=V-X){for((W=G<0)?(G=-G,v=Z):(X=V,v=N),v.reverse(),x=G;x--;v.push(0));v.reverse()}else for(L=(W=(G=Z.length)<(x=N.length))?G:x,G=x=0;x<L;x++)if(Z[x]!=N[x]){W=Z[x]<N[x];break}if(W&&(v=Z,Z=N,N=v,S.s=-S.s),x=(L=N.length)-(I=Z.length),x>0)for(;x--;Z[I++]=0);for(x=ft-1;L>G;){if(Z[--L]<N[L]){for(I=L;I&&!Z[--I];Z[I]=x);--Z[I],Z[L]+=ft}Z[L]-=N[L]}for(;Z[0]==0;Z.splice(0,1),--X);return Z[0]?w(S,Z,X):(S.s=r==3?-1:1,S.c=[S.e=0],S)},s.modulo=s.mod=function(S,x){var I,L,v=this;return S=new b(S,x),!v.c||!S.s||S.c&&!S.c[0]?new b(NaN):!S.c||v.c&&!v.c[0]?new b(v):(m==9?(L=S.s,S.s=1,I=e(v,S,0,3),S.s=L,I.s*=L):I=e(v,S,0,m),S=v.minus(I.times(S)),!S.c[0]&&m==1&&(S.s=v.s),S)},s.multipliedBy=s.times=function(S,x){var I,L,v,W,E,G,V,X,Z,N,D,Y,H,B,O,P=this,F=P.c,K=(S=new b(S,x)).c;if(!F||!K||!F[0]||!K[0])return!P.s||!S.s||F&&!F[0]&&!K||K&&!K[0]&&!F?S.c=S.e=S.s=null:(S.s*=P.s,!F||!K?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(L=nt(P.e/he)+nt(S.e/he),S.s*=P.s,V=F.length,N=K.length,V<N&&(H=F,F=K,K=H,v=V,V=N,N=v),v=V+N,H=[];v--;H.push(0));for(B=ft,O=Ot,v=N;--v>=0;){for(I=0,D=K[v]%O,Y=K[v]/O|0,E=V,W=v+E;W>v;)X=F[--E]%O,Z=F[E]/O|0,G=Y*X+Z*D,X=D*X+G%O*O+H[W]+I,I=(X/B|0)+(G/O|0)+Y*Z,H[W--]=X%B;H[W]=I}return I?++L:H.splice(0,1),w(S,H,L)},s.negated=function(){var S=new b(this);return S.s=-S.s||null,S},s.plus=function(S,x){var I,L=this,v=L.s;if(S=new b(S,x),x=S.s,!v||!x)return new b(NaN);if(v!=x)return S.s=-x,L.minus(S);var W=L.e/he,E=S.e/he,G=L.c,V=S.c;if(!W||!E){if(!G||!V)return new b(v/0);if(!G[0]||!V[0])return V[0]?S:new b(G[0]?L:v*0)}if(W=nt(W),E=nt(E),G=G.slice(),v=W-E){for(v>0?(E=W,I=V):(v=-v,I=G),I.reverse();v--;I.push(0));I.reverse()}for(v=G.length,x=V.length,v-x<0&&(I=V,V=G,G=I,x=v),v=0;x;)v=(G[--x]=G[x]+V[x]+v)/ft|0,G[x]=ft===G[x]?0:G[x]%ft;return v&&(G=[v].concat(G),++E),w(S,G,E)},s.precision=s.sd=function(S,x){var I,L,v,W=this;if(S!=null&&S!==!!S)return we(S,1,Ne),x==null?x=r:we(x,0,8),M(new b(W),S,x);if(!(I=W.c))return null;if(v=I.length-1,L=v*he+1,v=I[v]){for(;v%10==0;v/=10,L--);for(v=I[0];v>=10;v/=10,L++);}return S&&W.e+1>L&&(L=W.e+1),L},s.shiftedBy=function(S){return we(S,-Do,Do),this.times("1e"+S)},s.squareRoot=s.sqrt=function(){var S,x,I,L,v,W=this,E=W.c,G=W.s,V=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(+R(W)),G==0||G==1/0?(x=it(E),(x.length+V)%2==0&&(x+="0"),G=Math.sqrt(+x),V=nt((V+1)/2)-(V<0||V%2),G==1/0?x="5e"+V:(x=G.toExponential(),x=x.slice(0,x.indexOf("e")+1)+V),I=new b(x)):I=new b(G+""),I.c[0]){for(V=I.e,G=V+X,G<3&&(G=0);;)if(v=I,I=Z.times(v.plus(e(W,v,X,1))),it(v.c).slice(0,G)===(x=it(I.c)).slice(0,G))if(I.e<V&&--G,x=x.slice(G-3,G+1),x=="9999"||!L&&x=="4999"){if(!L&&(M(v,v.e+a+2,0),v.times(v).eq(W))){I=v;break}X+=4,G+=4,L=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(M(I,I.e+a+2,1),S=!I.times(I).eq(W));break}}return M(I,I.e+a+1,r,S)},s.toExponential=function(S,x){return S!=null&&(we(S,0,Ne),S++),k(this,S,x,1)},s.toFixed=function(S,x){return S!=null&&(we(S,0,Ne),S=S+this.e+1),k(this,S,x)},s.toFormat=function(S,x,I){var L,v=this;if(I==null)S!=null&&x&&typeof x=="object"?(I=x,x=null):S&&typeof S=="object"?(I=S,S=x=null):I=p;else if(typeof I!="object")throw Error(Ue+"Argument not an object: "+I);if(L=v.toFixed(S,x),v.c){var W,E=L.split("."),G=+I.groupSize,V=+I.secondaryGroupSize,X=I.groupSeparator||"",Z=E[0],N=E[1],D=v.s<0,Y=D?Z.slice(1):Z,H=Y.length;if(V&&(W=G,G=V,V=W,H-=W),G>0&&H>0){for(W=H%G||G,Z=Y.substr(0,W);W<H;W+=G)Z+=X+Y.substr(W,G);V>0&&(Z+=X+Y.slice(W)),D&&(Z="-"+Z)}L=N?Z+(I.decimalSeparator||"")+((V=+I.fractionGroupSize)?N.replace(new RegExp("\\d{"+V+"}\\B","g"),"$&"+(I.fractionGroupSeparator||"")):N):Z}return(I.prefix||"")+L+(I.suffix||"")},s.toFraction=function(S){var x,I,L,v,W,E,G,V,X,Z,N,D,Y=this,H=Y.c;if(S!=null&&(G=new b(S),!G.isInteger()&&(G.c||G.s!==1)||G.lt(l)))throw Error(Ue+"Argument "+(G.isInteger()?"out of range: ":"not an integer: ")+R(G));if(!H)return new b(Y);for(x=new b(l),X=I=new b(l),L=V=new b(l),D=it(H),W=x.e=D.length-Y.e-1,x.c[0]=Yo[(E=W%he)<0?he+E:E],S=!S||G.comparedTo(x)>0?W>0?x:X:G,E=u,u=1/0,G=new b(D),V.c[0]=0;Z=e(G,x,0,1),v=I.plus(Z.times(L)),v.comparedTo(S)!=1;)I=L,L=v,X=V.plus(Z.times(v=X)),V=v,x=G.minus(Z.times(v=x)),G=v;return v=e(S.minus(I),L,0,1),V=V.plus(v.times(X)),I=I.plus(v.times(L)),V.s=X.s=Y.s,W=W*2,N=e(X,L,W,r).minus(Y).abs().comparedTo(e(V,I,W,r).minus(Y).abs())<1?[X,L]:[V,I],u=E,N},s.toNumber=function(){return+R(this)},s.toPrecision=function(S,x){return S!=null&&we(S,1,Ne),k(this,S,x,2)},s.toString=function(S){var x,I=this,L=I.s,v=I.e;return v===null?L?(x="Infinity",L<0&&(x="-"+x)):x="NaN":(S==null?x=v<=c||v>=d?fs(it(I.c),v):vt(it(I.c),v,"0"):S===10&&C?(I=M(new b(I),a+v+1,r),x=vt(it(I.c),I.e,"0")):(we(S,2,y.length,"Base"),x=n(vt(it(I.c),v,"0"),10,S,L,!0)),L<0&&I.c[0]&&(x="-"+x)),x},s.valueOf=s.toJSON=function(){return R(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=he-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/he)==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 Zr=Gr();function sn(t){return new Zr(t)}function Oo(t,e){return sn(t).plus(sn(e)).toNumber()}function M0(t,e){return sn(t).minus(sn(e)).toNumber()}function v0(t,e){return sn(t).dividedBy(sn(e)).toNumber()}function Xr(t,e){return sn(t).decimalPlaces(e,Zr.ROUND_DOWN).toNumber()}const R0={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,R)=>{var S,x;return b?R.parent||M.push((S=R.data)==null?void 0:S[p]):M.push((x=R.data)==null?void 0:x[p]),M},[]):w=s.value.store.map(M=>M[i][T]),y){case"sum":{const M=w.reduce((R,S)=>{const x=Number(S);return Number.isNaN(x)?R:Oo(R,x)},0);k=M&&Xr(M,c(C??e.default));break}case"average":{const M=w.reduce((R,S)=>{const x=Number(S);return Number.isNaN(x)?R:Oo(R,x)},0);k=M&&Xr(v0(M,w.length),c(C??e.default));break}case"max":{const M=w.filter(R=>R!=null);k=M.length?Math.max(...M):"";break}case"min":{const M=w.filter(R=>R!=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}}},V0={class:"column-list"},E0=["title"],W0=["title"];function G0(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",V0,[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,E0)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,W0))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const Nr=ce(R0,[["render",G0],["__scopeId","data-v-4b9bef37"]]),Z0={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:L=>e("update:isShow",L)}),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:L=>e("update:isShowMenuOnClick",L)}),y=L=>{var v;(L==null?void 0:L.length)===1?m=L[0]:(L==null?void 0:L.length)<1&&(m==null&&(m=(v=r.value[0])==null?void 0:v.text),a.value.push(m))},C=L=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,L){const v=L.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 L=d.value.length?d.value:r.value;a.value=L.filter(v=>v.originChecked).map(v=>v.text),b()},T=()=>{d.value=r.value.filter(v=>a.value.includes(v.text));const L=d.value.map(v=>v.text);e("apply-column",L),n.value=!1,p.value=!1},w=o.ref(),M=o.ref(),R=()=>{M.value=Re(a.value),r.value=t.columns.filter(L=>!L.hide&&L.caption).map(L=>{var E,G;const v=(E=w.value)==null?void 0:E.find(V=>V.field===L.field);let W=!1;return v?W=(v==null?void 0:v.hiddenDisplay)!==(L==null?void 0:L.hiddenDisplay)||!((G=M.value)!=null&&G.length)?!(L!=null&&L.hiddenDisplay):M.value.includes(L.field):W=!L.hiddenDisplay,{label:L.caption,text:L.field,originChecked:!L.hiddenDisplay,checked:W,fixed:L.fixed}}),a.value=r.value.filter(L=>L.checked).map(L=>L.text),d.value.length=0,w.value=Re(t.columns)},S=()=>{n.value=!1,p.value=!1},x=()=>{const L=document.createElement("div");L.id="ev-grid-column-setting-modal",L.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(L)},I=async()=>{var Y;await o.nextTick();const L=document.documentElement.clientWidth,v=document.documentElement.clientHeight,W=(Y=i.value)==null?void 0:Y.getBoundingClientRect(),E=W==null?void 0:W.width,G=W==null?void 0:W.height,{top:V,left:X,columnListMenuWidth:Z}=t.position;let N;Z?(N=X,L<X+E&&(N=X-E-Z)):N=X-E;const D=v-G;g.top=`${Math.min(V,D)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>x()),o.watch(()=>t.columns,()=>{R()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{k(),n.value&&await I()}),o.watch(()=>t.hiddenColumn,L=>{const v=d.value.length?d.value.filter(W=>W.text!==L):r.value.filter(W=>W.text!==L&&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:S}}},X0={class:"ev-grid-column-setting__header"},N0={class:"header-title"},P0={class:"ev-grid-column-setting__content"},B0={key:1,class:"is-empty"},D0={class:"ev-grid-column-setting__footer"};function Y0(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",X0,[o.createElementVNode("p",N0,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",P0,[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",B0,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",D0,[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 Pr=ce(Z0,[["render",Y0]]),O0={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 R;const w=[],M=Re(t.items);T&&i.value.field&&((R=M[i.value.field])!=null&&R.length?M[i.value.field].forEach(S=>{w.push(S)}):w.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=w)});const C=(T,w)=>{var M;return((M=T.find(R=>R.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,""))}}}},H0={class:"ev-grid-filter-setting__header"},F0={class:"header-title"},z0={class:"ev-grid-filter-setting__content"},A0={class:"ev-grid-filter-setting__row--button"},K0={class:"ev-grid-filter-setting__footer"};function _0(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",H0,[o.createVNode(a,{icon:"ev-icon-filter-list"}),o.createElementVNode("span",F0," Filter ("+o.toDisplayString(t.$props.column.caption)+") ",1)]),o.createElementVNode("div",z0,[(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",A0,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:m=>i.removeRow(f)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",K0,[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 U0=ce(O0,[["render",_0]]),J0={name:"GridSortButton",props:{icon:{type:String,default:""}}},j0={key:0},Q0={key:1},$0={key:2};function q0(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
4
+ `],...function({vnode:h,recurseCount:u}){const f=u>0?`... (${u} recursive calls)`:"",m=!!h.component&&h.component.parent==null,g=` at <${Ql(h.component,h.type,m)}`,p=">"+f;return h.props?[g,...td(h.props),p]:[g+p]}(c))}),r}(s)),console.warn(...l)}ul()}function td(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(i=>{e.push(...vl(i,t[i]))}),n.length>3&&e.push(" ..."),e}function vl(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=vl(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 Rl={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){Vl(l,e,n)}return s}function Hs(t,e,n,i){if(Be(t)){const l=Jt(t,e,n,i);return l&&vc(l)&&l.catch(a=>{Vl(a,e,n)}),l}const s=[];for(let l=0;l<t.length;l++)s.push(Hs(t[l],e,n,i));return s}function Vl(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"?Rl[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=Rl[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,Fs=!1;const at=[];let Xt=0;const cn=[];let bt=null,Nt=0;const El=Promise.resolve();let As=null;const nd=100;function Wl(t){const e=As||El;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),Gl())}function Gl(){Ni||Fs||(Fs=!0,As=El.then(Xl))}function Zl(t){Se(t)?cn.push(...t):bt&&bt.includes(t,t.allowRecurse?Nt+1:Nt)||cn.push(t),Gl()}const Mn=t=>t.id==null?1/0:t.id,id=(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 Xl(t){Fs=!1,Ni=!0,process.env.NODE_ENV!=="production"&&(t=t||new Map),at.sort(id);const e=process.env.NODE_ENV!=="production"?n=>Nl(t,n):nl;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"&&Nl(n,bt[Nt])||bt[Nt]();bt=null,Nt=0}}(t),Ni=!1,As=null,(at.length||cn.length)&&Xl(t)}}function Nl(t,e){if(t.has(e)){const n=t.get(e);if(n>nd){const i=e.ownerInstance,s=i&&jl(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),Pl(n.initialDef,e);const i=[...n.instances];for(const s of i){const l=Rn(s.type);vn.has(l)||(l!==n.initialDef&&Pl(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.")}Zl(()=>{for(const s of i)vn.delete(Rn(s.type))})})});const Pi=new Map;function Rn(t){return $l(t)?t.__vccOpts:t}function Pl(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,sd=null;const od=Symbol.for("v-ndc"),Bi={};function ld(t,e,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Ms){var r;process.env.NODE_ENV==="production"||e||(n!==void 0&&gt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&gt('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=ll===((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(),Hs(t,d,3,[g])}:(h=nl,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(),Hs(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=()=>zl(y,d&&d.suspense):(y.pre=!0,d&&(y.id=d.uid),C=()=>Ks(y));const b=new Pc(h,C);return process.env.NODE_ENV!=="production"&&(b.onTrack=l,b.onTrigger=a),e?n?y():p=b.run():s==="post"?zl(b.run.bind(b),d&&d.suspense):b.run(),()=>{b.stop(),d&&d.scope&&Lc(d.scope.effects,b)}}function ad(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=ld(s,l.bind(i),n);return a?Jl(a):fd(),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(Mc(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,Wc(i,"__v_skip",!0),Kt(n=i)?n:new Proxy(n,ed)),{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=Wl.bind(t.proxy)),$watch:t=>ad.bind(t)});function Bl(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"&&gt('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=rd[a]||n&&n[a];t[a]=r?r(t[a],e[a]):e[a]}return t}const rd={data:Dl,props:Yl,emits:Yl,methods:En,computed:En,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,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]=Oe(t[i],e[i]);return n},provide:Dl,inject:function(t,e){return En(Ol(t),Ol(e))}};function Dl(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 Oe(t,e){return t?[...new Set([].concat(t,e))]:e}function En(t,e){return t?lt(Object.create(null),t,e):e}function Yl(t,e){return t?Se(t)&&Se(e)?[...new Set([...t,...e])]:lt(Object.create(null),Bl(t),Bl(e??{})):e}const zl=function(t,e){e&&e.pendingBranch?Se(t)?e.effects.push(...t):e.effects.push(t):Zl(t)},Hl=Symbol.for("v-fgt"),cd=Symbol.for("v-txt"),dd=Symbol.for("v-cmt"),Fl="__vInternal",Al=({key:t})=>t??null,Oi=({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),hd=process.env.NODE_ENV!=="production"?(...t)=>Kl(...t):Kl;function Kl(t,e=null,n=null,i=0,s=null,l=!1){if(t&&t!==od||(process.env.NODE_ENV==="production"||t||gt(`Invalid vnode type when creating vnode: ${t}.`),t=dd),(a=t)&&a.__v_isVNode===!0){const c=Yi(t,e,!0);return n&&js(c,n),c.patchFlag|=-2,c}var a;if($l(t)&&(t=t.__vccOpts),e){e=function(h){return h?Os(h)||Fl in h?lt({},h):h:null}(e);let{class:c,style:d}=e;c&&!pt(c)&&(e.class=Es(c)),Ae(d)&&(Os(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&&Os(t)&&gt("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===Hl?0:1,g=!1,p=!1){const y={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Al(d),ref:d&&Oi(d),scopeId:sd,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&&gt("VNode created with invalid key (NaN). VNode type:",y.type),y}(t,e,n,i,s,r,l,!0)}function Yi(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(Ic(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&&Al(r),ref:e&&e.ref?n&&s?Se(s)?s.concat(Oi(e)):[s,Oi(e)]:Oi(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Se(a)?a.map(_l):a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Hl?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&&Yi(t.ssContent),ssFallback:t.ssFallback&&Yi(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function _l(t){const e=Yi(t);return Se(t.children)&&(e.children=t.children.map(_l)),e}function ud(t=" ",e=0){return hd(cd,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||Fl in e||(e._ctx=Vn)}}else Be(e)?(e={default:e,_ctx:Vn},n=32):(e=String(e),64&i?(n=16,e=[ud(e)]):n=8);t.children=e,t.shapeFlag|=n}let Qs,hn,un=null,Ul="__VUE_INSTANCE_SETTERS__";(hn=Rs()[Ul])||(hn=Rs()[Ul]=[]),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()},fd=()=>{un&&un.scope.off(),Qs(null)},md=/(?:^|[-_])(\w)/g,pd=t=>t.replace(md,e=>e.toUpperCase()).replace(/[-_]/g,"");function jl(t,e=!0){return Be(t)?t.displayName||t.name:t.name||e&&t.__name}function Ql(t,e,n=!1){let i=jl(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?pd(i):n?"App":"Anonymous"}function $l(t){return Be(t)&&"__vccOpts"in t}function $s(t){return!(!t||!t.__v_isShallow)}function ql(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 ea(t,e){if(t===e)return!0;if(typeof t=="object"){for(var n in t)if(!ea(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 gd=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,ql([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,ql([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 gd(t,n))},updated:function(t,e){var n=e.value;if(!ea(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},bd={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=()=>{if(!h.value||!d.value||!c.value)return;const x=a.value.findIndex(D=>D.value===s.value);if(x<0)return;const I=d.value.children[x];if(!I)return;const L=c.value.offsetWidth,v=d.value.offsetWidth,W=L-v,E=I.offsetLeft,G=E+I.offsetWidth,V=-u.x,X=V+L,Z=a.value.length-1;let N=u.x;E<V?N=x===0?0:-E:G>X&&(N=x===Z?W:L-G),u.x=Math.min(0,Math.max(W,N))},g=()=>{const x=c.value.offsetWidth,I=d.value.offsetWidth;if(h.value=x<I,h.value){const L=x-I;L>u.x&&(u.x=L),o.nextTick(m)}else u.x=0};o.watch(s,()=>{o.nextTick(m)}),o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let x,I;r.length>l.value.length?(x=r,I=l.value.map(v=>v.value)):(x=l.value.map(v=>v.value),I=r);const L=x.filter(v=>!I.includes(v))[0];if(s.value===L){const v=r.findIndex(W=>W===L);v===0?s.value=l.value[0].value:s.value=l.value[v-1].value}}});const p=x=>{s.value=x},y=x=>{if(l.value.length<2)return;const I=l.value.findIndex(L=>L.value===x);if(I<0){s.value=l.value[0].value;return}x===s.value&&(I===0?s.value=l.value[1].value:s.value=l.value[I-1].value),l.value.splice(I,1),o.nextTick(()=>{r.splice(I,1)}),o.triggerRef(l)},C=(x,I=100)=>{const L=c.value.offsetWidth,v=d.value.offsetWidth,W=L-v;x==="next"&&u.x!==W?W>=u.x-I?u.x=W:u.x-=I:x==="prev"&&u.x!==0&&(I*-1<=u.x?u.x=0:u.x+=I)},b=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:p,removeTab:y,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:C,dragstartTab:(x,I)=>{t.draggable&&(i.value=[...l.value],b.item=x,b.idx=I,n.value=!0)},dragoverTab:x=>{var v;if(!t.draggable||((v=b.item)==null?void 0:v.value)===x)return;const I=i.value.findIndex(W=>{var E;return W.value===((E=b.item)==null?void 0:E.value)}),L=i.value.findIndex(W=>W.value===x);i.value.splice(I,1),i.value.splice(L,0,b.item)},dragendTab:()=>{t.draggable&&(l.value=[...i.value],b.item={},b.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:x=>{var I;return t.draggable&&((I=b.item)==null?void 0:I.value)===x},selectIdxCls:x=>t.draggable&&b.idx===x,onResize:()=>{g()}}}},yd={class:"ev-tabs-header"},xd={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},Sd=["onClick","onDragstart","onDragover"],Cd=["title"],kd=["onClick"],wd={class:"ev-tabs-body"};function Id(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",yd,[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",xd,[o.withDirectives((o.openBlock(),o.createElementBlock("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,Cd),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,kd)):o.createCommentVNode("",!0)],16,Sd))),128))],4)),[[a,i.onResize]])],512)],2)]),o.createElementVNode("div",wd,[o.renderSlot(t.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Gn=ce(bd,[["render",Id]]);Gn.install=t=>{t.component(Gn.name,Gn)};const Ld={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}}},Td={key:0,class:"ev-tab-panel"};function Md(t,e,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",Td,[o.renderSlot(t.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const Zn=ce(Ld,[["render",Md]]);Zn.install=t=>{t.component(Zn.name,Zn)};const vd={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}}},Rd=["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,Rd)}const fn=ce(vd,[["render",Vd]]);fn.install=t=>{t.component(fn.name,fn)};const Ed={name:"EvButtonGroup"},Wd={class:"ev-button-group"};function Gd(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Wd,[o.renderSlot(t.$slots,"default")])}const Xn=ce(Ed,[["render",Gd]]);Xn.install=t=>{t.component(Xn.name,Xn)};const Zd={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}}},Xd=["disabled","value","readonly"],Nd={ref:"checkboxLabel",class:"ev-checkbox-label"};function Pd(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,Xd),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",Nd,[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(Zd,[["render",Pd]]);mn.install=t=>{t.component(mn.name,mn)};const Bd={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 Dd(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(Bd,[["render",Dd]]);pn.install=t=>{t.component(pn.name,pn)};const Od={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}}},Yd=["value","disabled"],zd={class:"ev-radio-label"};function Hd(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,Yd),[[o.vModelRadio,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))])],2)}const Nn=ce(Od,[["render",Hd]]);Nn.install=t=>{t.component(Nn.name,Nn)};const Fd={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 Ad(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(Fd,[["render",Ad]]);Pn.install=t=>{t.component(Pn.name,Pn)};const zi={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}},Kd={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}},_d={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 Hi=44032,Bn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ye=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],We=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Bt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},eo={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},ta=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],na=[["ㄱ","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 ia(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)-Hi;a=r%We.length,l=(r-a)/We.length%Ye.length,s=((r-a)/We.length-l)/Ye.length,e=Bn[s],n=Ye[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 Ud(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=ia(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]&&ta.indexOf(d)===-1?Bt[d]:d,Bt[h]&&ta.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))},{}),sa=function(t){return typeof t<"u"};function Jd(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=Bn.indexOf(jt[i]||i),r=Ye.indexOf(jt[s]||s),c=We.indexOf(jt[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Hi+a*(Ye.length*We.length)+r*We.length+c):t.join("")}function jd(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);We.indexOf(m)===-1&&(g=gn([m],g,!0),m=""),u.filter(sa).forEach(function(p){return s.push([p])}),s.push([f,c,m].filter(Boolean)),g.filter(sa).forEach(function(p){return s.push([p])})}}),s.map(Jd).join("")}var Qd=Object.values(na).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[s]=i,n))},{});function oa(t){return jd(t.split("").map(function(e){return Qd[e]||e}).join(""))}var la=/[\\^$.*+?()[\]{}|]/g,$d=RegExp(la.source);function to(t){return t&&$d.test(t)?t.replace(la,"\\$&"):t||""}var Fi=function(t,e){e===void 0&&(e=!1);var n=Bn.indexOf(t);if(n!==-1){var i=n*Ye.length*We.length+Hi;return"[".concat(e?t:"").concat(String.fromCharCode(i),"-").concat(String.fromCharCode(i+Ye.length*We.length-1),"]")}return t},aa="__".concat(parseInt("fuzzy",36),"__"),ra="__".concat(parseInt("ignorespace",36),"__"),qd=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 R=n,S=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var x=oa(n.trim());x.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(R=x,S.push(to(n.trim())))}var I=R.split(""),L=I.slice(-1)[0],v="",W=ia(L||"");if(W.initialOffset!==-1){I=I.slice(0,-1);var E=W.initial,G=W.medial,V=W.finale,X=W.initialOffset,Z=W.medialOffset,N=X*Ye.length*We.length+Hi,D=[];switch(!0){case V!=="":{D.push(L),Bn.includes(V)&&D.push("".concat(String.fromCharCode(N+Z*We.length)).concat(Fi(V))),Bt[V]&&D.push("".concat(String.fromCharCode(N+Z*We.length+We.join("").search(Bt[V][0])+1)).concat(Fi(Bt[V][1])));break}case G!=="":{var O=void 0,z=void 0;eo[G]?(O=N+Ye.join("").search(eo[G][0])*We.length,z=N+Ye.join("").search(eo[G][1])*We.length+We.length-1):(O=N+Z*We.length,z=O+We.length-1),D.push("[".concat(String.fromCharCode(O),"-").concat(String.fromCharCode(z),"]"));break}case E!=="":{D.push(Fi(E,!0));break}}v=D.length>1?T?"(?:".concat(D.join("|"),")"):"(".concat(D.join("|"),")"):D[0]}var B=b?aa:f?ra:"",Y=a?I.map(function(Q){return Q.search(/[ㄱ-ㅎ]/)!==-1?Fi(Q,!0):to(Q)}).join(B):to(I.join(B)),P=Y.trim()!==""&&v.trim()!=="",H=P?"".concat(Y).concat(B).concat(v):"".concat(Y).concat(v),K=(c?"^":"")+H+(h?"$":"");return B&&(K=K.replace(RegExp(aa,"g"),".*").replace(RegExp(ra,"g"),"\\s*")),S.length>0&&(K=gn(gn([],S,!0),[K],!1).map(function(Q){return"(".concat(Q,")")}).join("|")),e=RegExp(K,(y?"g":"")+(g?"i":"")),e}}(),eh=Object.values(na).reduce(function(t,e){var n,i=e[0],s=e[1];return Pt(Pt({},t),(n={},n[i]=s,n))},{});function th(t){return t.split("").map(function(e){return Ud(e,{grouped:!1}).map(function(n){return eh[n]||n})}).flat().join("")}const ca=new Set,da=(t,...e)=>{ca.has(t)||(ca.add(t),console.warn(...e))},nh=(t,e="Component")=>{if(!t)return"body";const n=`${e}::${t}`;try{const i=document.querySelector(t);return i||(da(n,`[${e}] teleport selector "${t}" did not match any element. Falling back to document.body.`),document.body)}catch(i){return da(n,`[${e}] teleport selector "${t}" is invalid. Falling back to document.body.`,i),document.body}},ih=()=>{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}},sh=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,left:"auto"}),m=o.ref(!1),g=o.ref("body"),p=(B,Y)=>B?[B,oa(B),th(B)].filter(Boolean).map(P=>qd(P,Y)):[],y=o.computed(()=>{var P;const B=(P=l.value)==null?void 0:P.trim();if(!B||!e.filterable)return e.items;const Y=p(B);return e.items.filter(({name:H})=>Y.some(K=>H.search(K)>-1))}),C=o.computed(()=>{var B,Y;return!!((B=e.highlight)!=null&&B.match)&&e.filterable&&!!((Y=l.value)!=null&&Y.trim())}),b=o.computed(()=>{var B;return p((B=l.value)==null?void 0:B.trim(),{global:!0})}),k=B=>{const Y=[{text:B,matched:!1}];if(typeof B!="string"||!B)return Y;const P=[];if(b.value.forEach(U=>{U.lastIndex=0;let j=U.exec(B);for(;j;)j[0].length?P.push([j.index,j.index+j[0].length]):U.lastIndex+=1,j=U.exec(B)}),!P.length)return Y;P.sort((U,j)=>U[0]-j[0]);const H=[P[0]];P.slice(1).forEach(([U,j])=>{const J=H[H.length-1];U<=J[1]?J[1]=Math.max(J[1],j):H.push([U,j])});const K=[];let Q=0;return H.forEach(([U,j])=>{U>Q&&K.push({text:B.slice(Q,U),matched:!1}),K.push({text:B.slice(U,j),matched:!0}),Q=j}),Q<B.length&&K.push({text:B.slice(Q),matched:!1}),K},T=o.computed(()=>C.value?y.value.map(({name:B})=>k(B)):[]),w=o.computed(()=>{var B;return(B=e.highlight)!=null&&B.color?{color:e.highlight.color}:null}),M=B=>{var Y;l.value=(Y=B==null?void 0:B.target)==null?void 0:Y.value},R=B=>{let Y=B==null?void 0:B.parentElement;for(;Y&&Y!==document.documentElement;){const P=window.getComputedStyle(Y);if(/(auto|scroll|overlay|hidden|clip)/.test(P.overflowY))return Y;Y=Y.parentElement}return document.documentElement},S=async({recomputeDirection:B=!1}={})=>{if(await o.nextTick(),!r.value||!c.value)return;const Y=r.value.getBoundingClientRect(),P=Y.height,H=Y.y,K=c.value.getBoundingClientRect().height;if(e.teleport){const Q=document.documentElement.clientHeight;if(B){const U=Y.top,j=Q-Y.bottom,J=K>j;m.value=J&&U>j&&U>=K}f.top=m.value?`${Y.top-K}px`:`${Y.bottom}px`,f.left=`${Y.left}px`;return}if(B){const Q=R(r.value),U=Q===document.documentElement,j=Q.getBoundingClientRect(),J=document.documentElement.clientHeight,ne=U?J:Math.min(j.bottom,J),q=U?0:Math.max(j.top,0),ee=H-q,$=ne-(H+P),de=K>$;m.value=de&&ee>$&&ee>=K}m.value?f.top=`-${K}px`:f.top=`${P}px`,f.left="auto"},x=()=>{var K,Q,U;if(!((U=(Q=(K=d.value)==null?void 0:K.children[0])==null?void 0:Q.children)!=null&&U.length))return;const B="selected",Y=d.value.children[0].children,P=d.value.offsetTop;let H=null;for(let j=0;j<Y.length;j++)if(H=Y[j],H.classList.contains(B)){if(!H.offsetTop)return;d.value.scrollTop=H.offsetTop-P;break}},I=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth),e.teleport||(h.value=`${u.value}px`,await o.nextTick());const B=d.value.querySelectorAll(".ev-select-dropbox-item");let Y=0;B.forEach(ee=>{const $=ee.scrollWidth;$>Y&&(Y=$)});const{borderLeftWidth:P,borderRightWidth:H}=window.getComputedStyle(c.value),K=parseInt(P)+parseInt(H),Q=d.value.offsetWidth-d.value.clientWidth;Y+=Q+K;const U=window.innerWidth,J=c.value.getBoundingClientRect().left,ne=U-J-20,q=Math.max(Math.min(Y,ne),u.value);h.value=`${q}px`}else h.value="100%"};o.watch(()=>s.value,async B=>{B&&(await x(),await I())}),o.watch(()=>y.value,async()=>{await S()});const L=async()=>{if(e.items.length&&!e.disabled&&(s.value=!s.value,s.value)){if(e.teleport&&(g.value=nh(e.teleport,"EvSelect"),r.value)){const B=r.value.getBoundingClientRect();h.value=`${B.width}px`,f.top=`${B.bottom}px`,f.left=`${B.left}px`}await S({recomputeDirection:!0})}},v=()=>{e.filterable&&(l.value=""),s.value=!1},W=o.ref(!1),E=B=>{B||(W.value=!W.value),W.value?n.value=y.value.filter(Y=>!Y.disabled).map(Y=>Y.value):n.value=[]},G=B=>{e.filterable&&(l.value=""),s.value=!1,n.value!==B&&(n.value=B,i())},V=B=>{if(e.filterable&&(l.value=""),!n.value.includes(B))n.value.push(B);else{const Y=n.value.indexOf(B);n.value.splice(Y,1)}W.value=n.value.length===y.value.filter(Y=>!Y.disabled).length,n.value=[...n.value],i()},X=e.multiple?V:G,Z=B=>B===n.value,N=B=>n.value.includes(B),D=e.multiple?N:Z;o.watch(()=>n.value,B=>{e.multiple&&e.checkable&&(B.length===0?W.value=!1:W.value=B.length===y.value.filter(Y=>!Y.disabled).length,S())});const O=()=>{if(s.value){if(e.teleport){v();return}I(),S({recomputeDirection:!0})}},z=B=>{var H,K;if(!s.value)return;const Y=B.target;Y instanceof Element&&((H=c.value)!=null&&H.contains(Y)||(K=a.value)!=null&&K.contains(Y))||v()};return o.onMounted(()=>{window.addEventListener("resize",O)}),o.onUnmounted(()=>{window.removeEventListener("resize",O)}),o.watch(()=>!!e.teleport&&s.value,(B,Y,P)=>{B&&(window.addEventListener("scroll",z,{capture:!0,passive:!0}),P(()=>{window.removeEventListener("scroll",z,{capture:!0})}))}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:y,isHighlightMatch:C,itemChunks:T,highlightStyle:w,clickSelectInput:L,clickOutsideDropbox:v,changeFilterText:M,changeDropboxPosition:S,clickItem:X,selectedItemClass:D,allCheck:W,changeAllCheck:E,dropboxWidth:h,teleportTarget:g}},oh={name:"EvSelect",components:{EvCheckbox:mn,EvCheckboxGroup:pn},directives:{clickoutside:Kd},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"},teleport:{type:String,default:""},tagMaxRows:{type:Number,default:0,validator:t=>Number.isInteger(t)&&t>=0},highlight:{type:Object,default:()=>({}),validator:t=>(t.match===void 0||typeof t.match=="boolean")&&(t.color===void 0||typeof t.color=="string")&&Object.keys(t).every(e=>["match","color"].includes(e))}},emits:{"update:modelValue":null,change:null},setup(t){const e=o.computed(()=>t.tagMaxRows>0),{mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c}=ih(),{select:d,selectWrapper:h,dropbox:u,itemWrapper:f,isDropbox:m,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:T,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:R,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:L,dropboxWidth:v,teleportTarget:W}=sh({mv:n,changeMv:a});return{hasMaxRows:e,mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c,select:d,selectWrapper:h,dropbox:u,itemWrapper:f,isDropbox:m,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:T,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:R,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:L,dropboxWidth:v,teleportTarget:W}}},lh={ref:"selectWrapper",class:"ev-select__wrapper"},ah=["placeholder","disabled"],rh=["tabindex","placeholder","disabled"],ch={class:"ev-tag-name"},dh=["onClick"],hh={class:"ev-tag-name"},uh={class:"ev-tag-name"},fh={class:"ev-select-dropbox-wrapper"},mh=["placeholder","value"],ph={ref:"itemWrapper",class:"ev-select-dropbox-list"},gh={key:0,class:"ev-select-dropbox-ul"},bh=["title","onClick"],yh={key:1},xh={class:"ev-select-dropbox-item disabled"},Sh={key:0,class:"ev-select-dropbox-ul"},Ch=["title","onClick"],kh={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},wh={key:0,class:"ev-select-dropbox-ul"},Ih=["title","onClick"],Lh={key:1},Th={class:"ev-select-dropbox-item disabled"};function Mh(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",lh,[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-select-tag-wrapper",{"has-max-rows":i.hasMaxRows}]),style:o.normalizeStyle(i.hasMaxRows?{"--ev-select-tag-max-rows":n.tagMaxRows}:null),onClick:e[9]||(e[9]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:e[3]||(e[3]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},[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:"",tabindex:i.hasMaxRows?-1:null,placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:e[4]||(e[4]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},null,8,rh),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-select-tag",onClick:e[7]||(e[7]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",hh,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:e[6]||(e[6]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...e[17]||(e[17]=[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",{key:1,class:"ev-select-tag num",onClick:e[8]||(e[8]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",uh," + "+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",onClick:e[5]||(e[5]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",ch,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...e[16]||(e[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,dh)]))),128))],6)):(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,ah),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:e[10]||(e[10]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...e[18]||(e[18]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",fh,[(o.openBlock(),o.createBlock(o.Teleport,{to:i.teleportTarget,disabled:!n.teleport},[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-select-dropbox",{teleported:!!n.teleport}]),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[11]||(e[11]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,mh)]):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[14]||(e[14]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":e[12]||(e[12]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:e[13]||(e[13]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",ph,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":e[15]||(e[15]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",gh,[(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),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["label","disabled"])],10,bh))),128))])):(o.openBlock(),o.createElementBlock("ul",yh,[o.createElementVNode("li",xh,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",Sh,[(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),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["model-value","disabled"])],10,Ch))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",kh,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",wh,[(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),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))],10,Ih))),128))])):(o.openBlock(),o.createElementBlock("ul",Lh,[o.createElementVNode("li",Th,o.toDisplayString(n.noMatchingText),1)]))],512))],6)):o.createCommentVNode("",!0)],8,["to","disabled"]))])],512)],2)),[[c,i.clickOutsideDropbox]])}const Dn=ce(oh,[["render",Mh]]);Dn.install=t=>{t.component(Dn.name,Dn)};const vh={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 Rh(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 On=ce(vh,[["render",Rh]]);On.install=t=>{t.component(On.name,On)};const Vh={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}}},Eh={class:"ev-text-field-wrapper"},Wh=["placeholder","disabled","readonly","autocomplete","maxlength"],Gh=["type","placeholder","disabled","readonly","autocomplete","maxlength"],Zh={key:3,class:"ev-text-field-icon icon-suffix"},Xh={key:4,class:"ev-text-field-icon icon-prefix"},Nh={key:0,class:"ev-text-field-error"},Ph={class:"curr-length"};function Bh(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",Eh,[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,Wh)),[[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,Gh),[[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",Zh,[o.renderSlot(t.$slots,"icon-suffix")])):o.createCommentVNode("",!0),t.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",Xh,[o.renderSlot(t.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",Nh,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",Ph,o.toDisplayString(i.currentLength),1),o.createTextVNode(" / "+o.toDisplayString(n.maxLength)+o.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):o.createCommentVNode("",!0)],2)}const Yn=ce(Vh,[["render",Bh]]);Yn.install=t=>{t.component(Yn.name,Yn)};const bn=globalThis.console,zn={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 ha(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 Dh(t){return yt(t)?1e6*t:0}function Oh(t){return yt(t)?1e9*t:0}function Yh(t){return yt(t)?1e12*t:0}function zh(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 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(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 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 Ah(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 Kh(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 _h={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}=Ah({currentValue:t,validateValue:e});return Kh({currentValue:t,validateValue:e}),{currentValue:t,validateValue:e,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},Uh={class:"ev-input-number__wrapper"},Jh=["onClick"],jh=["placeholder","disabled","readonly"];function Qh(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",Uh,[(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,Jh)),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 Fn=ce(_h,[["render",Qh]]);Fn.install=t=>{t.component(Fn.name,Fn)};var ua=typeof global=="object"&&global&&global.Object===Object&&global,$h=typeof self=="object"&&self&&self.Object===Object&&self,rt=ua||$h||Function("return this")(),xt=rt.Symbol,fa=Object.prototype,qh=fa.hasOwnProperty,eu=fa.toString,An=xt?xt.toStringTag:void 0;function tu(t){var e=qh.call(t,An),n=t[An];try{t[An]=void 0;var i=!0}catch{}var s=eu.call(t);return i&&(e?t[An]=n:delete t[An]),s}var nu=Object.prototype,iu=nu.toString;function su(t){return iu.call(t)}var ou="[object Null]",lu="[object Undefined]",ma=xt?xt.toStringTag:void 0;function Dt(t){return t==null?t===void 0?lu:ou:ma&&ma in Object(t)?tu(t):su(t)}function ct(t){return t!=null&&typeof t=="object"}var au="[object Symbol]";function Ai(t){return typeof t=="symbol"||ct(t)&&Dt(t)==au}function ru(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,pa=xt?xt.prototype:void 0,ga=pa?pa.toString:void 0;function ba(t){if(typeof t=="string")return t;if(qe(t))return ru(t,ba)+"";if(Ai(t))return ga?ga.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var cu=/\s/;function du(t){for(var e=t.length;e--&&cu.test(t.charAt(e)););return e}var hu=/^\s+/;function uu(t){return t&&t.slice(0,du(t)+1).replace(hu,"")}function ze(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ya=NaN,fu=/^[-+]0x[0-9a-f]+$/i,mu=/^0b[01]+$/i,pu=/^0o[0-7]+$/i,gu=parseInt;function Ki(t){if(typeof t=="number")return t;if(Ai(t))return ya;if(ze(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ze(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=uu(t);var n=mu.test(t);return n||pu.test(t)?gu(t.slice(2),n?2:8):fu.test(t)?ya:+t}var xa=1/0,bu=17976931348623157e292;function Sa(t){if(!t)return t===0?t:0;if(t=Ki(t),t===xa||t===-xa){var e=t<0?-1:1;return e*bu}return t===t?t:0}function io(t){return t}var yu="[object AsyncFunction]",xu="[object Function]",Su="[object GeneratorFunction]",Cu="[object Proxy]";function Kn(t){if(!ze(t))return!1;var e=Dt(t);return e==xu||e==Su||e==yu||e==Cu}var so=rt["__core-js_shared__"],Ca=function(){var t=/[^.]+$/.exec(so&&so.keys&&so.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ku(t){return!!Ca&&Ca in t}var wu=Function.prototype,Iu=wu.toString;function qt(t){if(t!=null){try{return Iu.call(t)}catch{}try{return t+""}catch{}}return""}var Lu=/[\\^$.*+?()[\]{}|]/g,Tu=/^\[object .+?Constructor\]$/,Mu=Function.prototype,vu=Object.prototype,Ru=Mu.toString,Vu=vu.hasOwnProperty,Eu=RegExp("^"+Ru.call(Vu).replace(Lu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wu(t){if(!ze(t)||ku(t))return!1;var e=Kn(t)?Eu:Tu;return e.test(qt(t))}function Gu(t,e){return t==null?void 0:t[e]}function en(t,e){var n=Gu(t,e);return Wu(n)?n:void 0}var oo=en(rt,"WeakMap"),ka=Object.create,Zu=function(){function t(){}return function(e){if(!ze(e))return{};if(ka)return ka(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function wa(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 Xu(){}function Nu(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var Pu=800,Bu=16,Du=Date.now;function Ou(t){var e=0,n=0;return function(){var i=Du(),s=Bu-(i-n);if(n=i,s>0){if(++e>=Pu)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{}}(),zu=_i?function(t,e){return _i(t,"toString",{configurable:!0,enumerable:!1,value:Yu(e),writable:!0})}:io,Hu=Ou(zu);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 Au(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 Ku(t){return t!==t}function _u(t,e,n){for(var i=n-1,s=t.length;++i<s;)if(t[i]===e)return i;return-1}function Uu(t,e,n){return e===e?_u(t,e,n):Au(t,Ku,n)}function Ju(t,e){var n=t==null?0:t.length;return!!n&&Uu(t,e,0)>-1}var ju=9007199254740991,Qu=/^(?:0|[1-9]\d*)$/;function lo(t,e){var n=typeof t;return e=e??ju,!!e&&(n=="number"||n!="symbol"&&Qu.test(t))&&t>-1&&t%1==0&&t<e}function ao(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 $u=Object.prototype,qu=$u.hasOwnProperty;function Ia(t,e,n){var i=t[e];(!(qu.call(t,e)&&yn(i,n))||n===void 0&&!(e in t))&&ao(t,e,n)}function ef(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?ao(n,r,c):Ia(n,r,c)}return n}var La=Math.max;function tf(t,e,n){return e=La(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,l=La(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),wa(t,this,r)}}function ro(t,e){return Hu(tf(t,e,io),t+"")}var nf=9007199254740991;function co(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=nf}function Ui(t){return t!=null&&co(t.length)&&!Kn(t)}function Ta(t,e,n){if(!ze(n))return!1;var i=typeof e;return(i=="number"?Ui(n)&&lo(e,n.length):i=="string"&&e in n)?yn(n[e],t):!1}function Ma(t){return ro(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&&Ta(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 sf=Object.prototype;function ho(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||sf;return t===n}function of(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}var lf="[object Arguments]";function va(t){return ct(t)&&Dt(t)==lf}var Ra=Object.prototype,af=Ra.hasOwnProperty,rf=Ra.propertyIsEnumerable,Ji=va(function(){return arguments}())?va:function(t){return ct(t)&&af.call(t,"callee")&&!rf.call(t,"callee")};function cf(){return!1}var Va=typeof le=="object"&&le&&!le.nodeType&&le,Ea=Va&&typeof module=="object"&&module&&!module.nodeType&&module,df=Ea&&Ea.exports===Va,Wa=df?rt.Buffer:void 0,hf=Wa?Wa.isBuffer:void 0,_n=hf||cf,uf="[object Arguments]",ff="[object Array]",mf="[object Boolean]",pf="[object Date]",gf="[object Error]",bf="[object Function]",yf="[object Map]",xf="[object Number]",Sf="[object Object]",Cf="[object RegExp]",kf="[object Set]",wf="[object String]",If="[object WeakMap]",Lf="[object ArrayBuffer]",Tf="[object DataView]",Mf="[object Float32Array]",vf="[object Float64Array]",Rf="[object Int8Array]",Vf="[object Int16Array]",Ef="[object Int32Array]",Wf="[object Uint8Array]",Gf="[object Uint8ClampedArray]",Zf="[object Uint16Array]",Xf="[object Uint32Array]",Ce={};Ce[Mf]=Ce[vf]=Ce[Rf]=Ce[Vf]=Ce[Ef]=Ce[Wf]=Ce[Gf]=Ce[Zf]=Ce[Xf]=!0,Ce[uf]=Ce[ff]=Ce[Lf]=Ce[mf]=Ce[Tf]=Ce[pf]=Ce[gf]=Ce[bf]=Ce[yf]=Ce[xf]=Ce[Sf]=Ce[Cf]=Ce[kf]=Ce[wf]=Ce[If]=!1;function Nf(t){return ct(t)&&co(t.length)&&!!Ce[Dt(t)]}function uo(t){return function(e){return t(e)}}var Ga=typeof le=="object"&&le&&!le.nodeType&&le,Un=Ga&&typeof module=="object"&&module&&!module.nodeType&&module,Pf=Un&&Un.exports===Ga,fo=Pf&&ua.process,xn=function(){try{var t=Un&&Un.require&&Un.require("util").types;return t||fo&&fo.binding&&fo.binding("util")}catch{}}(),Za=xn&&xn.isTypedArray,mo=Za?uo(Za):Nf,Bf=Object.prototype,Df=Bf.hasOwnProperty;function Xa(t,e){var n=qe(t),i=!n&&Ji(t),s=!n&&!i&&_n(t),l=!n&&!i&&!s&&mo(t),a=n||i||s||l,r=a?of(t.length,String):[],c=r.length;for(var d in t)(e||Df.call(t,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lo(d,c)))&&r.push(d);return r}function Na(t,e){return function(n){return t(e(n))}}var Of=Na(Object.keys,Object),Yf=Object.prototype,zf=Yf.hasOwnProperty;function Hf(t){if(!ho(t))return Of(t);var e=[];for(var n in Object(t))zf.call(t,n)&&n!="constructor"&&e.push(n);return e}function Pa(t){return Ui(t)?Xa(t):Hf(t)}function Ff(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var Af=Object.prototype,Kf=Af.hasOwnProperty;function _f(t){if(!ze(t))return Ff(t);var e=ho(t),n=[];for(var i in t)i=="constructor"&&(e||!Kf.call(t,i))||n.push(i);return n}function po(t){return Ui(t)?Xa(t,!0):_f(t)}var Uf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jf=/^\w*$/;function go(t,e){if(qe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ai(t)?!0:Jf.test(t)||!Uf.test(t)||e!=null&&t in Object(e)}var Jn=en(Object,"create");function jf(){this.__data__=Jn?Jn(null):{},this.size=0}function Qf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $f="__lodash_hash_undefined__",qf=Object.prototype,em=qf.hasOwnProperty;function tm(t){var e=this.__data__;if(Jn){var n=e[t];return n===$f?void 0:n}return em.call(e,t)?e[t]:void 0}var nm=Object.prototype,im=nm.hasOwnProperty;function sm(t){var e=this.__data__;return Jn?e[t]!==void 0:im.call(e,t)}var om="__lodash_hash_undefined__";function lm(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jn&&e===void 0?om: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=Qf,tn.prototype.get=tm,tn.prototype.has=sm,tn.prototype.set=lm;function am(){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 rm=Array.prototype,cm=rm.splice;function dm(t){var e=this.__data__,n=ji(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():cm.call(e,n,1),--this.size,!0}function hm(t){var e=this.__data__,n=ji(e,t);return n<0?void 0:e[n][1]}function um(t){return ji(this.__data__,t)>-1}function fm(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=am,It.prototype.delete=dm,It.prototype.get=hm,It.prototype.has=um,It.prototype.set=fm;var jn=en(rt,"Map");function mm(){this.size=0,this.__data__={hash:new tn,map:new(jn||It),string:new tn}}function pm(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 pm(e)?n[typeof e=="string"?"string":"hash"]:n.map}function gm(t){var e=Qi(this,t).delete(t);return this.size-=e?1:0,e}function bm(t){return Qi(this,t).get(t)}function ym(t){return Qi(this,t).has(t)}function xm(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=mm,Lt.prototype.delete=gm,Lt.prototype.get=bm,Lt.prototype.has=ym,Lt.prototype.set=xm;var Sm="Expected a function";function bo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Sm);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(bo.Cache||Lt),n}bo.Cache=Lt;var Cm=500;function km(t){var e=bo(t,function(i){return n.size===Cm&&n.clear(),i}),n=e.cache;return e}var wm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Im=/\\(\\)?/g,Lm=km(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(wm,function(n,i,s,l){e.push(s?l.replace(Im,"$1"):i||n)}),e});function Tm(t){return t==null?"":ba(t)}function Ba(t,e){return qe(t)?t:go(t,e)?[t]:Lm(Tm(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 Da(t,e){e=Ba(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 Mm(t,e,n){var i=t==null?void 0:Da(t,e);return i===void 0?n:i}function vm(t,e){for(var n=-1,i=e.length,s=t.length;++n<i;)t[s+n]=e[n];return t}var Oa=Na(Object.getPrototypeOf,Object),Rm="[object Object]",Vm=Function.prototype,Em=Object.prototype,Ya=Vm.toString,Wm=Em.hasOwnProperty,Gm=Ya.call(Object);function Zm(t){if(!ct(t)||Dt(t)!=Rm)return!1;var e=Oa(t);if(e===null)return!0;var n=Wm.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Ya.call(n)==Gm}function Xm(){this.__data__=new It,this.size=0}function Nm(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Pm(t){return this.__data__.get(t)}function Bm(t){return this.__data__.has(t)}var Dm=200;function Om(t,e){var n=this.__data__;if(n instanceof It){var i=n.__data__;if(!jn||i.length<Dm-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=Xm,dt.prototype.delete=Nm,dt.prototype.get=Pm,dt.prototype.has=Bm,dt.prototype.set=Om;var za=typeof le=="object"&&le&&!le.nodeType&&le,Ha=za&&typeof module=="object"&&module&&!module.nodeType&&module,Ym=Ha&&Ha.exports===za,Fa=Ym?rt.Buffer:void 0,Aa=Fa?Fa.allocUnsafe:void 0;function Ka(t,e){if(e)return t.slice();var n=t.length,i=Aa?Aa(n):new t.constructor(n);return t.copy(i),i}function zm(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,Am=Fm.propertyIsEnumerable,_a=Object.getOwnPropertySymbols,Km=_a?function(t){return t==null?[]:(t=Object(t),zm(_a(t),function(e){return Am.call(t,e)}))}:Hm;function _m(t,e,n){var i=e(t);return qe(t)?i:vm(i,n(t))}function yo(t){return _m(t,Pa,Km)}var xo=en(rt,"DataView"),So=en(rt,"Promise"),Sn=en(rt,"Set"),Ua="[object Map]",Um="[object Object]",Ja="[object Promise]",ja="[object Set]",Qa="[object WeakMap]",$a="[object DataView]",Jm=qt(xo),jm=qt(jn),Qm=qt(So),$m=qt(Sn),qm=qt(oo),ht=Dt;(xo&&ht(new xo(new ArrayBuffer(1)))!=$a||jn&&ht(new jn)!=Ua||So&&ht(So.resolve())!=Ja||Sn&&ht(new Sn)!=ja||oo&&ht(new oo)!=Qa)&&(ht=function(t){var e=Dt(t),n=e==Um?t.constructor:void 0,i=n?qt(n):"";if(i)switch(i){case Jm:return $a;case jm:return Ua;case Qm:return Ja;case $m:return ja;case qm:return Qa}return e});var ep=Object.prototype,tp=ep.hasOwnProperty;function np(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&tp.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var qi=rt.Uint8Array;function Co(t){var e=new t.constructor(t.byteLength);return new qi(e).set(new qi(t)),e}function ip(t,e){var n=Co(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var sp=/\w*$/;function op(t){var e=new t.constructor(t.source,sp.exec(t));return e.lastIndex=t.lastIndex,e}var qa=xt?xt.prototype:void 0,er=qa?qa.valueOf:void 0;function lp(t){return er?Object(er.call(t)):{}}function tr(t,e){var n=e?Co(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var ap="[object Boolean]",rp="[object Date]",cp="[object Map]",dp="[object Number]",hp="[object RegExp]",up="[object Set]",fp="[object String]",mp="[object Symbol]",pp="[object ArrayBuffer]",gp="[object DataView]",bp="[object Float32Array]",yp="[object Float64Array]",xp="[object Int8Array]",Sp="[object Int16Array]",Cp="[object Int32Array]",kp="[object Uint8Array]",wp="[object Uint8ClampedArray]",Ip="[object Uint16Array]",Lp="[object Uint32Array]";function Tp(t,e,n){var i=t.constructor;switch(e){case pp:return Co(t);case ap:case rp:return new i(+t);case gp:return ip(t);case bp:case yp:case xp:case Sp:case Cp:case kp:case wp:case Ip:case Lp:return tr(t,n);case cp:return new i;case dp:case fp:return new i(t);case hp:return op(t);case up:return new i;case mp:return lp(t)}}function nr(t){return typeof t.constructor=="function"&&!ho(t)?Zu(Oa(t)):{}}var Mp="[object Map]";function vp(t){return ct(t)&&ht(t)==Mp}var ir=xn&&xn.isMap,Rp=ir?uo(ir):vp,Vp="[object Set]";function Ep(t){return ct(t)&&ht(t)==Vp}var sr=xn&&xn.isSet,Wp=sr?uo(sr):Ep,Gp=1,or="[object Arguments]",Zp="[object Array]",Xp="[object Boolean]",Np="[object Date]",Pp="[object Error]",lr="[object Function]",Bp="[object GeneratorFunction]",Dp="[object Map]",Op="[object Number]",ar="[object Object]",Yp="[object RegExp]",zp="[object Set]",Hp="[object String]",Fp="[object Symbol]",Ap="[object WeakMap]",Kp="[object ArrayBuffer]",_p="[object DataView]",Up="[object Float32Array]",Jp="[object Float64Array]",jp="[object Int8Array]",Qp="[object Int16Array]",$p="[object Int32Array]",qp="[object Uint8Array]",eg="[object Uint8ClampedArray]",tg="[object Uint16Array]",ng="[object Uint32Array]",ye={};ye[or]=ye[Zp]=ye[Kp]=ye[_p]=ye[Xp]=ye[Np]=ye[Up]=ye[Jp]=ye[jp]=ye[Qp]=ye[$p]=ye[Dp]=ye[Op]=ye[ar]=ye[Yp]=ye[zp]=ye[Hp]=ye[Fp]=ye[qp]=ye[eg]=ye[tg]=ye[ng]=!0,ye[Pp]=ye[lr]=ye[Ap]=!1;function Qn(t,e,n,i,s,l){var a,r=e&Gp;if(n&&(a=s?n(t,i,s,l):n(t)),a!==void 0)return a;if(!ze(t))return t;var c=qe(t);if(c)a=np(t);else{var d=ht(t),h=d==lr||d==Bp;if(_n(t))return Ka(t,r);if(d==ar||d==or||h&&!s)a=h?{}:nr(t);else{if(!ye[d])return s?t:{};a=Tp(t,d,r)}}l||(l=new dt);var u=l.get(t);if(u)return u;l.set(t,a),Wp(t)?t.forEach(function(g){a.add(Qn(g,e,n,g,t,l))}):Rp(t)&&t.forEach(function(g,p){a.set(p,Qn(g,e,n,p,t,l))});var f=yo,m=c?void 0:f(t);return Fu(m||t,function(g,p){m&&(p=g,g=t[p]),Ia(a,p,Qn(g,e,n,p,t,l))}),a}var ig=1,sg=4;function Re(t){return Qn(t,ig|sg)}var og=1,lg=4;function rr(t,e){return e=typeof e=="function"?e:void 0,Qn(t,og|lg,e)}var ag="__lodash_hash_undefined__";function rg(t){return this.__data__.set(t,ag),this}function cg(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=rg,$n.prototype.has=cg;function dg(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 cr(t,e){return t.has(e)}var hg=1,ug=2;function dr(t,e,n,i,s,l){var a=n&hg,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&ug?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(!dg(e,function(C,b){if(!cr(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 fg(t){var e=-1,n=Array(t.size);return t.forEach(function(i,s){n[++e]=[s,i]}),n}function ko(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}var mg=1,pg=2,gg="[object Boolean]",bg="[object Date]",yg="[object Error]",xg="[object Map]",Sg="[object Number]",Cg="[object RegExp]",kg="[object Set]",wg="[object String]",Ig="[object Symbol]",Lg="[object ArrayBuffer]",Tg="[object DataView]",hr=xt?xt.prototype:void 0,wo=hr?hr.valueOf:void 0;function Mg(t,e,n,i,s,l,a){switch(n){case Tg:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Lg:return!(t.byteLength!=e.byteLength||!l(new qi(t),new qi(e)));case gg:case bg:case Sg:return yn(+t,+e);case yg:return t.name==e.name&&t.message==e.message;case Cg:case wg:return t==e+"";case xg:var r=fg;case kg:var c=i&mg;if(r||(r=ko),t.size!=e.size&&!c)return!1;var d=a.get(t);if(d)return d==e;i|=pg,a.set(t,e);var h=dr(r(t),r(e),i,s,l,a);return a.delete(t),h;case Ig:if(wo)return wo.call(t)==wo.call(e)}return!1}var vg=1,Rg=Object.prototype,Vg=Rg.hasOwnProperty;function Eg(t,e,n,i,s,l){var a=n&vg,r=yo(t),c=r.length,d=yo(e),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in e:Vg.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 Wg=1,ur="[object Arguments]",fr="[object Array]",es="[object Object]",Gg=Object.prototype,mr=Gg.hasOwnProperty;function Zg(t,e,n,i,s,l){var a=qe(t),r=qe(e),c=a?fr:ht(t),d=r?fr:ht(e);c=c==ur?es:c,d=d==ur?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||mo(t)?dr(t,e,n,i,s,l):Mg(t,e,c,n,i,s,l);if(!(n&Wg)){var m=h&&mr.call(t,"__wrapped__"),g=u&&mr.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),Eg(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:Zg(t,e,n,i,ts,s)}var Xg=1,Ng=2;function Pg(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,Xg|Ng,i,h):u))return!1}}return!0}function pr(t){return t===t&&!ze(t)}function Bg(t){for(var e=Pa(t),n=e.length;n--;){var i=e[n],s=t[i];e[n]=[i,s,pr(s)]}return e}function gr(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Dg(t){var e=Bg(t);return e.length==1&&e[0][2]?gr(e[0][0],e[0][1]):function(n){return n===t||Pg(n,t,e)}}function Og(t,e){return t!=null&&e in Object(t)}function Yg(t,e,n){e=Ba(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&&co(s)&&lo(a,s)&&(qe(t)||Ji(t)))}function zg(t,e){return t!=null&&Yg(t,e,Og)}var Hg=1,Fg=2;function Ag(t,e){return go(t)&&pr(e)?gr($i(t),e):function(n){var i=Mm(n,t);return i===void 0&&i===e?zg(n,t):ts(e,i,Hg|Fg)}}function Kg(t){return function(e){return e==null?void 0:e[t]}}function _g(t){return function(e){return Da(e,t)}}function Ug(t){return go(t)?Kg($i(t)):_g(t)}function Jg(t){return typeof t=="function"?t:t==null?io:typeof t=="object"?qe(t)?Ag(t[0],t[1]):Dg(t):Ug(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 Qg=jg(),Io=function(){return rt.Date.now()},$g="Expected a function",qg=Math.max,eb=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($g);e=Ki(e)||0,ze(n)&&(h=!!n.leading,u="maxWait"in n,l=u?qg(Ki(n.maxWait)||0,e):l,f="trailing"in n?!!n.trailing:f);function m(M){var R=i,S=s;return i=s=void 0,d=M,a=t.apply(S,R),a}function g(M){return d=M,r=setTimeout(C,e),h?m(M):a}function p(M){var R=M-c,S=M-d,x=e-R;return u?eb(x,l-S):x}function y(M){var R=M-c,S=M-d;return c===void 0||R>=e||R<0||u&&S>=l}function C(){var M=Io();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(Io())}function w(){var M=Io(),R=y(M);if(i=arguments,s=this,c=M,R){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 br=Object.prototype,tb=br.hasOwnProperty,nb=ro(function(t,e){t=Object(t);var n=-1,i=e.length,s=i>2?e[2]:void 0;for(s&&Ta(e[0],e[1],s)&&(i=1);++n<i;)for(var l=e[n],a=po(l),r=-1,c=a.length;++r<c;){var d=a[r],h=t[d];(h===void 0||yn(h,br[d])&&!tb.call(t,d))&&(t[d]=l[d])}return t});function Lo(t,e,n){(n!==void 0&&!yn(t[e],n)||n===void 0&&!(e in t))&&ao(t,e,n)}function ib(t){return ct(t)&&Ui(t)}function To(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function sb(t){return ef(t,po(t))}function ob(t,e,n,i,s,l,a){var r=To(t,n),c=To(e,n),d=a.get(c);if(d){Lo(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&&mo(c);h=c,f||m||g?qe(r)?h=r:ib(r)?h=Nu(r):m?(u=!1,h=Ka(c,!0)):g?(u=!1,h=tr(c,!0)):h=[]:Zm(c)||Ji(c)?(h=r,Ji(r)?h=sb(r):(!ze(r)||Kn(r))&&(h=nr(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),Lo(t,n,h)}function is(t,e,n,i,s){t!==e&&Qg(e,function(l,a){if(s||(s=new dt),ze(l))ob(t,e,a,n,is,i,s);else{var r=i?i(To(t,a),l,a+"",t,e,s):void 0;r===void 0&&(r=l),Lo(t,a,r)}},po)}function yr(t,e,n,i,s,l){return ze(t)&&ze(e)&&(l.set(e,t),is(t,e,void 0,yr,l),l.delete(e)),t}var lb=Ma(function(t,e,n,i){is(t,e,n,i)}),Xe=ro(function(t){return t.push(void 0,yr),wa(lb,void 0,t)}),ab=Math.max,rb=Math.min;function cb(t,e,n){return t>=rb(e,n)&&t<ab(e,n)}function St(t,e,n){return e=Sa(e),n===void 0?(n=e,e=0):n=Sa(n),t=Ki(t),cb(t,e,n)}function He(t,e){return ts(t,e)}var db="[object Number]";function hb(t){return typeof t=="number"||ct(t)&&Dt(t)==db}function Ot(t){return t==null}function ub(t){return t===void 0}var Mo=Ma(function(t,e,n){is(t,e,n)}),fb=Array.prototype,mb=fb.reverse;function pb(t){return t==null?t:mb.call(t)}var gb="Expected a function";function ss(t,e,n){var i=!0,s=!0;if(typeof t!="function")throw new TypeError(gb);return ze(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 bb=1/0,yb=Sn&&1/ko(new Sn([,-0]))[1]==bb?function(t){return new Sn(t)}:Xu,xb=200;function Sb(t,e,n){var i=-1,s=Ju,l=t.length,a=!0,r=[],c=r;if(l>=xb){var d=e?null:yb(t);if(d)return ko(d);a=!1,s=cr,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 Cb(t,e){return t&&t.length?Sb(t,Jg(e)):[]}const kb=()=>{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)=>{hb(f)&&f>=0&&!He(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}},wb=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}},Ib=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)}}},Lb=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()})},Tb={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}=kb(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m}=wb({state:e,slider:n}),{startDrag:g,clickSlider:p,changeInput:y}=Ib({currentValue:t,state:e,slider:n,updateSliderInfo:l,setSliderValue:a});return Lb({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}}},Mb={class:"ev-slider-wrapper"},vb={ref:"sliderLine",class:"ev-slider-line"},Rb={key:0,class:"ev-slider-step-wrapper"},Vb={key:2,class:"ev-slider-mark-wrapper"},Eb={class:"ev-slider-mark-label"},Wb=["innerHTML"],Gb=["innerHTML"];function Zb(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",Mb,[o.createElementVNode("div",vb,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",Rb,[(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",Vb,[(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",Eb,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,Wb)],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,Gb)],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(Tb,[["render",Zb]]);qn.install=t=>{t.component(qn.name,qn)};const Xb={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 Nb(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(Xb,[["render",Nb]]);Cn.install=t=>{t.component(Cn.name,Cn)};const vo=6,Ro=7,Vo=4,Eo=3,Wo=5,Go=4,je=12,Pb=24,Bb=60,Db=60,ut=12,xr=4,Zo=20,Xo={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월"]},Ob={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"),Sr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Cr=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)),zb=(t,e)=>new Date(`${t}-${e}-1`).getDay(),No=(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},kr=(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(),wr=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/Zo)*Zo,l=s+Zo-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&&Sr.exec((y=t.modelValue)==null?void 0:y.toString())||t.modelValue.length===19&&Cr.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&&Sr.exec(b)||b.length===19&&Cr.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(()=>wr(c.main.year)),expanded:o.computed(()=>wr(c.expanded.year))}),h=o.computed(()=>Xo[t.monthNotation][c.main.month-1]),u=o.computed(()=>Xo[t.monthNotation][c.expanded.month-1]),f=o.reactive({main:h,expanded:u}),m=o.computed(()=>Ob[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(Wo,Go),expanded:kn(Wo,Go)}),a=o.reactive({main:kn(Vo,Eo),expanded:kn(Vo,Eo)}),r=o.reactive({main:kn(vo,Ro),expanded:kn(vo,Ro)}),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,R=zb(p.year,p.month),S=No(p.month===1?p.year-1:p.year,(je+p.month-1)%je||je),x=No(p.year,p.month);let I="";e.mode.includes("Time")&&(e.mode==="dateTime"?I=n.value:I=g==="main"?n.value[0]:n.value[1]);let L=0,v=0,W=0,E=0,G="";const V=(X,Z,N)=>{var H,K,Q;G=ei({year:v,month:W,date:E});const D=(I==null?void 0:I.split(" ")[1])??"",O=C&&!y&&as(e.mode,g,G,n.value)||+new Date(`${G} ${D}`)<ls,z=y&&y(new Date(`${G} ${D}`))||O,B=+(g!=="main"),Y=C&&n.value.length>B&&((K=(H=n.value)==null?void 0:H[B])==null?void 0:K.includes(G)),P=!z&&(C?Y:(Q=n.value)==null?void 0:Q.includes(G));r[g][Z][N]={monthType:`${X}${z?" disabled":""}`,isToday:b===G,isSelected:P,year:v,month:W,date:E}};for(let X=0;X<vo;X++)for(let Z=0;Z<Ro;Z++)X===0?R!==0?Z<R?(v=w,W=k,E=S-R+1+Z,V("prev",X,Z)):(L++,v=p.year,W=p.month,E=L,V("",X,Z)):(v=w,W=k,E=S-6+Z,V("prev",X,Z)):x<=L?(L++,v=M,W=T,E=L-x,V("next",X,Z)):(L++,v=p.year,W=p.month,E=L,V("",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<Vo;T++)for(let w=0;w<Eo;w++)a[g][T][w]={label:Xo.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<Wo;b++)for(let k=0;k<Go;k++)l[g][b][k]={label:p,value:p,today:p===y,isSelected:p===i[g].year,disabled:p<C},p++},setHmsTime:()=>{var R,S;const g=(R=e.options)==null?void 0:R.timeFormat,p=(S=e.options)==null?void 0:S.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=(x,I,L)=>{const v=x==="main"?b:k,W=x==="main"?T:w;if(!v)return!1;const E=v.split(" ")[0];let G=Ze(v,"hour"),V=Ze(v,"min"),X=Ze(v,"sec");I==="hour"?G=L:I==="min"?V=L:I==="sec"&&(X=L);const Z=`${E} ${Ge(G)}:${Ge(V)}:${Ge(X)}`;return W&&W(new Date(Z))?!0:!W&&as(e.mode,x,Z,n.value)};["hour","min","sec"].forEach(x=>{let I=Db;x==="hour"?I=Pb:x==="min"&&(I=Bb);const L=b&&b.length>0?ti(y,b,x):-1,v=k&&k.length>0?ti(C,k,x):-1;for(let W=0;W<I;W++){let E=e.mode==="dateTimeRange"&&M("main",x,W);c.main[x][W]={timeType:x,num:W,isSelected:!E&&L===W,isDisabled:E},e.mode==="dateTimeRange"&&(E=M("expanded",x,W),c.expanded[x][W]={timeType:x,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,R=T*ut+w*xr+M;return k[g][R]}}},Ab=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=(V,X)=>{const Z=l[V],{year:N,month:D,hour:O,min:z,sec:B}=X;N&&(Z.year=N),D&&(Z.month=D),O&&(Z.hour=O),z&&(Z.min=z),B&&(Z.sec=B)},b=V=>{V==null||V.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=(V,X)=>{const Z=u[V]===et.MONTH?1:20,N=X==="prev"?-Z:Z,D=new Date(ls).getFullYear(),O=l[V].year+N;l[V].year=O<D?D:O},T=(V,X)=>{const Z=l[V];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=(V,X)=>{switch(u[V]){case et.DATE:{T(V,X),r(V);break}case et.MONTH:k(V,X),c(V);break;case et.YEAR:k(V,X),d(V);break}},M=(V,X)=>{X===et.DATE?r(V):X===et.MONTH?c(V):X===et.YEAR&&d(V),u[V]=X},R=(V,X)=>{const{value:Z}=X;X.disabled||(u[V]===et.YEAR?(l[V].year=Z,u[V]=et.MONTH,c(V)):(l[V].month=Z,u[V]=et.DATE,r(V)))},S=(V,X)=>{var J,ne,q,ee;const{year:Z,month:N,date:D,monthType:O}=X,z=ei({year:Z,month:N,date:D}),B=e.modelValue?(Array.isArray(e.modelValue)?((J=e.modelValue)==null?void 0:J.map($=>$==null?void 0:$.split(" ")[0]))??[]:e.modelValue.split(" ")[0]).includes(z):!1;let Y=e.options.disabledDate;if(Y&&Array.isArray(Y)&&(Y=V==="main"?Y[0]:Y[1]),Y&&Y(new Date(z))&&!B)return;if(!Y&&["dateRange","dateTimeRange"].includes(e.mode)&&as(e.mode,V,z,s.value))return;const P=l[V],H=(je+P.month-1)%je||je,K=P.month===1?P.year-1:P.year,Q=(P.month+1)%je||je,U=P.month===12?P.year+1:P.year,j=()=>{O.includes("prev")?(P.year=K,P.month=H):O.includes("next")&&(P.year=U,P.month=Q)};switch(e.mode){case"date":n("update:modelValue",z);break;case"dateTime":{const de=!!((ne=s.value)!=null&&ne.split(" ")[1])?(q=s.value)==null?void 0:q.split(" ")[1]:"00:00:00",me=Te(i,`${z} ${de}`);n("update:modelValue",me);break}case"dateMulti":{const $=e.options.multiType,de=e.options.multiDayLimit;if($==="date"){const me=s.value.indexOf(z);me>-1?(s.value.splice(me,1),n("update:modelValue",[...s.value])):s.value.length<de&&(s.value.push(z),j(),n("update:modelValue",[...s.value]))}else if($==="week"||$==="weekday"){const me=$==="week"?7:5,ae=$==="week"?6:5,xe=new Date(`${z} 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),j();(!Y||!Y(new Date(Vt)))&&s.value.unshift(Vt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let $=[...s.value];if(!s.value.length)$=[z,z];else{const de=+(V==="expanded");$[de]=z}n("update:modelValue",$);break}case"dateTimeRange":{let $=[...s.value];if($.length){const de=+(V==="expanded"),me=((ee=$[de])==null?void 0:ee.split(" ")[1])||"00:00:00";let ae=`${z} ${me}`;i&&i.length&&(ae=Te(i[de],ae)),$[de]=ae}else{let de=`${z} 00:00:00`,me=`${z} 00:00:00`;i&&i.length&&(de=Te(i[0],de),me=Te(i[1],me)),$=[de,me]}n("update:modelValue",$);break}}},x=(V,X,Z)=>{if(y[V][X])return;const N=l[V],D=1;X==="hour"?Z==="down"&&N.hour<2?N.hour++:Z==="up"&&N.hour>D&&N.hour--:X==="min"?Z==="down"&&N.min<5?N.min++:Z==="up"&&N.min>D&&N.min--:X==="sec"&&(Z==="down"&&N.sec<5?N.sec++:Z==="up"&&N.sec>D&&N.sec--)},I=(V,X,Z,N)=>{var ne;if(y[V][X])return;const D=l[V],O=a[V],z=D[X]-1,B=Z-1,Y=N-1,P=z*ut+B*xr+Y;if((ne=O[X][P])!=null&&ne.isDisabled)return;const H=new Date,K={year:H.getFullYear(),month:H.getMonth()+1,date:H.getDate()};let Q=!0,U=[];const j=()=>{let q;return X==="hour"?q=`${Ge(P)}:00:00'`:X==="min"?q=`00:${Ge(P)}:00`:X==="sec"&&(q=`00:00:${Ge(P)}`),`${ei(K)} ${q}`},J=q=>{let ae=11;return X==="min"?ae=14:X==="sec"&&(ae=17),`${q==null?void 0:q.substr(0,ae)}${Ge(P)}${q==null?void 0:q.substr(ae+2)}`};if(e.mode==="dateTime"){let q;e.modelValue?q=Te(i,J(e.modelValue)):(Q=!1,q=Te(i,j())),n("update:modelValue",q),U.push(q)}else{const q=V!=="main"|0;let ee=[...s.value];if(e.modelValue.length){let $=J(e.modelValue[q]);i&&i.length&&($=Te(i[q],$)),ee[q]=$}else{const $=j();ee=[$,$],i&&i.length&&(ee=[...ee.map((de,me)=>Te(i[me],de))]),Q=!1,U=ee}n("update:modelValue",ee)}h(),Q||b(U)},L=(V,X)=>{w(V,X.deltaY>0?"next":"prev")},v=(V,X,Z)=>{y[V][X]||x(V,X,Z.deltaY>0?"down":"up")},W=ss((V,X)=>{const Z=X.target.tagName==="TD"?X.target:X.target.parentElement,N=Z.classList.contains("disabled"),D=Z.classList.contains("prev"),O=Z.classList.contains("next");if(Z.classList.length>0&&!N){const z=l[V];let B={year:+z.year,month:+z.month,date:X.target.innerText};D?B={...B,...kr("prev",B.year,B.month)}:O&&(B={...B,...kr("next",B.year,B.month)});const Y=f.value,P=ei({year:B.year,month:B.month,date:B.date});wn(P)<wn(Y)?(s.value[0]=P,s.value[1]=Y):(s.value[0]=Y,s.value[1]=P),r("main"),r("expanded")}},10),E=V=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode),Z=e.options.disabledDate;if(X){const[N,D]=s.value;let[O,z]=[Z,Z];if(Z&&Array.isArray(Z)&&([O,z]=Z),V[0]&&V[0]!==N&&O&&O(new Date(V[0])))return!0;if(V[1]&&V[1]!==D&&z&&z(new Date(V[1])))return!0;if(!Z&&as(e.mode,"main",V[0],V))return!0}else{if(e.mode==="dateMulti")return V.some(N=>Z&&Z(new Date(N)));if(Z&&Z(new Date(V)))return!0}return!1};return o.watch(()=>e.modelValue,V=>{if(E(V)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(e.mode);if(s.value=X?[...V]:V,e.mode==="dateRange")b(V);else if(e.mode.includes("Time")){let Z=[];e.mode==="dateTime"?Z=[V]:e.mode==="dateTimeRange"&&(Z=V),b(Z),h()}else e.mode==="date"&&b([V])}),{clickYearMonthBtn:M,clickPrevNextBtn:w,clickDate:S,clickYearMonth:R,clickHmsBtn:x,clickTime:I,wheelMonth:L,wheelTime:v,calendarEventName:m,onMousemoveDate:W,preventTimeEventType:y}},Kb={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:R,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:L}=Ab({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:R,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:L}}},_b={class:"ev-calendar-wrapper"},Ub={class:"ev-calendar-date-area"},Jb={class:"ev-calendar-header"},jb=["onClick"],Qb={class:"ev-calendar-year-month-wrapper"},$b={key:0,class:"ev-calendar-year-range"},qb=["onClick"],ey=["onClick"],ty=["onClick"],ny={class:"ev-calendar-body"},iy=["onWheel"],sy=["onClick"],oy=["onWheel"],ly=["onClick"],ay={key:2,class:"ev-calendar-selector-btn-wrapper"},ry={key:0,class:"ev-calendar-time-area"},cy={key:0,class:"ev-calendar-time-area-disabled"},dy={class:"ev-calendar-time-side"},hy={class:"ev-calendar-time-center"},uy=["onWheel"],fy=["onClick"],my={class:"ev-calendar-time-side"},py=["onClick"];function gy(t,e,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",_b,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",Ub,[o.createElementVNode("div",Jb,[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",Qb,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",$b,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,qb),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,ey)):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,ty)]),o.createElementVNode("div",ny,[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,sy))),128))]))),128))],40,iy)])):(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,ly))),128))]))),128))],40,oy)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",ay,[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",ry,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",cy)):o.createCommentVNode("",!0),o.createElementVNode("div",dy,[(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",hy,[(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,fy)),64))])),64))],40,uy)])),64))]),o.createElementVNode("div",my,[(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,py)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const ni=ce(Kb,[["render",gy]]);ni.install=t=>{t.component(ni.name,ni)};const by=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),yy=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]/),xy=()=>{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&&by.exec(b)),p=b=>!!(b.length===19&&yy.exec(b)),y=b=>{const k=b.split(" ")[0],T=+k.split("-")[0],w=+k.split("-")[1],M=+k.split("-")[2],R=No(T,w);return+M<=R&&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]}}}},Sy=()=>{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}},Cy=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[R,S]=M(),[x,I]=b,L=Te(x,h(R)),v=Te(I,h(S)),W=L===h(k),E=v===h(T);return W&&E}):w=l.find(({shortcutDate:M})=>{const[R,S]=M(),x=e.mode==="dateTimeRange"?h:d,I=x(R)===x(k),L=x(S)===x(T);return I&&L}),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,R]=b;n.value=[Te(M,h(T)),Te(R,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}},ky={name:"EvDatePicker",directives:{clickoutside:_d},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}=xy(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p}=Sy(),{usedShortcuts:y,clickShortcut:C,setActiveShortcut:b}=Cy({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}}},wy={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},Iy=["placeholder","readonly","disabled"],Ly=["placeholder","disabled"],Ty={class:"ev-tag-name"},My=["onClick"],vy={key:0,class:"ev-select-tag num"},Ry={class:"ev-tag-name"},Vy={class:"ev-select-tag num"},Ey={class:"ev-tag-name"},Wy={class:"ev-date-picker-dropbox-wrapper"},Gy={key:0,class:"ev-date-picker-dropbox__button-layout"},Zy={key:1,class:"ev-date-picker-dropbox__divider"};function Xy(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",wy,[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,Iy),[[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,Ly),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",Ty,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,My)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",vy,[o.createElementVNode("span",Ry,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",Vy,[o.createElementVNode("span",Ey,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",Wy,[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",Gy,[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",Zy)):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(ky,[["render",Xy]]);ii.install=t=>{t.component(ii.name,ii)};const Ny={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}}},Py={key:0,class:"ev-message-icon"},By=["innerHTML"],Dy={key:2,class:"ev-message-content"};function Oy(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",Py,[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,By)):(o.openBlock(),o.createElementBlock("div",Dy,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(Ny,[["render",Oy]]),zy=o.defineComponent(Yy),Ir="ev-message-modal",Lr=document.createElement("div");Lr.id=Ir;const rs=(t={})=>{document.getElementById(Ir)||document.body.appendChild(Lr);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof t=="string"?{message:t,unmount:i}:{...t,unmount:i},l=o.h(zy,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"},Ay={class:"ev-notification-content"},Ky={key:0,class:"title"},_y=["innerHTML"],Uy={key:2,class:"message"};function Jy(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",Ay,[n.title?(o.openBlock(),o.createElementBlock("p",Ky,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,_y)):(o.openBlock(),o.createElementBlock("p",Uy,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",Jy]]),Qy=o.defineComponent(jy),Tr="ev-notification-modal",cs=document.createElement("div");cs.id=Tr;const $y=["top-left","top-right","bottom-left","bottom-right"],ds=(t={})=>{const e=t.position||"top-right";if(!$y.includes(e)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(Tr)||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(Qy,r);o.render(c,l),i.appendChild(c.el)};ds.install=t=>{const e=t.config.globalProperties;e.$notify=ds};const qy={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}}},ex={key:0,class:"ev-message-box-icon"},tx={class:"ev-message-box-content"},nx={key:0,class:"ev-message-box-title"},ix=["innerHTML"],sx={key:2,class:"ev-message-box-message"},ox={class:"ev-message-box-btn"};function lx(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",ex,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",tx,[n.title?(o.openBlock(),o.createElementBlock("p",nx,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,ix)):(o.openBlock(),o.createElementBlock("p",sx,o.toDisplayString(n.message),1))]),o.createElementVNode("div",ox,[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 ax=ce(qy,[["render",lx]]),rx=o.defineComponent(ax),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(rx,i);o.render(s,e)};hs.install=t=>{const e=t.config.globalProperties;e.$messagebox=hs};const Mr=(t,e)=>Array.from(Array(t),()=>Array(e).fill(!1)),cx=()=>{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?Mr(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=[...Mr(t.rowLabels.length,t.colLabels.length)])}}},dx=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]}}},hx={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}=cx();e();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=dx({mv:t});return{mv:t,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},ux={class:"ev-scheduler-header"},fx=["onClick","innerHTML"],mx=["onClick","innerHTML"],px=["onMousedown","onMouseup"];function gx(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",ux,[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,fx))),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,mx)),(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,px))),128))]))),128))],32)],2)}const si=ce(hx,[["render",gx]]);si.install=t=>{t.component(si.name,si)};const bx=()=>{const t=o.defineComponent(vr),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)}}},yx=()=>{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)}}},xx=()=>{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 L,v,W;const m=document.documentElement.clientWidth,g=document.documentElement.clientHeight,p=20,y=(L=f.target.parentElement)==null?void 0:L.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:R}=w,S=f.target.offsetTop,x=g<b+S+R,I=m<C+k+M+p;x?r.top=`${T-R}px`:r.top=`${S}px`,I?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}},Sx={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}=xx();return{isExistChild:t,computedIsShow:e,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},Cx={class:"ev-menu-list"},kx={class:"ev-menu-ul"},wx=["onClick","onMouseenter"],Ix={class:"ev-menu-li-text"},Lx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function Tx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Cx,[o.createElementVNode("ul",kx,[(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",Ix,[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",Lx)):o.createCommentVNode("",!0)],42,wx)),[[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 vr=ce(Sx,[["render",Tx]]),Mx={name:"EvContextMenu",directives:{clickoutside:zi},components:{MenuList:vr},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}=bx(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=yx();return o.onBeforeMount(()=>e()),{isShow:n,rootMenuList:i,menuStyle:s,comp:t,show:l,hide:a}}};function vx(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(Mx,[["render",vx]]);oi.install=t=>{t.component(oi.name,oi)};const Rx=()=>window.innerWidth-document.documentElement.clientWidth,Vx=()=>{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=Rx();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}},Ex=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=(L,v)=>{if(L==null||v==null)return!1;const W=i.value.getBoundingClientRect(),E=+L-W.left,G=+v-W.top,V=s.value.style,X={top:r(V.paddingTop,"vertical"),left:r(V.paddingLeft,"horizontal"),right:r(V.paddingRight,"horizontal")},Z=X.left,N=W.width-X.right,D=X.top,O=D+s.value.offsetHeight;return E>Z&&E<N&&G>D&&G<O},y=L=>{if(L===null||typeof L!="object")return;let v,W,E,G,V,X;const Z=i.value,N=Object.prototype.hasOwnProperty;N.call(L,"top")?v=L.top:v=u.top,N.call(L,"left")?W=L.left:W=u.left,N.call(L,"width")?E=L.width:E=Z.offsetWidth,N.call(L,"height")?G=L.height:G=Z.offsetHeight,N.call(L,"minWidth")?V=L.minWidth:V=e.minWidth,N.call(L,"minHeight")?X=L.minHeight:X=e.minHeight,E=r(E,"horizontal")>r(V,"horizontal")?E:V,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(V),h.minHeight=a(X)},C=L=>{if(!(!i.value||u.pressedSpot))if(e.resizable){const v=i.value.getBoundingClientRect(),W=L.clientX-v.left,E=L.clientY-v.top,G=E<d,V=W<d,X=W>=v.width-d,Z=E>=v.height-d;G&&V||Z&&X?i.value.style.cursor="nwse-resize":G&&X||Z&&V?i.value.style.cursor="nesw-resize":X||V?i.value.style.cursor="ew-resize":Z||G?i.value.style.cursor="ns-resize":e.draggable&&p(L.clientX,L.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else e.draggable&&p(L.clientX,L.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},b=L=>{const v=window.innerWidth,W=window.innerHeight,E=m.top,G=m.left,V=m.right,X=m.bottom,Z=r(e.minWidth,"horizontal"),N=r(e.minHeight,"vertical"),D=L.clientX>=v?v:L.clientX;let O=L.clientY>=W?W:L.clientY;O=L.clientY>0?O:0;const z=D-u.clientX,B=O-u.clientY;let Y=u.top,P=u.left,H=u.width,K=u.height;const Q=Y+u.height-N,U=P+u.width-Z;E&&(Y=u.top+B,K=u.height-B,Y>Q&&(Y=Q)),G&&(P=u.left+z,H=u.width-z,P>U&&(P=U)),V&&(H=u.width+z),X&&(K=u.height+B),H=Math.min(Math.max(H,Z),v),K=Math.min(Math.max(K,N),W);const j={top:Y,left:P,width:H,height:K};y(j),n("resize",L,{...j})},k=(L,v)=>{let W=v;return W<0?W=0:W>L-c&&(W=Math.floor(L-c)),W},T=(L,v)=>{let W=v;return W<-(u.width-c)?W=-Math.floor(u.width-c):W>L-c&&(W=Math.floor(L-c)),W},w=L=>{if(L.preventDefault(),u.state="mousedown-mousemove",e.draggable&&u.pressedSpot==="header"){const v=document.documentElement.clientWidth,W=document.documentElement.clientHeight,E=L.clientY-u.clientY,G=L.clientX-u.clientX;let V=u.top+E,X=u.left+G;V=k(W,V),X=T(v,X),y({top:`${V}px`,left:`${X}px`,width:h.width??e.width,height:h.height??e.height})}else e.resizable&&u.pressedSpot==="border"&&b(L);n("mousedown-mousemove",L)},M=L=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",L),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",M)},R=L=>{if(!i.value||!e.resizable&&!e.draggable)return;let v="";if(e.resizable){const W=i.value.getBoundingClientRect(),E=L.clientX-W.left,G=L.clientY-W.top,V=G<d,X=E<d,Z=E>=W.width-d,N=G>=W.height-d;m.top=V,m.left=X,m.right=Z,m.bottom=N,(V||X||Z||N)&&(v="border")}if(v!=="border"&&p(L.clientX,L.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=L.clientX,u.clientY=L.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=L.clientX,u.clientY=L.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",w),window.addEventListener("mouseup",M)},S=L=>{!e.draggable&&!e.resizable||C(L)},x=()=>{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})})},I=()=>{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(L=>{delete h[L]})};return o.watch(()=>e.visible,L=>{L||I()}),{dragStyle:h,startDrag:R,moveMouse:S,clickExpandBtn:x}},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)}}})(),Wx=t=>{const e=window.getComputedStyle(t).getPropertyValue("z-index").trim();return!e||isNaN(e)?700:parseInt(e)},Po=()=>{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:Wx(n.elem)})).sort(t)},Gx=({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=Po(),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=Po();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=Po(),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}},Zx={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}=Vx(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=Ex({windowRef:t,headerRef:e,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=Gx({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}}},Xx={key:0,ref:"headerRef",class:"ev-window-header"},Nx={key:0,class:"ev-window-icon"},Px={key:1,class:"ev-window-title"},Bx={class:"ev-window-content"},Dx={key:1,class:"ev-window-footer"},Ox={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",Xx,[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",Nx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",Px,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",Bx,[o.renderSlot(t.$slots,"default")]),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",Dx,[o.renderSlot(t.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",Ox,[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(Zx,[["render",Yx]]);li.install=t=>{t.component(li.name,li)};const zx={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 Ax(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(zx,[["render",Ax]]);ai.install=t=>{t.component(ai.name,ai)};const Kx={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}}},_x={class:"ev-progress"},Ux={key:0,class:"ev-progress-inner-text"},Jx={key:0,class:"ev-progress-label"};function jx(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",_x,[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",Ux,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),t.$slots.default?(o.openBlock(),o.createElementBlock("div",Jx,[o.renderSlot(t.$slots,"default")])):o.createCommentVNode("",!0)])}const ri=ce(Kx,[["render",jx]]);ri.install=t=>{t.component(ri.name,ri)};const Qx={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)}}}},$x={class:"text"};function qx(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",$x,[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 Rr=ce(Qx,[["render",qx]]),e0={name:"EvMenu",components:{MenuItem:Rr},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:Rr}}},t0={class:"ev-menu"};function n0(t,e,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",t0,[(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(e0,[["render",n0]]);ci.install=t=>{t.component(ci.name,ci)};const i0={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)}}}},s0={class:"ev-tree-children"},o0={class:"ev-tree-node"};function l0(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",s0,[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",o0,[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 Vr=ce(i0,[["render",l0]]),a0={name:"EvTree",components:{TreeNode:Vr},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=Vr;function r(S){const x=i[S].parent;if(typeof x>"u")return;const I=i[S].node,L=i[x].node;if(!(I.checked===L.checked&&I.indeterminate===L.indeterminate)){if(I.checked)L.checked=L.children.every(v=>v.checked),L.indeterminate=!L.checked;else{const v=W=>W.checked||I.indeterminate;L.checked=!1,L.indeterminate=L.children.some(v)}r(x)}}function c(S,x={}){const I=Object.keys(x);for(let L=0;L<I.length;L++)S[I[L]]=x[I[L]];S.children&&S.children.forEach(L=>{c(L,x)})}function d(){let S=0;const x=[],I=[];function L(v,W){const E=v;E.nodeKey=S++,Object.hasOwnProperty.call(E,"selected")||(E.selected=!1),Object.hasOwnProperty.call(E,"visible")||(E.visible=!0),"value"in E&&I.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),I.push(E.value),x[E.nodeKey]={node:E,nodeKey:E.nodeKey},typeof W<"u"&&(x[E.nodeKey].parent=W.nodeKey,x[W.nodeKey].children.push(E.nodeKey)),E.children&&(x[E.nodeKey].children=[],E.children.forEach(G=>L(G,E)))}return n.value.length&&L(n.value[0]),x}i=d();function h(){return i.filter(S=>S.node.checked).map(S=>S.node)}function u(){h().forEach(x=>{c(x,{checked:!0});const I=i[x.nodeKey].parent;if(!I&&I!==0)return;const L=i[I].node;typeof x.checked<"u"&&x.checked&&L.checked!==x.checked&&r(x.nodeKey)})}function f({nodeKey:S,isChecked:x}){const I=i[S].node;I.checked=x,I.indeterminate=!1,r(S),c(I,{checked:x,indeterminate:!1});const L=h();e("check",L),u()}function m(S){const x=i[S].node;for(let I=0;I<i.length;I++)i[I].node.nodeKey!==S&&(i[I].node.selected=!1);e("click-node",{title:x.title,value:x.value})}function g(S){const x=i[S].node;e("dblclick-node",{title:x.title,value:x.value})}const p=S=>{t.contextMenuItems.length&&l&&(s.value.show(S),l=!1)},y=(S,x)=>{l=S,p(x)},C=(S,x)=>S.toLowerCase().includes(x.toLowerCase()),b=S=>{var x;if(S.children){const I=!!((x=S.children.filter(L=>C(L.title,t.searchWord)))!=null&&x.length);S.children.forEach(L=>{b(L),L.visible=I&&C(L.title,t.searchWord)||!I})}};function k(S){S.children&&S.children.forEach(x=>{x.visible=!1,k(x)})}function T(S){if(!S&&S!==0)return;const x=i[S];x.node.visible=!0,x.parent!==void 0&&T(x.parent)}function w(S){i.forEach(I=>{const L=I.node;L.visible=!1}),i.filter(I=>C(I.node.title,S)).forEach(I=>{const L=I.node;L.visible=!0,t.searchIncludeChildren?b(L):k(L);const v=i[L.nodeKey].parent;T(v)})}const M=o.computed(()=>!n.value.length||n.value.every(S=>!S.visible));o.watch(()=>t.data,S=>{n.value=S,i=d()},{deep:!0});let R;return o.watch(()=>t.searchWord,S=>{R&&clearTimeout(R),R=setTimeout(()=>{S?w(S):i.forEach(x=>{const I=x.node;I.visible=!0})},200)}),o.onMounted(()=>{u();const S=h();S.length&&e("check",S)}),o.onBeforeUnmount(()=>{R&&clearTimeout(R)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:f,clickContent:m,dblClickContent:g,showContextMenu:p,getContextMenuFlag:y}}},r0={class:"ev-tree-view"},c0={key:0};function d0(t,e,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",r0,[(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",c0,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(a0,[["render",d0]]);di.install=t=>{t.component(di.name,di)};const h0={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],R=M.value>w[1]?"23:59":w[1];e("update:modelValue",[M,R])}}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}}},u0={class:"ev-time-picker"},f0={key:0,class:"ev-time-picker-range"},m0=["disabled","readonly","placeholder"],p0=["disabled","readonly","placeholder"],g0={key:1,class:"ev-time-picker-single"},b0=["disabled","readonly","placeholder"];function y0(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",u0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",f0,[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,m0),[[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,p0),[[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",g0,[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,b0),[[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(h0,[["render",y0]]);hi.install=t=>{t.component(hi.name,hi)};const x0={name:"EvGridToolbar"},S0={class:"gridToolbar"};function C0(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",S0,[o.renderSlot(t.$slots,"toolbarWrapper")])}const k0=ce(x0,[["render",C0]]),w0={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}}},I0={class:"grid-pagination"};function L0(t,e,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",I0,[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 Er=ce(w0,[["render",L0],["__scopeId","data-v-2e265290"]]);var T0=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Bo=Math.ceil,tt=Math.floor,Ue="[BigNumber Error] ",Wr=Ue+"Number primitive has more than 15 significant digits: ",ft=1e14,he=14,Do=9007199254740991,Oo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Yt=1e7,Ne=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(S,x){var I,L,v,W,E,G,V,X,Z=this;if(!(Z instanceof b))return new b(S,x);if(x==null){if(S&&S._isBigNumber===!0){Z.s=S.s,!S.c||S.e>u?Z.c=Z.e=null:S.e<h?Z.c=[Z.e=0]:(Z.e=S.e,Z.c=S.c.slice());return}if((G=typeof S=="number")&&S*0==0){if(Z.s=1/S<0?(S=-S,-1):1,S===~~S){for(W=0,E=S;E>=10;E/=10,W++);W>u?Z.c=Z.e=null:(Z.e=W,Z.c=[S]);return}X=String(S)}else{if(!T0.test(X=String(S)))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(x,2,y.length,"Base"),x==10&&C)return Z=new b(S),M(Z,a+Z.e+1,r);if(X=String(S),G=typeof S=="number"){if(S*0!=0)return i(Z,X,G,x);if(Z.s=1/S<0?(X=X.slice(1),-1):1,b.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Wr+S)}else Z.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(I=y.slice(0,x),W=E=0,V=X.length;E<V;E++)if(I.indexOf(L=X.charAt(E))<0){if(L=="."){if(E>W){W=V;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(S),G,x)}G=!1,X=n(X,x,10,Z.s),(W=X.indexOf("."))>-1?X=X.replace(".",""):W=X.length}for(E=0;X.charCodeAt(E)===48;E++);for(V=X.length;X.charCodeAt(--V)===48;);if(X=X.slice(E,++V)){if(V-=E,G&&b.DEBUG&&V>15&&(S>Do||S!==tt(S)))throw Error(Wr+Z.s*S);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)%he,W<0&&(E+=he),E<V){for(E&&Z.c.push(+X.slice(0,E)),V-=he;E<V;)Z.c.push(+X.slice(E,E+=he));E=he-(X=X.slice(E)).length}else E-=V;for(;E--;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(S){var x,I;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(x="DECIMAL_PLACES")&&(I=S[x],we(I,0,Ne,x),a=I),S.hasOwnProperty(x="ROUNDING_MODE")&&(I=S[x],we(I,0,8,x),r=I),S.hasOwnProperty(x="EXPONENTIAL_AT")&&(I=S[x],I&&I.pop?(we(I[0],-Ne,0,x),we(I[1],0,Ne,x),c=I[0],d=I[1]):(we(I,-Ne,Ne,x),c=-(d=I<0?-I:I))),S.hasOwnProperty(x="RANGE"))if(I=S[x],I&&I.pop)we(I[0],-Ne,-1,x),we(I[1],1,Ne,x),h=I[0],u=I[1];else if(we(I,-Ne,Ne,x),I)h=-(u=I<0?-I:I);else throw Error(Ue+x+" cannot be zero: "+I);if(S.hasOwnProperty(x="CRYPTO"))if(I=S[x],I===!!I)if(I)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=I;else throw f=!I,Error(Ue+"crypto unavailable");else f=I;else throw Error(Ue+x+" not true or false: "+I);if(S.hasOwnProperty(x="MODULO_MODE")&&(I=S[x],we(I,0,9,x),m=I),S.hasOwnProperty(x="POW_PRECISION")&&(I=S[x],we(I,0,Ne,x),g=I),S.hasOwnProperty(x="FORMAT"))if(I=S[x],typeof I=="object")p=I;else throw Error(Ue+x+" not an object: "+I);if(S.hasOwnProperty(x="ALPHABET"))if(I=S[x],typeof I=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(I))C=I.slice(0,10)=="0123456789",y=I;else throw Error(Ue+x+" invalid: "+I)}else throw Error(Ue+"Object expected: "+S);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(S){if(!S||S._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var x,I,L=S.c,v=S.e,W=S.s;e:if({}.toString.call(L)=="[object Array]"){if((W===1||W===-1)&&v>=-Ne&&v<=Ne&&v===tt(v)){if(L[0]===0){if(v===0&&L.length===1)return!0;break e}if(x=(v+1)%he,x<1&&(x+=he),String(L[0]).length==x){for(x=0;x<L.length;x++)if(I=L[x],I<0||I>=ft||I!==tt(I))break e;if(I!==0)return!0}}}else if(L===null&&v===null&&(W===null||W===1||W===-1))return!0;throw Error(Ue+"Invalid BigNumber: "+S)},b.maximum=b.max=function(){return T(arguments,-1)},b.minimum=b.min=function(){return T(arguments,1)},b.random=function(){var S=9007199254740992,x=Math.random()*S&2097151?function(){return tt(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(I){var L,v,W,E,G,V=0,X=[],Z=new b(l);if(I==null?I=a:we(I,0,Ne),E=Bo(I/he),f)if(crypto.getRandomValues){for(L=crypto.getRandomValues(new Uint32Array(E*=2));V<E;)G=L[V]*131072+(L[V+1]>>>11),G>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),L[V]=v[0],L[V+1]=v[1]):(X.push(G%1e14),V+=2);V=E/2}else if(crypto.randomBytes){for(L=crypto.randomBytes(E*=7);V<E;)G=(L[V]&31)*281474976710656+L[V+1]*1099511627776+L[V+2]*4294967296+L[V+3]*16777216+(L[V+4]<<16)+(L[V+5]<<8)+L[V+6],G>=9e15?crypto.randomBytes(7).copy(L,V):(X.push(G%1e14),V+=7);V=E/7}else throw f=!1,Error(Ue+"crypto unavailable");if(!f)for(;V<E;)G=x(),G<9e15&&(X[V++]=G%1e14);for(E=X[--V],I%=he,E&&I&&(G=Oo[he-I],X[V]=tt(E/G)*G);X[V]===0;X.pop(),V--);if(V<0)X=[W=0];else{for(W=-1;X[0]===0;X.splice(0,1),W-=he);for(V=1,G=X[0];G>=10;G/=10,V++);V<he&&(W-=he-V)}return Z.e=W,Z.c=X,Z}}(),b.sum=function(){for(var S=1,x=arguments,I=new b(x[0]);S<x.length;)I=I.plus(x[S++]);return I},n=function(){var S="0123456789";function x(I,L,v,W){for(var E,G=[0],V,X=0,Z=I.length;X<Z;){for(V=G.length;V--;G[V]*=L);for(G[0]+=W.indexOf(I.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(I,L,v,W,E){var G,V,X,Z,N,D,O,z,B=I.indexOf("."),Y=a,P=r;for(B>=0&&(Z=g,g=0,I=I.replace(".",""),z=new b(L),D=z.pow(I.length-B),g=Z,z.c=x(vt(it(D.c),D.e,"0"),10,v,S),z.e=z.c.length),O=x(I,L,v,E?(G=y,S):(G=S,y)),X=Z=O.length;O[--Z]==0;O.pop());if(!O[0])return G.charAt(0);if(B<0?--X:(D.c=O,D.e=X,D.s=W,D=e(D,z,Y,P,v),O=D.c,N=D.r,X=D.e),V=X+Y+1,B=O[V],Z=v/2,N=N||V<0||O[V+1]!=null,N=P<4?(B!=null||N)&&(P==0||P==(D.s<0?3:2)):B>Z||B==Z&&(P==4||N||P==6&&O[V-1]&1||P==(D.s<0?8:7)),V<1||!O[0])I=N?vt(G.charAt(1),-Y,G.charAt(0)):G.charAt(0);else{if(O.length=V,N)for(--v;++O[--V]>v;)O[V]=0,V||(++X,O=[1].concat(O));for(Z=O.length;!O[--Z];);for(B=0,I="";B<=Z;I+=G.charAt(O[B++]));I=vt(I,X,G.charAt(0))}return I}}(),e=function(){function S(L,v,W){var E,G,V,X,Z=0,N=L.length,D=v%Yt,O=v/Yt|0;for(L=L.slice();N--;)V=L[N]%Yt,X=L[N]/Yt|0,E=O*V+X*D,G=D*V+E%Yt*Yt+Z,Z=(G/W|0)+(E/Yt|0)+O*X,L[N]=G%W;return Z&&(L=[Z].concat(L)),L}function x(L,v,W,E){var G,V;if(W!=E)V=W>E?1:-1;else for(G=V=0;G<W;G++)if(L[G]!=v[G]){V=L[G]>v[G]?1:-1;break}return V}function I(L,v,W,E){for(var G=0;W--;)L[W]-=G,G=L[W]<v[W]?1:0,L[W]=G*E+L[W]-v[W];for(;!L[0]&&L.length>1;L.splice(0,1));}return function(L,v,W,E,G){var V,X,Z,N,D,O,z,B,Y,P,H,K,Q,U,j,J,ne,q=L.s==v.s?1:-1,ee=L.c,$=v.c;if(!ee||!ee[0]||!$||!$[0])return new b(!L.s||!v.s||(ee?$&&ee[0]==$[0]:!$)?NaN:ee&&ee[0]==0||!$?q*0:q/0);for(B=new b(q),Y=B.c=[],X=L.e-v.e,q=W+X+1,G||(G=ft,X=nt(L.e/he)-nt(v.e/he),q=q/he|0),Z=0;$[Z]==(ee[Z]||0);Z++);if($[Z]>(ee[Z]||0)&&X--,q<0)Y.push(1),N=!0;else{for(U=ee.length,J=$.length,Z=0,q+=2,D=tt(G/($[0]+1)),D>1&&($=S($,D,G),ee=S(ee,D,G),J=$.length,U=ee.length),Q=J,P=ee.slice(0,J),H=P.length;H<J;P[H++]=0);ne=$.slice(),ne=[0].concat(ne),j=$[0],$[1]>=G/2&&j++;do{if(D=0,V=x($,P,J,H),V<0){if(K=P[0],J!=H&&(K=K*G+(P[1]||0)),D=tt(K/j),D>1)for(D>=G&&(D=G-1),O=S($,D,G),z=O.length,H=P.length;x(O,P,z,H)==1;)D--,I(O,J<z?ne:$,z,G),z=O.length,V=1;else D==0&&(V=D=1),O=$.slice(),z=O.length;if(z<H&&(O=[0].concat(O)),I(P,O,H,G),H=P.length,V==-1)for(;x($,P,J,H)<1;)D++,I(P,J<H?ne:$,H,G),H=P.length}else V===0&&(D++,P=[0]);Y[Z++]=D,P[0]?P[H++]=ee[Q]||0:(P=[ee[Q]],H=1)}while((Q++<U||P[0]!=null)&&q--);N=P[0]!=null,Y[0]||Y.splice(0,1)}if(G==ft){for(Z=1,q=Y[0];q>=10;q/=10,Z++);M(B,W+(B.e=Z+X*he-1)+1,E,N)}else B.e=X,B.r=+N;return B}}();function k(S,x,I,L){var v,W,E,G,V;if(I==null?I=r:we(I,0,8),!S.c)return S.toString();if(v=S.c[0],E=S.e,x==null)V=it(S.c),V=L==1||L==2&&(E<=c||E>=d)?fs(V,E):vt(V,E,"0");else if(S=M(new b(S),x,I),W=S.e,V=it(S.c),G=V.length,L==1||L==2&&(x<=W||W<=c)){for(;G<x;V+="0",G++);V=fs(V,W)}else if(x-=E+(L===2&&W>E),V=vt(V,W,"0"),W+1>G){if(--x>0)for(V+=".";x--;V+="0");}else if(x+=W-G,x>0)for(W+1==G&&(V+=".");x--;V+="0");return S.s<0&&v?"-"+V:V}function T(S,x){for(var I,L,v=1,W=new b(S[0]);v<S.length;v++)L=new b(S[v]),(!L.s||(I=nn(W,L))===x||I===0&&W.s===x)&&(W=L);return W}function w(S,x,I){for(var L=1,v=x.length;!x[--v];x.pop());for(v=x[0];v>=10;v/=10,L++);return(I=L+I*he-1)>u?S.c=S.e=null:I<h?S.c=[S.e=0]:(S.e=I,S.c=x),S}i=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,I=/^\.([^.]+)$/,L=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(W,E,G,V){var X,Z=G?E:E.replace(v,"");if(L.test(Z))W.s=isNaN(Z)?null:Z<0?-1:1;else{if(!G&&(Z=Z.replace(S,function(N,D,O){return X=(O=O.toLowerCase())=="x"?16:O=="b"?2:8,!V||V==X?D:N}),V&&(X=V,Z=Z.replace(x,"$1").replace(I,"0.$1")),E!=Z))return new b(Z,X);if(b.DEBUG)throw Error(Ue+"Not a"+(V?" base "+V:"")+" number: "+E);W.s=null}W.c=W.e=null}}();function M(S,x,I,L){var v,W,E,G,V,X,Z,N=S.c,D=Oo;if(N){e:{for(v=1,G=N[0];G>=10;G/=10,v++);if(W=x-v,W<0)W+=he,E=x,V=N[X=0],Z=tt(V/D[v-E-1]%10);else if(X=Bo((W+1)/he),X>=N.length)if(L){for(;N.length<=X;N.push(0));V=Z=0,v=1,W%=he,E=W-he+1}else break e;else{for(V=G=N[X],v=1;G>=10;G/=10,v++);W%=he,E=W-he+v,Z=E<0?0:tt(V/D[v-E-1]%10)}if(L=L||x<0||N[X+1]!=null||(E<0?V:V%D[v-E-1]),L=I<4?(Z||L)&&(I==0||I==(S.s<0?3:2)):Z>5||Z==5&&(I==4||L||I==6&&(W>0?E>0?V/D[v-E]:0:N[X-1])%10&1||I==(S.s<0?8:7)),x<1||!N[0])return N.length=0,L?(x-=S.e+1,N[0]=D[(he-x%he)%he],S.e=-x||0):N[0]=S.e=0,S;if(W==0?(N.length=X,G=1,X--):(N.length=X+1,G=D[he-W],N[X]=E>0?tt(V/D[v-E]%D[E])*G:0),L)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&&(S.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());}S.e>u?S.c=S.e=null:S.e<h&&(S.c=[S.e=0])}return S}function R(S){var x,I=S.e;return I===null?S.toString():(x=it(S.c),x=I<=c||I>=d?fs(x,I):vt(x,I,"0"),S.s<0?"-"+x:x)}return s.absoluteValue=s.abs=function(){var S=new b(this);return S.s<0&&(S.s=1),S},s.comparedTo=function(S,x){return nn(this,new b(S,x))},s.decimalPlaces=s.dp=function(S,x){var I,L,v,W=this;if(S!=null)return we(S,0,Ne),x==null?x=r:we(x,0,8),M(new b(W),S+W.e+1,x);if(!(I=W.c))return null;if(L=((v=I.length-1)-nt(this.e/he))*he,v=I[v])for(;v%10==0;v/=10,L--);return L<0&&(L=0),L},s.dividedBy=s.div=function(S,x){return e(this,new b(S,x),a,r)},s.dividedToIntegerBy=s.idiv=function(S,x){return e(this,new b(S,x),0,1)},s.exponentiatedBy=s.pow=function(S,x){var I,L,v,W,E,G,V,X,Z,N=this;if(S=new b(S),S.c&&!S.isInteger())throw Error(Ue+"Exponent not an integer: "+R(S));if(x!=null&&(x=new b(x)),G=S.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!S.c||!S.c[0])return Z=new b(Math.pow(+R(N),G?S.s*(2-us(S)):+R(S))),x?Z.mod(x):Z;if(V=S.s<0,x){if(x.c?!x.c[0]:!x.s)return new b(NaN);L=!V&&N.isInteger()&&x.isInteger(),L&&(N=N.mod(x))}else{if(S.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(S)?-0:0,N.e>-1&&(W=1/W),new b(V?1/W:W);g&&(W=Bo(g/he+2))}for(G?(I=new b(.5),V&&(S.s=1),X=us(S)):(v=Math.abs(+R(S)),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):L&&(Z=Z.mod(x))}if(v){if(v=tt(v/2),v===0)break;X=v%2}else if(S=S.times(I),M(S,S.e+1,1),S.e>14)X=us(S);else{if(v=+R(S),v===0)break;X=v%2}N=N.times(N),W?N.c&&N.c.length>W&&(N.c.length=W):L&&(N=N.mod(x))}return L?Z:(V&&(Z=l.div(Z)),x?Z.mod(x):W?M(Z,g,r,E):Z)},s.integerValue=function(S){var x=new b(this);return S==null?S=r:we(S,0,8),M(x,x.e+1,S)},s.isEqualTo=s.eq=function(S,x){return nn(this,new b(S,x))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(S,x){return nn(this,new b(S,x))>0},s.isGreaterThanOrEqualTo=s.gte=function(S,x){return(x=nn(this,new b(S,x)))===1||x===0},s.isInteger=function(){return!!this.c&&nt(this.e/he)>this.c.length-2},s.isLessThan=s.lt=function(S,x){return nn(this,new b(S,x))<0},s.isLessThanOrEqualTo=s.lte=function(S,x){return(x=nn(this,new b(S,x)))===-1||x===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(S,x){var I,L,v,W,E=this,G=E.s;if(S=new b(S,x),x=S.s,!G||!x)return new b(NaN);if(G!=x)return S.s=-x,E.plus(S);var V=E.e/he,X=S.e/he,Z=E.c,N=S.c;if(!V||!X){if(!Z||!N)return Z?(S.s=-x,S):new b(N?E:NaN);if(!Z[0]||!N[0])return N[0]?(S.s=-x,S):new b(Z[0]?E:r==3?-0:0)}if(V=nt(V),X=nt(X),Z=Z.slice(),G=V-X){for((W=G<0)?(G=-G,v=Z):(X=V,v=N),v.reverse(),x=G;x--;v.push(0));v.reverse()}else for(L=(W=(G=Z.length)<(x=N.length))?G:x,G=x=0;x<L;x++)if(Z[x]!=N[x]){W=Z[x]<N[x];break}if(W&&(v=Z,Z=N,N=v,S.s=-S.s),x=(L=N.length)-(I=Z.length),x>0)for(;x--;Z[I++]=0);for(x=ft-1;L>G;){if(Z[--L]<N[L]){for(I=L;I&&!Z[--I];Z[I]=x);--Z[I],Z[L]+=ft}Z[L]-=N[L]}for(;Z[0]==0;Z.splice(0,1),--X);return Z[0]?w(S,Z,X):(S.s=r==3?-1:1,S.c=[S.e=0],S)},s.modulo=s.mod=function(S,x){var I,L,v=this;return S=new b(S,x),!v.c||!S.s||S.c&&!S.c[0]?new b(NaN):!S.c||v.c&&!v.c[0]?new b(v):(m==9?(L=S.s,S.s=1,I=e(v,S,0,3),S.s=L,I.s*=L):I=e(v,S,0,m),S=v.minus(I.times(S)),!S.c[0]&&m==1&&(S.s=v.s),S)},s.multipliedBy=s.times=function(S,x){var I,L,v,W,E,G,V,X,Z,N,D,O,z,B,Y,P=this,H=P.c,K=(S=new b(S,x)).c;if(!H||!K||!H[0]||!K[0])return!P.s||!S.s||H&&!H[0]&&!K||K&&!K[0]&&!H?S.c=S.e=S.s=null:(S.s*=P.s,!H||!K?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(L=nt(P.e/he)+nt(S.e/he),S.s*=P.s,V=H.length,N=K.length,V<N&&(z=H,H=K,K=z,v=V,V=N,N=v),v=V+N,z=[];v--;z.push(0));for(B=ft,Y=Yt,v=N;--v>=0;){for(I=0,D=K[v]%Y,O=K[v]/Y|0,E=V,W=v+E;W>v;)X=H[--E]%Y,Z=H[E]/Y|0,G=O*X+Z*D,X=D*X+G%Y*Y+z[W]+I,I=(X/B|0)+(G/Y|0)+O*Z,z[W--]=X%B;z[W]=I}return I?++L:z.splice(0,1),w(S,z,L)},s.negated=function(){var S=new b(this);return S.s=-S.s||null,S},s.plus=function(S,x){var I,L=this,v=L.s;if(S=new b(S,x),x=S.s,!v||!x)return new b(NaN);if(v!=x)return S.s=-x,L.minus(S);var W=L.e/he,E=S.e/he,G=L.c,V=S.c;if(!W||!E){if(!G||!V)return new b(v/0);if(!G[0]||!V[0])return V[0]?S:new b(G[0]?L:v*0)}if(W=nt(W),E=nt(E),G=G.slice(),v=W-E){for(v>0?(E=W,I=V):(v=-v,I=G),I.reverse();v--;I.push(0));I.reverse()}for(v=G.length,x=V.length,v-x<0&&(I=V,V=G,G=I,x=v),v=0;x;)v=(G[--x]=G[x]+V[x]+v)/ft|0,G[x]=ft===G[x]?0:G[x]%ft;return v&&(G=[v].concat(G),++E),w(S,G,E)},s.precision=s.sd=function(S,x){var I,L,v,W=this;if(S!=null&&S!==!!S)return we(S,1,Ne),x==null?x=r:we(x,0,8),M(new b(W),S,x);if(!(I=W.c))return null;if(v=I.length-1,L=v*he+1,v=I[v]){for(;v%10==0;v/=10,L--);for(v=I[0];v>=10;v/=10,L++);}return S&&W.e+1>L&&(L=W.e+1),L},s.shiftedBy=function(S){return we(S,-Do,Do),this.times("1e"+S)},s.squareRoot=s.sqrt=function(){var S,x,I,L,v,W=this,E=W.c,G=W.s,V=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(+R(W)),G==0||G==1/0?(x=it(E),(x.length+V)%2==0&&(x+="0"),G=Math.sqrt(+x),V=nt((V+1)/2)-(V<0||V%2),G==1/0?x="5e"+V:(x=G.toExponential(),x=x.slice(0,x.indexOf("e")+1)+V),I=new b(x)):I=new b(G+""),I.c[0]){for(V=I.e,G=V+X,G<3&&(G=0);;)if(v=I,I=Z.times(v.plus(e(W,v,X,1))),it(v.c).slice(0,G)===(x=it(I.c)).slice(0,G))if(I.e<V&&--G,x=x.slice(G-3,G+1),x=="9999"||!L&&x=="4999"){if(!L&&(M(v,v.e+a+2,0),v.times(v).eq(W))){I=v;break}X+=4,G+=4,L=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(M(I,I.e+a+2,1),S=!I.times(I).eq(W));break}}return M(I,I.e+a+1,r,S)},s.toExponential=function(S,x){return S!=null&&(we(S,0,Ne),S++),k(this,S,x,1)},s.toFixed=function(S,x){return S!=null&&(we(S,0,Ne),S=S+this.e+1),k(this,S,x)},s.toFormat=function(S,x,I){var L,v=this;if(I==null)S!=null&&x&&typeof x=="object"?(I=x,x=null):S&&typeof S=="object"?(I=S,S=x=null):I=p;else if(typeof I!="object")throw Error(Ue+"Argument not an object: "+I);if(L=v.toFixed(S,x),v.c){var W,E=L.split("."),G=+I.groupSize,V=+I.secondaryGroupSize,X=I.groupSeparator||"",Z=E[0],N=E[1],D=v.s<0,O=D?Z.slice(1):Z,z=O.length;if(V&&(W=G,G=V,V=W,z-=W),G>0&&z>0){for(W=z%G||G,Z=O.substr(0,W);W<z;W+=G)Z+=X+O.substr(W,G);V>0&&(Z+=X+O.slice(W)),D&&(Z="-"+Z)}L=N?Z+(I.decimalSeparator||"")+((V=+I.fractionGroupSize)?N.replace(new RegExp("\\d{"+V+"}\\B","g"),"$&"+(I.fractionGroupSeparator||"")):N):Z}return(I.prefix||"")+L+(I.suffix||"")},s.toFraction=function(S){var x,I,L,v,W,E,G,V,X,Z,N,D,O=this,z=O.c;if(S!=null&&(G=new b(S),!G.isInteger()&&(G.c||G.s!==1)||G.lt(l)))throw Error(Ue+"Argument "+(G.isInteger()?"out of range: ":"not an integer: ")+R(G));if(!z)return new b(O);for(x=new b(l),X=I=new b(l),L=V=new b(l),D=it(z),W=x.e=D.length-O.e-1,x.c[0]=Oo[(E=W%he)<0?he+E:E],S=!S||G.comparedTo(x)>0?W>0?x:X:G,E=u,u=1/0,G=new b(D),V.c[0]=0;Z=e(G,x,0,1),v=I.plus(Z.times(L)),v.comparedTo(S)!=1;)I=L,L=v,X=V.plus(Z.times(v=X)),V=v,x=G.minus(Z.times(v=x)),G=v;return v=e(S.minus(I),L,0,1),V=V.plus(v.times(X)),I=I.plus(v.times(L)),V.s=X.s=O.s,W=W*2,N=e(X,L,W,r).minus(O).abs().comparedTo(e(V,I,W,r).minus(O).abs())<1?[X,L]:[V,I],u=E,N},s.toNumber=function(){return+R(this)},s.toPrecision=function(S,x){return S!=null&&we(S,1,Ne),k(this,S,x,2)},s.toString=function(S){var x,I=this,L=I.s,v=I.e;return v===null?L?(x="Infinity",L<0&&(x="-"+x)):x="NaN":(S==null?x=v<=c||v>=d?fs(it(I.c),v):vt(it(I.c),v,"0"):S===10&&C?(I=M(new b(I),a+v+1,r),x=vt(it(I.c),I.e,"0")):(we(S,2,y.length,"Base"),x=n(vt(it(I.c),v,"0"),10,S,L,!0)),L<0&&I.c[0]&&(x="-"+x)),x},s.valueOf=s.toJSON=function(){return R(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=he-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/he)==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 Zr=Gr();function sn(t){return new Zr(t)}function Yo(t,e){return sn(t).plus(sn(e)).toNumber()}function M0(t,e){return sn(t).minus(sn(e)).toNumber()}function v0(t,e){return sn(t).dividedBy(sn(e)).toNumber()}function Xr(t,e){return sn(t).decimalPlaces(e,Zr.ROUND_DOWN).toNumber()}const R0={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,R)=>{var S,x;return b?R.parent||M.push((S=R.data)==null?void 0:S[p]):M.push((x=R.data)==null?void 0:x[p]),M},[]):w=s.value.store.map(M=>M[i][T]),y){case"sum":{const M=w.reduce((R,S)=>{const x=Number(S);return Number.isNaN(x)?R:Yo(R,x)},0);k=M&&Xr(M,c(C??e.default));break}case"average":{const M=w.reduce((R,S)=>{const x=Number(S);return Number.isNaN(x)?R:Yo(R,x)},0);k=M&&Xr(v0(M,w.length),c(C??e.default));break}case"max":{const M=w.filter(R=>R!=null);k=M.length?Math.max(...M):"";break}case"min":{const M=w.filter(R=>R!=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}}},V0={class:"column-list"},E0=["title"],W0=["title"];function G0(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",V0,[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,E0)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,W0))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const Nr=ce(R0,[["render",G0],["__scopeId","data-v-4b9bef37"]]),Z0={name:"EVGridColumnSetting",directives:{clickoutside:zi},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:L=>e("update:isShow",L)}),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:L=>e("update:isShowMenuOnClick",L)}),y=L=>{var v;(L==null?void 0:L.length)===1?m=L[0]:(L==null?void 0:L.length)<1&&(m==null&&(m=(v=r.value[0])==null?void 0:v.text),a.value.push(m))},C=L=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,L){const v=L.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 L=d.value.length?d.value:r.value;a.value=L.filter(v=>v.originChecked).map(v=>v.text),b()},T=()=>{d.value=r.value.filter(v=>a.value.includes(v.text));const L=d.value.map(v=>v.text);e("apply-column",L),n.value=!1,p.value=!1},w=o.ref(),M=o.ref(),R=()=>{M.value=Re(a.value),r.value=t.columns.filter(L=>!L.hide&&L.caption).map(L=>{var E,G;const v=(E=w.value)==null?void 0:E.find(V=>V.field===L.field);let W=!1;return v?W=(v==null?void 0:v.hiddenDisplay)!==(L==null?void 0:L.hiddenDisplay)||!((G=M.value)!=null&&G.length)?!(L!=null&&L.hiddenDisplay):M.value.includes(L.field):W=!L.hiddenDisplay,{label:L.caption,text:L.field,originChecked:!L.hiddenDisplay,checked:W,fixed:L.fixed}}),a.value=r.value.filter(L=>L.checked).map(L=>L.text),d.value.length=0,w.value=Re(t.columns)},S=()=>{n.value=!1,p.value=!1},x=()=>{const L=document.createElement("div");L.id="ev-grid-column-setting-modal",L.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(L)},I=async()=>{var O;await o.nextTick();const L=document.documentElement.clientWidth,v=document.documentElement.clientHeight,W=(O=i.value)==null?void 0:O.getBoundingClientRect(),E=W==null?void 0:W.width,G=W==null?void 0:W.height,{top:V,left:X,columnListMenuWidth:Z}=t.position;let N;Z?(N=X,L<X+E&&(N=X-E-Z)):N=X-E;const D=v-G;g.top=`${Math.min(V,D)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>x()),o.watch(()=>t.columns,()=>{R()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{k(),n.value&&await I()}),o.watch(()=>t.hiddenColumn,L=>{const v=d.value.length?d.value.filter(W=>W.text!==L):r.value.filter(W=>W.text!==L&&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:S}}},X0={class:"ev-grid-column-setting__header"},N0={class:"header-title"},P0={class:"ev-grid-column-setting__content"},B0={key:1,class:"is-empty"},D0={class:"ev-grid-column-setting__footer"};function O0(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",X0,[o.createElementVNode("p",N0,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",P0,[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",B0,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",D0,[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 Pr=ce(Z0,[["render",O0]]),Y0={name:"EVGridFilterSetting",directives:{clickoutside:zi},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 R;const w=[],M=Re(t.items);T&&i.value.field&&((R=M[i.value.field])!=null&&R.length?M[i.value.field].forEach(S=>{w.push(S)}):w.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=w)});const C=(T,w)=>{var M;return((M=T.find(R=>R.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,""))}}}},z0={class:"ev-grid-filter-setting__header"},H0={class:"header-title"},F0={class:"ev-grid-filter-setting__content"},A0={class:"ev-grid-filter-setting__row--button"},K0={class:"ev-grid-filter-setting__footer"};function _0(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",z0,[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",A0,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:m=>i.removeRow(f)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",K0,[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 U0=ce(Y0,[["render",_0]]),J0={name:"GridSortButton",props:{icon:{type:String,default:""}}},j0={key:0},Q0={key:1},$0={key:2};function q0(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
@@ -14,5 +14,5 @@ Component that was made reactive: `,t=ge(t)),function(c,d=null,h=null,u=0,f=null
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
15
  4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):o.createCommentVNode("",!0)}const Br=ce(J0,[["render",q0]]),eS={name:"GridOptionButton"},tS={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nS(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("svg",tS,[...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 Ho=ce(eS,[["render",nS]]),Rt=0,In=1,ue=2,ui=3,Fo=4,iS=()=>{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}})},sS=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(V=>T.findIndex(X=>X[ue]===V)))??[],R=T.length*y+w*C;let S=0,x=0;if(w)for(S=0;x+y<p.scrollTop;S++)M.includes(S)&&(x+=C),x+=y;else S=Math.floor(p.scrollTop/y),x=Math.max(S,0)*y;S>T.length-1&&(S=0);let I=0,L=0;if(w)for(let V=S;L<=p.clientHeight;V++)M.includes(V)&&(L+=C),L+=y,I+=1;else I=p.clientHeight>y?Math.ceil(p.clientHeight/y):T.length,L=I*y;const v=S+I+1,W=Math.max(S,0),E=v,G=i.table;n.viewStore=T.slice(W,E),e.hasVerticalScrollBar=I<T.length||p.clientHeight<G.clientHeight,e.vScrollTopHeight=x,e.vScrollBottomHeight=R-L-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}}},oS=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,R=T-k.clientWidth,S=r.orderedColumns.reduce((x,I)=>(I.hide||I.hiddenDisplay||(I.width?x.totalWidth+=I.width:x.emptyCount++),x),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*e.rows.length>w&&(T-=R),l.useCheckbox.use&&(T-=i.minWidth),a.useRowDetail&&(T-=i.minWidth),y=T-S.totalWidth,y>0){const x=S.emptyCount===0?0:Math.floor(y/S.emptyCount);C=y-x*S.emptyCount,y=S.emptyCount!==0?x: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,R=w.getBoundingClientRect(),S=s.resizeLine,x=R.left-T+M,I=R.right-T,L=C.clientX,v=R.left-T;k.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const W=G=>{const V=G.clientX-L,X=I+V,Z=Math.max(x,X);S.style.left=`${Z}px`},E=()=>{const V=parseInt(S.style.left,10)-v;r.orderedColumns[y]&&(r.orderedColumns[y].width=V,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})}}},lS=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))}}},aS=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)}}},rS=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[Fo]=!l[Fo],n("update:expanded",e.expandedRows),n("expand-row",s,l[ue],l[Fo],l[Rt])}}},cS=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 I;const{field:p,index:y}=e.sortColumn||{},C=((I=e.sortFunction)==null?void 0:I[p])??null,b=(L,v)=>L>v?-1:1,k=(L,v)=>L<v?-1:1,T=(L,v)=>(L===null)-(v===null)||Number(v)-Number(L),w=(L,v)=>(L===null)-(v===null)||Number(L)-Number(v);if(e.sortOrder==="init"||!e.sortField&&!e.isSorting){n.store.sort((L,v)=>typeof L[Rt]=="number"?k(L[Rt],v[Rt]):0);return}const M=e.sortColumn.type||"string",R=e.sortOrder==="desc"?b:k,S=e.sortOrder==="desc"?T:w,x=(L,v)=>{var G,V;let W=L[ue][y],E=v[ue][y];return L[ue][y]&&typeof L[ue][y]=="object"&&(W=L[ue][y][(G=n.originColumns[y])==null?void 0:G.field],E=v[ue][y][(V=n.originColumns[y])==null?void 0:V.field]),{aCol:W,bCol:E}};if(C){n.store.sort((L,v)=>{const W=L[ue][y],E=v[ue][y],G=C(W,E);return e.sortOrder==="desc"?-G:G});return}switch(M){case"string":n.store.sort((L,v)=>{let{aCol:W,bCol:E}=x(L,v);if((!W||typeof W=="string")&&(!E||typeof E=="string")){W=W||"",E=E||"";const G=W.toLowerCase(),V=E.toLowerCase();if(W!==E&&G===V){const X=Array.from(W).findIndex((Z,N)=>Z!==E[N]);return R(W[X],E[X])}return R(G,V)}return 0});break;case"stringNumber":n.store.sort((L,v)=>{let{aCol:W,bCol:E}=x(L,v);return!W||typeof W=="string"||typeof W=="number"?(W=W===""?null:W,E=E===""?null:E,S(W??null,E??null)):0});break;default:n.store.sort((L,v)=>{const{aCol:W,bCol:E}=x(L,v);return!W||typeof W=="number"||typeof W=="boolean"?S(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()}},dS=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(R=>{const S=l.checkedRows.includes(R[ue]);R[In]=S,M+=S?1:0}),w.length&&(l.isHeaderChecked=w.length===M,l.isHeaderIndeterminate=w.length!==M&&M>0,l.isHeaderUncheckable=w.every(R=>e.uncheckable.includes(R[ue])||e.disabledRows.includes(R[ue])))},m=(w,M,R)=>{if(typeof w!="string"||M===null)return!1;const S=M==null?void 0:M.toLowerCase(),x=w==null?void 0:w.toLowerCase();let I=S.includes(x);return R&&(R==="start"?I=S.startsWith(x):R==="end"&&(I=S.endsWith(x))),I},g=(w,M)=>{const R=M.comparison,S=M.value;let x=w[ue][M.index];(x||x===0)&&(x=`${w[ue][M.index]}`);let I;return R==="="?I=(S==null?void 0:S.toLowerCase())===(x==null?void 0:x.toLowerCase()):R==="!="?I=(S==null?void 0:S.toLowerCase())!==(x==null?void 0:x.toLowerCase()):R==="%s%"?I=m(S,x):R==="notLike"?I=!m(S,x):R==="s%"?I=m(S,x,"start"):R==="%s"?I=m(S,x,"end"):R==="isEmpty"?I=x==null||x==="":R==="isNotEmpty"&&(I=!!x),I},p=(w,M,R)=>{const S=M.comparison,x=Number(M.value.replace(/,/g,""));let I=Number(w[ue][M.index]),L;return R==="float"&&(I=Number(I.toFixed(3))),S==="="?L=I===x:S===">"?L=I>x:S==="<"?L=I<x:S==="<="?L=I<=x:S===">="?L=I>=x:S==="!="?L=I!==x:S==="isEmpty"?L=I==null||isNaN(I):S==="isNotEmpty"&&(L=!!I||I===0),L},y=(w,M)=>{const R=M.comparison,S=M.value,x=`${w[ue][M.index]}`;let I;return R==="="&&(I=x===S),I},C=(w,M,R)=>{let S=M==="string"||M==="stringNumber"?g:p;return M==="boolean"&&(S=y),w.filter(x=>S(x,R,M))||[]},b=()=>{const w=i.filteringItemsByColumn,M=Object.keys(w),R=s.originStore;let S=[],x=!1,I=[];M.forEach((L,v)=>{const W=w[L],E=u(L),G=e.columns[E].type,V=i.columnOperator==="or",X=v>0&&i.columnOperator==="and";W.forEach((Z,N)=>{!S.length&&!x?S=C(R,G,{...Z,index:E}):X&&Z.operator==="or"?N>0?S.push(...C(I,G,{...Z,index:E})):S=C(I,G,{...Z,index:E}):N===0&&V||N!==0&&Z.operator==="or"?S.push(...C(R,G,{...Z,index:E})):S=C(S,G,{...Z,index:E}),x=!0}),I=JSON.parse(JSON.stringify(S))}),x?s.filterStore=Cb(S,JSON.stringify):s.filterStore=R};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 R=!1;const S=n.isFilteringColumn?M[ue].filter((x,I)=>n.visibleColumnIdx.includes(I)):M[ue];for(let x=0;x<s.orderedColumns.length;x++){const I=s.orderedColumns[x]||{};let L=S[I.index]??null;if(I.type=I.type||"string",L!==null&&(L instanceof Array?L=JSON.stringify(L):typeof L=="object"&&(L=L[I.field]),!I.hide&&((I==null?void 0:I.searchable)===void 0||I!=null&&I.searchable)&&(L=r(I,L).toString(),R=L.toLowerCase().includes(w.toString().toLowerCase()),R)))break}return R}),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}},hS=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,R,S;if(p.target.className==="column-name"){const x=y.sortable===void 0?!0:y.sortable,I=l.isFiltering&&y.filterable===void 0?!0:y.filterable,L=[{text:((C=e.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!x,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:!x,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:!I,hidden:((M=e.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((R=e.columnMenuTextInfo)==null?void 0:R.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||y.fixed,hidden:((S=e.hiddenColumnMenuItem)==null?void 0:S.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=[],!x&&!I&&!a.value)return;e.columnMenuItems=L.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)}}},uS=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((R,S)=>{const x=e.checked.includes(R),I=e.uncheckable.includes(R)||e.disabledRows.includes(R);let L=!1;n.useSelect&&(L=e.selected.includes(R)),!x&&!I&&(M=!0);let v=!1;c.useRowDetail&&(v=e.expanded.includes(R));const W=e.disabledRows.includes(R);w.push([S,x,R,L,v,I,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(R=>e.uncheckable.includes(R)||e.disabledRows.includes(R)),s.originStore=w}r.isFiltering&&f(),C&&y&&h(C,!1),l.sortField&&d(),(T=a.body)!=null&&T.clientHeight&&u()}}},fS=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 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()}}},mS=({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})}}},pS={name:"EvGrid",directives:{clickoutside:Hi,observeVisibility:qs,resize:Wn},components:{Toolbar:k0,GridPagination:Er,GridSummary:Nr,ColumnSetting:Pr,FilterSetting:U0,GridSortButton:Br,GridOptionButton:Ho},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 uc,fc,mc,pc,gc,bc,yc,xc,Sc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=iS(),u=o.ref(null),f=o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:ie.use)||!1}),m=o.computed(()=>t.option.showHeader??!0),g=o.computed(()=>{var A;return((A=t.option)==null?void 0:A.useSummary)||!1}),p=o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.stripe)||!1}),y=o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.border)||""}),C=o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.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"}),R=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((fc=(uc=t.option)==null?void 0:uc.useGridSetting)==null?void 0:fc.columnMenuText)??"Column List",search:((pc=(mc=t.option)==null?void 0:mc.useGridSetting)==null?void 0:pc.searchText)??"Search",empty:((bc=(gc=t.option)==null?void 0:gc.useGridSetting)==null?void 0:bc.emptyText)??"No records",ok:((xc=(yc=t.option)==null?void 0:yc.useGridSetting)==null?void 0:xc.okBtnText)??"OK"}}),S=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const A=M.isFiltering?S.filterStore:S.originStore;return M.isSearch?S.searchStore:A}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>t.columns.map((A,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,...A,width:isFinite(A.width)?A.width:void 0,sortOption:{sortType:((Le=A==null?void 0:A.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const A=S.movedColumns.length?S.movedColumns:S.originColumns;return S.filteredColumns.length?S.filteredColumns:A}),updatedColumns:o.computed(()=>ms(S))}),x=o.reactive({usePage:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.use)||!1}),useClient:((Sc=t.option.page)==null?void 0:Sc.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,ie;return(A=t.option.page)!=null&&A.useClient?S.store.length:(ie=t.option.page)==null?void 0:ie.total}),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(()=>x.useClient&&x.usePage&&!x.isInfinite),isHighlight:!1,highlightPage:0}),I=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:t.checked,useCheckbox:o.computed(()=>t.option.useCheckbox||{})}),L=o.reactive({expandedRows:t.expanded,useRowDetail:o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var A,ie;return(ie=(A=t.option)==null?void 0:A.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 A,ie;return((ie=(A=t.option)==null?void 0:A.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.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 A,ie;return((ie=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),V=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=()=>{I.checkedRows=[],I.isHeaderChecked=!1,I.isHeaderIndeterminate=!1,S.store.forEach(A=>{A[1]=!1})},Z=()=>{W.selectedRow=[],S.store.forEach(A=>{A[3]=!1})},N=()=>{S.store.forEach(A=>{A[4]=!1}),L.expandedRows=[]},{getPagingData:D,updatePagingInfo:Y,changePage:H}=fS({stores:S,pageInfo:x,sortInfo:E,filterInfo:M,elementInfo:w,clearCheckInfo:X}),B=o.ref(0),{updateVScroll:O,updateHScroll:P,onScroll:F}=sS({scrollInfo:v,stores:S,elementInfo:w,resizeInfo:V,pageInfo:x,summaryScroll:B,expandedInfo:L,getPagingData:D,updatePagingInfo:Y}),{onCheck:K,onCheckAll:Q}=aS({checkInfo:I,stores:S,pageInfo:x,getPagingData:D}),{onExpanded:U}=rS({expandedInfo:L}),{onSort:j,getSortTarget:J,setSort:ne,setSortInfo:q,hasSortTarget:ee}=cS({sortInfo:E,stores:S,updatePagingInfo:Y}),{onSearch:$,setFilter:de,setHeaderCheckboxByFilter:me}=dS({columnSettingInfo:R,filterInfo:M,stores:S,checkInfo:I,pageInfo:x,getConvertValue:c,updateVScroll:O,getPagingData:D,updatePagingInfo:Y,getColumnIndex:d}),{setStore:ae}=uS({selectInfo:W,checkInfo:I,stores:S,sortInfo:E,elementInfo:w,filterInfo:M,expandedInfo:L,setSort:ne,setSortInfo:q,updateVScroll:O,setFilter:de}),{calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re}=oS({resizeInfo:V,elementInfo:w,checkInfo:I,expandedInfo:L,stores:S,isRenderer:a,updateVScroll:O,updateHScroll:P,contextInfo:G}),{setPositionColumnSetting:pe,initColumnSettingInfo:Ie,onApplyColumn:Ee,setColumnHidden:kt}=Dr({stores:S,columnSettingInfo:R,contextInfo:G,onSearch:$,onResize:be}),{setContextMenu:Vt,onContextMenu:Qo,onColumnContextMenu:$o,onGridSettingContextMenu:ys}=hS({contextInfo:G,stores:S,selectInfo:W,useGridSetting:f,filterInfo:M,columnSettingInfo:R,setColumnHidden:kt,onSort:j}),{onRowClick:xs,onRowDblClick:Ss}=lS({selectInfo:W,stores:S}),{onDragStart:Cs,onDragOver:ks,onDrop:ws}=mS({stores:S}),Is=A=>{G.gridSettingContextMenuItems.length=0,G.customGridSettingContextMenu.length?ys(A):R.isShowColumnSetting=!0},on=A=>{var ie,Le,wt,ln,Ii,Et,ot,Ls,Ts,Cc;A.type==="wheel"&&((ie=G.menu)==null||ie.hide(A)),A.type==="scroll"&&!((Le=A.target.classList)!=null&&Le.contains("table-body"))&&!((ln=(wt=A.target.offsetParent)==null?void 0:wt.classList)!=null&&ln.contains("ev-select-dropbox"))&&!((Et=(Ii=A.target.offsetParent)==null?void 0:Ii.classList)!=null&&Et.contains("ev-grid-column-setting"))&&!((Ls=(ot=A.target.offsetParent)==null?void 0:ot.classList)!=null&&Ls.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,R.isShowColumnSetting=!1,G.isShowMenuOnClick=!1,(Ts=G.columnMenu)==null||Ts.hide(A),(Cc=G.gridSettingMenu)==null||Cc.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 A;T.value=((A=w["grid-wrapper"])==null?void 0:A.offsetWidth)/1.5||0}),o.watch(()=>R.isShowColumnSetting,A=>{var ie;if(!A){(ie=G.gridSettingMenu)==null||ie.hide();return}pe(u.value)}),o.watch(()=>t.columns,()=>{ee()?q(J()):(q(J()),ne()),M.filteringColumn=null,M.filteringItemsByColumn={},S.filterStore=[],ae({rows:[],isMakeIndex:!1}),Ie(),S.movedColumns.length=0},{deep:!0}),o.watch(()=>E.isSorting,A=>{A&&(ae({rows:S.originStore,isMakeIndex:!1}),E.isSorting=!A,x.isClientPaging&&(x.currentPage=1,S.pagingStore=D(),X()))}),o.watch(()=>t.rows,A=>{ae({rows:A}),M.isSearch&&$(M.searchWord),be()},{deep:!0}),o.watch(()=>t.uncheckable,()=>{ae({rows:t.rows})},{deep:!0}),o.watch(()=>t.checked,A=>{I.checkedRows=A}),o.watch(()=>t.disabledRows,()=>{S.store.length&&S.store.forEach(A=>{A[6]=t.disabledRows.includes(A[2])})},{deep:!0}),o.watch(()=>I.checkedRows,A=>{I.isHeaderChecked=!1;let ie=S.store;x.isClientPaging&&(ie=D()),ie.length&&(ie.forEach(Le=>{Le[1]=A.includes(Le[2])}),I.isHeaderChecked=A.length===ie.length),O()}),o.watch(()=>t.selected,A=>{W.useSelect&&(W.selectedRow=A)}),o.watch(()=>W.selectedRow,A=>{W.useSelect&&(S.store.forEach(ie=>{ie[3]=A.includes(ie[2])&&!t.disabledRows.includes(ie[2])}),O())}),o.watch(()=>C.value,async A=>{if(await o.nextTick(),A>=0){if(x.usePage&&!x.isInfinite&&(x.highlightPage=Math.ceil(A/x.perPage)||1,x.highlightPage!==x.currentPage)){x.currentPage=x.highlightPage,x.isHighlight=!0;return}w.body.scrollTop=V.rowHeight*C.value}}),o.watch(()=>I.useCheckbox.mode,()=>{X()}),o.watch(()=>W.useSelect,()=>{Z()}),o.watch(()=>W.multiple,()=>{Z()}),o.watch(()=>t.checked.length,A=>{A||X()}),o.watch(()=>t.expanded.length,A=>{A||N(),O()}),o.watch(()=>[t.option.columnWidth,V.gridWidth],async()=>{await o.nextTick(),V.columnWidth=t.option.columnWidth;const A=w["grid-wrapper"];A.style.width=V.gridWidth,A.style.height=V.gridHeight,S.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,A=>{A!==void 0&&($((A==null?void 0:A.value)??A),x.isClientPaging&&(X(),Z()))},{immediate:!0}),o.watch(()=>{var A;return(A=t.option.page)==null?void 0:A.currentPage},A=>{var Le;const ie=A||1;x.currentPage=(Le=t.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>x.currentPage,(A,ie)=>{o.nextTick(()=>{H(ie),x.isClientPaging&&A!==ie&&(X(),Z()),O(),A===x.highlightPage&&x.isHighlight&&(w.body.scrollTop=V.rowHeight*C.value,x.isHighlight=!x.isHighlight)})});const Ln=o.reactive({boxTop:0,boxLeft:0}),_=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"}],qo=o.ref(0),Qk=({caption:A,field:ie},Le)=>{if(ze.caption=A,ze.field=ie,Qe.value=Le,(Le==null?void 0:Le.length)>1){se.value=!0;const wt=_.value.getBoundingClientRect().left,ln=window.pageYOffset+_.value.getBoundingClientRect().top+_.value.getBoundingClientRect().height;Ln.boxTop=`${ln}px`,Ln.boxLeft=`${wt}px`}},$k=()=>{S.filterStore=[],ae({rows:[],isMakeIndex:!1})},el=async A=>{var ln,Ii;A&&fe.value&&(qo.value=0);const ie=(ln=_.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=_.value.getBoundingClientRect())==null?void 0:Ii.width,{width:Ts}=ot.getBoundingClientRect();wt+=Ts+10,Ls-150<=wt&&!ot.classList.contains("filtering-items__item--count")?(qo.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)})}},qk=async(A,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[A]=ie,fe.value=!0):(delete Ve.value[A],delete M.filteringItemsByColumn[A]),await o.nextTick(),el(!0),M.isShowFilterSetting=!1,S.filterStore=[],ae({rows:[],isMakeIndex:!1}),me(S.filterStore)};let tl=null;const ew=()=>{tl&&clearTimeout(tl),tl=setTimeout(()=>{fe.value=!fe.value,el(fe.value)},150)},tw=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Ve.value={},S.filterStore=[],ae({rows:[],isMakeIndex:!1})},nw=o.computed(()=>{var A;return{width:`${T.value}px`,top:`${((A=_.value)==null?void 0:A.getBoundingClientRect().height)||0}px`}}),iw=A=>{const ie=M.filteringItemsByColumn[A];return ie==null?void 0:ie[ie.length-1]},sw=()=>{const A=document.createElement("div");A.id="ev-grid-filtering-items-modal",A.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(A)};return o.onBeforeMount(()=>sw()),{idColIndex:o.computed(()=>{var A;return(A=S.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:A.index}),summaryScroll:B,showHeader:m,stripeStyle:p,borderStyle:y,highlightIdx:C,useSummary:g,useGridSetting:f,toolbarRef:u,stores:S,emptyText:b,...o.toRefs(w),...o.toRefs(S),...o.toRefs(M),...o.toRefs(v),...o.toRefs(x),...o.toRefs(V),...o.toRefs(W),...o.toRefs(I),...o.toRefs(L),...o.toRefs(E),...o.toRefs(G),...o.toRefs(R),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:O,updateHScroll:P,onScroll:F,calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re,onRowClick:xs,onRowDblClick:Ss,onCheck:K,onCheckAll:Q,onExpanded:U,onSort:j,setSort:ne,setStore:ae,setContextMenu:Vt,onContextMenu:Qo,onSearch:$,setGridSetting:Is,onApplyColumn:Ee,onColumnContextMenu:$o,filteringItemsWidth:T,isShowColumnFilteringItems:fe,operatorItems:jk,selectedFilteringItems:Qe,selectedFilteringColumn:ze,filteringItemsRef:_,isShowFilteringItemsBox:se,filteringItemsStyle:nw,hiddenFilteringItemsCount:qo,...o.toRefs(Ln),hiddenFilteringItemsRef:ke,hiddenFilteringItemsByColumn:Ve,removeAllFiltering:tw,onExpandFilteringItems:ew,setColumnFilteringItems:el,onChangeOperator:$k,onApplyFilter:qk,onClickFilteringItem:Qk,getFilteringItemByField:iw,onDragStart:Cs,onDragOver:ks,onDrop:ws,ROW_DISABLED_INDEX:6}}},gS={key:0,class:"filtering-items filtering-items--used"},bS={key:1,ref:"filteringItemsRef",class:"filtering-items"},yS=["data-field","onClick"],xS={class:"filtering-items__item--title"},SS=["title"],CS={key:1,class:"filtering-items__item--value"},kS=["onClick"],wS={class:"filtering-items__item--title"},IS=["title"],LS={key:1,class:"filtering-items__item--value"},TS={class:"column-list"},MS=["data-index"],vS=["title","onClick"],RS=["onClick"],VS=["onMousedown"],ES={ref:"table"},WS=["data-index","disabled","onClick","onContextmenu","onDblclick"],GS=["data-name","data-index","disabled"],ZS={key:0},XS=["title"],NS=["disabled"],PS=["disabled"],BS={key:0},DS=["colspan"],YS={key:0},OS={class:"is-empty"},HS={ref:"resizeLine",class:"table-resize-line"};function FS(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",gS,[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",bS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(t.filteringItemsByColumn),(w,M)=>{var R,S,x,I;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((...L)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...L),["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]=L=>t.columnOperator=L),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(L=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},t.filteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",xS,o.toDisplayString((R=i.getFilteringItemByField(w))==null?void 0:R.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),t.filteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,SS)):(o.openBlock(),o.createElementBlock("span",CS," + "+o.toDisplayString(t.filteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:L=>i.onApplyFilter(w,[])},null,8,["onClick"])],8,yS)],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 R,S,x,I;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(L=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},i.hiddenFilteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",wS,o.toDisplayString((R=i.getFilteringItemByField(w))==null?void 0:R.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),i.hiddenFilteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,IS)):(o.openBlock(),o.createElementBlock("span",LS," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:L=>i.onApplyFilter(w,[],!0)},null,8,["onClick"])],8,kS)}),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",TS,[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]=(...R)=>i.onDragStart&&i.onDragStart(...R)),onDragover:e[7]||(e[7]=(...R)=>i.onDragOver&&i.onDragOver(...R)),onDrop:e[8]||(e[8]=(...R)=>i.onDrop&&i.onDrop(...R))},[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:[R=>i.onColumnContextMenu(R,w),e[5]||(e[5]=o.withModifiers((...R)=>t.columnMenu.show&&t.columnMenu.show(...R),["prevent"]))]},[o.createTextVNode(o.toDisplayString(w.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(R=>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,RS)],8,vS)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(R=>i.onColumnResize(M,R),["stop","left"])},null,40,VS)],46,MS)):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",ES,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.viewStore,(w,M)=>{var R,S;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:x=>i.onRowClick(x,w),onContextmenu:x=>i.onRowClick(x,w,!0),onDblclick:x=>i.onRowDblClick(x,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":x=>w[1]=x,class:"row-checkbox-input",disabled:w[5]||w[i.ROW_DISABLED_INDEX],onChange:x=>i.onCheck(x,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":x=>w[4]=x,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(x=>i.onExpanded(x,w),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(x,I)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?w[2][i.idColIndex]:M}-${I}`},[!x.hide&&!x.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":x.field,"data-index":x.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(x),[x.type]:x.type,[x.align]:x.align,[x.field]:x.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${x.width}px`,height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,"min-width":`${i.isRenderer(x)?t.rendererMinWidth:t.minWidth}px`,"border-right":t.orderedColumns.length-1===I?"none":"1px solid #CFCFCF"}),disabled:w[i.ROW_DISABLED_INDEX]},[t.$slots[x.field]?(o.openBlock(),o.createElementBlock("div",ZS,[o.renderSlot(t.$slots,x.field,{item:{row:w,column:x},disabled:w[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(x,w[2][x.index])},o.toDisplayString(i.getConvertValue(x,w[2][x.index])),9,XS))],14,GS)):o.createCommentVNode("",!0)],64))),128)),(R=t.$props.option.customContextMenu)!=null&&R.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]=x=>i.onContextMenu(x))},[o.renderSlot(t.$slots,"contextmenuIcon",{},void 0,!0)],8,PS)):(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]=x=>i.onContextMenu(x))},null,8,["disabled"]))],14,NS)):o.createCommentVNode("",!0)],42,WS),t.useRowDetail&&((S=t.$slots)!=null&&S.rowDetail)&&w[4]?(o.openBlock(),o.createElementBlock("tr",BS,[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,DS)])):o.createCommentVNode("",!0)],64)}),128)),t.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",YS,[o.createElementVNode("td",OS,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",HS,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(pS,[["render",FS],["__scopeId","data-v-22cd2bf6"]]);fi.install=t=>{t.component(fi.name,fi)};let mi=null;function zS(){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,AS=512,z={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>=AS&&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=Hh(1),i=Oh(1),s=Yh(1),l=Dh(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=zS();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 KS(t){const e=(String(t).split(".")[1]??"").length;return t.toFixed(e+1)}var _S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function US(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yr={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(_S,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"],V=E%100;return"["+E+(G[(V-20)%10]||G[V]||G[0])+"]"}},k=function(E,G,V){var X=String(E);return!X||X.length>=G?E:""+Array(G+1-X.length).join(V)+E},T={s:k,z:function(E){var G=-E.utcOffset(),V=Math.abs(G),X=Math.floor(V/60),Z=V%60;return(G<=0?"+":"-")+k(X,2,"0")+":"+k(Z,2,"0")},m:function E(G,V){if(G.date()<V.date())return-E(V,G);var X=12*(V.year()-G.year())+(V.month()-G.month()),Z=G.clone().add(X,u),N=V-Z<0,D=G.clone().add(X+(N?-1:1),u);return+(-(X+(V-Z)/(N?Z-D:D-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 R="$isDayjsObject",S=function(E){return E instanceof v||!(!E||!E[R])},x=function E(G,V,X){var Z;if(!G)return w;if(typeof G=="string"){var N=G.toLowerCase();M[N]&&(Z=N),V&&(M[N]=V,Z=N);var D=G.split("-");if(!Z&&D.length>1)return E(D[0])}else{var Y=G.name;M[Y]=G,Z=Y}return!X&&Z&&(w=Z),Z||!X&&w},I=function(E,G){if(S(E))return E.clone();var V=typeof G=="object"?G:{};return V.date=E,V.args=arguments,new v(V)},L=T;L.l=x,L.i=S,L.w=function(E,G){return I(E,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var v=function(){function E(V){this.$L=x(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[R]=!0}var G=E.prototype;return G.parse=function(V){this.$d=function(X){var Z=X.date,N=X.utc;if(Z===null)return new Date(NaN);if(L.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var D=Z.match(y);if(D){var Y=D[2]-1||0,H=(D[7]||"0").substring(0,3);return N?new Date(Date.UTC(D[1],Y,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)):new Date(D[1],Y,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)}}return new Date(Z)}(V),this.init()},G.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},G.$utils=function(){return L},G.isValid=function(){return this.$d.toString()!==p},G.isSame=function(V,X){var Z=I(V);return this.startOf(X)<=Z&&Z<=this.endOf(X)},G.isAfter=function(V,X){return I(V)<this.startOf(X)},G.isBefore=function(V,X){return this.endOf(X)<I(V)},G.$g=function(V,X,Z){return L.u(V)?this[X]:this.set(Z,V)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(V,X){var Z=this,N=!!L.u(X)||X,D=L.p(V),Y=function(U,j){var J=L.w(Z.$u?Date.UTC(Z.$y,j,U):new Date(Z.$y,j,U),Z);return N?J:J.endOf(d)},H=function(U,j){return L.w(Z.toDate()[U].apply(Z.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(j)),Z)},B=this.$W,O=this.$M,P=this.$D,F="set"+(this.$u?"UTC":"");switch(D){case m:return N?Y(1,0):Y(31,11);case u:return N?Y(1,O):Y(0,O+1);case h:var K=this.$locale().weekStart||0,Q=(B<K?B+7:B)-K;return Y(N?P-Q:P+(6-Q),O);case d:case g:return H(F+"Hours",0);case c:return H(F+"Minutes",1);case r:return H(F+"Seconds",2);case a:return H(F+"Milliseconds",3);default:return this.clone()}},G.endOf=function(V){return this.startOf(V,!1)},G.$set=function(V,X){var Z,N=L.p(V),D="set"+(this.$u?"UTC":""),Y=(Z={},Z[d]=D+"Date",Z[g]=D+"Date",Z[u]=D+"Month",Z[m]=D+"FullYear",Z[c]=D+"Hours",Z[r]=D+"Minutes",Z[a]=D+"Seconds",Z[l]=D+"Milliseconds",Z)[N],H=N===d?this.$D+(X-this.$W):X;if(N===u||N===m){var B=this.clone().set(g,1);B.$d[Y](H),B.init(),this.$d=B.set(g,Math.min(this.$D,B.daysInMonth())).$d}else Y&&this.$d[Y](H);return this.init(),this},G.set=function(V,X){return this.clone().$set(V,X)},G.get=function(V){return this[L.p(V)]()},G.add=function(V,X){var Z,N=this;V=Number(V);var D=L.p(X),Y=function(O){var P=I(N);return L.w(P.date(P.date()+Math.round(O*V)),N)};if(D===u)return this.set(u,this.$M+V);if(D===m)return this.set(m,this.$y+V);if(D===d)return Y(1);if(D===h)return Y(7);var H=(Z={},Z[r]=i,Z[c]=s,Z[a]=n,Z)[D]||1,B=this.$d.getTime()+V*H;return L.w(B,this)},G.subtract=function(V,X){return this.add(-1*V,X)},G.format=function(V){var X=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||p;var N=V||"YYYY-MM-DDTHH:mm:ssZ",D=L.z(this),Y=this.$H,H=this.$m,B=this.$M,O=Z.weekdays,P=Z.months,F=Z.meridiem,K=function(j,J,ne,q){return j&&(j[J]||j(X,N))||ne[J].slice(0,q)},Q=function(j){return L.s(Y%12||12,j,"0")},U=F||function(j,J,ne){var q=j<12?"AM":"PM";return ne?q.toLowerCase():q};return N.replace(C,function(j,J){return J||function(ne){switch(ne){case"YY":return String(X.$y).slice(-2);case"YYYY":return L.s(X.$y,4,"0");case"M":return B+1;case"MM":return L.s(B+1,2,"0");case"MMM":return K(Z.monthsShort,B,P,3);case"MMMM":return K(P,B);case"D":return X.$D;case"DD":return L.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return K(Z.weekdaysMin,X.$W,O,2);case"ddd":return K(Z.weekdaysShort,X.$W,O,3);case"dddd":return O[X.$W];case"H":return String(Y);case"HH":return L.s(Y,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return U(Y,H,!0);case"A":return U(Y,H,!1);case"m":return String(H);case"mm":return L.s(H,2,"0");case"s":return String(X.$s);case"ss":return L.s(X.$s,2,"0");case"SSS":return L.s(X.$ms,3,"0");case"Z":return D}return null}(j)||D.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(V,X,Z){var N,D=this,Y=L.p(X),H=I(V),B=(H.utcOffset()-this.utcOffset())*i,O=this-H,P=function(){return L.m(D,H)};switch(Y){case m:N=P()/12;break;case u:N=P();break;case f:N=P()/3;break;case h:N=(O-B)/6048e5;break;case d:N=(O-B)/864e5;break;case c:N=O/s;break;case r:N=O/i;break;case a:N=O/n;break;default:N=O}return Z?N:L.a(N)},G.daysInMonth=function(){return this.endOf(u).$D},G.$locale=function(){return M[this.$L]},G.locale=function(V,X){if(!V)return this.$L;var Z=this.clone(),N=x(V,X,!0);return N&&(Z.$L=N),Z},G.clone=function(){return L.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 I.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])}}),I.extend=function(E,G){return E.$i||(E(G,v,I),E.$i=!0),I},I.locale=x,I.isDayjs=S,I.unix=function(E){return I(1e3*E)},I.en=M[w],I.Ls=M,I.p={},I})})(Yr);var JS=Yr.exports;const Pe=US(JS),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 R=(w-T)/1e3,S=Number.isFinite(R)?Math.max(0,Math.floor(R)):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(S>0)if(S>=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 V=0;V<S;V++)M(m[E]),E=(E+1)%y,G=(G+1)%y;f.startIndex=E,f.endIndex=G}const x=this.options.coordinateDedupe!==!1;let I=-1;for(let E=0;E<u;E++){const G=h[E];if(G){const V=Math.floor(G.x/1e3)*1e3;if(f.fromTime<=V){let X=f.endIndex-(f.toTime-V)/1e3;X<0&&(X=y+X);const Z=m[X],N=z.coordinateKey(G.x,G.y);if(!(x&&Z.dataKeys.has(N))){x&&Z.dataKeys.add(N),Z.data.push({x:G.x,y:G.y,o:G.value??G.y,color:G.color,k:x&&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 Y=(f.toTime-V)/1e3;Y>I&&(I=Y)}}}}f.lastTick={seq:(((r=f.lastTick)==null?void 0:r.seq)??0)+1,gapCount:S,prevToTime:T,toTime:f.toTime,length:y,startIndex:f.startIndex,endIndex:f.endIndex,maxDirtyAge:I};const L=1e3,v={maxY:-1/0,minY:1/0};for(let E=0;E<y;E++){const G=m[E];for(let V=0;V<G.data.length;V++){const X=G.data[V],Z=Math.floor(X.x/L)*L;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-1)*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=!z.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&&!z.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=!z.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 V;const G=this.seriesList[E];return(G==null?void 0:G.show)&&((V=G==null?void 0:G.data)==null?void 0:V.length)>0});if(W){const E=this.seriesList[W].data,G=a?t[1]:t[0];let V=1/0,X=-1;for(let Z=0;Z<E.length;Z++){const N=s||l.some(Y=>{var B,O,P,F;const H=this.seriesList[Y];return(H==null?void 0:H.show)&&((O=(B=H.data)==null?void 0:B[Z])==null?void 0:O.o)!==null&&((F=(P=H.data)==null?void 0:P[Z])==null?void 0:F.o)!==void 0}),D=E[Z];if(N&&D){let Y;if(a?Y=D.h?D.yp+D.h/2:D.yp:Y=D.w?D.xp+D.w/2:D.xp,Y!=null){const H=Math.abs(G-Y);H<V&&(V=H,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="",R=null,S=1/0,x=0,I=!1;for(let W=0;W<l.length;W++){const E=l[W],G=this.seriesList[E],V=e?G.findApproximateData:G.findGraphData;if(V){const X=V.call(G,t,a,d,i),Z=X.data,N=X.index;if(Z)if(z.isPieType(X.type))h=X.type,u=E,g=E,f=(Z.ea-Z.sa)/2,m=Z.o,p=Z.index;else{const D=a?Z.y:Z.x,Y=a?Z.yp:Z.xp;if(D!=null){const H=a?Z.o||Z.x:Z.o||Z.y;G.stackIndex!=null?(x+=isNaN(Z.o)?0:Z.o,I=!0):x+=Z.y;const B=H!=null&&!Number.isNaN(H),O=Z.xp!==null&&Z.xp!==void 0&&Z.yp!==null&&Z.yp!==void 0;if(B&&O){const P=z.calcBoxDistance(Z,r,c);(M===""||P<S)&&(S=P,b=G.type,k=D,T=Y,w=H,M=E,R=N)}else B&&M===""&&(b=G.type,k=D,T=Y,w=H,M=E,R=N);if(X.hit&&Z.xp!==void 0&&Z.yp!==void 0){const P=(Z.xp-t[0])**2+(Z.yp-t[1])**2;X.directHit?((!C||P<y)&&(y=P,h=G.type,u=D,f=Y,m=H,g=E,p=N),C=!0):C||P<y&&(y=P,h=G.type,u=D,f=Y,m=H,g=E,p=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const W=l.find(G=>{var X;const V=this.seriesList[G];return(V==null?void 0:V.show)&&((X=V==null?void 0:V.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,R=d)}const L=g!=="";return{type:L?h:b,label:L?u:k,pos:L?f:T,value:L?m:w,sId:L?g:M,acc:x,useStack:I,dataIndex:L?p:R}},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],R=Math.floor((+M-+w)/T)+1,S=(f-u)/R,I=Math.floor(((e==="yAxis"||r?i:n)-u)/S);b==="step"?m=w+I:m=(d==null?void 0:d.labels.findIndex(v=>v===+w))+I}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,R=Math.abs(k-T)/m,S=Math.floor((w+M)/R);return R*S+M>w&&R*S-M<w&&(u=S*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=pb(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;(!z.checkSafeInteger(c)||!z.checkSafeInteger(d)||!z.checkSafeInteger(u)||!z.checkSafeInteger(h)||!z.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}},QS={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"},$S={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},qS={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},Or={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}}},Hr={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,valueFormatter:null,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}}},zo={color:"#FF0000",lineWidth:1,label:Hr},Ao={color:"#FAE59D",border:null},eC={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}},tC=Object.freeze([1,2,5]),Fr=["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),Fr.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);Fr.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")?z.getOpacity(m):1,p=s?l:g;h.addColorStop(f,z.colorStringToRgba(m,p))}return h}},nC=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),zr=Math.PI*2;class iC{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=>!z.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=S=>S==null||S<p||S>y?null:Math.ceil(m+k*(S-p)),R=S=>{const x=a&&S>b?b:S;return x==null||x<C||x>b?null:Math.floor(g?g-T*(x-w):-(T*(x-w)))};for(let S=0;S<this.data.length;S++){const x=this.data[S];let I=M(x.x),L=R(x.y);this.isExistGrp&&r&&x.o===null&&(L=R(x.b??0)),I!==null&&(I+=z.aliasPixel(I)),x.xp=I,x.yp=L}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 H,B,O,P,F,K,Q,U,j;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=((H=a==null?void 0:a.selected)==null?void 0:H.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((B=r==null?void 0:r.option)!=null&&B.use&&((P=(O=r==null?void 0:r.selected)==null?void 0:O.seriesId)!=null&&P.length)){const J=(K=(F=r==null?void 0:r.selected)==null?void 0:F.seriesId)==null?void 0:K.includes(this.sId);p=this.extent[J?"highlight":"downplay"]}else m&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const y=J=>J!=null&&J.includes("rgba")?z.getOpacity(J):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,R=this._rgbaCache||(this._rgbaCache={}),S=(J,ne,q)=>{const ee=R[J];if(ee!==void 0&&ee.s===ne&&ee.o===q)return ee.v;const $=z.colorStringToRgba(ne,q);return R[J]={s:ne,o:q,v:$},$};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=S("stroke",C,b),this.segments&&n.setLineDash(this.segments);const x=this.useLinearInterpolation();let I=0;const L=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&&(I=W/(this.data.length||1),W-=I,this.size.comboOffset=I);const G=i.x1+s.left+I/2,V=i.y2-s.bottom,X=J=>te.calculateX(J,L.graphMin,L.graphMax,W,G),Z=J=>te.calculateY(u&&J>v.graphMax?v.graphMax:J,v.graphMin,v.graphMax,E,V);let N,D=null,Y=null;for(let J=0;J<this.data.length;J++){const ne=this.data[J],q=ne.xp,ee=ne.yp;x&&ne.o===null||(q===null||ee===null?N=void 0:(Yt(N==null?void 0:N.y)&&!this.isExistGrp||!x&&(Yt(N==null?void 0:N.y)||Yt(ne.o))?(n.moveTo(q,ee),D=q,Y=ee):(q!==D||ee!==Y)&&(n.lineTo(q,ee),D=q,Y=ee),N=ne))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const J=this.data.some(ae=>ae.o<0),ne=J?Z(0):i.y2-s.bottom,q=S("fill",this.fillColor||C,w);if((Q=this.fill)!=null&&Q.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,J?oe:q),be.addColorStop(.5,q),be.addColorStop(1,oe),n.fillStyle=be}else n.fillStyle=q;let ee=null,$=null;const de=[],me=this.data.length;for(let ae=0;ae<me+1;ae++){const xe=(U=this.data[ae])==null?void 0:U.o;if(x&&ub(xe)||!x&&Yt(xe)){if(ee!==null&&$!==null){let be=ee-1;for(let oe=ae-1;oe>=ee;oe--){const re=(j=this.data[oe])==null?void 0:j.o;if(!Yt(re)&&re!==null){be=oe;break}}de.push([ee,be]),ee=null,$=null}}else x&&xe===null||(ee=ee===null?ae:ee),$=ae}de.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=S("stroke",C,b);const J=S("focus",k,1),ne=S("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 ee=g.length?new Set(g):null,$=this.pointSize,de=this.pointStyle,me=this.data,ae=me.length,xe=!nC.has(de),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(x)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=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 Ee=me[pe];Ie===2?(re===null&&(re=[]),re.push(Ee)):(oe||(n.beginPath(),oe=!0),n.moveTo(Ee.xp+$,Ee.yp),n.arc(Ee.xp,Ee.yp,$,0,zr))}}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+$,Ie.yp),n.arc(Ie.xp,Ie.yp,$,0,zr)}n.fillStyle=J,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,te.drawPointBatch(n,de,$,oe)),re!==null&&(n.fillStyle=J,te.drawPointBatch(n,de,$,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=z.colorStringToRgba(this.color,0),s.fillStyle=z.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??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,R)=>M+R,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 R=d?p:c;for(let S=0;S<R.length;S++){const x=Math.abs(l-R[S].xp);x<=M&&(w=!0,M=x,g=d?R[S].originalIndex:S)}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=>!z.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 sC{constructor(e,n,i,s=!1){const l=Mo({},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=z.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=z.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(z.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")?z.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=te.calculateX(e.x,r.graphMin,r.graphMax,d,f);const p=te.calculateY(a&&e.y>c.graphMax?c.graphMax:e.y,c.graphMin,c.graphMax,h,m);g!==null&&!this.realTimeScatter&&(g+=z.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=z.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),R=this.getCachedColor(w,M);if(h){const S=`${T} ${R}`;let x=u.get(S);x||(x={strokeStyle:T,fillStyle:R,points:[]},u.set(S,x)),x.points.push(m),c.add(p)}else n.strokeStyle=T,n.fillStyle=R,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,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 R;if(l?R=l.sId===this.sId:u?R=s.get(M.k??z.coordinateKey(M.x,M.y))===this.sId:R=!0,R&&M.xp!==null&&M.yp!==null){const S=M.y>r.graphMax&&this.overflowColor,x=S||M.color||this.color,I=S||M.color||this.pointFill||this.color,L=this.getOpacity(e,x,w),v=this.getOpacity(e,I,w),W=this.getCachedColor(x,L),E=this.getCachedColor(I,v);if(f){const G=`${W} ${E}`;let V=m.get(G);V||(V={strokeStyle:W,fillStyle:E,points:[]},m.set(G,V)),V.points.push(M)}else n.strokeStyle=W,n.fillStyle=E,te.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,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(!p.drawn&&!(r&&l.get(p.k??z.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),te.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),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 Ar{constructor(e,n,i,s){const l=Xe({},n,$S);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,R=te.calculateX(0,g.graphMin,g.graphMax,k),S=te.calculateY(0,p.graphMin,p.graphMax,T),x=u?w+R:w,I=u?M:M+S,L=u?T:k,v=L/(y||1);let W;e.cPadRatio>=1||e.cPadRatio<=0?W=2:W=Math.max(L*(e.cPadRatio/2)/y,2);let G,V,X;G=v>W*2?v-W*2:v,G=this.isExistGrp?G:G/h;const Z=this.calculateBarSize(d,G);V=u?null:Z,X=u?Z:null;const N=u?(G-X)/2:(G-V)/2,D=this.isExistGrp?1:c+1;this.size.cat=v,this.size.bar=G,this.size.cPad=W,this.size.bPad=N,this.size.w=V,this.size.h=X,this.size.ix=D,this.chartRect=l,this.labelOffset=a,this.borderRadius=e.borderRadius,this.filteredCount=y;const Y=ve(C)?C:0,H=ve(b)?b:this.data.length-1;this.visibleStartIndex=Y;for(let B=Y;B<=H;B++){const O=B-Y,P=this.data[B];if(P){const F=u?I-v*O-W:x+v*O+W;if(u?(f=x,m=Math.round(F-(G*D-(X+N)))):(f=Math.round(F+(G*D-(V+N))),m=I),u){const K=P.b?P.o:P.x,Q=e.displayOverflow&&K>g.graphMax?g.graphMax:K;V=te.calculateX(Q,g.graphMin,g.graphMax,k,-R),P.b&&(f=te.calculateX(P.b,g.graphMin,g.graphMax,k,x-R));const U=K>0?-1:1;V=K&&V!==null&&Math.abs(V)===0?U:V}else{const K=P.b?P.o:P.y,Q=e.displayOverflow&&K>p.graphMax?p.graphMax:K;X=te.calculateY(Q,p.graphMin,p.graphMax,T,-S),P.b&&(m=te.calculateY(P.b,p.graphMin,p.graphMax,T,I-S));const U=K>0?-1:1;X=K&&X!==null&&Math.abs(X)===0?U:X}P.xp=f,P.yp=m,P.w=V,P.h=u?-X:X,P.index=B}}n&&(this._lastDataEpoch=e.dataEpoch,this._lastScaleVersion=e.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(e){var O,P,F,K,Q;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),R=i.chartHeight-(s.top+s.bottom),S=i.x1+s.left,x=i.y2-s.bottom,I=te.calculateX(0,g.graphMin,g.graphMax,M),L=te.calculateY(0,p.graphMin,p.graphMax,R),v=h?S+I:S,W=h?x:x+L,E=h?R:M,G=E/(w||1);let V;e.cPadRatio>=1||e.cPadRatio<=0?V=2:V=Math.max(E*(e.cPadRatio/2)/w,2);let Z,N,D;Z=G>V*2?G-V*2:G,Z=this.isExistGrp?Z:Z/c;const Y=this.calculateBarSize(r,Z);N=h?null:Y,D=h?Y:null;const H=h?(Z-D)/2:(Z-N)/2,B=this.isExistGrp?1:a+1;this.size.cat=G,this.size.bar=Z,this.size.cPad=V,this.size.bPad=H,this.size.w=N,this.size.h=D,this.size.ix=B,this.chartRect=i,this.labelOffset=s,this.borderRadius=e.borderRadius,this.filteredCount=w,this.visibleStartIndex=k;for(let U=k;U<=T;U++){const j=U-k,J=this.data[U];if(J){const ne=h?W-G*j-V:v+G*j+V;if(h?(f=v,m=Math.round(ne-(Z*B-(D+H)))):(f=Math.round(ne+(Z*B-(N+H))),m=W),h){const oe=J.b?J.o:J.x,re=d&&oe>g.graphMax?g.graphMax:oe;N=te.calculateX(re,g.graphMin,g.graphMax,M,-I),J.b&&(f=te.calculateX(J.b,g.graphMin,g.graphMax,M,v-I));const pe=oe>0?-1:1;N=oe&&N!==null&&Math.abs(N)===0?pe:N}else{const oe=J.b?J.o:J.y,re=d&&oe>p.graphMax?p.graphMax:oe;D=te.calculateY(re,p.graphMin,p.graphMax,R,-L),J.b&&(m=te.calculateY(J.b,p.graphMin,p.graphMax,R,W-L));const pe=oe>0?-1:1;D=oe&&D!==null&&Math.abs(D)===0?pe:D}const q=J.dataColor||this.color,ee=e==null?void 0:e.legendHitInfo,$=(O=e==null?void 0:e.selectLabel)==null?void 0:O.option,de=(P=e==null?void 0:e.selectItem)==null?void 0:P.option,me=((K=(F=e==null?void 0:e.selectLabel)==null?void 0:F.selected)==null?void 0:K.dataIndex)??[],{dataIndex:ae,seriesID:xe}=((Q=e==null?void 0:e.selectItem)==null?void 0:Q.selected)??{};let be=!1;if(ee?be=(ee==null?void 0:ee.sId)!==this.sId:$!=null&&$.use&&($!=null&&$.useSeriesOpacity)?be=me.length&&!me.includes(U):yt(ae)&&(de!=null&&de.useSeriesOpacity)&&(this.isExistGrp?be=ae!==U:be=ae!==U||xe!==this.sId),typeof q!="string")n.fillStyle=te.createGradient(n,h,{x:f,y:m,w:N,h:D},q,be,e.unSelectedOpacity);else{const oe=q.includes("rgba")?z.getOpacity(q):1,re=be?e.unSelectedOpacity:oe;n.fillStyle=z.colorStringToRgba(q,re)}this.drawBar({ctx:n,positions:{x:f,y:m,w:N,h:D}}),u.use&&this.drawValueLabels({context:n,data:J,positions:{x:f,y:m,h:D,w:N},isHighlight:!1,textColor:J.dataTextColor,index:U})}}}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 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=z.labelSignFormat(b,f)??"");const w=b<0,M=Math.round(C.measureText(T).width),R=c,S=r&&h!=="end"?10:4,x=w?m-S:m+S,I=w?g+S:g-S,L=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),V=E-S,X=G-S,Z=M<=E&&E>=R;switch(h){case"start":{if(r){if(M<V&&R<G){const N=w?x-M:x;C.fillText(T,N,W)}}else if(Z&&R+S<=G){const N=w?g+R/2+S:g-R/2-S;C.fillText(T,L,N)}break}case"center":{r?M<V&&R<G&&C.fillText(T,L,W):Z&&R<X&&C.fillText(T,L,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,D=this.chartRect.x2-this.labelOffset.right;if(R<this.size.bar)if(w){const Y=m-S+p-M;Y>N&&C.fillText(T,Y,W)}else{const Y=m+S+p;Y+M<D&&C.fillText(T,Y,W)}}else{const N=this.chartRect.y1+this.labelOffset.top,D=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(w){const Y=g+y+S+R/2;Y+R/2<=D&&C.fillText(T,L,Y)}else{const Y=g+y-S-R/2;Y-R/2>=N&&C.fillText(T,L,Y)}}break}default:case"end":{if(r){if(M<V&&R<G){const N=w?m+p+S:m+p-M-S;C.fillText(T,N,W)}}else if(w){const N=g+y-R/2-S;N>I&&Z&&R+S<=G&&C.fillText(T,L,N)}else Z&&R+S<=G&&C.fillText(T,L,g+y+R/2+S);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 oC extends Ar{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 R=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 S=a?null:R,x=a?null:R,I=a?R:null;const L=a?(w-I)/2:(w-S)/2,v=this.isExistGrp?1:l+1;this.size.cat=k,this.size.bar=w,this.size.cPad=T,this.size.bPad=L,this.size.w=S,this.size.ix=v,this.chartRect=n,this.labelOffset=i,this.borderRadius=e.borderRadius,this.data.forEach(W=>{a?(d=p,h=te.calculateY(W.y,f.graphMin,f.graphMax,g,y)):(d=te.calculateSubX(W.x,u.graphMin,u.graphMax,m,p),d<p?(x-=p-d,d=d+S<p?null:p):d+S>C&&(x-=x-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(w*v)-Math.round(S+L)),h=y),a?W.b?(S=te.calculateX(W.x-W.b,u.graphMin,u.graphMax,m),d=te.calculateX(W.b,u.graphMin,u.graphMax,m,p)):S=te.calculateX(W.x,u.graphMin,u.graphMax,m):W.b?(I=te.calculateY(W.y-W.b,f.graphMin,f.graphMax,g),h=te.calculateY(W.b,f.graphMin,f.graphMax,g,y)):I=te.calculateY(W.y,f.graphMin,f.graphMax,g),d!==null&&h!==null&&typeof(W.dataColor||this.color)!="string"&&(S=S!==x?x:S),x=S,W.xp=d,W.yp=h,W.w=S,W.h=a?-I:I})}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 S=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 x=r?null:S,I=r?null:S,L=r?S:null;const v=r?(M-L)/2:(M-x)/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=x,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=te.calculateY(E.y,m.graphMin,m.graphMax,p,C)):(h=te.calculateSubX(E.x,f.graphMin,f.graphMax,g,y),h<y?(I-=y-h,h=h+x<y?null:y):h+x>b&&(I-=I-(b-h)),h>=b&&(h=null),h!==null&&(h+=Math.ceil(M*W)-Math.round(x+v)),u=C),r?E.b?(x=te.calculateX(E.x-E.b,f.graphMin,f.graphMax,g),h=te.calculateX(E.b,f.graphMin,f.graphMax,g,y)):x=te.calculateX(E.x,f.graphMin,f.graphMax,g):E.b?(L=te.calculateY(E.y-E.b,m.graphMin,m.graphMax,p),u=te.calculateY(E.b,m.graphMin,m.graphMax,p,C)):L=te.calculateY(E.y,m.graphMin,m.graphMax,p),h!==null&&u!==null){const V=E.dataColor||this.color,X=V.includes("rgba")?z.getOpacity(V):1,Z=this.state==="downplay"?e.unSelectedOpacity:X;typeof V!="string"?(x=x!==I?I:x,n.fillStyle=te.createGradient(n,r,{x:h,y:u,w:x,h:L},V,this.state==="downplay",e.unSelectedOpacity)):n.fillStyle=z.colorStringToRgba(V,Z),this.drawBar({ctx:n,positions:{x:h,y:u,w:x,h:L}}),this.showValue.use&&this.drawValueLabels({context:n,data:E,positions:{x:h,y:u,h:L,w:x},isHighlight:!1,index:G})}I=x})}}class lC{constructor(e,n,i){const s=Mo({},qS,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")?z.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=z.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=z.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")?z.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:m;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=z.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 aC{constructor(e,n,i,s,l){const a=Mo({},eC,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("#")?z.hexToRgb(s):s.replace(i,""),u=l.includes("#")?z.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,R=+m-k*w,S=+g-T*w;n.push({id:`color#${w}`,color:`rgb(${M},${R},${S})`,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=z.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 k=f.o;if(p!==null&&y!==null&&k!==null&&k!==void 0){const{show:w,dataColor:M,id:R}=this.getItemInfo(k);if(f.dataColor||(f.dataColor=M),f.cId=R,w){let S=this.stroke;const x=s==null?void 0:s.option,I=(x==null?void 0:x.use)&&(x==null?void 0:x.showBorder),L=m===((T=s==null?void 0:s.selected)==null?void 0:T.dataIndex);if(I&&L&&(S={show:x==null?void 0:x.showBorder,...x==null?void 0:x.borderStyle}),S.show&&S.lineWidth>0){const{lineWidth:v}=S,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:R}=r,{option:S,selected:x}=l,I=yt(R==null?void 0:R.dataIndex)&&(R==null?void 0:R.dataIndex)>-1,L=((k=x==null?void 0:x.label)==null?void 0:k.length)>0;return I?w=M.useSeriesOpacity?b!==(R==null?void 0:R.dataIndex):!1:L&&(w=S.useSeriesOpacity?!((T=x==null?void 0:x.label)!=null&&T.includes(this.getItemLabel(l,y))):!1),w?.1:C}return C};this.data.forEach((y,C)=>{var S;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 R=y.o;if(k!==null&&T!==null&&R!==null&&R!==void 0){const{show:x,opacity:I,dataColor:L,id:v}=this.getItemInfo(R);let W=I;I===1&&z.getColorStringType(y.dataColor)==="RGBA"&&(W=z.getOpacity(y.dataColor));const E=p(y,W,C);if(y.dataColor||(y.dataColor=L),y.cId=v,n.save(),x){n.fillStyle=z.colorStringToRgba(y.dataColor,E);let G=this.stroke;const V=r==null?void 0:r.option,X=(V==null?void 0:V.use)&&(V==null?void 0:V.showBorder),Z=C===((S=r==null?void 0:r.selected)==null?void 0:S.dataIndex);X&&Z&&(G={show:V==null?void 0:V.showBorder,...V==null?void 0:V.borderStyle});let N=!1;if(G.show&&G.lineWidth>0){const{color:D,lineWidth:Y,opacity:H}=G,B=Y*2;N=B<Math.floor(w)&&B<Math.floor(M),n.strokeStyle=N?z.colorStringToRgba(D,E===1?H:E):void 0,N?(n.lineWidth=Y,k+=Y,T+=Y,w-=B,M-=B):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=z.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=z.getColorStringType(i.dataColor)==="RGBA"?e.dataColor:z.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,R,S;k==="x"?(R=p,S=u+r):(R=y,S=m),a[k].findIndex((I,L)=>(M=S+R*L,M<=T&&T<=M+R))>-1?C[w]=["xsp","ysp"].includes(w)?M:M+R:T<S&&(C[w]=S)};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,R=(u-h)/w,S=n+s,x=i+l,I={min:Math.floor((n-c)/M),max:Math.floor((S-c-M)/M)},L=w-1,v={min:L-Math.round((x-h-R)/R),max:L-Math.round((i-h)/R)},W=this.getFilteredLabel(f,T,p,y),E=this.getFilteredLabel(m,w,b,k);r={xMin:W[I.min],xMax:W[I.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 Kr={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 iC(n,i,s);else if(e==="scatter")this.seriesInfo.charts.scatter.push(n),a=new sC(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 oC(n,i,s,l):a=new Ar(n,i,s,l);else if(e==="pie")this.seriesInfo.charts.pie.push(n),a=new lC(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 aC(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,Or);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=e,this.ctx=i,this.units=QS[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:z.calcTextSizeCanvas(c,z.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(e,n,i=[]){const s=z.getLabelStyle(this.labelStyle);return[...(e??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=z.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=z.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,R,S,x,I,L,v,W,E,G,V,X,Z,N,D,Y;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=z.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=z.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 H=p-g,B=H/h,O=[],P=i.interval;let F=null,K=null,Q=g,U=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const J=Math.floor(u/P)*P;J!==+u&&(U=J+P,Q+=H/(f-u)*(U-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,k=z.aliasPixel(r.lineWidth);let j;for(let J=0;J<=h;J++)if(F=Math.round(Q+B*J),F<=p||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),O[J]=U+J*m,O[J]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,K=F+k,j=this.getLabelFormat(Math.min(f,O[J]),{prev:O[J-1]??""});const q=((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.use)&&((S=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:S.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((x=l==null?void 0:l.dataIndex)==null?void 0:x.length)&&!(l!=null&&l.label.map(me=>this.getLabelFormat(Math.min(f,me),{prev:O[J-1]??""})).includes(j));let ee;J===h&&this.lastLabelFontStyle?(r.font=z.getLabelStyle(this.lastLabelFontStyle),ee=this.lastLabelFontStyle.color):J===0&&this.firstLabelFontStyle?(r.font=z.getLabelStyle(this.firstLabelFontStyle),ee=this.firstLabelFontStyle.color):(r.font=z.getLabelStyle(this.labelStyle),ee=this.labelStyle.color);let $=1;z.getColorStringType(ee)==="RGBA"&&($=z.getOpacity(ee)),r.fillStyle=z.colorStringToRgba(ee,q?(I=this.options)==null?void 0:I.unSelectedOpacity:$);let de;if(this.type==="x"){if(de=this.position==="top"?y-10:y+10,((L=c==null?void 0:c.brush)!=null&&L.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(j),F,de),!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===j){const ae=Math.round(r.measureText((E=this.labelStyle)==null?void 0:E.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(me).width)+10,height:ae,x:F,y:de+(ae-2),borderRadius:2,arrowSize:3,text:j,backgroundColor:(V=(G=c==null?void 0:c.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:V.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(K,y),r.lineTo(K,y+b),r.stroke(),r.closePath()),(J!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(K,y),r.lineTo(K,C),r.stroke(),r.closePath())}else de=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(j),de,F),J===h&&(K-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(y+(this.axisLineWidth??1),K),r.lineTo(y-b,K),r.stroke(),r.closePath()),J!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(y,K),r.lineTo(C,K),r.stroke(),r.closePath())}}((D=this.plotBands)!=null&&D.length||(Y=this.plotLines)!=null&&Y.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,Ao),{from:w,to:M,label:R,border:S}=T,x=z.isNullOrUndefined(w)?n:Math.max(w,n),I=z.isNullOrUndefined(M)?i:Math.min(M,i);let L,v;if(this.type==="x"){if(L=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),L===null||v===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(L,v,h,u,f,m,S)}else{if(L=te.calculateY(x,n,i,c,m),v=te.calculateY(I,n,i,c,m),L===null||v===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(L,v,h,u,f,m,S)}this.drawPlotBandLabel(L,v,R,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const T=Xe({},k,zo),{value:w,label:M}=T;let R;if(this.type==="x"){if(R=te.calculateX(w,n,i,r,h),R===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(R,h,u,f,m)}else{if(R=te.calculateY(w,n,i,c,m),R===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(R,h,u,f,m)}this.drawPlotLineLabel(R,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+=z.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+=z.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,Hr),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=!z.isNullOrUndefined(u)&&d<u,m=!f&&!z.isNullOrUndefined(h)&&d<h,g=s.text!=null?String(s.text):"",p=!z.isNullOrUndefined(i)&&Number.isFinite(+i);let y="";if(s.showValue&&p)if(typeof s.valueFormatter=="function"){const L=s.valueFormatter(i);y=L==null?String(this.getLabelFormat(i)):String(L)}else y=String(this.getLabelFormat(i));let C;s.showValue?C=m?y:[g,y].filter(L=>L).join(" "):C=g,l.save(),l.font=z.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=z.truncateLabelWithEllipsis(C,T,l),k=l.measureText(b).width),l.restore();const w=c/4,M=s.padding;let R=w,S=w,x=w,I=w;return typeof M=="number"?(R=M,S=M,x=M,I=M):M&&typeof M=="object"&&(R=M.top??w,S=M.right??w,x=M.bottom??w,I=M.left??w),{...s,label:b,fontSize:c,labelWidth:k,padTop:R,padRight:S,padBottom:x,padLeft:I,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,R;if(this.type==="x")switch(u==="innerEnd"?(R=C-h,w=R-k):(w=y+h,R=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":R=e-h,w=R-k;break;case"bottom":w=e+h,R=w+k;break;default:w=e-k/2,R=e+k/2;break}let S;return this.type==="x"?S=u==="innerEnd"?"top":"bottom":f==="top"?S="bottom":f==="bottom"?S="top":S=null,{textX:T+d+s/2,textY:w+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:T,top:w,right:M,bottom:R},pointerEdge:S}}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=z.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,R;switch(n){case"top":b=y-h,k=e.top,T=y+h,w=e.top,M=p,R=e.top-d;break;case"left":b=e.left,k=C-h,T=e.left,w=C+h,M=e.left-d,R=C;break;case"right":b=e.right,k=C-h,T=e.right,w=C+h,M=e.right+d,R=C;break;case"bottom":default:b=y-h,k=e.bottom,T=y+h,w=e.bottom,M=p,R=e.bottom+d;break}c.beginPath(),c.moveTo(b,k),c.lineTo(M,R),c.lineTo(T,w),c.closePath(),c.fillStyle=i,c.fill(),l>0&&(c.beginPath(),c.moveTo(b,k),c.lineTo(M,R),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?z.truncateLabelWithEllipsis(e,n,this.ctx,i):e}}function rC(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 _r(t){return t.hour()===0&&t.minute()===0&&t.second()===0&&t.millisecond()===0?t:t.startOf("day")}function cC(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 _r(t.add(n*7,"day"));case"day":return _r(t.add(n,"day"));default:return Pe(t.valueOf()+e.ms)}}function dC(t,e){return e.unit?cC(Pe(t),e).valueOf():t+e.ms}function hC(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"),l=i.startOf("day"),a=Math.round((l.valueOf()-s.valueOf())/Ct.day.size),r=l.valueOf()>=t?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"day").valueOf()}if(e.unit==="week"){const s=i.startOf("year"),l=s.subtract((s.day()+6)%7,"day"),a=i.subtract((i.day()+6)%7,"day").startOf("day"),r=Math.round((a.valueOf()-l.valueOf())/Ct.week.size),c=a.valueOf()>=t?r:r+1,d=Math.ceil(c/n)*n;return l.add(d*7,"day").valueOf()}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 uC(t,e,n){const i=[];let s=hC(t,n);const l=1e4;for(;s<=e&&i.length<l;)i.push(s),s=dC(s,n);return i}const Ko=864e5,fC=["millisecond","second","minute","hour"],_o=new Map;function mC(t){if(_o.has(t))return _o.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 _o.set(t,i),i}function Ur(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 pC(t,e,n){const i=s=>Math.floor(e/s)+1<=n;if(i(t.ms))return t;if(t.unit&&fC.includes(t.unit)&&Ko%t.ms===0){const s=mC(Ko/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 Ur({ms:Ko,unit:"day",time:1},e,n)}return Ur(t,e,n)}function Jr(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 gC extends bi{normalizeTimeValue(e){return Jr(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:z.calcTextSizeCanvas("",z.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=rC(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:pC(c,d,s),u=h.ms,f=uC(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,R,S,x,I,L,v,W,E,G,V,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=z.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=z.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 D=c.x2-c.x1,Y=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=z.aliasPixel(a.lineWidth);let H;for(let B=0;B<u.length;B++){const O=u[B];let P;if(this.type==="x"?P=te.calculateX(O,d,h,D,c.x1):P=te.calculateY(O,d,h,Y,c.y2),P===null)continue;O===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const K=P+C;H=this.getLabelFormat(O,{prev:u[B-1]??""});const Q=((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")&&((R=l==null?void 0:l.dataIndex)==null?void 0:R.length)&&!(l!=null&&l.label.map(ne=>this.getLabelFormat(ne,{prev:u[B-1]??""})).includes(H));let U;B===u.length-1&&this.lastLabelFontStyle?(a.font=z.getLabelStyle(this.lastLabelFontStyle),U=this.lastLabelFontStyle.color):B===0&&this.firstLabelFontStyle?(a.font=z.getLabelStyle(this.firstLabelFontStyle),U=this.firstLabelFontStyle.color):(a.font=z.getLabelStyle(this.labelStyle),U=this.labelStyle.color);let j=1;z.getColorStringType(U)==="RGBA"&&(j=z.getOpacity(U)),a.fillStyle=z.colorStringToRgba(U,Q?(S=this.options)==null?void 0:S.unSelectedOpacity:j);let J;if(this.type==="x"){if(J=this.position==="top"?g-10:g+10,((x=r==null?void 0:r.brush)!=null&&x.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(H),P,J),!Q&&((I=r==null?void 0:r.selectItem)!=null&&I.showLabelTip)&&(s!=null&&s.label)&&!((L=this.options)!=null&&L.horizontal)){const ne=this.getLabelFormat(s.label);if(ne===H){const q=Math.round(a.measureText((v=this.labelStyle)==null?void 0:v.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ne).width)+10,height:q,x:P,y:J+(q-2),borderRadius:2,arrowSize:3,text:H,backgroundColor:(E=(W=r==null?void 0:r.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:E.backgroundColor,textColor:(V=(G=r==null?void 0:r.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:V.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(K,g),a.lineTo(K,g+y),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(K,g),a.lineTo(K,p),a.stroke(),a.closePath())}else{J=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(H),J,P);let ne=K;B===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,Ao),{from:w,to:M,label:R,border:S}=T,x=z.isNullOrUndefined(w)?n:Math.max(w,n),I=z.isNullOrUndefined(M)?i:Math.min(M,i);let L,v;if(this.type==="x"){if(L=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),L===null||v===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(L,v,h,u,f,m,S)}else{if(L=te.calculateY(x,n,i,c,m),v=te.calculateY(I,n,i,c,m),L===null||v===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(L,v,h,u,f,m,S)}this.drawPlotBandLabel(L,v,R,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const T=Xe({},k,zo),{value:w,label:M}=T;let R;if(this.type==="x"){if(R=te.calculateX(w,n,i,r,h),R===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(R,h,u,f,m)}else{if(R=te.calculateY(w,n,i,c,m),R===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(R,h,u,f,m)}this.drawPlotLineLabel(R,M,g,l,w)})}}class bC 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 z.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 tC){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 S=Math.round(M);return f(T),{steps:S,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:z.calcTextSizeCanvas(m,z.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:z.calcTextSizeCanvas(h,z.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class yC 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=z.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:z.calcTextSizeCanvas(r,z.getLabelStyle(this.labelStyle))}}calculateSteps(e,n){const i=e.maxValue,s=e.minValue,l=e.maxSteps,a=z.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 z.labelSignFormat(e,this.decimalPoint)}getInterval(e){const n=e.maxValue,i=e.minValue;return 10**z.calculateMagnitude(n-i)}}const Uo=new WeakMap;class xC 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?(Uo.has(this.labels)||Uo.set(this.labels,z.getStringMinMax(this.labels)),Uo.get(this.labels)):z.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:z.calcTextSizeCanvas(this.getLabelFormat(l,u),z.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,R,S,x,I;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=z.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 L=z.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+L),a.lineTo(m,g+L)):(a.moveTo(g+L,f),a.lineTo(g+L,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 V,X,Z;for(Z=0;Z<d;Z+=h){const N=u+Z,D=this.labels[N];E=Math.round(f+v*Z),G=E+L,V=this.getLabelFormat(D,y);const{selectLabel:Y,selectItem:H,horizontal:B}=this.options;let O;l!=null&&l.targetAxis?O=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":O=B?"y":"x";const P=(Y==null?void 0:Y.use)&&(Y==null?void 0:Y.useLabelOpacity)&&O===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 F;Z===d-1&&this.lastLabelFontStyle?(a.font=z.getLabelStyle(this.lastLabelFontStyle),F=this.lastLabelFontStyle.color):Z===0&&this.firstLabelFontStyle?(a.font=z.getLabelStyle(this.firstLabelFontStyle),F=this.firstLabelFontStyle.color):(a.font=z.getLabelStyle(this.labelStyle),F=this.labelStyle.color);let K=1;if(z.getColorStringType(F)==="RGBA"&&(K=z.getOpacity(F)),a.fillStyle=z.colorStringToRgba(F,P?(w=this.options)==null?void 0:w.unSelectedOpacity:K),this.type==="x"){X=this.position==="top"?g-10:g+10;const Q=W?E:E+v/2;if(a.fillText(this.checkFixWidth(V),Q,X),!P&&(H!=null&&H.showLabelTip)&&(s!=null&&s.label)&&!B){const U=s.label;if(U===V){const j=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(U).width)+10,height:j,x:E+v/2,y:X+(j-2),borderRadius:2,arrowSize:3,text:V,backgroundColor:(R=H==null?void 0:H.labelTipStyle)==null?void 0:R.backgroundColor,textColor:(S=H==null?void 0:H.labelTipStyle)==null?void 0:S.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 Q=W?E:E+v/2;a.fillText(this.checkFixWidth(V),X,Q),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),Q),a.lineTo(g-C,Q),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 Y=Math.round(f+v*(d-1)),H=W?Y:Y+v/2,B=this.getLabelFormat(r[N],y);a.font=this.lastLabelFontStyle?z.getLabelStyle(this.lastLabelFontStyle):z.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),H,X):a.fillText(this.checkFixWidth(B),X,H),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(H,g),a.lineTo(H,g+C)):(a.moveTo(g+(this.axisLineWidth??1),H),a.lineTo(g-C,H)),a.stroke(),a.closePath())}}if(W&&!this.showLastLabel){const N=M0(+r[1],+r[0]),D=Oo(+r[r.length-1],N);if(isNaN(D))return;E=Math.round(f+v*this.labels.length),G=E+L;const Y=this.getLabelFormat(`${D}`,y),H=E+v/2;a.font=z.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(Y),E,X):a.fillText(this.checkFixWidth(Y),X,E),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(H,g),a.lineTo(H,g+C)):(a.moveTo(g+(this.axisLineWidth??1),G),a.lineTo(g-C,G)),a.stroke(),a.closePath())}a.closePath()}((x=this.plotBands)!=null&&x.length||(I=this.plotLines)!=null&&I.length)&&(this._plotGeom={aPos:c,startPoint:f,endPoint:m,chartRect:e,aliasPixel:z.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(z.isNullOrUndefined(b.from)&&z.isNullOrUndefined(b.to))return;const k=Xe({},b,Ao),{from:T=0,to:w=e.length,label:M,border:R}=k,S=Math.round(i+f*T),x=Math.round(i+f*w);this.setPlotBandStyle(k),this.type==="x"?this.drawXPlotBand(S,x,c,d,h,u,R):this.drawYPlotBand(S,x,c,d,h,u,R),this.drawPlotBandLabel(S,x,M,m,l,T,w)}),(C=this.plotLines)==null||C.forEach(b=>{if(z.isNullOrUndefined(b.value))return;const k=Xe({},b,zo),{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=z.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return z.truncateLabelWithEllipsis(e,n,i,s)}getLabelWidthHasMaxLength(e,n,i=[]){const s=z.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=z.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class SC 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,V,X,Z,N,D,Y,H,B,O,P,F,K,Q,U;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=z.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=z.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 R=null,S=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let x,I,L;const v=d<=2?Math.max(1,m-1):Math.round(m/d),W=v===m?m:m-1;for(L=0;L<=W;L+=v){M[L]=Pe(h).valueOf()+L*f,R=Math.round(g+w*L),S=R+k;let j;for(let ee=0;ee<M.length;ee++)M[ee]!==void 0&&ee!==L&&(j=M[ee]);x=this.getLabelFormat(Math.min(u,M[L]),{prev:j});const J=((G=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:G.use)&&((X=(V=this.options)==null?void 0:V.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:j})).includes(x)),ne=this.labelStyle.color;let q=1;if(z.getColorStringType(ne)==="RGBA"&&(q=z.getOpacity(ne)),a.fillStyle=z.colorStringToRgba(ne,J?(N=this.options)==null?void 0:N.unSelectedOpacity:q),this.type==="x"){if(I=this.position==="top"?y-10:y+10,a.fillText(this.checkFixWidth(x),R,I),!J&&((Y=(D=this.options)==null?void 0:D.selectItem)!=null&&Y.showLabelTip)&&(s!=null&&s.label)&&!((H=this.options)!=null&&H.horizontal)){const ee=this.getLabelFormat(Math.min(u,s.label+0*f));if(ee===x){const $=Math.round(a.measureText((B=this.labelStyle)==null?void 0:B.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ee).width)+10,height:$,x:R,y:I+($-2),borderRadius:2,arrowSize:3,text:x,backgroundColor:(F=(P=(O=this.options)==null?void 0:O.selectItem)==null?void 0:P.labelTipStyle)==null?void 0:F.backgroundColor,textColor:(U=(Q=(K=this.options)==null?void 0:K.selectItem)==null?void 0:Q.labelTipStyle)==null?void 0:U.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(S,y),a.lineTo(S,y+b),a.stroke(),a.closePath()),L<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(S,y),a.lineTo(S,C),a.stroke(),a.closePath())}else I=this.position==="left"?y-10:y+10,a.fillText(this.checkFixWidth(x),I,R),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(y+(this.axisLineWidth??1),S),a.lineTo(y-b,S),a.stroke(),a.closePath()),L<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(y,S),a.lineTo(C,S),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&T&&L*v===m){const j=Pe(r[1]).diff(Pe(r[0])),J=this.getLabelFormat(Pe(M[m-1]+j));R=Math.round(g+w*m),S=R+k,this.type==="x"?(a.fillText(this.checkFixWidth(J),R,I),this.showGrid&&(a.moveTo(S,y),a.lineTo(S,C))):(a.fillText(this.checkFixWidth(J),I,R),this.showGrid&&(a.moveTo(y,S),a.lineTo(C,S))),a.stroke()}a.closePath()}}const CC={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`}},kC={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,z.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=z.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?z.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,z.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=z.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?z.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",z.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(),z.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=z.labelSignFormat(+n,e)),i}},jr=28,wC={width:70,height:60},IC={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>jr?jr: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 R=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");R[0].style.cssText=g+y,R[1].style.cssText=g+C;const S=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");S[0].style.backgroundColor=this.isSide?u:h,S[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}=wC,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`)}},LC={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,Or.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)||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:(k=(b=(C=this.options.axesY)==null?void 0:C[0])==null?void 0:b.scrollbar)==null?void 0:k.resetPosition;if(a){const R=(T=s==null?void 0:s[0])==null?void 0:T.range,S=this.scrollbar[t].range;if(!M&&(R!=null&&R.length)&&(S!=null&&S.length)){const x=R[1]-R[0],I=this.scrollbar[t].anchorEdge,L=I?this.getScrollbarLimits(t):null;I==="start"&&L?this.scrollbar[t].range=[L.limitMin,L.limitMin+x]:I==="end"&&L?this.scrollbar[t].range=[L.limitMax-x,L.limitMax]:this.scrollbar[t].range=[S[0],S[0]+x]}else this.scrollbar[t].range=R!=null&&R.length?[...R]: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 R,S;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=(R=this.options.title)!=null&&R.show?(S=this.options.title)==null?void 0:S.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 x=i.getElementsByClassName("ev-chart-scrollbar-button-up"),I=Math.floor(f-m.size),L=Math.floor(m.position)>I?.5:1;x[0].style.cssText=`background-color: ${n.background};${b}`,x[0].style.opacity=L,x[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,R=s.deltaY<0,S=s.deltaY>0;if(!(w&&R||M&&S))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,[R,S]=s;if(k>0){const x=a+(M-+R);T=+R+x,w=T+(+S-+R)}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 TC(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")}function Qr(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,TC(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(I){const L=i,v=s;return i=s=void 0,d=I,a=t.apply(v,L),a}function p(I,L){return m?(window.cancelAnimationFrame(r),window.requestAnimationFrame(I)):setTimeout(I,L)}function y(I){if(m)return window.cancelAnimationFrame(I);clearTimeout(I)}function C(I){return d=I,r=p(T,e),h?g(I):a}function b(I){const L=I-c,v=I-d,W=e-L;return u?Math.min(W,l-v):W}function k(I){const L=I-c,v=I-d;return c===void 0||L>=e||L<0||u&&v>=l}function T(){const I=Date.now();if(k(I))return w(I);r=p(T,b(I))}function w(I){return r=void 0,f&&i?g(I):(i=s=void 0,a)}function M(){r!==void 0&&y(r),d=0,i=c=s=r=void 0}function R(){return r===void 0?a:w(Date.now())}function S(){return r!==void 0}function x(...I){const L=Date.now(),v=k(L);if(i=I,s=this,c=L,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 x.cancel=M,x.flush=R,x.pending=S,x}const MC="Expected a function";function vC(t,e,n){let i=!0,s=!0;if(typeof t!="function")throw new TypeError(MC);return Qr(t,e,{leading:i,maxWait:e,trailing:s})}const RC={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 R=C.slice().sort();for(let S=0;S<R.length;S++){const x=R[S];k+=`|${x}:${g.items[x].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 S=[];for(let x=0;x<C.length;x++){const I=C[x],L=g.items[I];S.push({sId:I,data:L.data,color:L.color,name:L.name,dataId:L.id,index:L.index})}this.hideTooltipDOM(),u.returnValue(S,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 R=Object.values(this.seriesList||{}).some(S=>S.type==="line");if(u.use&&(f==="line"||R)){const S=this.drawIndicatorForTooltip(g,h.color),x=S==null?void 0:S.labelValue,I=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:I,mousePosition:[c.clientX,c.clientY],dataLabel:x}}}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 R=Object.values(this.seriesList||{}).some(x=>x.type==="line");(f!=="line"&&!R||!u.use||!Object.keys(g.items).length)&&this.drawIndicator(m,h.color);const S=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:S,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 S,x;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],R=w.items[M];R&&(d.label=R.label,d.value=(S=R.data)==null?void 0:S.o,d.seriesId=M,d.dataIndex=R.index,d.acc=(x=R.data)==null?void 0:x.acc)},k=w=>{var L,v;const M=this.findHitItem(h,!0),R=M.hitId??Object.keys(M.items)[0],S=M.items[R],{labelIndex:x}=this.getLabelInfoByPosition(h,w),{dataIndex:I}=this.regulateSelectedLabelInfo(x,w);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(I,w),S&&(d.label=S.label,d.seriesId=R,d.value=(L=S.data)==null?void 0:L.o,d.acc=(v=S.data)==null?void 0:v.acc,d.dataIndex=S.index)},T=()=>{var S,x,I;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],R=w.items[M];if(M!==null){const L=this.updateSelectedSeriesInfo(M,!0);R&&(d.label=R.label,d.value=(S=R.data)==null?void 0:S.o,d.seriesId=(x=L.seriesId)==null?void 0:x.at(0),d.acc=(I=R.data)==null?void 0:I.acc,d.dataIndex=R.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 x,I,L,v;const{labelIndex:R}=this.getLabelInfoByPosition(h,M),{dataIndex:S}=this.regulateSelectedLabelInfo(R,M);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(S,M),M&&(this.defaultSelectInfo.targetAxis=S!=null&&S.length?M:null),d.selected={eventTarget:"label",...Re(this.defaultSelectInfo)},d.label=(I=(x=this.defaultSelectInfo)==null?void 0:x.label)==null?void 0:I.at(0),d.dataIndex=(v=(L=this.defaultSelectInfo)==null?void 0:L.dataIndex)==null?void 0:v.at(0)},T=()=>{const M=this.findHitItem(h,!0),R=M.hitId??Object.keys(M.items)[0],S=M.items[R];if(!Yt(R)){const x=this.updateSelectedSeriesInfo(R,!1);this.defaultSelectInfo.seriesId=x.seriesId,d.selected={eventTarget:"series",...Re(this.defaultSelectInfo)},d.label=S.label,d.dataIndex=S.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:R}=m,S=this.getCurMouseLocation(h);if(S==="chartBackground")this.clearSelectedLabelInfo(),d.deselected={eventTarget:"label"},b();else if(S==="yAxis"||S==="xAxis"){if(this.clearSelectedItemInfo(),d.deselected={eventTarget:"item"},!R&&S!==(M?"yAxis":"xAxis"))return;k(S)}}else if(p)b();else if(y){const{useBothAxis:R}=m,S=this.getCurMouseLocation(h);if((S==="yAxis"||S==="xAxis")&&!R&&S!==(M?"yAxis":"xAxis"))return;S!=="canvas"&&k(R?S: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=vC(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:R}=T;let S,x;if(T.isMove=!0,this.isMouseMove=!0,b<R.x1?S=R.x1:b>R.x2?S=R.x2:S=b,k<R.y1?x=u.y1:k>R.y2?x=R.y2:x=k,e==="heatMap"){const I={xcp:w,xep:S,ycp:M,yep:x,range:R},{xsp:L,ysp:v,width:W,height:E}=this.getDragInfoForHeatMap(I);T.xsp=L,T.ysp=v,T.width=W,T.height=E}else T.xsp=Math.min(w,S),T.ysp=e==="scatter"?Math.min(M,x):R.y1,T.width=Math.ceil(Math.abs(S-w)),T.height=e==="scatter"?Math.ceil(Math.abs(x-M)):R.y2-R.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:R}),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:R,width:S}=b,x=M-R.x1;w.range.dragSelectionInfo={dragXsp:x,dragXep:x+S,exceptAxesYChartWidth:R.x2-R.x1,exceptAxesXChartHeight:R.y2-R.y1,chartRange:R,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 I=C.x2-C.x1,L=C.y2-C.y1,v=d.x2-d.x1,W=d.y2-d.y1;b=d.x1+v*((m-C.x1)/I),k=d.y1+W*((g-C.y1)/L),T=v*(p/I),w=W*(y/L)}const M=m-f.xsp,R=g-f.ysp,S=f.xsp+f.width-(m+p),x=f.ysp+f.height-(g+y);n.fillRect(b-M+l,k-R+a,T+M+S,w+R+x)}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,R=d.x1+k*w,S=d.y1+T*M,x=g/C,I=p/b,L=k*x,v=T*I;n.fillRect(R+l,S+a,L,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,R,S;(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(x=>this.seriesList[x].type==="bar");for(let x=0;x<n.length;x++){const I=n[x],L=this.seriesList[I];if(L.findGraphData&&L.show){const v=L.findGraphData(t,s,b,!k);if(v!=null&&v.data){let W;if(v.data.o===null&&L.interpolation!=="zero"?L.isExistGrp||(W=s?v.data.x:v.data.y):isNaN(v.data.o)||(W=v.data.o),W!=null){const E=this.getFormattedTooltipLabel({dataId:L.id,seriesId:I,seriesName:L.name,itemData:v.data}),G=l?l.measureText(E).width:1;v.id=L.id,v.name=E,v.axis={x:L.xAxisIndex,y:L.yAxisIndex},v.label=s?(M=v.data)==null?void 0:M.y:(R=v.data)==null?void 0:R.x,i[I]=v;const V=this.getFormattedTooltipValue({dataId:L.id,seriesId:I,seriesName:E,value:W,itemData:v.data});if(v.data.formatted=V,h<G&&(d=E,h=G),u.length<=`${V}`.length&&(u=`${V}`),(f===null||f<=W)&&(f=W,m=I),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=I),p=!0):!p&&X<g&&(g=X,c=I)}if(c===null&&v.data.xp!==void 0&&v.data.yp!==void 0&&v.data.xp!==null&&v.data.yp!==null){const X=z.calcBoxDistance(v.data,a,r);X<C&&(C=X,y=I)}}}}}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 x=n.find(L=>{var W;const v=this.seriesList[L];return(v==null?void 0:v.show)&&((W=v==null?void 0:v.data)==null?void 0:W.length)>0}),I=x?(S=this.seriesList[x].data)==null?void 0:S[b]:null;I&&(i[""]={id:"",name:"",label:s?I.y:I.x,index:b,axis:{x:0,y:0},data:{o:void 0,x:I.x,y:I.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&&this._dataEpoch!=null;if(d){this._tooltipValueCacheEpoch!==this._dataEpoch&&(this._tooltipValueCache=null,this._tooltipValueCacheEpoch=this._dataEpoch),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(S=>n?(S==null?void 0:S.y)===s:(S==null?void 0:S.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 S={};S.color=y.color,S.hit=!1,S.name=b,S.axis={x:y.xAxisIndex,y:y.yAxisIndex},S.index=n?y.yAxisIndex:y.xAxisIndex,S.data=C,S.data.formatted=k,t.items[p]=S}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,R=e?e.measureText(`${k}`).width:1;M<R&&(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,VC=8,EC={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=Qr(()=>{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 B,O,P,F,K,Q,U;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=(B=u.formatter)==null?void 0:B.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?(P=(O=l[t.hitId])==null?void 0:O.data)==null?void 0:P.y:(K=(F=l[t.hitId])==null?void 0:F.data)==null?void 0:K.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,R=M>u.maxWidth?u.maxWidth:M;let S=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const j=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>j){let q="";for(let ee=0;ee<ne.length;ee++){const $=ne[ee],de=`${q}${$}`;n.measureText(de).width>j?(q=$,S+=1):q=de}}S+=1}),n.restore()}const x=h.t+S*this.getTextHeight()+d*Jo+h.b;let I;u.useScrollbar&&x>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",I=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",I=x),this.tooltipCanvas.width=R*this.pixelRatio,this.tooltipCanvas.height=x*this.pixelRatio,this.tooltipCanvas.style.width=`${R}px`,this.tooltipCanvas.style.height=`${x}px`,this.tooltipHeaderDOM.style.width=`${R}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${I+6}px`,this.tooltipDOM.style.display="block";const L=document.body.clientWidth,v=document.body.clientHeight,W=20,E=((Q=this.tooltipDOM)==null?void 0:Q.offsetHeight)||((U=this.tooltipHeaderDOM)==null?void 0:U.offsetHeight)+I+VC,G=L-R-W,V=v-E-W,X=i+W,Z=s+W,N=i-R-W,D=s-E-W,Y=X>G?N:X,H=Z>V?D:Z;this.tooltipDOM.style.transform=`translate3d(${Y}px, ${H}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+=z.aliasPixel(u),f+=z.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+=z.aliasPixel(w),M+=z.aliasPixel(M),n.beginPath(),typeof b!="string"?n.fillStyle=te.createGradient(n,r,{x:w-4,y:M,w:12,h:-12},b):n.fillStyle=b;const R={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(R):c.fontColor.label??c.fontColor;const S=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-ps,x=w+h,I=M;if(S>n.measureText(k).width)n.fillText(k,x,I);else if(c.textOverflow==="wrap"){let L="",v=I;for(let W=0;W<k.length;W++){const E=k[W],G=`${L}${E}`;n.measureText(G).width>S?(n.fillText(L,x,v),L=E,p+=1,v+=d):L=G}n.fillText(L,x,v)}else{const L=z.truncateLabelWithEllipsis(k,S,n);n.fillText(L,x,I)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(R):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:R}=u.valueOpt,S=Je(l.o-M,R-M),{start:x,end:I}=y[0];g=x<=S&&S<=I||l.o===-1}else{const M=y.find(({id:R})=>R===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=te.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+=z.aliasPixel(h),u+=z.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+=z.aliasPixel(T),w+=z.aliasPixel(w),n.beginPath(),typeof C!="string"?n.fillStyle=te.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 R=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-ps,S=T+d,x=w;if(R>n.measureText(b).width)n.fillText(b,S,x);else if(r.textOverflow==="wrap"){let I="",L=x;for(let v=0;v<b.length;v++){const W=b[v],E=`${I}${W}`;n.measureText(E).width>R?(n.fillText(I,S,L),I=W,g+=1,L+=c):I=E}n.fillText(I,S,L)}else{const I=z.truncateLabelWithEllipsis(b,R,n);n.fillText(I,S,x)}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=z.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),z.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,R;if(!((u=this.data)!=null&&u.labels)||!t)return;const n=this.data.labels.findIndex(S=>(S==null?void 0:S.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 S=c.y2-c.y1,x=(f=this.options.axesY)==null?void 0:f.some(v=>v.categoryMode),I=(m=this.options.axesY)==null?void 0:m.some(v=>v.type==="time");let L;if(x)L=c.y1+S*(n+.5)/d;else if(I){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]);L=c.y1+S*(+t-W)/(E-W)}else L=c.y1+S*n/(d-1);h=[c.x2,L]}else{const S=c.x2-c.x1,x=(b=this.options.axesX)==null?void 0:b.some(v=>v.categoryMode),I=(k=this.options.axesX)==null?void 0:k.some(v=>v.type==="time");let L;if(x)L=c.x1+S*(n+.5)/d;else if(I){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)??+((R=this.data.labels)==null?void 0:R[this.data.labels.length-1]);L=c.x1+S*(+t-W)/(E-W)}else L=c.x1+S*n/(d-1);h=[L,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}},WC=480,GC=28,ZC=5,XC=50,NC={_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??XC)},_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=z.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||WC;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??GC;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??ZC,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 R=l.clientWidth;R!==w&&(w=R,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)}},PC={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 R=k-(k-b)/i.length*w;if((T=s==null?void 0:s.pieStroke)!=null&&T.use&&(R-=s.pieStroke.lineWidth),R<0)return;if(M.or=R,w<i.length-1?M.ir=k-(k-b)/i.length*(w+1):M.ir=1,M.total){for(let S=0;S<M.data.length;S++)if(r=M.data[S],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 x={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(x.use=!1,e.lineWidth=s.pieStroke.lineWidth,e.strokeStyle=s.pieStroke.color,e.arc(g,p,R,0,2*Math.PI),e.stroke());const{selectInfo:I,legendHitInfo:L,unSelectedOpacity:v}=t;f.isSelect=(I==null?void 0:I.sId)===r.id,f.isDownplay=L&&L.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=g,f.centerY=p,f.radius=R,f.doughnutHoleSize=R*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:m},f.draw(e,x,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:R}=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,R)}}},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}},BC={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 R=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(R=!0),k.showTextTip||k.showTip){if(k.tipText==="label"){const S=s?n.axesY[0]:n.axesX[0],x=M.label;M.text=S.type==="time"?Pe(x).format(S.timeFormat):x}else M.text=Qt(M.value);this.drawTextTip({opt:k,tipType:"sel",seriesOpt:w,isSamePos:R,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,R=Number.isFinite(M)?M-1:w,S=Number.isFinite(T)&&Number.isFinite(w),x=S&&w<T,I=S&&(T>0||w<R);let L,v=null;x?L=void 0:I?(v=this.getVisibleWindowMaxSeries(T,w),L=v==null?void 0:v.sId):L=this.minMax[s?"x":"y"][0].maxSID;const W=L?this.seriesList[L]: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 R;if(e==="sel"){if(n&&n.label!==null)R=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=R;else if(s.value!==null)M=s.value,R=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,R=G.label,s.value=M,s.label=R}}}const S=i?h.graphMax:u.graphMax;if((e==="max"||e==="sel")&&M>S&&!this.options.displayOverflow)return!1;let x,I,L;if(p==="bar"){const E=i?this.scrollbar.y:this.scrollbar.x;if(E!=null&&E.use){const[G,V]=(E==null?void 0:E.range)??[];if(w>=G&&w<=V)w-=G??0;else return!1}else{const G=i?u:h,{minIndex:V,maxIndex:X}=G??{};if(Number.isFinite(V)&&Number.isFinite(X))if(w>=V&&w<=X)w-=V;else return!1}i?(I=Math.round(y.h/2),x=g-y.cat*w-y.cPad,L=x-(y.bar*y.ix-(y.h+y.bPad))-I):(I=Math.round(y.w/2),x=f+y.cat*w+y.cPad,L=x+(y.bar*y.ix-(y.w+y.bPad))+I)}else p==="line"?L=te.calculateX(w,h.graphMin,h.graphMax,d-y.comboOffset,f+y.comboOffset/2):p==="scatter"&&(L=te.calculateX(w,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:m,ysp:g},...{dp:L,value:M,label:R,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,k=h.chartWidth-(u.left+u.right),T=h.chartHeight-(u.top+u.bottom),w=n?k:T,M=f[g.units.rectStart];let R=this.options.type==="bar"?4:6;R*=n?1:-1;const S=Object.keys(this.seriesList??{}),x=S.filter(B=>this.seriesList[B].show),I=S.some(B=>this.seriesList[B].isExistGrp&&!this.seriesList[B].isOverlapping),L=((c=this.data.groups)==null?void 0:c[0])??[];let v,W,E,G,V,X,Z,N,D,Y=0,H=(d=m.labels)==null?void 0:d.length;if(m.labels){let B=m.labels.length;if(b!=null&&b.use){const{range:O,interval:P,type:F}=b,[K,Q]=O??[];if(ve(K)&&ve(Q))B=Math.floor((+Q-+K)/P)+1,Y=F==="step"?K:m.labels.findIndex(U=>U===+K),H=F==="step"?Q:m.labels.findIndex(U=>U===+Q);else{const U=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(U==null?void 0:U.minIndex)&&Number.isFinite(U==null?void 0:U.maxIndex)&&U.minIndex<U.maxIndex&&(Y=U.minIndex,H=U.maxIndex,B=H-Y+1)}}G=f[m.units.rectStart],V=f[m.units.rectEnd],X=(V-G)/B}else Z=this.axesSteps.x[0],N=S.find(B=>{var O;return((O=this.seriesList[B])==null?void 0:O.type)==="line"}),D=this.seriesList[N].size;l.forEach((B,O)=>{var P;if(E=p.graphMax,!i.fixedPosTop){if(I){const F=x==null?void 0:x.reduce((U,j)=>{var J,ne;return L.includes(j)&&(((J=B[j])==null?void 0:J.value)??B[j])>0?U+(((ne=B[j])==null?void 0:ne.value)??B[j]):U},0),K=((P=x==null?void 0:x.filter(U=>!L.includes(U)))==null?void 0:P.map(U=>{var j;return((j=B[U])==null?void 0:j.value)??B[U]}))??[],Q=(K==null?void 0:K.length)>0?K.reduce((U,j)=>Math.max(U,j??-1/0),-1/0):-1/0;E=F>0?Math.max(Q,F):Math.max(Q,0)}else if(x.length){const F=x.map(Q=>{var U;return((U=B[Q])==null?void 0:U.value)??B[Q]}),K=F.length>0?F.reduce((Q,U)=>Math.max(Q,U??-1/0),-1/0):-1/0;E=K>0||this.options.type!=="bar"?K:0}}if(m.labels){if(s[O]<Y||s[O]>H)return;const F=s[O]-Y;v=Math.round(G+X*F)+X/2}else v=C(a[O],Z.graphMin,Z.graphMax,k-D.comboOffset,f.x1+D.comboOffset/2);W=y(E,p.graphMin,p.graphMax,w,M)+R,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:R}=m.tipStyle,S=`normal normal ${M} ${T}px ${w}`;let x=1;g==="line"?x+=6:g==="scatter"?x+=C==null?void 0:C.pointSize:g==="bar"&&(x+=4);let I,L=h;if(m.fixedPosTop)e?(I=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),I+=x):(I=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),I-=x);else if(e){const E=Math.min(Math.max(u,i.graphMin),i.graphMax);I=te.calculateX(E,i.graphMin,i.graphMax,l,r),I=u<0?I-x:I+x}else{const E=g==="bar"&&u<0?0:u,G=Math.min(Math.max(E,s.graphMin),s.graphMax);I=te.calculateY(G,s.graphMin,s.graphMax,a,d),I=E<0?I+x:I-x}let v="center";n.save(),n.font=S;const W=Math.round(Math.max(n.measureText(f).width+12,40));e||(h+W/2>c-10?(v="right",L-=W/2-b*2):h-W/2<r+10&&(v="left",L+=W/2-b*2)),n.restore(),(m.showTextTip||p==="max")&&this.showTextTip({context:n,type:v,width:W,height:R,x:e?I+W/2:L,y:e?L+R/2:I,opt:m,arrowSize:b,borderRadius:k,text:f,textStyle:S,isNegative:u<0}),m.showTip&&p==="sel"&&this.showTip({context:n,x:e?I:h,y:e?h:I,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()}},DC={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,R,S,x,I,L,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))&&!((R=e.selectSeries)!=null&&R.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?(x=(S=this.axesSteps)==null?void 0:S.x)==null?void 0:x[u.xi]:null,m=u?(L=(I=this.axesSteps)==null?void 0:I.y)==null?void 0:L[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 V=(W=(v=this.dataSet)==null?void 0:v[u.sId])==null?void 0:W.lastTick;V&&(d=V.gapCount??0,h=V.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??z.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 V=1;V<n.length;V++){const X=(G=(E=this.dataSet)==null?void 0:E[n[V].sId])==null?void 0:G.lastTick;X&&X.maxDirtyAge>y&&(y=X.maxDirtyAge);const Z=n[V].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,R=Math.min(M,Math.max(T+1,y+1)),S=new Array(R);for(let V=0;V<R;V++){let X=(w-V)%M;X<0&&(X+=M),S[V]=X}const x=this.options.coordinateDedupe!==!1&&n.length>1,I=x?new Map:null;x&&this.collectStripDuplicatePoints(I,S);const L={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:I,coordinateDedupe:x,rtXOffsetCss:this._blitCarry};for(let V=0;V<n.length;V++){const X=n[V],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,S,L),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}},YC={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})}}},$r=2,OC=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],HC=["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 ec(t,e){if(e==="time")return Jr(t);if(typeof t=="number")return t;if(e==="step"){const n=Number(t);return Number.isFinite(n)?n:null}return null}function FC(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]=ec(h.x,i),a[d]=ec(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 zC(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 AC(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,HC),data:FC(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:$r,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,OC),isGradient:((h=(d=t.options)==null?void 0:d.legend)==null?void 0:h.type)==="gradient"},selection:zC(t),seriesOrder:s,series:n}}function KC(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 tc="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLFp0PU9iamVjdC5wcm90b3R5cGUsRGU9WnQuaGFzT3duUHJvcGVydHksemU9WnQudG9TdHJpbmcsTXQ9T3Q/T3QudG9TdHJpbmdUYWc6dm9pZCAwO2Z1bmN0aW9uIEVlKGUpe3ZhciB0PURlLmNhbGwoZSxNdCksbj1lW010XTt0cnl7ZVtNdF09dm9pZCAwO3ZhciBzPSEwfWNhdGNoe312YXIgaT16ZS5jYWxsKGUpO3JldHVybiBzJiYodD9lW010XT1uOmRlbGV0ZSBlW010XSksaX12YXIgQmU9T2JqZWN0LnByb3RvdHlwZSxIZT1CZS50b1N0cmluZztmdW5jdGlvbiBMZShlKXtyZXR1cm4gSGUuY2FsbChlKX12Y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lJiZ0eXBlb2YgbW9kdWxlPT0ib2JqZWN0IiYmbW9kdWxlJiYhbW9kdWxlLm5vZGVUeXBlJiZtb2R1bGUsX249ZmUmJmZlLmV4cG9ydHM9PT1oZSx1ZT1fbj95dC5CdWZmZXI6dm9pZCAwLFBuPXVlP3VlLmlzQnVmZmVyOnZvaWQgMCxkZT1Qbnx8JG4sUm49IltvYmplY3QgQXJndW1lbnRzXSIsQW49IltvYmplY3QgQXJyYXldIixEbj0iW29iamVjdCBCb29sZWFuXSIsem49IltvYmplY3QgRGF0ZV0iLEVuPSJbb2JqZWN0IEVycm9yXSIsQm49IltvYmplY3QgRnVuY3Rpb25dIixIbj0iW29iamVjdCBNYXBdIixMbj0iW29iamVjdCBOdW1iZXJdIixObj0iW29iamVjdCBPYmplY3RdIixHbj0iW29iamVjdCBSZWdFeHBdIixqbj0iW29iamVjdCBTZXRdIixZbj0iW29iamVjdCBTdHJpbmddIixXbj0iW29iamVjdCBXZWFrTWFwXSIsRm49IltvYmplY3QgQXJyYXlCdWZmZXJdIixrbj0iW29iamVjdCBEYXRhVmlld10iLFZuPSJbb2JqZWN0IEZsb2F0MzJBcnJheV0iLFhuPSJbb2JqZWN0IEZsb2F0NjRBcnJheV0iLFVuPSJbb2JqZWN0IEludDhBcnJheV0iLHFuPSJbb2JqZWN0IEludDE2QXJyYXldIixabj0iW29iamVjdCBJbnQzMkFycmF5XSIsS249IltvYmplY3QgVWludDhBcnJheV0iLEpuPSJbb2JqZWN0IFVpbnQ4Q2xhbXBlZEFycmF5XSIsUW49IltvYmplY3QgVWludDE2QXJyYXldIix0aT0iW29iamVjdCBVaW50MzJBcnJheV0iLFg9e307WFtWbl09WFtYbl09WFtVbl09WFtxbl09WFtabl09WFtLbl09WFtKbl09WFtRbl09WFt0aV09ITAsWFtSbl09WFtBbl09WFtGbl09WFtEbl09WFtrbl09WFt6bl09WFtFbl09WFtCbl09WFtIbl09WFtMbl09WFtObl09WFtHbl09WFtqbl09WFtZbl09WFtXbl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Dp0LmVwb2NoLG1lc3NhZ2U6U3RyaW5nKG4mJm4ubWVzc2FnZXx8biksbmFtZTpuJiZuLm5hbWUsc3RhY2s6biYmbi5zdGFja30pfX19fSkoKTsK",_C=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),nc=typeof self<"u"&&self.Blob&&new Blob([_C(tc)],{type:"text/javascript;charset=utf-8"});function UC(t){let e;try{if(e=nc&&(self.URL||self.webkitURL).createObjectURL(nc),!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,"+tc,{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"},JC=3e3,jC=2,QC=3,Ft=()=>{},$C={onInitFailure:Ft,onTimeout:Ft,onRenderException:Ft,onFallback:Ft};function qC(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function e1(t){if(typeof structuredClone!="function")return!1;try{return structuredClone(t),!0}catch{return!1}}function t1(){return new UC}class n1{constructor(e={}){this.state=mt.IDLE,this.worker=null,this.version=e.version??$r,this.initTimeoutMs=e.initTimeoutMs??JC,this.maxInFlight=e.maxInFlight??jC,this.maxRenderErrors=e.maxRenderErrors??QC,this.hooks={...$C,...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||qC,this._createWorker=e.createWorker||t1}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()&&e1(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 i1=["text","badge","callout","circle"],s1=["axis","pixel","series"],o1=["straight","elbow"],l1=["top","bottom","left","right","auto"],a1=["start","end"],r1={type:"pixel",xAxisIndex:0,yAxisIndex:0,xValue:null,yValue:null,x:0,y:0,seriesId:null,location:"end",offsetX:0,offsetY:0},c1={enabled:!1,type:"straight",style:{stroke:"#9E9E9E",strokeWidth:1,dashStyle:"solid"}},ic={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 d1(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 h1(t,e,n){if(s1.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;a1.includes(i)||typeof i=="number"&&Number.isInteger(i)||(n.push(`[annotation:${e}] invalid location "${i}" — fallback to "end".`),t.location="end")}}function u1(t,e,n){const i=t.id!=null?String(t.id):`annotation-${e}`;let s=t.type;i1.includes(s)||(n.push(`[annotation:${i}] unknown type "${s}" — fallback to "text".`),s="text");const l=Re(t.style)||{},a=Xe({},l,ic[s].style);if("padding"in a){const h="padding"in l?l.padding:ic[s].style.padding;a.padding=d1(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"&&!l1.includes(a.anchor)&&(n.push(`[annotation:${i}] invalid style.anchor "${a.anchor}" — fallback to "auto".`),a.anchor="auto");const r=Xe({},Re(t.position)||{},r1);h1(r,i,n);const c=Xe({},Re(t.connector)||{},c1);o1.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 f1(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)=>u1(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 m1(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 p1(t,e=[]){const i=(Array.isArray(e)?e:[]).indexOf(t);return i!==-1?i:typeof t=="number"&&Number.isInteger(t)?t:-1}function g1(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=p1(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 sc(t,e,n,i,s){if(!e)return null;if((e.type||"linear")==="step")return g1(t,e,n,i,s);const l=m1(t,e);return l===null?null:s?te.calculateX(l,e.graphMin,e.graphMax,n,i):te.calculateY(l,e.graphMin,e.graphMax,n,i)}function oc(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 b1(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,R=sc(i.xValue,C,k,w,!0),S=sc(i.yValue,b,T,M,!1);return R===null||S===null?n:{x:R+s,y:S+l,anchorX:R,anchorY:S,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:R,radius:S,startAngle:x,endAngle:I}=p;if(M==null||R==null||S==null||x==null||I==null)return n;let L=(x+I)/2;Math.abs(I-x)>=Math.PI*2-1e-6&&(L=0);const W=M+Math.cos(L)*S,E=R+Math.sin(L)*S;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=oc(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 y1(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=oc(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 x1(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 lc(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 S1(t,e,n=z.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 C1(t,e,n=z.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=lc(s),a=`${l}|${e}`;let r;t._measure&&t._measure.key===a?r=t._measure.value:(r=S1(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 k1(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 w1(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 I1(t,e,n,i=z.calcTextSizeCanvas){const{type:s,style:l}=t,a=C1(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=k1(l.anchor,d,h);c=w1(r,h,u,l.arrowSize||8)}return{type:s,box:r,content:a.content,shape:null,tail:c}}const ac={solid:[],dash:[4,4],dot:[1,3]};function L1(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 T1(t,e,n,i){if(!(i!=null&&i.enabled))return;const s=L1(n,e),l=i.style||{};t.save();try{t.beginPath(),t.strokeStyle=l.stroke||"#9E9E9E",t.lineWidth=l.strokeWidth||1,t.setLineDash(ac[l.dashStyle]||ac.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 M1(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(),te.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 v1(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 R1(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 V1(t,e,n,i){var s;if(!(!n||!((s=n.lines)!=null&&s.length))){t.save();try{t.fillStyle=i.color||"#212121",t.font=lc(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 E1(t,e,n,i){var a;const{type:s,style:l}=e;if(s==="circle"){R1(t,n.shape,l);return}(a=e.connector)!=null&&a.enabled&&s!=="callout"&&T1(t,{x:i.anchorX,y:i.anchorY},n.box,e.connector),s==="callout"?v1(t,n.box,n.tail,l):M1(t,n.box,l),V1(t,n.box,n.content,l)}function W1(t,e,n,i=z.calcTextSizeCanvas){!t||!Array.isArray(e)||!e.length||e.forEach(s=>{try{const l=b1(s,n);if(!l.isVisible)return;const a=y1(s,n),r=s.type==="circle"?"":x1(s.content,a),c=I1(s,l,r,i);E1(t,s,c,l)}catch(l){Hn.warn(`[EvChart] annotation render failed (id: ${s&&s.id}):`,l)}})}const G1=300;let gs=class{constructor(e,n,i,s,l,a,r){Object.keys(Kr).forEach(d=>Object.assign(this,Kr[d])),i.brush||(Object.assign(this,EC),Object.assign(this,NC),Object.assign(this,RC),Object.assign(this,BC),Object.assign(this,kC),Object.assign(this,PC),Object.assign(this,CC),Object.assign(this,LC)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,IC),this.isMobile=Fh(),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 n1({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=[KS(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=AC(this,n),{columns:s,transferList:l}=KC(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||G1,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??z.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(z.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:R,cPadRatio:S,borderRadius:x}=this.options;w.draw({thickness:R,cPadRatio:S,borderRadius:x,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},R=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:R,unSelectedOpacity:h.unSelectedOpacity},e):this.drawPie({selectInfo:M,legendHitInfo:R,unSelectedOpacity:h.unSelectedOpacity},e),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(e);break}case"scatter":{const M=n==null?void 0:n.legend;let R;if(l.use&&l.useSeriesOpacity){const S=this.lastHitInfo,x=this.defaultSelectItemInfo;S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?R={seriesID:S.sId,dataIndex:S.dataIndex}:x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?R={...x}:R=null}this.options.seriesReverse&&(w=this.seriesList[b.at(-1-T)]),w.draw({legendHitInfo:M,selectInfo:R,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}=f1(e);this._normalizedAnnotations=a,this._annotationSource=e,r.forEach(c=>Hn.warn(c))}W1(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 bC(e,r,i,a);case"time":return r.categoryMode?new SC(e,r,i,l,a):new gC(e,r,i,a);case"log":return new yC(e,r,i);case"step":return new xC(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,R,S;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=(S=(R=this.options.axesY)==null?void 0:R[0])==null?void 0:S.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 R=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,R),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 R=!!((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():R&&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,DC),Object.assign(gs.prototype,YC);const Z1={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},X1={class:"ev-chart-toolbar"},N1={class:"ev-chart-toolbar__icon"};function P1(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",X1,[o.createElementVNode("div",N1,[(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 rc=ce(Z1,[["render",P1],["__scopeId","data-v-dfbffbab"]]);class B1{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 D1={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},Y1={series:{},groups:[],labels:[],data:{}},O1=t=>nb({...t},Y1),H1=t=>t instanceof Date||t!==null&&typeof t=="object"&&typeof t.toDate=="function"&&typeof t.format=="function",jo=t=>rr(t,function e(n){if(H1(n))return n;if(o.isReactive(n))return rr(o.toRaw(n),e)}),F1=()=>{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()}}},cc=(t,e)=>{var m;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const p=Xe({},g,D1);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=Re(i.selectedItem),c=Re(i.selectedLabel??(t==null?void 0:t.value)),d=Re(i.selectedSeries),{clickEventCallback:h,dblClickEventCallback:u}=F1(),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}},dc=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(ha(t.width)),height:i(ha(t.height))}});return{wrapper:e,wrapperStyle:n}},hc=(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=x=>{x.data.length&&x.range&&c.value&&m.dragZoom(x)},b=()=>{g.props.options.forEach((x,I)=>{if(x.zoom={...x.zoom,use:c.value,getRangeInfo:C},c.value)x.dragSelection={...x.dragSelection,use:!0,keepDisplay:!1};else{const{use:L,keepDisplay:v}=p.options[I].dragSelection??{};x.dragSelection={use:!!L,keepDisplay:!!v}}})},k=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:x,options:I},L)=>{x.chartIdx=L,g.props.data.push(x),g.props.options.push(I),y.value.push(L)})):(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 x={updateZoomStartIdx:I=>a("update:zoomStartIdx",I),updateZoomEndIdx:I=>a("update:zoomEndIdx",I)};m=new B1(g,p,u,h.value,r,f,x)}},T=x=>{p.data[0].labels.length<=1||(c.value=!c.value,x?x.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),b(),m.setIconStyle(c.value),m.setEventListener(c.value))},w=(x,I)=>{if(m.isAnimationFinish)switch(I){case"dragZoom":T(x.target);break;case"reset":m.initZoom();break;case"previous":case"latest":m.clickMoveZoomArea(I);break}};o.onUpdated(()=>{m&&h.value&&m.setIcon(h.value)});const M=x=>{!Fe(x.zoom,u.zoom)&&(u.zoom=x.zoom,m?(!u.zoom.toolbar.show&&c.value&&T(),m.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&k())},R=x=>{d.value?(r.value||(p.data=n?jo(x):[jo(x)],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},S=(x,I)=>{if(m.isUseToolbar){m.isUseToolbar=!1;return}c.value&&(m.executeZoom(x,I),m.setZoomAreaMemory(x,I))};return o.watch(()=>[f.start,f.end],([x,I],[L])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")x>=(L??0)?i.value.dataIndex-=x-(L??0):i.value.dataIndex+=L-x;else for(let v=0;v<i.value.dataIndex.length;v++)x>=(L??0)?i.value.dataIndex[v]-=x-(L??0):i.value.dataIndex[v]+=L-x;(f.isUseButton||f.isUseScroll)&&m.executeZoom(x,I)}),o.watch(()=>[f.isUseButton,f.isUseScroll],([x,I],[L,v])=>{L&&!x?m.setZoomAreaMemory(f.start,f.end):v&&!I&&(m.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:p,brushIdx:f,createEvChartZoom:k,setOptionsForUseZoom:M,setDataForUseZoom:R,controlZoomIdx:S,onClickToolbar:w}},z1={name:"EvChart",components:{EvChartToolbar:rc},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}=cc(a,r),C=p(t.data),b=y(t.options),k=o.computed(()=>t.selectedLabel),T=o.computed(()=>t.selectedItem),{wrapper:w,wrapperStyle:M}=dc(b),{evChartZoomOptions:R,evChartToolbarRef:S,createEvChartZoom:x,setOptionsForUseZoom:I,setDataForUseZoom:L,controlZoomIdx:v,onClickToolbar:W}=s?{}:hc(b,{wrapper:w,evChartGroupRef:null},t.selectedLabel?k:T,d),E=()=>typeof performance<"u"?performance.now():Date.now();let G=null,V=null;const X=P=>{var j;G?(P.updateSeries&&(G.updateSeries=!0),P.updateData&&(G.updateData=!0),P.updateLegend&&(G.updateLegend=!0),P.updateTooltip&&(G.updateTooltip=!0),(j=P.updateSelTip)!=null&&j.update&&(G.updateSelTip??(G.updateSelTip={}),G.updateSelTip.update=!0)):G={...P};const F=()=>{const ne=((h==null?void 0:h.deferUntil)??0)-E();if(ne>0){V=setTimeout(F,ne);return}G&&n&&n.update(G),G=null,V=null};clearTimeout(V);const K=E(),Q=(h==null?void 0:h.deferUntil)??0,U=Q>K?Q-K:0;V=setTimeout(F,U)},Z=()=>{var K;let P;b.selectLabel.use?P=m:b.selectSeries.use&&(P=g);const F=(K=t.options.realTimeScatter)!=null&&K.use?{...t.data,groups:[],labels:[]}:C;n=new gs(w.value,F,b,u,f,P,l)},N=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&x(),b.legend.show&&b.legend.external&&n.emitLegendData())};o.watch(()=>t.options,P=>{var j,J;const F=y(P),K=((J=(j=n.options)==null?void 0:j.legend)==null?void 0:J.show)??!1,Q=!Fe(F.legend.table,n.options.legend.table),U=F.tooltip.use&&!Fe(F.tooltip,n.options.tooltip);n.options=F,X({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:Q,updateTooltip:U}),F.legend.show&&F.legend.external&&!K&&n.emitLegendData(),s||I(F)},{deep:!b.shallowOptionsWatch,flush:"post"}),o.watch(()=>t.data,P=>{var q,ee;const F=(q=t.options.realTimeScatter)!=null&&q.use?{...P,groups:[],labels:[]}:p(P),K=!Fe(F.series,n.data.series),Q=!Fe(F.groups,n.data.groups),U=n.prunedRealTimeScatterSeries,j=!!(U!=null&&U.size)&&Object.keys(F.data??{}).some($=>{var de;return U.has($)&&((de=F.data[$])==null?void 0:de.length)}),J=K||Q||j||t.options.type==="heatMap",ne=K||Q||!Fe(F.labels,n.data.labels)||!Fe(F.data,n.data.data);n.data=(ee=t.options.realTimeScatter)!=null&&ee.use?F:jo(F),X({updateSeries:J,updateSelTip:{update:!0,keepDomain:!1},updateData:ne}),!s&&ne&&L(F)},{deep:!b.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(P,F)=>{if(k!=null&&k.value)for(let K=0;K<k.value.dataIndex.length;K++)P>=(F??0)?k.value.dataIndex[K]-=P-(F??0):k.value.dataIndex[K]+=F-P;else T!=null&&T.value&&(P>=(F??0)?T.value.dataIndex-=P-(F??0):T.value.dataIndex+=F-P)}),o.watch(()=>T.value,P=>{const F=t.options.type;n.selectItemByData(P,F)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??k.value,P=>{P!=null&&P.dataIndex&&n.selectLabelByData(P.dataIndex,P==null?void 0:P.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>t.selectedSeries,P=>{var F;(F=b.selectSeries)!=null&&F.use?P.seriesId&&n.selectSeriesByData(P.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],([P,F])=>{v(P,F)}),o.watch(()=>t.realTimeScatterReset,P=>{var F;P&&(Object.keys(n.dataSet??{}).forEach(K=>{n.dataSet[K]&&(n.dataSet[K].dataGroup=[])}),(F=n.prunedRealTimeScatterSeries)==null||F.clear(),e("update:realTimeScatterReset",!1))}),o.watch(()=>{var P;return(P=t.options.realTimeScatter)==null?void 0:P.use},P=>{n.options.realTimeScatter.use=P??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,P=>{P&&t.options.syncHover!==!1&&(P.label==null?n.overlayClear():n.drawSyncedIndicator(P))},{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 P;clearTimeout(V),G=null,V=null,n&&"destroy"in n&&n.destroy(),(P=d==null?void 0:d.value)!=null&&P.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const D=P=>{n==null||n.toggleSeries(P)},Y=P=>{n==null||n.highlightSeries(P)},H=()=>{n==null||n.unhighlightSeries()},B=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},O=ns(()=>{n&&"resize"in n&&n.resize()},t.resizeTimeout);return o.onActivated(()=>{i.value&&O()}),{wrapper:w,wrapperStyle:M,onResize:O,redraw:B,toggleSeries:D,highlightSeries:Y,unhighlightSeries:H,evChartToolbarRef:S,injectIsChartGroup:s,onClickToolbar:W,normalizedOptions:b,zoomOptions:o.toRef(R??{zoom:{}},"zoom")}}},A1={key:0,ref:"evChartToolbarRef"};function K1(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",A1,[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(z1,[["render",K1]]);xi.install=t=>{t.component(xi.name,xi)};const _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"}}}}},U1=()=>{const t=o.ref(!1),e=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:a=>Xe({},a,_1),isExecuteZoom:t,brushSeries:i,evChartGroupRef:e,evChartPropsInGroup:n,groupInteraction:{deferUntil:0}}},J1={name:"EvChartGroup",components:{evChartToolbar:rc},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=(x=h)=>{const I=Number.isFinite(x)?Math.min(Math.max(x,0),d):h,L=u();r.deferUntil=Math.min(Math.max(r.deferUntil,L+I),L+d)};o.provide("deferPollingRedraw",f);const m=o.computed({get:()=>t.groupSelectedLabel,set:x=>e("update:groupSelectedLabel",x)});o.provide("groupSelectedLabel",m);const g=o.ref(null);o.provide("groupHoveredLabel",g),o.watch(()=>t.options.syncHover,x=>{x?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:R,onClickToolbar:S}=hc(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,x=>{M(x)},{deep:!0}),o.watch(()=>t.options,x=>{const I=n(x);w(I)},{deep:!0}),o.watch(()=>[t.zoomStartIdx,t.zoomEndIdx],([x,I])=>{k.isUseButton||k.isUseScroll||R(x,I)}),{evChartGroupRef:l,evChartToolbarRef:C,zoomOptions:o.toRef(p,"zoom"),onClickToolbar:S,deferPollingRedraw:f}}},j1={key:0,ref:"evChartToolbarRef"},Q1={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function $1(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",Q1,[o.renderSlot(t.$slots,"default",{},void 0,!0)],512)],64)}const Si=ce(J1,[["render",$1],["__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 q1=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 ek={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},tk=()=>({getNormalizedBrushOptions:e=>Xe({},e,ek)}),nk={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}=tk(),d=o.computed(()=>c(t.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:m,getNormalizedData:g,getNormalizedOptions:p}=cc(),y=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var L,v;const x=l.props.options[d.value.chartIdx],I={...x,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:[{...(L=x==null?void 0:x.axesX)==null?void 0:L[0],title:{use:!1}}],axesY:[{...(v=x==null?void 0:x.axesY)==null?void 0:v[0],title:{use:!1}}]};return p(I)}),{wrapper:b,wrapperStyle:k}=dc(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,(x,I)=>{var L;x.brush.chartIdx<=((L=s.data)==null?void 0:L.length)-1?n&&!Fe(I.brush,x.brush)?n.removeBrushWrapper():e&&!Fe(x,I)&&(e.options=Re(x),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,x=>{if(e){const I=x[d.value.chartIdx];if(I){const L=!Fe(I.series,e.data.series),v=r.list[d.value.chartIdx];typeof v=="object"&&Object.keys(v).length&&Object.keys(I.series).forEach(W=>{var E;"show"in I.series[W]||(I.series[W].show=((E=v[W])==null?void 0:E.show)??!0)}),e.data=Re(g(I)),e.update({updateSeries:L,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const T=()=>{let x;C.value.selectLabel.use?x=f:C.value.selectSeries.use&&(x=m),e=new gs(b.value,y.value,C.value,h,u,x)},w=()=>{n=new q1(e,y,d,a,b)},M=()=>{e&&e.init()},R=x=>{n&&n.init(x)};o.watch(()=>[a.start,a.end],()=>{var x;b.value&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1&&R()}),o.onMounted(async()=>{d.value.show&&(await T(),await M(),w(),R()),i.value=!0}),o.onUpdated(async()=>{var x;if(d.value.show&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1){const I=r.list[d.value.chartIdx];typeof I=="object"&&Object.keys(I).length&&Object.keys(y.value.series).forEach(L=>{var v;"show"in y.value.series[L]||(y.value.series[L].show=((v=I[L])==null?void 0:v.show)??!0)}),await T(),await M(),w(),R()}}),o.onBeforeUnmount(()=>{e&&"destroy"in e&&e.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{e&&"hideTooltip"in e&&e.hideTooltip()});const S=ns(()=>{e&&"resize"in e&&new Promise(I=>e.resize(I)).then(I=>{I&&R(I)})},0);return o.onActivated(()=>{i.value&&S()}),{evChartBrushOptions:d,evChartBrushRef:b,evChartBrushStyle:k,onResize:S}}};function ik(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(nk,[["render",ik]]);Ci.install=t=>{t.component(Ci.name,Ci)};const sk={name:"TreeGridNode",components:{GridOptionButton:Ho},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`})}}},ok=["data-index"],lk=["data-name","data-index"],ak={class:"td-content__wrapper"},rk=["title"],ck={class:"td-content"};function dk(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",ak,[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,rk)):o.createCommentVNode("",!0),o.createElementVNode("div",ck,[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,lk)):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,ok)}const hk=ce(sk,[["render",dk],["__scopeId","data-v-faab3696"]]),uk={name:"EvTreeGridToolbar"},fk={class:"tree-grid-toolbar"};function mk(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",fk,[o.renderSlot(t.$slots,"toolbarWrapper")])}const pk=ce(uk,[["render",mk]]),gk=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}})},bk=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}}},yk=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,R)=>(R.hide||R.hiddenDisplay||(R.width?M.totalWidth+=R.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(),R=b.getBoundingClientRect().right-k,S=s.resizeLine,x=M.left-k+w,I=M.right-k,L=y.clientX,v=M.left-k;b.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const W=G=>{const V=G.clientX-L,X=I+V;let Z=Math.max(x,X);Z=Math.min(R,Z),S.style.left=`${Z}px`},E=()=>{const V=parseInt(S.style.left,10)-v;a.orderedColumns[p]&&(a.orderedColumns[p].width=V,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})}}},xk=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))}}},Sk=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)}}},Ck=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)}}},kk=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()}}},wk=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)}}},Ik=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})}}},Lk=({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")})}}},Tk={name:"EvTreeGrid",components:{TreeGridNode:hk,Toolbar:pk,GridPagination:Er,GridSummary:Nr,ColumnSetting:Pr,GridSortButton:Br,GridOptionButton:Ho},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 _,se;return((se=(_=t.option)==null?void 0:_.useGridSetting)==null?void 0:se.use)||!1}),i=o.computed(()=>{var _;return((_=t.option)==null?void 0:_.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 _,se;return((se=(_=t.option)==null?void 0:_.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(_=>_.show)),searchStore:o.computed(()=>c.treeStore.filter(_=>_.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:t.rows,filteredColumns:[],originColumns:o.computed(()=>t.columns.map((_,se)=>{var fe;return{index:se,hiddenDisplay:!1,..._,width:isFinite(_.width)?_.width:void 0,sortOption:{sortType:((fe=_==null?void 0:_.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 _;return((_=t.option.page)==null?void 0:_.use)||!1}),useClient:((Ln=t.option.page)==null?void 0:Ln.useClient)||!1,isInfinite:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.total)||0}),perPage:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.perPage)||20}),visiblePage:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.visiblePage)||8}),order:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.order)||"center"}),showPageInfo:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.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}=gk({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 _,se;return((se=(_=t.option)==null?void 0:_.useSelection)==null?void 0:se.use)??!0}),limitCount:o.computed(()=>{var se,fe;let _=(fe=(se=t.option)==null?void 0:se.useSelection)==null?void 0:fe.limitCount;return _=_&&_>=2?_:0,_}),multiple:o.computed(()=>{var _,se;return((se=(_=t.option)==null?void 0:_.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 _,se;return((se=(_=t.option)==null?void 0:_.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 _;return((_=t.option.style)==null?void 0:_.stripe)||!1}),borderStyle:o.computed(()=>{var _;return((_=t.option.style)==null?void 0:_.border)||""}),highlightIdx:o.computed(()=>{var _;return((_=t.option.style)==null?void 0:_.highlight)??-1})}),R=()=>{b.selectedRow.length=0,c.store.forEach(_=>{_.selected=!1})},S=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(_=>{_.checked=!1,_.indeterminate=!1})},{getPagingData:x,updatePagingInfo:I,changePage:L}=Ik({stores:c,pageInfo:d,sortInfo:k,filterInfo:a,elementInfo:l,clearCheckInfo:S}),v=o.ref(0),{updateVScroll:W,updateHScroll:E,onScroll:G}=bk({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:w,pageInfo:d,summaryScroll:v,getPagingData:x,updatePagingInfo:I}),{onRowClick:V,onRowDblClick:X}=xk(b),{onCheck:Z,onCheckAll:N}=Sk({checkInfo:h,stores:c,checkHeader:y,pageInfo:d,getPagingData:x}),{calculatedColumn:D,onResize:Y,onShow:H,onColumnResize:B}=yk({resizeInfo:w,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:W,updateHScroll:E,contextInfo:T}),{setTreeNodeStore:O,handleExpand:P}=kk({stores:c,onResize:Y}),{onSort:F,initSortInfo:K,setSortInfo:Q}=Lk({sortInfo:k,stores:c}),{onSearch:U}=wk({stores:c,filterInfo:a,pageInfo:d,getConvertValue:m,onResize:Y,checkHeader:y,getPagingData:x,updatePagingInfo:I}),{setPositionColumnSetting:j,initColumnSettingInfo:J,onApplyColumn:ne,setColumnHidden:q}=Dr({stores:c,columnSettingInfo:r,contextInfo:T,onSearch:U,onResize:Y}),{setContextMenu:ee,onContextMenu:$,onColumnContextMenu:de,onGridSettingContextMenu:me}=Ck({contextInfo:T,stores:c,selectInfo:b,useGridSetting:n,columnSettingInfo:r,setColumnHidden:q,onSort:F}),ae=_=>{T.gridSettingContextMenuItems.length=0,T.customGridSettingContextMenu.length?me(_):r.isShowColumnSetting=!0},xe=_=>{var se,fe,ke,Ve,ze,Qe;_.type==="wheel"&&((se=T.menu)==null||se.hide(_)),_.type==="scroll"&&!((fe=_.target.classList)!=null&&fe.contains("table-body"))&&!((Ve=(ke=_.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(_),(Qe=T.gridSettingMenu)==null||Qe.hide())};o.onMounted(()=>{var _;if(c.treeStore=O(),c.originStore=Re(c.treeStore),(_=t.option)!=null&&_.useSort)Q(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(()=>{Y()}),o.watch(()=>{var _;return(_=t.option)==null?void 0:_.useSort},_=>{const se=t.option.hiddenColumnMenuItem,fe=T.hiddenColumnMenuItem;_?(fe.ascending=(se==null?void 0:se.ascending)??!1,fe.descending=(se==null?void 0:se.descending)??!1,Q(t.columns,!1)):(fe.ascending=!0,fe.descending=!0,K(t.columns))}),o.watch(()=>r.isShowColumnSetting,_=>{var se;if(!_){(se=T.gridSettingMenu)==null||se.hide();return}j(e.value)}),o.watch(()=>t.columns,()=>{J()},{deep:!0,immediate:!0}),o.watch(()=>t.checked,_=>{h.checkedRows=_}),o.watch(()=>h.checkedRows,_=>{h.isHeaderChecked=!1;let se=c.store;d.isClientPaging&&(se=x()),se.length&&(se.forEach(fe=>{fe.checked=!!_.find(ke=>ke.index===fe.index)}),y(se)),W()}),o.watch(()=>t.selected,_=>{b.useSelect&&(b.selectedRow=_)}),o.watch(()=>b.selectedRow,_=>{b.useSelect&&(c.store.forEach(se=>{se.selected=!!_.find(fe=>fe.index===se.index)}),W())},{deep:!0}),o.watch(()=>M.highlightIdx,async _=>{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(_>=0){const ke=c.store.find(ze=>ze.index===_);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,()=>{R()}),o.watch(()=>b.multiple,()=>{R()}),o.watch(()=>t.rows,_=>{c.treeRows=_,c.treeStore=O(),Y()},{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(_=>{var fe;const se=_;return!((fe=t.columns[_.index])!=null&&fe.width)&&!se.resized&&(se.width=0),se}),Y()}),o.watch(()=>t.option.searchValue,_=>{o.nextTick(()=>{_!==void 0&&(U((_==null?void 0:_.value)??_),d.isClientPaging&&(S(),R()))})},{immediate:!0}),o.watch(()=>{var _;return(_=t.option.page)==null?void 0:_.currentPage},_=>{var fe;const se=_||1;d.currentPage=(fe=t.option.page)!=null&&fe.isInfinite?1:se},{immediate:!0}),o.watch(()=>d.currentPage,(_,se)=>{o.nextTick(()=>{if(L(se),d.isClientPaging&&_!==se&&(S(),R()),W(),_===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=_=>({column:!0,render:u(_),"non-border":!!M.borderStyle,[_.field]:_.field}),Qo=(_,se)=>{const fe=u(_);return{width:`${_.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"}},$o=_=>`${_}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:D,onResize:Y,onShow:H,onColumnResize:B,onRowClick:V,onRowDblClick:X,onCheck:Z,onCheckAll:N,setContextMenu:ee,onContextMenu:$,onSearch:U,handleExpand:P,getColumnClass:Vt,getColumnStyle:Qo,getSlotName:$o,setGridSetting:ae,onApplyColumn:ne,onColumnContextMenu:de,onSort:F,sortIconClass:be}}},Mk={class:"column-list"},vk=["data-index"],Rk=["title","onClick"],Vk=["onClick"],Ek=["onMousedown"],Wk={ref:"table"},Gk=["title"],Zk={key:0},Xk={class:"is-empty"},Nk={ref:"resizeLine",class:"table-resize-line"};function Pk(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",Mk,[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,Vk)],10,Rk)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(k,M),["stop","left"])},null,40,Ek)],14,vk)):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",Wk,[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,Gk))])})),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",Zk,[o.createElementVNode("td",Xk,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",Nk,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(Tk,[["render",Pk],["__scopeId","data-v-9ed705b7"]]);ki.install=t=>{t.component(ki.name,ki)};const Bk={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},Dk=["aria-current"];function Yk(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,Dk)}const Ok={name:"EvPagination",components:{EvIcon:Cn,pageButton:ce(Bk,[["render",Yk]])},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,R=i.value+b-2-C,S=M-1===2?2:-1,x=R+1===w-1?R+1:-1;return[u(1),u(S),...f(M,R),u(x),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}}},Hk={class:"pagination"},Fk={key:0,class:"pagination-info"},zk={key:0,class:"pagination-ellipsis"},Ak=["onClick"];function Kk(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",Hk,[n.showPageInfo?(o.openBlock(),o.createElementBlock("small",Fk,[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",zk,[...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,Ak))],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(Ok,[["render",Kk]]);wi.install=t=>{t.component(wi.name,wi)};const _k="3.19.0",Uk=[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],Jk={version:_k,install:t=>{t&&Uk.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=Jk,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 zo=ce(eS,[["render",nS]]),Rt=0,In=1,ue=2,ui=3,Ho=4,iS=()=>{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}})},sS=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(V=>T.findIndex(X=>X[ue]===V)))??[],R=T.length*y+w*C;let S=0,x=0;if(w)for(S=0;x+y<p.scrollTop;S++)M.includes(S)&&(x+=C),x+=y;else S=Math.floor(p.scrollTop/y),x=Math.max(S,0)*y;S>T.length-1&&(S=0);let I=0,L=0;if(w)for(let V=S;L<=p.clientHeight;V++)M.includes(V)&&(L+=C),L+=y,I+=1;else I=p.clientHeight>y?Math.ceil(p.clientHeight/y):T.length,L=I*y;const v=S+I+1,W=Math.max(S,0),E=v,G=i.table;n.viewStore=T.slice(W,E),e.hasVerticalScrollBar=I<T.length||p.clientHeight<G.clientHeight,e.vScrollTopHeight=x,e.vScrollBottomHeight=R-L-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}}},oS=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,R=T-k.clientWidth,S=r.orderedColumns.reduce((x,I)=>(I.hide||I.hiddenDisplay||(I.width?x.totalWidth+=I.width:x.emptyCount++),x),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*e.rows.length>w&&(T-=R),l.useCheckbox.use&&(T-=i.minWidth),a.useRowDetail&&(T-=i.minWidth),y=T-S.totalWidth,y>0){const x=S.emptyCount===0?0:Math.floor(y/S.emptyCount);C=y-x*S.emptyCount,y=S.emptyCount!==0?x: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,R=w.getBoundingClientRect(),S=s.resizeLine,x=R.left-T+M,I=R.right-T,L=C.clientX,v=R.left-T;k.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const W=G=>{const V=G.clientX-L,X=I+V,Z=Math.max(x,X);S.style.left=`${Z}px`},E=()=>{const V=parseInt(S.style.left,10)-v;r.orderedColumns[y]&&(r.orderedColumns[y].width=V,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})}}},lS=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))}}},aS=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)}}},rS=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[Ho]=!l[Ho],n("update:expanded",e.expandedRows),n("expand-row",s,l[ue],l[Ho],l[Rt])}}},cS=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 I;const{field:p,index:y}=e.sortColumn||{},C=((I=e.sortFunction)==null?void 0:I[p])??null,b=(L,v)=>L>v?-1:1,k=(L,v)=>L<v?-1:1,T=(L,v)=>(L===null)-(v===null)||Number(v)-Number(L),w=(L,v)=>(L===null)-(v===null)||Number(L)-Number(v);if(e.sortOrder==="init"||!e.sortField&&!e.isSorting){n.store.sort((L,v)=>typeof L[Rt]=="number"?k(L[Rt],v[Rt]):0);return}const M=e.sortColumn.type||"string",R=e.sortOrder==="desc"?b:k,S=e.sortOrder==="desc"?T:w,x=(L,v)=>{var G,V;let W=L[ue][y],E=v[ue][y];return L[ue][y]&&typeof L[ue][y]=="object"&&(W=L[ue][y][(G=n.originColumns[y])==null?void 0:G.field],E=v[ue][y][(V=n.originColumns[y])==null?void 0:V.field]),{aCol:W,bCol:E}};if(C){n.store.sort((L,v)=>{const W=L[ue][y],E=v[ue][y],G=C(W,E);return e.sortOrder==="desc"?-G:G});return}switch(M){case"string":n.store.sort((L,v)=>{let{aCol:W,bCol:E}=x(L,v);if((!W||typeof W=="string")&&(!E||typeof E=="string")){W=W||"",E=E||"";const G=W.toLowerCase(),V=E.toLowerCase();if(W!==E&&G===V){const X=Array.from(W).findIndex((Z,N)=>Z!==E[N]);return R(W[X],E[X])}return R(G,V)}return 0});break;case"stringNumber":n.store.sort((L,v)=>{let{aCol:W,bCol:E}=x(L,v);return!W||typeof W=="string"||typeof W=="number"?(W=W===""?null:W,E=E===""?null:E,S(W??null,E??null)):0});break;default:n.store.sort((L,v)=>{const{aCol:W,bCol:E}=x(L,v);return!W||typeof W=="number"||typeof W=="boolean"?S(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()}},dS=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(R=>{const S=l.checkedRows.includes(R[ue]);R[In]=S,M+=S?1:0}),w.length&&(l.isHeaderChecked=w.length===M,l.isHeaderIndeterminate=w.length!==M&&M>0,l.isHeaderUncheckable=w.every(R=>e.uncheckable.includes(R[ue])||e.disabledRows.includes(R[ue])))},m=(w,M,R)=>{if(typeof w!="string"||M===null)return!1;const S=M==null?void 0:M.toLowerCase(),x=w==null?void 0:w.toLowerCase();let I=S.includes(x);return R&&(R==="start"?I=S.startsWith(x):R==="end"&&(I=S.endsWith(x))),I},g=(w,M)=>{const R=M.comparison,S=M.value;let x=w[ue][M.index];(x||x===0)&&(x=`${w[ue][M.index]}`);let I;return R==="="?I=(S==null?void 0:S.toLowerCase())===(x==null?void 0:x.toLowerCase()):R==="!="?I=(S==null?void 0:S.toLowerCase())!==(x==null?void 0:x.toLowerCase()):R==="%s%"?I=m(S,x):R==="notLike"?I=!m(S,x):R==="s%"?I=m(S,x,"start"):R==="%s"?I=m(S,x,"end"):R==="isEmpty"?I=x==null||x==="":R==="isNotEmpty"&&(I=!!x),I},p=(w,M,R)=>{const S=M.comparison,x=Number(M.value.replace(/,/g,""));let I=Number(w[ue][M.index]),L;return R==="float"&&(I=Number(I.toFixed(3))),S==="="?L=I===x:S===">"?L=I>x:S==="<"?L=I<x:S==="<="?L=I<=x:S===">="?L=I>=x:S==="!="?L=I!==x:S==="isEmpty"?L=I==null||isNaN(I):S==="isNotEmpty"&&(L=!!I||I===0),L},y=(w,M)=>{const R=M.comparison,S=M.value,x=`${w[ue][M.index]}`;let I;return R==="="&&(I=x===S),I},C=(w,M,R)=>{let S=M==="string"||M==="stringNumber"?g:p;return M==="boolean"&&(S=y),w.filter(x=>S(x,R,M))||[]},b=()=>{const w=i.filteringItemsByColumn,M=Object.keys(w),R=s.originStore;let S=[],x=!1,I=[];M.forEach((L,v)=>{const W=w[L],E=u(L),G=e.columns[E].type,V=i.columnOperator==="or",X=v>0&&i.columnOperator==="and";W.forEach((Z,N)=>{!S.length&&!x?S=C(R,G,{...Z,index:E}):X&&Z.operator==="or"?N>0?S.push(...C(I,G,{...Z,index:E})):S=C(I,G,{...Z,index:E}):N===0&&V||N!==0&&Z.operator==="or"?S.push(...C(R,G,{...Z,index:E})):S=C(S,G,{...Z,index:E}),x=!0}),I=JSON.parse(JSON.stringify(S))}),x?s.filterStore=Cb(S,JSON.stringify):s.filterStore=R};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 R=!1;const S=n.isFilteringColumn?M[ue].filter((x,I)=>n.visibleColumnIdx.includes(I)):M[ue];for(let x=0;x<s.orderedColumns.length;x++){const I=s.orderedColumns[x]||{};let L=S[I.index]??null;if(I.type=I.type||"string",L!==null&&(L instanceof Array?L=JSON.stringify(L):typeof L=="object"&&(L=L[I.field]),!I.hide&&((I==null?void 0:I.searchable)===void 0||I!=null&&I.searchable)&&(L=r(I,L).toString(),R=L.toLowerCase().includes(w.toString().toLowerCase()),R)))break}return R}),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}},hS=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,R,S;if(p.target.className==="column-name"){const x=y.sortable===void 0?!0:y.sortable,I=l.isFiltering&&y.filterable===void 0?!0:y.filterable,L=[{text:((C=e.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!x,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:!x,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:!I,hidden:((M=e.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((R=e.columnMenuTextInfo)==null?void 0:R.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||y.fixed,hidden:((S=e.hiddenColumnMenuItem)==null?void 0:S.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=[],!x&&!I&&!a.value)return;e.columnMenuItems=L.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)}}},uS=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((R,S)=>{const x=e.checked.includes(R),I=e.uncheckable.includes(R)||e.disabledRows.includes(R);let L=!1;n.useSelect&&(L=e.selected.includes(R)),!x&&!I&&(M=!0);let v=!1;c.useRowDetail&&(v=e.expanded.includes(R));const W=e.disabledRows.includes(R);w.push([S,x,R,L,v,I,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(R=>e.uncheckable.includes(R)||e.disabledRows.includes(R)),s.originStore=w}r.isFiltering&&f(),C&&y&&h(C,!1),l.sortField&&d(),(T=a.body)!=null&&T.clientHeight&&u()}}},fS=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 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()}}},mS=({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})}}},pS={name:"EvGrid",directives:{clickoutside:zi,observeVisibility:qs,resize:Wn},components:{Toolbar:k0,GridPagination:Er,GridSummary:Nr,ColumnSetting:Pr,FilterSetting:U0,GridSortButton:Br,GridOptionButton:zo},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 uc,fc,mc,pc,gc,bc,yc,xc,Sc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=iS(),u=o.ref(null),f=o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:ie.use)||!1}),m=o.computed(()=>t.option.showHeader??!0),g=o.computed(()=>{var A;return((A=t.option)==null?void 0:A.useSummary)||!1}),p=o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.stripe)||!1}),y=o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.border)||""}),C=o.computed(()=>{var A;return((A=t.option.style)==null?void 0:A.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"}),R=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((fc=(uc=t.option)==null?void 0:uc.useGridSetting)==null?void 0:fc.columnMenuText)??"Column List",search:((pc=(mc=t.option)==null?void 0:mc.useGridSetting)==null?void 0:pc.searchText)??"Search",empty:((bc=(gc=t.option)==null?void 0:gc.useGridSetting)==null?void 0:bc.emptyText)??"No records",ok:((xc=(yc=t.option)==null?void 0:yc.useGridSetting)==null?void 0:xc.okBtnText)??"OK"}}),S=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const A=M.isFiltering?S.filterStore:S.originStore;return M.isSearch?S.searchStore:A}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>t.columns.map((A,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,...A,width:isFinite(A.width)?A.width:void 0,sortOption:{sortType:((Le=A==null?void 0:A.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const A=S.movedColumns.length?S.movedColumns:S.originColumns;return S.filteredColumns.length?S.filteredColumns:A}),updatedColumns:o.computed(()=>ms(S))}),x=o.reactive({usePage:o.computed(()=>{var A;return((A=t.option.page)==null?void 0:A.use)||!1}),useClient:((Sc=t.option.page)==null?void 0:Sc.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,ie;return(A=t.option.page)!=null&&A.useClient?S.store.length:(ie=t.option.page)==null?void 0:ie.total}),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(()=>x.useClient&&x.usePage&&!x.isInfinite),isHighlight:!1,highlightPage:0}),I=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:t.checked,useCheckbox:o.computed(()=>t.option.useCheckbox||{})}),L=o.reactive({expandedRows:t.expanded,useRowDetail:o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var A,ie;return(ie=(A=t.option)==null?void 0:A.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 A,ie;return((ie=(A=t.option)==null?void 0:A.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var A,ie;return((ie=(A=t.option)==null?void 0:A.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 A,ie;return((ie=(A=t.option)==null?void 0:A.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),V=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=()=>{I.checkedRows=[],I.isHeaderChecked=!1,I.isHeaderIndeterminate=!1,S.store.forEach(A=>{A[1]=!1})},Z=()=>{W.selectedRow=[],S.store.forEach(A=>{A[3]=!1})},N=()=>{S.store.forEach(A=>{A[4]=!1}),L.expandedRows=[]},{getPagingData:D,updatePagingInfo:O,changePage:z}=fS({stores:S,pageInfo:x,sortInfo:E,filterInfo:M,elementInfo:w,clearCheckInfo:X}),B=o.ref(0),{updateVScroll:Y,updateHScroll:P,onScroll:H}=sS({scrollInfo:v,stores:S,elementInfo:w,resizeInfo:V,pageInfo:x,summaryScroll:B,expandedInfo:L,getPagingData:D,updatePagingInfo:O}),{onCheck:K,onCheckAll:Q}=aS({checkInfo:I,stores:S,pageInfo:x,getPagingData:D}),{onExpanded:U}=rS({expandedInfo:L}),{onSort:j,getSortTarget:J,setSort:ne,setSortInfo:q,hasSortTarget:ee}=cS({sortInfo:E,stores:S,updatePagingInfo:O}),{onSearch:$,setFilter:de,setHeaderCheckboxByFilter:me}=dS({columnSettingInfo:R,filterInfo:M,stores:S,checkInfo:I,pageInfo:x,getConvertValue:c,updateVScroll:Y,getPagingData:D,updatePagingInfo:O,getColumnIndex:d}),{setStore:ae}=uS({selectInfo:W,checkInfo:I,stores:S,sortInfo:E,elementInfo:w,filterInfo:M,expandedInfo:L,setSort:ne,setSortInfo:q,updateVScroll:Y,setFilter:de}),{calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re}=oS({resizeInfo:V,elementInfo:w,checkInfo:I,expandedInfo:L,stores:S,isRenderer:a,updateVScroll:Y,updateHScroll:P,contextInfo:G}),{setPositionColumnSetting:pe,initColumnSettingInfo:Ie,onApplyColumn:Ee,setColumnHidden:kt}=Dr({stores:S,columnSettingInfo:R,contextInfo:G,onSearch:$,onResize:be}),{setContextMenu:Vt,onContextMenu:Qo,onColumnContextMenu:$o,onGridSettingContextMenu:ys}=hS({contextInfo:G,stores:S,selectInfo:W,useGridSetting:f,filterInfo:M,columnSettingInfo:R,setColumnHidden:kt,onSort:j}),{onRowClick:xs,onRowDblClick:Ss}=lS({selectInfo:W,stores:S}),{onDragStart:Cs,onDragOver:ks,onDrop:ws}=mS({stores:S}),Is=A=>{G.gridSettingContextMenuItems.length=0,G.customGridSettingContextMenu.length?ys(A):R.isShowColumnSetting=!0},on=A=>{var ie,Le,wt,ln,Ii,Et,ot,Ls,Ts,Cc;A.type==="wheel"&&((ie=G.menu)==null||ie.hide(A)),A.type==="scroll"&&!((Le=A.target.classList)!=null&&Le.contains("table-body"))&&!((ln=(wt=A.target.offsetParent)==null?void 0:wt.classList)!=null&&ln.contains("ev-select-dropbox"))&&!((Et=(Ii=A.target.offsetParent)==null?void 0:Ii.classList)!=null&&Et.contains("ev-grid-column-setting"))&&!((Ls=(ot=A.target.offsetParent)==null?void 0:ot.classList)!=null&&Ls.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,R.isShowColumnSetting=!1,G.isShowMenuOnClick=!1,(Ts=G.columnMenu)==null||Ts.hide(A),(Cc=G.gridSettingMenu)==null||Cc.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 A;T.value=((A=w["grid-wrapper"])==null?void 0:A.offsetWidth)/1.5||0}),o.watch(()=>R.isShowColumnSetting,A=>{var ie;if(!A){(ie=G.gridSettingMenu)==null||ie.hide();return}pe(u.value)}),o.watch(()=>t.columns,()=>{ee()?q(J()):(q(J()),ne()),M.filteringColumn=null,M.filteringItemsByColumn={},S.filterStore=[],ae({rows:[],isMakeIndex:!1}),Ie(),S.movedColumns.length=0},{deep:!0}),o.watch(()=>E.isSorting,A=>{A&&(ae({rows:S.originStore,isMakeIndex:!1}),E.isSorting=!A,x.isClientPaging&&(x.currentPage=1,S.pagingStore=D(),X()))}),o.watch(()=>t.rows,A=>{ae({rows:A}),M.isSearch&&$(M.searchWord),be()},{deep:!0}),o.watch(()=>t.uncheckable,()=>{ae({rows:t.rows})},{deep:!0}),o.watch(()=>t.checked,A=>{I.checkedRows=A}),o.watch(()=>t.disabledRows,()=>{S.store.length&&S.store.forEach(A=>{A[6]=t.disabledRows.includes(A[2])})},{deep:!0}),o.watch(()=>I.checkedRows,A=>{I.isHeaderChecked=!1;let ie=S.store;x.isClientPaging&&(ie=D()),ie.length&&(ie.forEach(Le=>{Le[1]=A.includes(Le[2])}),I.isHeaderChecked=A.length===ie.length),Y()}),o.watch(()=>t.selected,A=>{W.useSelect&&(W.selectedRow=A)}),o.watch(()=>W.selectedRow,A=>{W.useSelect&&(S.store.forEach(ie=>{ie[3]=A.includes(ie[2])&&!t.disabledRows.includes(ie[2])}),Y())}),o.watch(()=>C.value,async A=>{if(await o.nextTick(),A>=0){if(x.usePage&&!x.isInfinite&&(x.highlightPage=Math.ceil(A/x.perPage)||1,x.highlightPage!==x.currentPage)){x.currentPage=x.highlightPage,x.isHighlight=!0;return}w.body.scrollTop=V.rowHeight*C.value}}),o.watch(()=>I.useCheckbox.mode,()=>{X()}),o.watch(()=>W.useSelect,()=>{Z()}),o.watch(()=>W.multiple,()=>{Z()}),o.watch(()=>t.checked.length,A=>{A||X()}),o.watch(()=>t.expanded.length,A=>{A||N(),Y()}),o.watch(()=>[t.option.columnWidth,V.gridWidth],async()=>{await o.nextTick(),V.columnWidth=t.option.columnWidth;const A=w["grid-wrapper"];A.style.width=V.gridWidth,A.style.height=V.gridHeight,S.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,A=>{A!==void 0&&($((A==null?void 0:A.value)??A),x.isClientPaging&&(X(),Z()))},{immediate:!0}),o.watch(()=>{var A;return(A=t.option.page)==null?void 0:A.currentPage},A=>{var Le;const ie=A||1;x.currentPage=(Le=t.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>x.currentPage,(A,ie)=>{o.nextTick(()=>{z(ie),x.isClientPaging&&A!==ie&&(X(),Z()),Y(),A===x.highlightPage&&x.isHighlight&&(w.body.scrollTop=V.rowHeight*C.value,x.isHighlight=!x.isHighlight)})});const Ln=o.reactive({boxTop:0,boxLeft:0}),_=o.ref(null),se=o.ref(!1),fe=o.ref(!1),ke=o.ref(null),Ve=o.ref({}),Fe=o.reactive({caption:"",field:""}),Qe=o.ref([]),jk=[{name:"AND",value:"and"},{name:"OR",value:"or"}],qo=o.ref(0),Qk=({caption:A,field:ie},Le)=>{if(Fe.caption=A,Fe.field=ie,Qe.value=Le,(Le==null?void 0:Le.length)>1){se.value=!0;const wt=_.value.getBoundingClientRect().left,ln=window.pageYOffset+_.value.getBoundingClientRect().top+_.value.getBoundingClientRect().height;Ln.boxTop=`${ln}px`,Ln.boxLeft=`${wt}px`}},$k=()=>{S.filterStore=[],ae({rows:[],isMakeIndex:!1})},el=async A=>{var ln,Ii;A&&fe.value&&(qo.value=0);const ie=(ln=_.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=_.value.getBoundingClientRect())==null?void 0:Ii.width,{width:Ts}=ot.getBoundingClientRect();wt+=Ts+10,Ls-150<=wt&&!ot.classList.contains("filtering-items__item--count")?(qo.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)})}},qk=async(A,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[A]=ie,fe.value=!0):(delete Ve.value[A],delete M.filteringItemsByColumn[A]),await o.nextTick(),el(!0),M.isShowFilterSetting=!1,S.filterStore=[],ae({rows:[],isMakeIndex:!1}),me(S.filterStore)};let tl=null;const ew=()=>{tl&&clearTimeout(tl),tl=setTimeout(()=>{fe.value=!fe.value,el(fe.value)},150)},tw=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Ve.value={},S.filterStore=[],ae({rows:[],isMakeIndex:!1})},nw=o.computed(()=>{var A;return{width:`${T.value}px`,top:`${((A=_.value)==null?void 0:A.getBoundingClientRect().height)||0}px`}}),iw=A=>{const ie=M.filteringItemsByColumn[A];return ie==null?void 0:ie[ie.length-1]},sw=()=>{const A=document.createElement("div");A.id="ev-grid-filtering-items-modal",A.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(A)};return o.onBeforeMount(()=>sw()),{idColIndex:o.computed(()=>{var A;return(A=S.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:A.index}),summaryScroll:B,showHeader:m,stripeStyle:p,borderStyle:y,highlightIdx:C,useSummary:g,useGridSetting:f,toolbarRef:u,stores:S,emptyText:b,...o.toRefs(w),...o.toRefs(S),...o.toRefs(M),...o.toRefs(v),...o.toRefs(x),...o.toRefs(V),...o.toRefs(W),...o.toRefs(I),...o.toRefs(L),...o.toRefs(E),...o.toRefs(G),...o.toRefs(R),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:Y,updateHScroll:P,onScroll:H,calculatedColumn:xe,onResize:be,onShow:oe,onColumnResize:re,onRowClick:xs,onRowDblClick:Ss,onCheck:K,onCheckAll:Q,onExpanded:U,onSort:j,setSort:ne,setStore:ae,setContextMenu:Vt,onContextMenu:Qo,onSearch:$,setGridSetting:Is,onApplyColumn:Ee,onColumnContextMenu:$o,filteringItemsWidth:T,isShowColumnFilteringItems:fe,operatorItems:jk,selectedFilteringItems:Qe,selectedFilteringColumn:Fe,filteringItemsRef:_,isShowFilteringItemsBox:se,filteringItemsStyle:nw,hiddenFilteringItemsCount:qo,...o.toRefs(Ln),hiddenFilteringItemsRef:ke,hiddenFilteringItemsByColumn:Ve,removeAllFiltering:tw,onExpandFilteringItems:ew,setColumnFilteringItems:el,onChangeOperator:$k,onApplyFilter:qk,onClickFilteringItem:Qk,getFilteringItemByField:iw,onDragStart:Cs,onDragOver:ks,onDrop:ws,ROW_DISABLED_INDEX:6}}},gS={key:0,class:"filtering-items filtering-items--used"},bS={key:1,ref:"filteringItemsRef",class:"filtering-items"},yS=["data-field","onClick"],xS={class:"filtering-items__item--title"},SS=["title"],CS={key:1,class:"filtering-items__item--value"},kS=["onClick"],wS={class:"filtering-items__item--title"},IS=["title"],LS={key:1,class:"filtering-items__item--value"},TS={class:"column-list"},MS=["data-index"],vS=["title","onClick"],RS=["onClick"],VS=["onMousedown"],ES={ref:"table"},WS=["data-index","disabled","onClick","onContextmenu","onDblclick"],GS=["data-name","data-index","disabled"],ZS={key:0},XS=["title"],NS=["disabled"],PS=["disabled"],BS={key:0},DS=["colspan"],OS={key:0},YS={class:"is-empty"},zS={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",gS,[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",bS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(t.filteringItemsByColumn),(w,M)=>{var R,S,x,I;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((...L)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...L),["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]=L=>t.columnOperator=L),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(L=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},t.filteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",xS,o.toDisplayString((R=i.getFilteringItemByField(w))==null?void 0:R.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),t.filteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,SS)):(o.openBlock(),o.createElementBlock("span",CS," + "+o.toDisplayString(t.filteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:L=>i.onApplyFilter(w,[])},null,8,["onClick"])],8,yS)],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 R,S,x,I;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(L=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},i.hiddenFilteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",wS,o.toDisplayString((R=i.getFilteringItemByField(w))==null?void 0:R.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),i.hiddenFilteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,IS)):(o.openBlock(),o.createElementBlock("span",LS," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:L=>i.onApplyFilter(w,[],!0)},null,8,["onClick"])],8,kS)}),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",TS,[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]=(...R)=>i.onDragStart&&i.onDragStart(...R)),onDragover:e[7]||(e[7]=(...R)=>i.onDragOver&&i.onDragOver(...R)),onDrop:e[8]||(e[8]=(...R)=>i.onDrop&&i.onDrop(...R))},[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:[R=>i.onColumnContextMenu(R,w),e[5]||(e[5]=o.withModifiers((...R)=>t.columnMenu.show&&t.columnMenu.show(...R),["prevent"]))]},[o.createTextVNode(o.toDisplayString(w.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(R=>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,RS)],8,vS)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(R=>i.onColumnResize(M,R),["stop","left"])},null,40,VS)],46,MS)):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",ES,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.viewStore,(w,M)=>{var R,S;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:x=>i.onRowClick(x,w),onContextmenu:x=>i.onRowClick(x,w,!0),onDblclick:x=>i.onRowDblClick(x,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":x=>w[1]=x,class:"row-checkbox-input",disabled:w[5]||w[i.ROW_DISABLED_INDEX],onChange:x=>i.onCheck(x,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":x=>w[4]=x,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(x=>i.onExpanded(x,w),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.orderedColumns,(x,I)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?w[2][i.idColIndex]:M}-${I}`},[!x.hide&&!x.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":x.field,"data-index":x.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(x),[x.type]:x.type,[x.align]:x.align,[x.field]:x.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${x.width}px`,height:`${t.rowHeight}px`,"line-height":`${t.rowHeight}px`,"min-width":`${i.isRenderer(x)?t.rendererMinWidth:t.minWidth}px`,"border-right":t.orderedColumns.length-1===I?"none":"1px solid #CFCFCF"}),disabled:w[i.ROW_DISABLED_INDEX]},[t.$slots[x.field]?(o.openBlock(),o.createElementBlock("div",ZS,[o.renderSlot(t.$slots,x.field,{item:{row:w,column:x},disabled:w[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(x,w[2][x.index])},o.toDisplayString(i.getConvertValue(x,w[2][x.index])),9,XS))],14,GS)):o.createCommentVNode("",!0)],64))),128)),(R=t.$props.option.customContextMenu)!=null&&R.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]=x=>i.onContextMenu(x))},[o.renderSlot(t.$slots,"contextmenuIcon",{},void 0,!0)],8,PS)):(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]=x=>i.onContextMenu(x))},null,8,["disabled"]))],14,NS)):o.createCommentVNode("",!0)],42,WS),t.useRowDetail&&((S=t.$slots)!=null&&S.rowDetail)&&w[4]?(o.openBlock(),o.createElementBlock("tr",BS,[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,DS)])):o.createCommentVNode("",!0)],64)}),128)),t.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",OS,[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",zS,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(pS,[["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,AS=512,F={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>=AS&&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=zh(1),i=Yh(1),s=Oh(1),l=Dh(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=Ot(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=Ot(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 KS(t){const e=(String(t).split(".")[1]??"").length;return t.toFixed(e+1)}var _S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function US(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Or={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(_S,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"],V=E%100;return"["+E+(G[(V-20)%10]||G[V]||G[0])+"]"}},k=function(E,G,V){var X=String(E);return!X||X.length>=G?E:""+Array(G+1-X.length).join(V)+E},T={s:k,z:function(E){var G=-E.utcOffset(),V=Math.abs(G),X=Math.floor(V/60),Z=V%60;return(G<=0?"+":"-")+k(X,2,"0")+":"+k(Z,2,"0")},m:function E(G,V){if(G.date()<V.date())return-E(V,G);var X=12*(V.year()-G.year())+(V.month()-G.month()),Z=G.clone().add(X,u),N=V-Z<0,D=G.clone().add(X+(N?-1:1),u);return+(-(X+(V-Z)/(N?Z-D:D-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 R="$isDayjsObject",S=function(E){return E instanceof v||!(!E||!E[R])},x=function E(G,V,X){var Z;if(!G)return w;if(typeof G=="string"){var N=G.toLowerCase();M[N]&&(Z=N),V&&(M[N]=V,Z=N);var D=G.split("-");if(!Z&&D.length>1)return E(D[0])}else{var O=G.name;M[O]=G,Z=O}return!X&&Z&&(w=Z),Z||!X&&w},I=function(E,G){if(S(E))return E.clone();var V=typeof G=="object"?G:{};return V.date=E,V.args=arguments,new v(V)},L=T;L.l=x,L.i=S,L.w=function(E,G){return I(E,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var v=function(){function E(V){this.$L=x(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[R]=!0}var G=E.prototype;return G.parse=function(V){this.$d=function(X){var Z=X.date,N=X.utc;if(Z===null)return new Date(NaN);if(L.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var D=Z.match(y);if(D){var O=D[2]-1||0,z=(D[7]||"0").substring(0,3);return N?new Date(Date.UTC(D[1],O,D[3]||1,D[4]||0,D[5]||0,D[6]||0,z)):new Date(D[1],O,D[3]||1,D[4]||0,D[5]||0,D[6]||0,z)}}return new Date(Z)}(V),this.init()},G.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},G.$utils=function(){return L},G.isValid=function(){return this.$d.toString()!==p},G.isSame=function(V,X){var Z=I(V);return this.startOf(X)<=Z&&Z<=this.endOf(X)},G.isAfter=function(V,X){return I(V)<this.startOf(X)},G.isBefore=function(V,X){return this.endOf(X)<I(V)},G.$g=function(V,X,Z){return L.u(V)?this[X]:this.set(Z,V)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(V,X){var Z=this,N=!!L.u(X)||X,D=L.p(V),O=function(U,j){var J=L.w(Z.$u?Date.UTC(Z.$y,j,U):new Date(Z.$y,j,U),Z);return N?J:J.endOf(d)},z=function(U,j){return L.w(Z.toDate()[U].apply(Z.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(j)),Z)},B=this.$W,Y=this.$M,P=this.$D,H="set"+(this.$u?"UTC":"");switch(D){case m:return N?O(1,0):O(31,11);case u:return N?O(1,Y):O(0,Y+1);case h:var K=this.$locale().weekStart||0,Q=(B<K?B+7:B)-K;return O(N?P-Q:P+(6-Q),Y);case d:case g:return z(H+"Hours",0);case c:return z(H+"Minutes",1);case r:return z(H+"Seconds",2);case a:return z(H+"Milliseconds",3);default:return this.clone()}},G.endOf=function(V){return this.startOf(V,!1)},G.$set=function(V,X){var Z,N=L.p(V),D="set"+(this.$u?"UTC":""),O=(Z={},Z[d]=D+"Date",Z[g]=D+"Date",Z[u]=D+"Month",Z[m]=D+"FullYear",Z[c]=D+"Hours",Z[r]=D+"Minutes",Z[a]=D+"Seconds",Z[l]=D+"Milliseconds",Z)[N],z=N===d?this.$D+(X-this.$W):X;if(N===u||N===m){var B=this.clone().set(g,1);B.$d[O](z),B.init(),this.$d=B.set(g,Math.min(this.$D,B.daysInMonth())).$d}else O&&this.$d[O](z);return this.init(),this},G.set=function(V,X){return this.clone().$set(V,X)},G.get=function(V){return this[L.p(V)]()},G.add=function(V,X){var Z,N=this;V=Number(V);var D=L.p(X),O=function(Y){var P=I(N);return L.w(P.date(P.date()+Math.round(Y*V)),N)};if(D===u)return this.set(u,this.$M+V);if(D===m)return this.set(m,this.$y+V);if(D===d)return O(1);if(D===h)return O(7);var z=(Z={},Z[r]=i,Z[c]=s,Z[a]=n,Z)[D]||1,B=this.$d.getTime()+V*z;return L.w(B,this)},G.subtract=function(V,X){return this.add(-1*V,X)},G.format=function(V){var X=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||p;var N=V||"YYYY-MM-DDTHH:mm:ssZ",D=L.z(this),O=this.$H,z=this.$m,B=this.$M,Y=Z.weekdays,P=Z.months,H=Z.meridiem,K=function(j,J,ne,q){return j&&(j[J]||j(X,N))||ne[J].slice(0,q)},Q=function(j){return L.s(O%12||12,j,"0")},U=H||function(j,J,ne){var q=j<12?"AM":"PM";return ne?q.toLowerCase():q};return N.replace(C,function(j,J){return J||function(ne){switch(ne){case"YY":return String(X.$y).slice(-2);case"YYYY":return L.s(X.$y,4,"0");case"M":return B+1;case"MM":return L.s(B+1,2,"0");case"MMM":return K(Z.monthsShort,B,P,3);case"MMMM":return K(P,B);case"D":return X.$D;case"DD":return L.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return K(Z.weekdaysMin,X.$W,Y,2);case"ddd":return K(Z.weekdaysShort,X.$W,Y,3);case"dddd":return Y[X.$W];case"H":return String(O);case"HH":return L.s(O,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return U(O,z,!0);case"A":return U(O,z,!1);case"m":return String(z);case"mm":return L.s(z,2,"0");case"s":return String(X.$s);case"ss":return L.s(X.$s,2,"0");case"SSS":return L.s(X.$ms,3,"0");case"Z":return D}return null}(j)||D.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(V,X,Z){var N,D=this,O=L.p(X),z=I(V),B=(z.utcOffset()-this.utcOffset())*i,Y=this-z,P=function(){return L.m(D,z)};switch(O){case m:N=P()/12;break;case u:N=P();break;case f:N=P()/3;break;case h:N=(Y-B)/6048e5;break;case d:N=(Y-B)/864e5;break;case c:N=Y/s;break;case r:N=Y/i;break;case a:N=Y/n;break;default:N=Y}return Z?N:L.a(N)},G.daysInMonth=function(){return this.endOf(u).$D},G.$locale=function(){return M[this.$L]},G.locale=function(V,X){if(!V)return this.$L;var Z=this.clone(),N=x(V,X,!0);return N&&(Z.$L=N),Z},G.clone=function(){return L.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 I.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])}}),I.extend=function(E,G){return E.$i||(E(G,v,I),E.$i=!0),I},I.locale=x,I.isDayjs=S,I.unix=function(E){return I(1e3*E)},I.en=M[w],I.Ls=M,I.p={},I})})(Or);var JS=Or.exports;const Pe=US(JS),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 R=(w-T)/1e3,S=Number.isFinite(R)?Math.max(0,Math.floor(R)):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(S>0)if(S>=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 V=0;V<S;V++)M(m[E]),E=(E+1)%y,G=(G+1)%y;f.startIndex=E,f.endIndex=G}const x=this.options.coordinateDedupe!==!1;let I=-1;for(let E=0;E<u;E++){const G=h[E];if(G){const V=Math.floor(G.x/1e3)*1e3;if(f.fromTime<=V){let X=f.endIndex-(f.toTime-V)/1e3;X<0&&(X=y+X);const Z=m[X],N=F.coordinateKey(G.x,G.y);if(!(x&&Z.dataKeys.has(N))){x&&Z.dataKeys.add(N),Z.data.push({x:G.x,y:G.y,o:G.value??G.y,color:G.color,k:x&&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 O=(f.toTime-V)/1e3;O>I&&(I=O)}}}}f.lastTick={seq:(((r=f.lastTick)==null?void 0:r.seq)??0)+1,gapCount:S,prevToTime:T,toTime:f.toTime,length:y,startIndex:f.startIndex,endIndex:f.endIndex,maxDirtyAge:I};const L=1e3,v={maxY:-1/0,minY:1/0};for(let E=0;E<y;E++){const G=m[E];for(let V=0;V<G.data.length;V++){const X=G.data[V],Z=Math.floor(X.x/L)*L;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-1)*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=!F.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&&!F.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=!F.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 V;const G=this.seriesList[E];return(G==null?void 0:G.show)&&((V=G==null?void 0:G.data)==null?void 0:V.length)>0});if(W){const E=this.seriesList[W].data,G=a?t[1]:t[0];let V=1/0,X=-1;for(let Z=0;Z<E.length;Z++){const N=s||l.some(O=>{var B,Y,P,H;const z=this.seriesList[O];return(z==null?void 0:z.show)&&((Y=(B=z.data)==null?void 0:B[Z])==null?void 0:Y.o)!==null&&((H=(P=z.data)==null?void 0:P[Z])==null?void 0:H.o)!==void 0}),D=E[Z];if(N&&D){let O;if(a?O=D.h?D.yp+D.h/2:D.yp:O=D.w?D.xp+D.w/2:D.xp,O!=null){const z=Math.abs(G-O);z<V&&(V=z,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="",R=null,S=1/0,x=0,I=!1;for(let W=0;W<l.length;W++){const E=l[W],G=this.seriesList[E],V=e?G.findApproximateData:G.findGraphData;if(V){const X=V.call(G,t,a,d,i),Z=X.data,N=X.index;if(Z)if(F.isPieType(X.type))h=X.type,u=E,g=E,f=(Z.ea-Z.sa)/2,m=Z.o,p=Z.index;else{const D=a?Z.y:Z.x,O=a?Z.yp:Z.xp;if(D!=null){const z=a?Z.o||Z.x:Z.o||Z.y;G.stackIndex!=null?(x+=isNaN(Z.o)?0:Z.o,I=!0):x+=Z.y;const B=z!=null&&!Number.isNaN(z),Y=Z.xp!==null&&Z.xp!==void 0&&Z.yp!==null&&Z.yp!==void 0;if(B&&Y){const P=F.calcBoxDistance(Z,r,c);(M===""||P<S)&&(S=P,b=G.type,k=D,T=O,w=z,M=E,R=N)}else B&&M===""&&(b=G.type,k=D,T=O,w=z,M=E,R=N);if(X.hit&&Z.xp!==void 0&&Z.yp!==void 0){const P=(Z.xp-t[0])**2+(Z.yp-t[1])**2;X.directHit?((!C||P<y)&&(y=P,h=G.type,u=D,f=O,m=z,g=E,p=N),C=!0):C||P<y&&(y=P,h=G.type,u=D,f=O,m=z,g=E,p=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const W=l.find(G=>{var X;const V=this.seriesList[G];return(V==null?void 0:V.show)&&((X=V==null?void 0:V.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,R=d)}const L=g!=="";return{type:L?h:b,label:L?u:k,pos:L?f:T,value:L?m:w,sId:L?g:M,acc:x,useStack:I,dataIndex:L?p:R}},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],R=Math.floor((+M-+w)/T)+1,S=(f-u)/R,I=Math.floor(((e==="yAxis"||r?i:n)-u)/S);b==="step"?m=w+I:m=(d==null?void 0:d.labels.findIndex(v=>v===+w))+I}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,R=Math.abs(k-T)/m,S=Math.floor((w+M)/R);return R*S+M>w&&R*S-M<w&&(u=S*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=pb(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;(!F.checkSafeInteger(c)||!F.checkSafeInteger(d)||!F.checkSafeInteger(u)||!F.checkSafeInteger(h)||!F.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}},QS={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"}},zt=["#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"},$S={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},qS={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}}},zr={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,valueFormatter:null,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}}},Fo={color:"#FF0000",lineWidth:1,label:zr},Ao={color:"#FAE59D",border:null},eC={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}},tC=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")?F.getOpacity(m):1,p=s?l:g;h.addColorStop(f,F.colorStringToRgba(m,p))}return h}},nC=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),Fr=Math.PI*2;class iC{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:zt[i%zt.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=>!F.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=S=>S==null||S<p||S>y?null:Math.ceil(m+k*(S-p)),R=S=>{const x=a&&S>b?b:S;return x==null||x<C||x>b?null:Math.floor(g?g-T*(x-w):-(T*(x-w)))};for(let S=0;S<this.data.length;S++){const x=this.data[S];let I=M(x.x),L=R(x.y);this.isExistGrp&&r&&x.o===null&&(L=R(x.b??0)),I!==null&&(I+=F.aliasPixel(I)),x.xp=I,x.yp=L}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 z,B,Y,P,H,K,Q,U,j;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=((z=a==null?void 0:a.selected)==null?void 0:z.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((B=r==null?void 0:r.option)!=null&&B.use&&((P=(Y=r==null?void 0:r.selected)==null?void 0:Y.seriesId)!=null&&P.length)){const J=(K=(H=r==null?void 0:r.selected)==null?void 0:H.seriesId)==null?void 0:K.includes(this.sId);p=this.extent[J?"highlight":"downplay"]}else m&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const y=J=>J!=null&&J.includes("rgba")?F.getOpacity(J):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,R=this._rgbaCache||(this._rgbaCache={}),S=(J,ne,q)=>{const ee=R[J];if(ee!==void 0&&ee.s===ne&&ee.o===q)return ee.v;const $=F.colorStringToRgba(ne,q);return R[J]={s:ne,o:q,v:$},$};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=S("stroke",C,b),this.segments&&n.setLineDash(this.segments);const x=this.useLinearInterpolation();let I=0;const L=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&&(I=W/(this.data.length||1),W-=I,this.size.comboOffset=I);const G=i.x1+s.left+I/2,V=i.y2-s.bottom,X=J=>te.calculateX(J,L.graphMin,L.graphMax,W,G),Z=J=>te.calculateY(u&&J>v.graphMax?v.graphMax:J,v.graphMin,v.graphMax,E,V);let N,D=null,O=null;for(let J=0;J<this.data.length;J++){const ne=this.data[J],q=ne.xp,ee=ne.yp;x&&ne.o===null||(q===null||ee===null?N=void 0:(Ot(N==null?void 0:N.y)&&!this.isExistGrp||!x&&(Ot(N==null?void 0:N.y)||Ot(ne.o))?(n.moveTo(q,ee),D=q,O=ee):(q!==D||ee!==O)&&(n.lineTo(q,ee),D=q,O=ee),N=ne))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const J=this.data.some(ae=>ae.o<0),ne=J?Z(0):i.y2-s.bottom,q=S("fill",this.fillColor||C,w);if((Q=this.fill)!=null&&Q.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,J?oe:q),be.addColorStop(.5,q),be.addColorStop(1,oe),n.fillStyle=be}else n.fillStyle=q;let ee=null,$=null;const de=[],me=this.data.length;for(let ae=0;ae<me+1;ae++){const xe=(U=this.data[ae])==null?void 0:U.o;if(x&&ub(xe)||!x&&Ot(xe)){if(ee!==null&&$!==null){let be=ee-1;for(let oe=ae-1;oe>=ee;oe--){const re=(j=this.data[oe])==null?void 0:j.o;if(!Ot(re)&&re!==null){be=oe;break}}de.push([ee,be]),ee=null,$=null}}else x&&xe===null||(ee=ee===null?ae:ee),$=ae}de.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=S("stroke",C,b);const J=S("focus",k,1),ne=S("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 ee=g.length?new Set(g):null,$=this.pointSize,de=this.pointStyle,me=this.data,ae=me.length,xe=!nC.has(de),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(x)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=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 Ee=me[pe];Ie===2?(re===null&&(re=[]),re.push(Ee)):(oe||(n.beginPath(),oe=!0),n.moveTo(Ee.xp+$,Ee.yp),n.arc(Ee.xp,Ee.yp,$,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+$,Ie.yp),n.arc(Ie.xp,Ie.yp,$,0,Fr)}n.fillStyle=J,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,te.drawPointBatch(n,de,$,oe)),re!==null&&(n.fillStyle=J,te.drawPointBatch(n,de,$,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=F.colorStringToRgba(this.color,0),s.fillStyle=F.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??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,R)=>M+R,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 R=d?p:c;for(let S=0;S<R.length;S++){const x=Math.abs(l-R[S].xp);x<=M&&(w=!0,M=x,g=d?R[S].originalIndex:S)}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=>!F.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 sC{constructor(e,n,i,s=!1){const l=Mo({},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]=zt[i%zt.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=F.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=F.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(F.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")?F.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=te.calculateX(e.x,r.graphMin,r.graphMax,d,f);const p=te.calculateY(a&&e.y>c.graphMax?c.graphMax:e.y,c.graphMin,c.graphMax,h,m);g!==null&&!this.realTimeScatter&&(g+=F.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=F.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),R=this.getCachedColor(w,M);if(h){const S=`${T} ${R}`;let x=u.get(S);x||(x={strokeStyle:T,fillStyle:R,points:[]},u.set(S,x)),x.points.push(m),c.add(p)}else n.strokeStyle=T,n.fillStyle=R,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,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 R;if(l?R=l.sId===this.sId:u?R=s.get(M.k??F.coordinateKey(M.x,M.y))===this.sId:R=!0,R&&M.xp!==null&&M.yp!==null){const S=M.y>r.graphMax&&this.overflowColor,x=S||M.color||this.color,I=S||M.color||this.pointFill||this.color,L=this.getOpacity(e,x,w),v=this.getOpacity(e,I,w),W=this.getCachedColor(x,L),E=this.getCachedColor(I,v);if(f){const G=`${W} ${E}`;let V=m.get(G);V||(V={strokeStyle:W,fillStyle:E,points:[]},m.set(G,V)),V.points.push(M)}else n.strokeStyle=W,n.fillStyle=E,te.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,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(!p.drawn&&!(r&&l.get(p.k??F.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),te.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),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 Ar{constructor(e,n,i,s){const l=Xe({},n,$S);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=zt[i%zt.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,R=te.calculateX(0,g.graphMin,g.graphMax,k),S=te.calculateY(0,p.graphMin,p.graphMax,T),x=u?w+R:w,I=u?M:M+S,L=u?T:k,v=L/(y||1);let W;e.cPadRatio>=1||e.cPadRatio<=0?W=2:W=Math.max(L*(e.cPadRatio/2)/y,2);let G,V,X;G=v>W*2?v-W*2:v,G=this.isExistGrp?G:G/h;const Z=this.calculateBarSize(d,G);V=u?null:Z,X=u?Z:null;const N=u?(G-X)/2:(G-V)/2,D=this.isExistGrp?1:c+1;this.size.cat=v,this.size.bar=G,this.size.cPad=W,this.size.bPad=N,this.size.w=V,this.size.h=X,this.size.ix=D,this.chartRect=l,this.labelOffset=a,this.borderRadius=e.borderRadius,this.filteredCount=y;const O=ve(C)?C:0,z=ve(b)?b:this.data.length-1;this.visibleStartIndex=O;for(let B=O;B<=z;B++){const Y=B-O,P=this.data[B];if(P){const H=u?I-v*Y-W:x+v*Y+W;if(u?(f=x,m=Math.round(H-(G*D-(X+N)))):(f=Math.round(H+(G*D-(V+N))),m=I),u){const K=P.b?P.o:P.x,Q=e.displayOverflow&&K>g.graphMax?g.graphMax:K;V=te.calculateX(Q,g.graphMin,g.graphMax,k,-R),P.b&&(f=te.calculateX(P.b,g.graphMin,g.graphMax,k,x-R));const U=K>0?-1:1;V=K&&V!==null&&Math.abs(V)===0?U:V}else{const K=P.b?P.o:P.y,Q=e.displayOverflow&&K>p.graphMax?p.graphMax:K;X=te.calculateY(Q,p.graphMin,p.graphMax,T,-S),P.b&&(m=te.calculateY(P.b,p.graphMin,p.graphMax,T,I-S));const U=K>0?-1:1;X=K&&X!==null&&Math.abs(X)===0?U:X}P.xp=f,P.yp=m,P.w=V,P.h=u?-X:X,P.index=B}}n&&(this._lastDataEpoch=e.dataEpoch,this._lastScaleVersion=e.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(e){var Y,P,H,K,Q;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),R=i.chartHeight-(s.top+s.bottom),S=i.x1+s.left,x=i.y2-s.bottom,I=te.calculateX(0,g.graphMin,g.graphMax,M),L=te.calculateY(0,p.graphMin,p.graphMax,R),v=h?S+I:S,W=h?x:x+L,E=h?R:M,G=E/(w||1);let V;e.cPadRatio>=1||e.cPadRatio<=0?V=2:V=Math.max(E*(e.cPadRatio/2)/w,2);let Z,N,D;Z=G>V*2?G-V*2:G,Z=this.isExistGrp?Z:Z/c;const O=this.calculateBarSize(r,Z);N=h?null:O,D=h?O:null;const z=h?(Z-D)/2:(Z-N)/2,B=this.isExistGrp?1:a+1;this.size.cat=G,this.size.bar=Z,this.size.cPad=V,this.size.bPad=z,this.size.w=N,this.size.h=D,this.size.ix=B,this.chartRect=i,this.labelOffset=s,this.borderRadius=e.borderRadius,this.filteredCount=w,this.visibleStartIndex=k;for(let U=k;U<=T;U++){const j=U-k,J=this.data[U];if(J){const ne=h?W-G*j-V:v+G*j+V;if(h?(f=v,m=Math.round(ne-(Z*B-(D+z)))):(f=Math.round(ne+(Z*B-(N+z))),m=W),h){const oe=J.b?J.o:J.x,re=d&&oe>g.graphMax?g.graphMax:oe;N=te.calculateX(re,g.graphMin,g.graphMax,M,-I),J.b&&(f=te.calculateX(J.b,g.graphMin,g.graphMax,M,v-I));const pe=oe>0?-1:1;N=oe&&N!==null&&Math.abs(N)===0?pe:N}else{const oe=J.b?J.o:J.y,re=d&&oe>p.graphMax?p.graphMax:oe;D=te.calculateY(re,p.graphMin,p.graphMax,R,-L),J.b&&(m=te.calculateY(J.b,p.graphMin,p.graphMax,R,W-L));const pe=oe>0?-1:1;D=oe&&D!==null&&Math.abs(D)===0?pe:D}const q=J.dataColor||this.color,ee=e==null?void 0:e.legendHitInfo,$=(Y=e==null?void 0:e.selectLabel)==null?void 0:Y.option,de=(P=e==null?void 0:e.selectItem)==null?void 0:P.option,me=((K=(H=e==null?void 0:e.selectLabel)==null?void 0:H.selected)==null?void 0:K.dataIndex)??[],{dataIndex:ae,seriesID:xe}=((Q=e==null?void 0:e.selectItem)==null?void 0:Q.selected)??{};let be=!1;if(ee?be=(ee==null?void 0:ee.sId)!==this.sId:$!=null&&$.use&&($!=null&&$.useSeriesOpacity)?be=me.length&&!me.includes(U):yt(ae)&&(de!=null&&de.useSeriesOpacity)&&(this.isExistGrp?be=ae!==U:be=ae!==U||xe!==this.sId),typeof q!="string")n.fillStyle=te.createGradient(n,h,{x:f,y:m,w:N,h:D},q,be,e.unSelectedOpacity);else{const oe=q.includes("rgba")?F.getOpacity(q):1,re=be?e.unSelectedOpacity:oe;n.fillStyle=F.colorStringToRgba(q,re)}this.drawBar({ctx:n,positions:{x:f,y:m,w:N,h:D}}),u.use&&this.drawValueLabels({context:n,data:J,positions:{x:f,y:m,h:D,w:N},isHighlight:!1,textColor:J.dataTextColor,index:U})}}}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 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=F.labelSignFormat(b,f)??"");const w=b<0,M=Math.round(C.measureText(T).width),R=c,S=r&&h!=="end"?10:4,x=w?m-S:m+S,I=w?g+S:g-S,L=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),V=E-S,X=G-S,Z=M<=E&&E>=R;switch(h){case"start":{if(r){if(M<V&&R<G){const N=w?x-M:x;C.fillText(T,N,W)}}else if(Z&&R+S<=G){const N=w?g+R/2+S:g-R/2-S;C.fillText(T,L,N)}break}case"center":{r?M<V&&R<G&&C.fillText(T,L,W):Z&&R<X&&C.fillText(T,L,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,D=this.chartRect.x2-this.labelOffset.right;if(R<this.size.bar)if(w){const O=m-S+p-M;O>N&&C.fillText(T,O,W)}else{const O=m+S+p;O+M<D&&C.fillText(T,O,W)}}else{const N=this.chartRect.y1+this.labelOffset.top,D=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(w){const O=g+y+S+R/2;O+R/2<=D&&C.fillText(T,L,O)}else{const O=g+y-S-R/2;O-R/2>=N&&C.fillText(T,L,O)}}break}default:case"end":{if(r){if(M<V&&R<G){const N=w?m+p+S:m+p-M-S;C.fillText(T,N,W)}}else if(w){const N=g+y-R/2-S;N>I&&Z&&R+S<=G&&C.fillText(T,L,N)}else Z&&R+S<=G&&C.fillText(T,L,g+y+R/2+S);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()}findItems({xsp:e,width:n}){if(!this.show||this.isHorizontal)return[];const i=e+n,s=this.visibleStartIndex??0,l=this.filteredCount??this.data.length,a=Math.min(s+l-1,this.data.length-1);return this.data.slice(s,a+1).filter(({xp:r,w:c})=>r!=null&&r<=i&&r+c>=e)}}class oC extends Ar{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 R=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 S=a?null:R,x=a?null:R,I=a?R:null;const L=a?(w-I)/2:(w-S)/2,v=this.isExistGrp?1:l+1;this.size.cat=k,this.size.bar=w,this.size.cPad=T,this.size.bPad=L,this.size.w=S,this.size.ix=v,this.chartRect=n,this.labelOffset=i,this.borderRadius=e.borderRadius,this.data.forEach(W=>{a?(d=p,h=te.calculateY(W.y,f.graphMin,f.graphMax,g,y)):(d=te.calculateSubX(W.x,u.graphMin,u.graphMax,m,p),d<p?(x-=p-d,d=d+S<p?null:p):d+S>C&&(x-=x-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(w*v)-Math.round(S+L)),h=y),a?W.b?(S=te.calculateX(W.x-W.b,u.graphMin,u.graphMax,m),d=te.calculateX(W.b,u.graphMin,u.graphMax,m,p)):S=te.calculateX(W.x,u.graphMin,u.graphMax,m):W.b?(I=te.calculateY(W.y-W.b,f.graphMin,f.graphMax,g),h=te.calculateY(W.b,f.graphMin,f.graphMax,g,y)):I=te.calculateY(W.y,f.graphMin,f.graphMax,g),d!==null&&h!==null&&typeof(W.dataColor||this.color)!="string"&&(S=S!==x?x:S),x=S,W.xp=d,W.yp=h,W.w=S,W.h=a?-I:I})}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 S=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 x=r?null:S,I=r?null:S,L=r?S:null;const v=r?(M-L)/2:(M-x)/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=x,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=te.calculateY(E.y,m.graphMin,m.graphMax,p,C)):(h=te.calculateSubX(E.x,f.graphMin,f.graphMax,g,y),h<y?(I-=y-h,h=h+x<y?null:y):h+x>b&&(I-=I-(b-h)),h>=b&&(h=null),h!==null&&(h+=Math.ceil(M*W)-Math.round(x+v)),u=C),r?E.b?(x=te.calculateX(E.x-E.b,f.graphMin,f.graphMax,g),h=te.calculateX(E.b,f.graphMin,f.graphMax,g,y)):x=te.calculateX(E.x,f.graphMin,f.graphMax,g):E.b?(L=te.calculateY(E.y-E.b,m.graphMin,m.graphMax,p),u=te.calculateY(E.b,m.graphMin,m.graphMax,p,C)):L=te.calculateY(E.y,m.graphMin,m.graphMax,p),h!==null&&u!==null){const V=E.dataColor||this.color,X=V.includes("rgba")?F.getOpacity(V):1,Z=this.state==="downplay"?e.unSelectedOpacity:X;typeof V!="string"?(x=x!==I?I:x,n.fillStyle=te.createGradient(n,r,{x:h,y:u,w:x,h:L},V,this.state==="downplay",e.unSelectedOpacity)):n.fillStyle=F.colorStringToRgba(V,Z),this.drawBar({ctx:n,positions:{x:h,y:u,w:x,h:L}}),this.showValue.use&&this.drawValueLabels({context:n,data:E,positions:{x:h,y:u,h:L,w:x},isHighlight:!1,index:G})}I=x})}}class lC{constructor(e,n,i){const s=Mo({},qS,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=zt[i%zt.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")?F.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=F.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=F.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")?F.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:m;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=F.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 aC{constructor(e,n,i,s,l){const a=Mo({},eC,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("#")?F.hexToRgb(s):s.replace(i,""),u=l.includes("#")?F.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,R=+m-k*w,S=+g-T*w;n.push({id:`color#${w}`,color:`rgb(${M},${R},${S})`,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=F.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 k=f.o;if(p!==null&&y!==null&&k!==null&&k!==void 0){const{show:w,dataColor:M,id:R}=this.getItemInfo(k);if(f.dataColor||(f.dataColor=M),f.cId=R,w){let S=this.stroke;const x=s==null?void 0:s.option,I=(x==null?void 0:x.use)&&(x==null?void 0:x.showBorder),L=m===((T=s==null?void 0:s.selected)==null?void 0:T.dataIndex);if(I&&L&&(S={show:x==null?void 0:x.showBorder,...x==null?void 0:x.borderStyle}),S.show&&S.lineWidth>0){const{lineWidth:v}=S,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:R}=r,{option:S,selected:x}=l,I=yt(R==null?void 0:R.dataIndex)&&(R==null?void 0:R.dataIndex)>-1,L=((k=x==null?void 0:x.label)==null?void 0:k.length)>0;return I?w=M.useSeriesOpacity?b!==(R==null?void 0:R.dataIndex):!1:L&&(w=S.useSeriesOpacity?!((T=x==null?void 0:x.label)!=null&&T.includes(this.getItemLabel(l,y))):!1),w?.1:C}return C};this.data.forEach((y,C)=>{var S;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 R=y.o;if(k!==null&&T!==null&&R!==null&&R!==void 0){const{show:x,opacity:I,dataColor:L,id:v}=this.getItemInfo(R);let W=I;I===1&&F.getColorStringType(y.dataColor)==="RGBA"&&(W=F.getOpacity(y.dataColor));const E=p(y,W,C);if(y.dataColor||(y.dataColor=L),y.cId=v,n.save(),x){n.fillStyle=F.colorStringToRgba(y.dataColor,E);let G=this.stroke;const V=r==null?void 0:r.option,X=(V==null?void 0:V.use)&&(V==null?void 0:V.showBorder),Z=C===((S=r==null?void 0:r.selected)==null?void 0:S.dataIndex);X&&Z&&(G={show:V==null?void 0:V.showBorder,...V==null?void 0:V.borderStyle});let N=!1;if(G.show&&G.lineWidth>0){const{color:D,lineWidth:O,opacity:z}=G,B=O*2;N=B<Math.floor(w)&&B<Math.floor(M),n.strokeStyle=N?F.colorStringToRgba(D,E===1?z:E):void 0,N?(n.lineWidth=O,k+=O,T+=O,w-=B,M-=B):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=F.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=F.getColorStringType(i.dataColor)==="RGBA"?e.dataColor:F.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,R,S;k==="x"?(R=p,S=u+r):(R=y,S=m),a[k].findIndex((I,L)=>(M=S+R*L,M<=T&&T<=M+R))>-1?C[w]=["xsp","ysp"].includes(w)?M:M+R:T<S&&(C[w]=S)};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,R=(u-h)/w,S=n+s,x=i+l,I={min:Math.floor((n-c)/M),max:Math.floor((S-c-M)/M)},L=w-1,v={min:L-Math.round((x-h-R)/R),max:L-Math.round((i-h)/R)},W=this.getFilteredLabel(f,T,p,y),E=this.getFilteredLabel(m,w,b,k);r={xMin:W[I.min],xMax:W[I.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 Kr={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:He(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 iC(n,i,s);else if(e==="scatter")this.seriesInfo.charts.scatter.push(n),a=new sC(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 oC(n,i,s,l):a=new Ar(n,i,s,l);else if(e==="pie")this.seriesInfo.charts.pie.push(n),a=new lC(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 aC(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=QS[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:F.calcTextSizeCanvas(c,F.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(e,n,i=[]){const s=F.getLabelStyle(this.labelStyle);return[...(e??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=F.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=F.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,R,S,x,I,L,v,W,E,G,V,X,Z,N,D,O;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=F.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=F.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 z=p-g,B=z/h,Y=[],P=i.interval;let H=null,K=null,Q=g,U=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const J=Math.floor(u/P)*P;J!==+u&&(U=J+P,Q+=z/(f-u)*(U-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,k=F.aliasPixel(r.lineWidth);let j;for(let J=0;J<=h;J++)if(H=Math.round(Q+B*J),H<=p||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),Y[J]=U+J*m,Y[J]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,K=H+k,j=this.getLabelFormat(Math.min(f,Y[J]),{prev:Y[J-1]??""});const q=((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.use)&&((S=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:S.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((x=l==null?void 0:l.dataIndex)==null?void 0:x.length)&&!(l!=null&&l.label.map(me=>this.getLabelFormat(Math.min(f,me),{prev:Y[J-1]??""})).includes(j));let ee;J===h&&this.lastLabelFontStyle?(r.font=F.getLabelStyle(this.lastLabelFontStyle),ee=this.lastLabelFontStyle.color):J===0&&this.firstLabelFontStyle?(r.font=F.getLabelStyle(this.firstLabelFontStyle),ee=this.firstLabelFontStyle.color):(r.font=F.getLabelStyle(this.labelStyle),ee=this.labelStyle.color);let $=1;F.getColorStringType(ee)==="RGBA"&&($=F.getOpacity(ee)),r.fillStyle=F.colorStringToRgba(ee,q?(I=this.options)==null?void 0:I.unSelectedOpacity:$);let de;if(this.type==="x"){if(de=this.position==="top"?y-10:y+10,((L=c==null?void 0:c.brush)!=null&&L.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(j),H,de),!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===j){const ae=Math.round(r.measureText((E=this.labelStyle)==null?void 0:E.fontSize).width);F.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(me).width)+10,height:ae,x:H,y:de+(ae-2),borderRadius:2,arrowSize:3,text:j,backgroundColor:(V=(G=c==null?void 0:c.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:V.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(K,y),r.lineTo(K,y+b),r.stroke(),r.closePath()),(J!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(K,y),r.lineTo(K,C),r.stroke(),r.closePath())}else de=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(j),de,H),J===h&&(K-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(y+(this.axisLineWidth??1),K),r.lineTo(y-b,K),r.stroke(),r.closePath()),J!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(y,K),r.lineTo(C,K),r.stroke(),r.closePath())}}((D=this.plotBands)!=null&&D.length||(O=this.plotLines)!=null&&O.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,Ao),{from:w,to:M,label:R,border:S}=T,x=F.isNullOrUndefined(w)?n:Math.max(w,n),I=F.isNullOrUndefined(M)?i:Math.min(M,i);let L,v;if(this.type==="x"){if(L=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),L===null||v===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(L,v,h,u,f,m,S)}else{if(L=te.calculateY(x,n,i,c,m),v=te.calculateY(I,n,i,c,m),L===null||v===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(L,v,h,u,f,m,S)}this.drawPlotBandLabel(L,v,R,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const T=Xe({},k,Fo),{value:w,label:M}=T;let R;if(this.type==="x"){if(R=te.calculateX(w,n,i,r,h),R===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(R,h,u,f,m)}else{if(R=te.calculateY(w,n,i,c,m),R===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(R,h,u,f,m)}this.drawPlotLineLabel(R,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+=F.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+=F.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,zr),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=!F.isNullOrUndefined(u)&&d<u,m=!f&&!F.isNullOrUndefined(h)&&d<h,g=s.text!=null?String(s.text):"",p=!F.isNullOrUndefined(i)&&Number.isFinite(+i);let y="";if(s.showValue&&p)if(typeof s.valueFormatter=="function"){const L=s.valueFormatter(i);y=L==null?String(this.getLabelFormat(i)):String(L)}else y=String(this.getLabelFormat(i));let C;s.showValue?C=m?y:[g,y].filter(L=>L).join(" "):C=g,l.save(),l.font=F.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=F.truncateLabelWithEllipsis(C,T,l),k=l.measureText(b).width),l.restore();const w=c/4,M=s.padding;let R=w,S=w,x=w,I=w;return typeof M=="number"?(R=M,S=M,x=M,I=M):M&&typeof M=="object"&&(R=M.top??w,S=M.right??w,x=M.bottom??w,I=M.left??w),{...s,label:b,fontSize:c,labelWidth:k,padTop:R,padRight:S,padBottom:x,padLeft:I,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,R;if(this.type==="x")switch(u==="innerEnd"?(R=C-h,w=R-k):(w=y+h,R=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":R=e-h,w=R-k;break;case"bottom":w=e+h,R=w+k;break;default:w=e-k/2,R=e+k/2;break}let S;return this.type==="x"?S=u==="innerEnd"?"top":"bottom":f==="top"?S="bottom":f==="bottom"?S="top":S=null,{textX:T+d+s/2,textY:w+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:T,top:w,right:M,bottom:R},pointerEdge:S}}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=F.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,R;switch(n){case"top":b=y-h,k=e.top,T=y+h,w=e.top,M=p,R=e.top-d;break;case"left":b=e.left,k=C-h,T=e.left,w=C+h,M=e.left-d,R=C;break;case"right":b=e.right,k=C-h,T=e.right,w=C+h,M=e.right+d,R=C;break;case"bottom":default:b=y-h,k=e.bottom,T=y+h,w=e.bottom,M=p,R=e.bottom+d;break}c.beginPath(),c.moveTo(b,k),c.lineTo(M,R),c.lineTo(T,w),c.closePath(),c.fillStyle=i,c.fill(),l>0&&(c.beginPath(),c.moveTo(b,k),c.lineTo(M,R),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?F.truncateLabelWithEllipsis(e,n,this.ctx,i):e}}function rC(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 _r(t){return t.hour()===0&&t.minute()===0&&t.second()===0&&t.millisecond()===0?t:t.startOf("day")}function cC(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 _r(t.add(n*7,"day"));case"day":return _r(t.add(n,"day"));default:return Pe(t.valueOf()+e.ms)}}function dC(t,e){return e.unit?cC(Pe(t),e).valueOf():t+e.ms}function hC(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"),l=i.startOf("day"),a=Math.round((l.valueOf()-s.valueOf())/Ct.day.size),r=l.valueOf()>=t?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"day").valueOf()}if(e.unit==="week"){const s=i.startOf("year"),l=s.subtract((s.day()+6)%7,"day"),a=i.subtract((i.day()+6)%7,"day").startOf("day"),r=Math.round((a.valueOf()-l.valueOf())/Ct.week.size),c=a.valueOf()>=t?r:r+1,d=Math.ceil(c/n)*n;return l.add(d*7,"day").valueOf()}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 uC(t,e,n){const i=[];let s=hC(t,n);const l=1e4;for(;s<=e&&i.length<l;)i.push(s),s=dC(s,n);return i}const Ko=864e5,fC=["millisecond","second","minute","hour"],_o=new Map;function mC(t){if(_o.has(t))return _o.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 _o.set(t,i),i}function Ur(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 pC(t,e,n){const i=s=>Math.floor(e/s)+1<=n;if(i(t.ms))return t;if(t.unit&&fC.includes(t.unit)&&Ko%t.ms===0){const s=mC(Ko/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 Ur({ms:Ko,unit:"day",time:1},e,n)}return Ur(t,e,n)}function Jr(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 gC extends bi{normalizeTimeValue(e){return Jr(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:F.calcTextSizeCanvas("",F.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=rC(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:pC(c,d,s),u=h.ms,f=uC(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,R,S,x,I,L,v,W,E,G,V,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=F.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=F.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 D=c.x2-c.x1,O=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=F.aliasPixel(a.lineWidth);let z;for(let B=0;B<u.length;B++){const Y=u[B];let P;if(this.type==="x"?P=te.calculateX(Y,d,h,D,c.x1):P=te.calculateY(Y,d,h,O,c.y2),P===null)continue;Y===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const K=P+C;z=this.getLabelFormat(Y,{prev:u[B-1]??""});const Q=((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")&&((R=l==null?void 0:l.dataIndex)==null?void 0:R.length)&&!(l!=null&&l.label.map(ne=>this.getLabelFormat(ne,{prev:u[B-1]??""})).includes(z));let U;B===u.length-1&&this.lastLabelFontStyle?(a.font=F.getLabelStyle(this.lastLabelFontStyle),U=this.lastLabelFontStyle.color):B===0&&this.firstLabelFontStyle?(a.font=F.getLabelStyle(this.firstLabelFontStyle),U=this.firstLabelFontStyle.color):(a.font=F.getLabelStyle(this.labelStyle),U=this.labelStyle.color);let j=1;F.getColorStringType(U)==="RGBA"&&(j=F.getOpacity(U)),a.fillStyle=F.colorStringToRgba(U,Q?(S=this.options)==null?void 0:S.unSelectedOpacity:j);let J;if(this.type==="x"){if(J=this.position==="top"?g-10:g+10,((x=r==null?void 0:r.brush)!=null&&x.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(z),P,J),!Q&&((I=r==null?void 0:r.selectItem)!=null&&I.showLabelTip)&&(s!=null&&s.label)&&!((L=this.options)!=null&&L.horizontal)){const ne=this.getLabelFormat(s.label);if(ne===z){const q=Math.round(a.measureText((v=this.labelStyle)==null?void 0:v.fontSize).width);F.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ne).width)+10,height:q,x:P,y:J+(q-2),borderRadius:2,arrowSize:3,text:z,backgroundColor:(E=(W=r==null?void 0:r.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:E.backgroundColor,textColor:(V=(G=r==null?void 0:r.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:V.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(K,g),a.lineTo(K,g+y),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(K,g),a.lineTo(K,p),a.stroke(),a.closePath())}else{J=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(z),J,P);let ne=K;B===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,Ao),{from:w,to:M,label:R,border:S}=T,x=F.isNullOrUndefined(w)?n:Math.max(w,n),I=F.isNullOrUndefined(M)?i:Math.min(M,i);let L,v;if(this.type==="x"){if(L=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),L===null||v===null)return;this.setPlotBandStyle(T),this.drawXPlotBand(L,v,h,u,f,m,S)}else{if(L=te.calculateY(x,n,i,c,m),v=te.calculateY(I,n,i,c,m),L===null||v===null)return;this.setPlotBandStyle(T),this.drawYPlotBand(L,v,h,u,f,m,S)}this.drawPlotBandLabel(L,v,R,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const T=Xe({},k,Fo),{value:w,label:M}=T;let R;if(this.type==="x"){if(R=te.calculateX(w,n,i,r,h),R===null)return;this.setPlotLineStyle(T),this.drawXPlotLine(R,h,u,f,m)}else{if(R=te.calculateY(w,n,i,c,m),R===null)return;this.setPlotLineStyle(T),this.drawYPlotLine(R,h,u,f,m)}this.drawPlotLineLabel(R,M,g,l,w)})}}class bC 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 F.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 tC){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 S=Math.round(M);return f(T),{steps:S,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:F.calcTextSizeCanvas(m,F.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:F.calcTextSizeCanvas(h,F.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class yC 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=F.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:F.calcTextSizeCanvas(r,F.getLabelStyle(this.labelStyle))}}calculateSteps(e,n){const i=e.maxValue,s=e.minValue,l=e.maxSteps,a=F.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 F.labelSignFormat(e,this.decimalPoint)}getInterval(e){const n=e.maxValue,i=e.minValue;return 10**F.calculateMagnitude(n-i)}}const Uo=new WeakMap;class xC 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?(Uo.has(this.labels)||Uo.set(this.labels,F.getStringMinMax(this.labels)),Uo.get(this.labels)):F.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:F.calcTextSizeCanvas(this.getLabelFormat(l,u),F.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,R,S,x,I;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=F.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 L=F.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+L),a.lineTo(m,g+L)):(a.moveTo(g+L,f),a.lineTo(g+L,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 V,X,Z;for(Z=0;Z<d;Z+=h){const N=u+Z,D=this.labels[N];E=Math.round(f+v*Z),G=E+L,V=this.getLabelFormat(D,y);const{selectLabel:O,selectItem:z,horizontal:B}=this.options;let Y;l!=null&&l.targetAxis?Y=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":Y=B?"y":"x";const P=(O==null?void 0:O.use)&&(O==null?void 0:O.useLabelOpacity)&&Y===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 H;Z===d-1&&this.lastLabelFontStyle?(a.font=F.getLabelStyle(this.lastLabelFontStyle),H=this.lastLabelFontStyle.color):Z===0&&this.firstLabelFontStyle?(a.font=F.getLabelStyle(this.firstLabelFontStyle),H=this.firstLabelFontStyle.color):(a.font=F.getLabelStyle(this.labelStyle),H=this.labelStyle.color);let K=1;if(F.getColorStringType(H)==="RGBA"&&(K=F.getOpacity(H)),a.fillStyle=F.colorStringToRgba(H,P?(w=this.options)==null?void 0:w.unSelectedOpacity:K),this.type==="x"){X=this.position==="top"?g-10:g+10;const Q=W?E:E+v/2;if(a.fillText(this.checkFixWidth(V),Q,X),!P&&(z!=null&&z.showLabelTip)&&(s!=null&&s.label)&&!B){const U=s.label;if(U===V){const j=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);F.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(U).width)+10,height:j,x:E+v/2,y:X+(j-2),borderRadius:2,arrowSize:3,text:V,backgroundColor:(R=z==null?void 0:z.labelTipStyle)==null?void 0:R.backgroundColor,textColor:(S=z==null?void 0:z.labelTipStyle)==null?void 0:S.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 Q=W?E:E+v/2;a.fillText(this.checkFixWidth(V),X,Q),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),Q),a.lineTo(g-C,Q),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 O=Math.round(f+v*(d-1)),z=W?O:O+v/2,B=this.getLabelFormat(r[N],y);a.font=this.lastLabelFontStyle?F.getLabelStyle(this.lastLabelFontStyle):F.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),z,X):a.fillText(this.checkFixWidth(B),X,z),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(z,g),a.lineTo(z,g+C)):(a.moveTo(g+(this.axisLineWidth??1),z),a.lineTo(g-C,z)),a.stroke(),a.closePath())}}if(W&&!this.showLastLabel){const N=M0(+r[1],+r[0]),D=Yo(+r[r.length-1],N);if(isNaN(D))return;E=Math.round(f+v*this.labels.length),G=E+L;const O=this.getLabelFormat(`${D}`,y),z=E+v/2;a.font=F.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(O),E,X):a.fillText(this.checkFixWidth(O),X,E),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(z,g),a.lineTo(z,g+C)):(a.moveTo(g+(this.axisLineWidth??1),G),a.lineTo(g-C,G)),a.stroke(),a.closePath())}a.closePath()}((x=this.plotBands)!=null&&x.length||(I=this.plotLines)!=null&&I.length)&&(this._plotGeom={aPos:c,startPoint:f,endPoint:m,chartRect:e,aliasPixel:F.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(F.isNullOrUndefined(b.from)&&F.isNullOrUndefined(b.to))return;const k=Xe({},b,Ao),{from:T=0,to:w=e.length,label:M,border:R}=k,S=Math.round(i+f*T),x=Math.round(i+f*w);this.setPlotBandStyle(k),this.type==="x"?this.drawXPlotBand(S,x,c,d,h,u,R):this.drawYPlotBand(S,x,c,d,h,u,R),this.drawPlotBandLabel(S,x,M,m,l,T,w)}),(C=this.plotLines)==null||C.forEach(b=>{if(F.isNullOrUndefined(b.value))return;const k=Xe({},b,Fo),{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=F.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return F.truncateLabelWithEllipsis(e,n,i,s)}getLabelWidthHasMaxLength(e,n,i=[]){const s=F.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=F.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class SC 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,V,X,Z,N,D,O,z,B,Y,P,H,K,Q,U;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=F.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=F.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 R=null,S=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let x,I,L;const v=d<=2?Math.max(1,m-1):Math.round(m/d),W=v===m?m:m-1;for(L=0;L<=W;L+=v){M[L]=Pe(h).valueOf()+L*f,R=Math.round(g+w*L),S=R+k;let j;for(let ee=0;ee<M.length;ee++)M[ee]!==void 0&&ee!==L&&(j=M[ee]);x=this.getLabelFormat(Math.min(u,M[L]),{prev:j});const J=((G=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:G.use)&&((X=(V=this.options)==null?void 0:V.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:j})).includes(x)),ne=this.labelStyle.color;let q=1;if(F.getColorStringType(ne)==="RGBA"&&(q=F.getOpacity(ne)),a.fillStyle=F.colorStringToRgba(ne,J?(N=this.options)==null?void 0:N.unSelectedOpacity:q),this.type==="x"){if(I=this.position==="top"?y-10:y+10,a.fillText(this.checkFixWidth(x),R,I),!J&&((O=(D=this.options)==null?void 0:D.selectItem)!=null&&O.showLabelTip)&&(s!=null&&s.label)&&!((z=this.options)!=null&&z.horizontal)){const ee=this.getLabelFormat(Math.min(u,s.label+0*f));if(ee===x){const $=Math.round(a.measureText((B=this.labelStyle)==null?void 0:B.fontSize).width);F.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ee).width)+10,height:$,x:R,y:I+($-2),borderRadius:2,arrowSize:3,text:x,backgroundColor:(H=(P=(Y=this.options)==null?void 0:Y.selectItem)==null?void 0:P.labelTipStyle)==null?void 0:H.backgroundColor,textColor:(U=(Q=(K=this.options)==null?void 0:K.selectItem)==null?void 0:Q.labelTipStyle)==null?void 0:U.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(S,y),a.lineTo(S,y+b),a.stroke(),a.closePath()),L<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(S,y),a.lineTo(S,C),a.stroke(),a.closePath())}else I=this.position==="left"?y-10:y+10,a.fillText(this.checkFixWidth(x),I,R),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(y+(this.axisLineWidth??1),S),a.lineTo(y-b,S),a.stroke(),a.closePath()),L<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(y,S),a.lineTo(C,S),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&T&&L*v===m){const j=Pe(r[1]).diff(Pe(r[0])),J=this.getLabelFormat(Pe(M[m-1]+j));R=Math.round(g+w*m),S=R+k,this.type==="x"?(a.fillText(this.checkFixWidth(J),R,I),this.showGrid&&(a.moveTo(S,y),a.lineTo(S,C))):(a.fillText(this.checkFixWidth(J),I,R),this.showGrid&&(a.moveTo(y,S),a.lineTo(C,S))),a.stroke()}a.closePath()}}const CC={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`}},kC={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,F.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=F.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?F.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,F.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=F.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?F.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",F.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(),F.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=F.labelSignFormat(+n,e)),i}},jr=28,wC={width:70,height:60},IC={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>jr?jr: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 R=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");R[0].style.cssText=g+y,R[1].style.cssText=g+C;const S=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");S[0].style.backgroundColor=this.isSide?u:h,S[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}=wC,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`)}},LC={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)||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=!He((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 R=(T=s==null?void 0:s[0])==null?void 0:T.range,S=this.scrollbar[t].range;if(!M&&(R!=null&&R.length)&&(S!=null&&S.length)){const x=R[1]-R[0],I=this.scrollbar[t].anchorEdge,L=I?this.getScrollbarLimits(t):null;I==="start"&&L?this.scrollbar[t].range=[L.limitMin,L.limitMin+x]:I==="end"&&L?this.scrollbar[t].range=[L.limitMax-x,L.limitMax]:this.scrollbar[t].range=[S[0],S[0]+x]}else this.scrollbar[t].range=R!=null&&R.length?[...R]: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 R,S;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=(R=this.options.title)!=null&&R.show?(S=this.options.title)==null?void 0:S.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 x=i.getElementsByClassName("ev-chart-scrollbar-button-up"),I=Math.floor(f-m.size),L=Math.floor(m.position)>I?.5:1;x[0].style.cssText=`background-color: ${n.background};${b}`,x[0].style.opacity=L,x[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,R=s.deltaY<0,S=s.deltaY>0;if(!(w&&R||M&&S))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,[R,S]=s;if(k>0){const x=a+(M-+R);T=+R+x,w=T+(+S-+R)}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 TC(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")}function Qr(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,TC(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(I){const L=i,v=s;return i=s=void 0,d=I,a=t.apply(v,L),a}function p(I,L){return m?(window.cancelAnimationFrame(r),window.requestAnimationFrame(I)):setTimeout(I,L)}function y(I){if(m)return window.cancelAnimationFrame(I);clearTimeout(I)}function C(I){return d=I,r=p(T,e),h?g(I):a}function b(I){const L=I-c,v=I-d,W=e-L;return u?Math.min(W,l-v):W}function k(I){const L=I-c,v=I-d;return c===void 0||L>=e||L<0||u&&v>=l}function T(){const I=Date.now();if(k(I))return w(I);r=p(T,b(I))}function w(I){return r=void 0,f&&i?g(I):(i=s=void 0,a)}function M(){r!==void 0&&y(r),d=0,i=c=s=r=void 0}function R(){return r===void 0?a:w(Date.now())}function S(){return r!==void 0}function x(...I){const L=Date.now(),v=k(L);if(i=I,s=this,c=L,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 x.cancel=M,x.flush=R,x.pending=S,x}const MC="Expected a function";function vC(t,e,n){let i=!0,s=!0;if(typeof t!="function")throw new TypeError(MC);return Qr(t,e,{leading:i,maxWait:e,trailing:s})}const RC={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 R=C.slice().sort();for(let S=0;S<R.length;S++){const x=R[S];k+=`|${x}:${g.items[x].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 S=[];for(let x=0;x<C.length;x++){const I=C[x],L=g.items[I];S.push({sId:I,data:L.data,color:L.color,name:L.name,dataId:L.id,index:L.index})}this.hideTooltipDOM(),u.returnValue(S,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 R=Object.values(this.seriesList||{}).some(S=>S.type==="line");if(u.use&&(f==="line"||R)){const S=this.drawIndicatorForTooltip(g,h.color),x=S==null?void 0:S.labelValue,I=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:I,mousePosition:[c.clientX,c.clientY],dataLabel:x}}}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 R=Object.values(this.seriesList||{}).some(x=>x.type==="line");(f!=="line"&&!R||!u.use||!Object.keys(g.items).length)&&this.drawIndicator(m,h.color);const S=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:S,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 S,x;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],R=w.items[M];R&&(d.label=R.label,d.value=(S=R.data)==null?void 0:S.o,d.seriesId=M,d.dataIndex=R.index,d.acc=(x=R.data)==null?void 0:x.acc)},k=w=>{var L,v;const M=this.findHitItem(h,!0),R=M.hitId??Object.keys(M.items)[0],S=M.items[R],{labelIndex:x}=this.getLabelInfoByPosition(h,w),{dataIndex:I}=this.regulateSelectedLabelInfo(x,w);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(I,w),S&&(d.label=S.label,d.seriesId=R,d.value=(L=S.data)==null?void 0:L.o,d.acc=(v=S.data)==null?void 0:v.acc,d.dataIndex=S.index)},T=()=>{var S,x,I;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],R=w.items[M];if(M!==null){const L=this.updateSelectedSeriesInfo(M,!0);R&&(d.label=R.label,d.value=(S=R.data)==null?void 0:S.o,d.seriesId=(x=L.seriesId)==null?void 0:x.at(0),d.acc=(I=R.data)==null?void 0:I.acc,d.dataIndex=R.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 x,I,L,v;const{labelIndex:R}=this.getLabelInfoByPosition(h,M),{dataIndex:S}=this.regulateSelectedLabelInfo(R,M);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(S,M),M&&(this.defaultSelectInfo.targetAxis=S!=null&&S.length?M:null),d.selected={eventTarget:"label",...Re(this.defaultSelectInfo)},d.label=(I=(x=this.defaultSelectInfo)==null?void 0:x.label)==null?void 0:I.at(0),d.dataIndex=(v=(L=this.defaultSelectInfo)==null?void 0:L.dataIndex)==null?void 0:v.at(0)},T=()=>{const M=this.findHitItem(h,!0),R=M.hitId??Object.keys(M.items)[0],S=M.items[R];if(!Ot(R)){const x=this.updateSelectedSeriesInfo(R,!1);this.defaultSelectInfo.seriesId=x.seriesId,d.selected={eventTarget:"series",...Re(this.defaultSelectInfo)},d.label=S.label,d.dataIndex=S.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:R}=m,S=this.getCurMouseLocation(h);if(S==="chartBackground")this.clearSelectedLabelInfo(),d.deselected={eventTarget:"label"},b();else if(S==="yAxis"||S==="xAxis"){if(this.clearSelectedItemInfo(),d.deselected={eventTarget:"item"},!R&&S!==(M?"yAxis":"xAxis"))return;k(S)}}else if(p)b();else if(y){const{useBothAxis:R}=m,S=this.getCurMouseLocation(h);if((S==="yAxis"||S==="xAxis")&&!R&&S!==(M?"yAxis":"xAxis"))return;S!=="canvas"&&k(R?S: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,horizontal:u}=this.options,f=h==="bar"&&!u,m=!h&&!u;d.use&&(h==="scatter"||h==="line"||h==="heatMap"||f||m)&&(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=vC(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:R}=T;let S,x;if(T.isMove=!0,this.isMouseMove=!0,b<R.x1?S=R.x1:b>R.x2?S=R.x2:S=b,k<R.y1?x=u.y1:k>R.y2?x=R.y2:x=k,e==="heatMap"){const I={xcp:w,xep:S,ycp:M,yep:x,range:R},{xsp:L,ysp:v,width:W,height:E}=this.getDragInfoForHeatMap(I);T.xsp=L,T.ysp=v,T.width=W,T.height=E}else T.xsp=Math.min(w,S),T.ysp=e==="scatter"?Math.min(M,x):R.y1,T.width=Math.ceil(Math.abs(S-w)),T.height=e==="scatter"?Math.ceil(Math.abs(x-M)):R.y2-R.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:R}),this.overlayClear(),this.drawSelectionArea(T)},y=C=>{var k,T,w,M;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 R={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"](R);else if(R.range){const{xsp:S,range:x,width:I}=b,L=S-x.x1;R.range.dragSelectionInfo={dragXsp:L,dragXep:L+I,exceptAxesYChartWidth:x.x2-x.x1,exceptAxesXChartHeight:x.y2-x.y1,chartRange:x,chartTitle:this.options.title.text},(M=(w=this.options.zoom)==null?void 0:w.getRangeInfo)==null||M.call(w,R)}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(!He(d,C)){const I=C.x2-C.x1,L=C.y2-C.y1,v=d.x2-d.x1,W=d.y2-d.y1;b=d.x1+v*((m-C.x1)/I),k=d.y1+W*((g-C.y1)/L),T=v*(p/I),w=W*(y/L)}const M=m-f.xsp,R=g-f.ysp,S=f.xsp+f.width-(m+p),x=f.ysp+f.height-(g+y);n.fillRect(b-M+l,k-R+a,T+M+S,w+R+x)}else{const{xsp:f,ysp:m,width:g,height:p,range:y}=t;if(He(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,R=d.x1+k*w,S=d.y1+T*M,x=g/C,I=p/b,L=k*x,v=T*I;n.fillRect(R+l,S+a,L,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,R,S;(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(x=>this.seriesList[x].type==="bar");for(let x=0;x<n.length;x++){const I=n[x],L=this.seriesList[I];if(L.findGraphData&&L.show){const v=L.findGraphData(t,s,b,!k);if(v!=null&&v.data){let W;if(v.data.o===null&&L.interpolation!=="zero"?L.isExistGrp||(W=s?v.data.x:v.data.y):isNaN(v.data.o)||(W=v.data.o),W!=null){const E=this.getFormattedTooltipLabel({dataId:L.id,seriesId:I,seriesName:L.name,itemData:v.data}),G=l?l.measureText(E).width:1;v.id=L.id,v.name=E,v.axis={x:L.xAxisIndex,y:L.yAxisIndex},v.label=s?(M=v.data)==null?void 0:M.y:(R=v.data)==null?void 0:R.x,i[I]=v;const V=this.getFormattedTooltipValue({dataId:L.id,seriesId:I,seriesName:E,value:W,itemData:v.data});if(v.data.formatted=V,h<G&&(d=E,h=G),u.length<=`${V}`.length&&(u=`${V}`),(f===null||f<=W)&&(f=W,m=I),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=I),p=!0):!p&&X<g&&(g=X,c=I)}if(c===null&&v.data.xp!==void 0&&v.data.yp!==void 0&&v.data.xp!==null&&v.data.yp!==null){const X=F.calcBoxDistance(v.data,a,r);X<C&&(C=X,y=I)}}}}}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 x=n.find(L=>{var W;const v=this.seriesList[L];return(v==null?void 0:v.show)&&((W=v==null?void 0:v.data)==null?void 0:W.length)>0}),I=x?(S=this.seriesList[x].data)==null?void 0:S[b]:null;I&&(i[""]={id:"",name:"",label:s?I.y:I.x,index:b,axis:{x:0,y:0},data:{o:void 0,x:I.x,y:I.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&&this._dataEpoch!=null;if(d){this._tooltipValueCacheEpoch!==this._dataEpoch&&(this._tooltipValueCache=null,this._tooltipValueCacheEpoch=this._dataEpoch),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(S=>n?(S==null?void 0:S.y)===s:(S==null?void 0:S.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 S={};S.color=y.color,S.hit=!1,S.name=b,S.axis={x:y.xAxisIndex,y:y.yAxisIndex},S.index=n?y.yAxisIndex:y.xAxisIndex,S.data=C,S.data.formatted=k,t.items[p]=S}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,R=e?e.measureText(`${k}`).width:1;M<R&&(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,VC=8,EC={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=Qr(()=>{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 B,Y,P,H,K,Q,U;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=(B=u.formatter)==null?void 0:B.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?(P=(Y=l[t.hitId])==null?void 0:Y.data)==null?void 0:P.y:(K=(H=l[t.hitId])==null?void 0:H.data)==null?void 0:K.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,R=M>u.maxWidth?u.maxWidth:M;let S=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const j=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>j){let q="";for(let ee=0;ee<ne.length;ee++){const $=ne[ee],de=`${q}${$}`;n.measureText(de).width>j?(q=$,S+=1):q=de}}S+=1}),n.restore()}const x=h.t+S*this.getTextHeight()+d*Jo+h.b;let I;u.useScrollbar&&x>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",I=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",I=x),this.tooltipCanvas.width=R*this.pixelRatio,this.tooltipCanvas.height=x*this.pixelRatio,this.tooltipCanvas.style.width=`${R}px`,this.tooltipCanvas.style.height=`${x}px`,this.tooltipHeaderDOM.style.width=`${R}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${I+6}px`,this.tooltipDOM.style.display="block";const L=document.body.clientWidth,v=document.body.clientHeight,W=20,E=((Q=this.tooltipDOM)==null?void 0:Q.offsetHeight)||((U=this.tooltipHeaderDOM)==null?void 0:U.offsetHeight)+I+VC,G=L-R-W,V=v-E-W,X=i+W,Z=s+W,N=i-R-W,D=s-E-W,O=X>G?N:X,z=Z>V?D:Z;this.tooltipDOM.style.transform=`translate3d(${O}px, ${z}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+=F.aliasPixel(u),f+=F.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+=F.aliasPixel(w),M+=F.aliasPixel(M),n.beginPath(),typeof b!="string"?n.fillStyle=te.createGradient(n,r,{x:w-4,y:M,w:12,h:-12},b):n.fillStyle=b;const R={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(R):c.fontColor.label??c.fontColor;const S=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-ps,x=w+h,I=M;if(S>n.measureText(k).width)n.fillText(k,x,I);else if(c.textOverflow==="wrap"){let L="",v=I;for(let W=0;W<k.length;W++){const E=k[W],G=`${L}${E}`;n.measureText(G).width>S?(n.fillText(L,x,v),L=E,p+=1,v+=d):L=G}n.fillText(L,x,v)}else{const L=F.truncateLabelWithEllipsis(k,S,n);n.fillText(L,x,I)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(R):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:R}=u.valueOpt,S=Je(l.o-M,R-M),{start:x,end:I}=y[0];g=x<=S&&S<=I||l.o===-1}else{const M=y.find(({id:R})=>R===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=te.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+=F.aliasPixel(h),u+=F.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+=F.aliasPixel(T),w+=F.aliasPixel(w),n.beginPath(),typeof C!="string"?n.fillStyle=te.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 R=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-ps,S=T+d,x=w;if(R>n.measureText(b).width)n.fillText(b,S,x);else if(r.textOverflow==="wrap"){let I="",L=x;for(let v=0;v<b.length;v++){const W=b[v],E=`${I}${W}`;n.measureText(E).width>R?(n.fillText(I,S,L),I=W,g+=1,L+=c):I=E}n.fillText(I,S,L)}else{const I=F.truncateLabelWithEllipsis(b,R,n);n.fillText(I,S,x)}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=F.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),F.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,R;if(!((u=this.data)!=null&&u.labels)||!t)return;const n=this.data.labels.findIndex(S=>(S==null?void 0:S.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 S=c.y2-c.y1,x=(f=this.options.axesY)==null?void 0:f.some(v=>v.categoryMode),I=(m=this.options.axesY)==null?void 0:m.some(v=>v.type==="time");let L;if(x)L=c.y1+S*(n+.5)/d;else if(I){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]);L=c.y1+S*(+t-W)/(E-W)}else L=c.y1+S*n/(d-1);h=[c.x2,L]}else{const S=c.x2-c.x1,x=(b=this.options.axesX)==null?void 0:b.some(v=>v.categoryMode),I=(k=this.options.axesX)==null?void 0:k.some(v=>v.type==="time");let L;if(x)L=c.x1+S*(n+.5)/d;else if(I){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)??+((R=this.data.labels)==null?void 0:R[this.data.labels.length-1]);L=c.x1+S*(+t-W)/(E-W)}else L=c.x1+S*n/(d-1);h=[L,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}},WC=480,GC=28,ZC=5,XC=50,NC={_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??XC)},_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=F.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||WC;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??GC;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??ZC,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 R=l.clientWidth;R!==w&&(w=R,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)}},PC={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 R=k-(k-b)/i.length*w;if((T=s==null?void 0:s.pieStroke)!=null&&T.use&&(R-=s.pieStroke.lineWidth),R<0)return;if(M.or=R,w<i.length-1?M.ir=k-(k-b)/i.length*(w+1):M.ir=1,M.total){for(let S=0;S<M.data.length;S++)if(r=M.data[S],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 x={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(x.use=!1,e.lineWidth=s.pieStroke.lineWidth,e.strokeStyle=s.pieStroke.color,e.arc(g,p,R,0,2*Math.PI),e.stroke());const{selectInfo:I,legendHitInfo:L,unSelectedOpacity:v}=t;f.isSelect=(I==null?void 0:I.sId)===r.id,f.isDownplay=L&&L.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=g,f.centerY=p,f.radius=R,f.doughnutHoleSize=R*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:m},f.draw(e,x,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:R}=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,R)}}},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}},BC={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 R=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(R=!0),k.showTextTip||k.showTip){if(k.tipText==="label"){const S=s?n.axesY[0]:n.axesX[0],x=M.label;M.text=S.type==="time"?Pe(x).format(S.timeFormat):x}else M.text=Qt(M.value);this.drawTextTip({opt:k,tipType:"sel",seriesOpt:w,isSamePos:R,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,R=Number.isFinite(M)?M-1:w,S=Number.isFinite(T)&&Number.isFinite(w),x=S&&w<T,I=S&&(T>0||w<R);let L,v=null;x?L=void 0:I?(v=this.getVisibleWindowMaxSeries(T,w),L=v==null?void 0:v.sId):L=this.minMax[s?"x":"y"][0].maxSID;const W=L?this.seriesList[L]: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 R;if(e==="sel"){if(n&&n.label!==null)R=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=R;else if(s.value!==null)M=s.value,R=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,R=G.label,s.value=M,s.label=R}}}const S=i?h.graphMax:u.graphMax;if((e==="max"||e==="sel")&&M>S&&!this.options.displayOverflow)return!1;let x,I,L;if(p==="bar"){const E=i?this.scrollbar.y:this.scrollbar.x;if(E!=null&&E.use){const[G,V]=(E==null?void 0:E.range)??[];if(w>=G&&w<=V)w-=G??0;else return!1}else{const G=i?u:h,{minIndex:V,maxIndex:X}=G??{};if(Number.isFinite(V)&&Number.isFinite(X))if(w>=V&&w<=X)w-=V;else return!1}i?(I=Math.round(y.h/2),x=g-y.cat*w-y.cPad,L=x-(y.bar*y.ix-(y.h+y.bPad))-I):(I=Math.round(y.w/2),x=f+y.cat*w+y.cPad,L=x+(y.bar*y.ix-(y.w+y.bPad))+I)}else p==="line"?L=te.calculateX(w,h.graphMin,h.graphMax,d-y.comboOffset,f+y.comboOffset/2):p==="scatter"&&(L=te.calculateX(w,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:m,ysp:g},...{dp:L,value:M,label:R,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,k=h.chartWidth-(u.left+u.right),T=h.chartHeight-(u.top+u.bottom),w=n?k:T,M=f[g.units.rectStart];let R=this.options.type==="bar"?4:6;R*=n?1:-1;const S=Object.keys(this.seriesList??{}),x=S.filter(B=>this.seriesList[B].show),I=S.some(B=>this.seriesList[B].isExistGrp&&!this.seriesList[B].isOverlapping),L=((c=this.data.groups)==null?void 0:c[0])??[];let v,W,E,G,V,X,Z,N,D,O=0,z=(d=m.labels)==null?void 0:d.length;if(m.labels){let B=m.labels.length;if(b!=null&&b.use){const{range:Y,interval:P,type:H}=b,[K,Q]=Y??[];if(ve(K)&&ve(Q))B=Math.floor((+Q-+K)/P)+1,O=H==="step"?K:m.labels.findIndex(U=>U===+K),z=H==="step"?Q:m.labels.findIndex(U=>U===+Q);else{const U=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(U==null?void 0:U.minIndex)&&Number.isFinite(U==null?void 0:U.maxIndex)&&U.minIndex<U.maxIndex&&(O=U.minIndex,z=U.maxIndex,B=z-O+1)}}G=f[m.units.rectStart],V=f[m.units.rectEnd],X=(V-G)/B}else Z=this.axesSteps.x[0],N=S.find(B=>{var Y;return((Y=this.seriesList[B])==null?void 0:Y.type)==="line"}),D=this.seriesList[N].size;l.forEach((B,Y)=>{var P;if(E=p.graphMax,!i.fixedPosTop){if(I){const H=x==null?void 0:x.reduce((U,j)=>{var J,ne;return L.includes(j)&&(((J=B[j])==null?void 0:J.value)??B[j])>0?U+(((ne=B[j])==null?void 0:ne.value)??B[j]):U},0),K=((P=x==null?void 0:x.filter(U=>!L.includes(U)))==null?void 0:P.map(U=>{var j;return((j=B[U])==null?void 0:j.value)??B[U]}))??[],Q=(K==null?void 0:K.length)>0?K.reduce((U,j)=>Math.max(U,j??-1/0),-1/0):-1/0;E=H>0?Math.max(Q,H):Math.max(Q,0)}else if(x.length){const H=x.map(Q=>{var U;return((U=B[Q])==null?void 0:U.value)??B[Q]}),K=H.length>0?H.reduce((Q,U)=>Math.max(Q,U??-1/0),-1/0):-1/0;E=K>0||this.options.type!=="bar"?K:0}}if(m.labels){if(s[Y]<O||s[Y]>z)return;const H=s[Y]-O;v=Math.round(G+X*H)+X/2}else v=C(a[Y],Z.graphMin,Z.graphMax,k-D.comboOffset,f.x1+D.comboOffset/2);W=y(E,p.graphMin,p.graphMax,w,M)+R,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:R}=m.tipStyle,S=`normal normal ${M} ${T}px ${w}`;let x=1;g==="line"?x+=6:g==="scatter"?x+=C==null?void 0:C.pointSize:g==="bar"&&(x+=4);let I,L=h;if(m.fixedPosTop)e?(I=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),I+=x):(I=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),I-=x);else if(e){const E=Math.min(Math.max(u,i.graphMin),i.graphMax);I=te.calculateX(E,i.graphMin,i.graphMax,l,r),I=u<0?I-x:I+x}else{const E=g==="bar"&&u<0?0:u,G=Math.min(Math.max(E,s.graphMin),s.graphMax);I=te.calculateY(G,s.graphMin,s.graphMax,a,d),I=E<0?I+x:I-x}let v="center";n.save(),n.font=S;const W=Math.round(Math.max(n.measureText(f).width+12,40));e||(h+W/2>c-10?(v="right",L-=W/2-b*2):h-W/2<r+10&&(v="left",L+=W/2-b*2)),n.restore(),(m.showTextTip||p==="max")&&this.showTextTip({context:n,type:v,width:W,height:R,x:e?I+W/2:L,y:e?L+R/2:I,opt:m,arrowSize:b,borderRadius:k,text:f,textStyle:S,isNegative:u<0}),m.showTip&&p==="sel"&&this.showTip({context:n,x:e?I:h,y:e?h:I,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()}},DC={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,R,S,x,I,L,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))&&!((R=e.selectSeries)!=null&&R.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?(x=(S=this.axesSteps)==null?void 0:S.x)==null?void 0:x[u.xi]:null,m=u?(L=(I=this.axesSteps)==null?void 0:I.y)==null?void 0:L[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 V=(W=(v=this.dataSet)==null?void 0:v[u.sId])==null?void 0:W.lastTick;V&&(d=V.gapCount??0,h=V.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??F.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 V=1;V<n.length;V++){const X=(G=(E=this.dataSet)==null?void 0:E[n[V].sId])==null?void 0:G.lastTick;X&&X.maxDirtyAge>y&&(y=X.maxDirtyAge);const Z=n[V].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,R=Math.min(M,Math.max(T+1,y+1)),S=new Array(R);for(let V=0;V<R;V++){let X=(w-V)%M;X<0&&(X+=M),S[V]=X}const x=this.options.coordinateDedupe!==!1&&n.length>1,I=x?new Map:null;x&&this.collectStripDuplicatePoints(I,S);const L={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:I,coordinateDedupe:x,rtXOffsetCss:this._blitCarry};for(let V=0;V<n.length;V++){const X=n[V],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,S,L),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}},OC={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})}}},$r=2,YC=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],zC=["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 ec(t,e){if(e==="time")return Jr(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]=ec(h.x,i),a[d]=ec(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 AC(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,zC),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:$r,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 KC(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 tc="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLFp0PU9iamVjdC5wcm90b3R5cGUsRGU9WnQuaGFzT3duUHJvcGVydHksemU9WnQudG9TdHJpbmcsTXQ9T3Q/T3QudG9TdHJpbmdUYWc6dm9pZCAwO2Z1bmN0aW9uIEVlKGUpe3ZhciB0PURlLmNhbGwoZSxNdCksbj1lW010XTt0cnl7ZVtNdF09dm9pZCAwO3ZhciBzPSEwfWNhdGNoe312YXIgaT16ZS5jYWxsKGUpO3JldHVybiBzJiYodD9lW010XT1uOmRlbGV0ZSBlW010XSksaX12YXIgQmU9T2JqZWN0LnByb3RvdHlwZSxIZT1CZS50b1N0cmluZ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y29uc3QgdD1lLmRhdGE7aWYodCl7aWYodC50eXBlPT09ImluaXQiKXtsZXQgbj10eXBlb2YgT2Zmc2NyZWVuQ2FudmFzPCJ1IjtpZihuKXRyeXtuPSEhbmV3IE9mZnNjcmVlbkNhbnZhcygxLDEpLmdldENvbnRleHQoIjJkIil9Y2F0Y2h7bj0hMX1zZWxmLnBvc3RNZXNzYWdlKHt0eXBlOm4/InJlYWR5IjoidW5zdXBwb3J0ZWQiLHZlcnNpb246Z3N9KTtyZXR1cm59aWYodC50eXBlPT09InJlbmRlciIpdHJ5e0lzKHQpfWNhdGNoKG4pe3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6InJlbmRlci1lcnJvciIsZXBvY2g6dC5lcG9jaCxtZXNzYWdlOlN0cmluZyhuJiZuLm1lc3NhZ2V8fG4pLG5hbWU6biYmbi5uYW1lLHN0YWNrOm4mJm4uc3RhY2t9KX19fX0pKCk7Cg==",_C=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),nc=typeof self<"u"&&self.Blob&&new Blob([_C(tc)],{type:"text/javascript;charset=utf-8"});function UC(t){let e;try{if(e=nc&&(self.URL||self.webkitURL).createObjectURL(nc),!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,"+tc,{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"},JC=3e3,jC=2,QC=3,Ht=()=>{},$C={onInitFailure:Ht,onTimeout:Ht,onRenderException:Ht,onFallback:Ht};function qC(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function e1(t){if(typeof structuredClone!="function")return!1;try{return structuredClone(t),!0}catch{return!1}}function t1(){return new UC}class n1{constructor(e={}){this.state=mt.IDLE,this.worker=null,this.version=e.version??$r,this.initTimeoutMs=e.initTimeoutMs??JC,this.maxInFlight=e.maxInFlight??jC,this.maxRenderErrors=e.maxRenderErrors??QC,this.hooks={...$C,...e.hooks||{}},this._timer=null,this._frameHandler=Ht,this._errorHandler=Ht,this._inFlight=0,this._renderErrorStreak=0,this._isEnabled=e.isEnabled||(()=>!1),this._isSupported=e.isSupported||qC,this._createWorker=e.createWorker||t1}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()&&e1(e)}setFrameHandler(e){this._frameHandler=e||Ht}setErrorHandler(e){this._errorHandler=e||Ht}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 i1=["text","badge","callout","circle"],s1=["axis","pixel","series"],o1=["straight","elbow"],l1=["top","bottom","left","right","auto"],a1=["start","end"],r1={type:"pixel",xAxisIndex:0,yAxisIndex:0,xValue:null,yValue:null,x:0,y:0,seriesId:null,location:"end",offsetX:0,offsetY:0},c1={enabled:!1,type:"straight",style:{stroke:"#9E9E9E",strokeWidth:1,dashStyle:"solid"}},ic={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 d1(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 h1(t,e,n){if(s1.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;a1.includes(i)||typeof i=="number"&&Number.isInteger(i)||(n.push(`[annotation:${e}] invalid location "${i}" — fallback to "end".`),t.location="end")}}function u1(t,e,n){const i=t.id!=null?String(t.id):`annotation-${e}`;let s=t.type;i1.includes(s)||(n.push(`[annotation:${i}] unknown type "${s}" — fallback to "text".`),s="text");const l=Re(t.style)||{},a=Xe({},l,ic[s].style);if("padding"in a){const h="padding"in l?l.padding:ic[s].style.padding;a.padding=d1(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"&&!l1.includes(a.anchor)&&(n.push(`[annotation:${i}] invalid style.anchor "${a.anchor}" — fallback to "auto".`),a.anchor="auto");const r=Xe({},Re(t.position)||{},r1);h1(r,i,n);const c=Xe({},Re(t.connector)||{},c1);o1.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 f1(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)=>u1(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 m1(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 p1(t,e=[]){const i=(Array.isArray(e)?e:[]).indexOf(t);return i!==-1?i:typeof t=="number"&&Number.isInteger(t)?t:-1}function g1(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=p1(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 sc(t,e,n,i,s){if(!e)return null;if((e.type||"linear")==="step")return g1(t,e,n,i,s);const l=m1(t,e);return l===null?null:s?te.calculateX(l,e.graphMin,e.graphMax,n,i):te.calculateY(l,e.graphMin,e.graphMax,n,i)}function oc(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 b1(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,R=sc(i.xValue,C,k,w,!0),S=sc(i.yValue,b,T,M,!1);return R===null||S===null?n:{x:R+s,y:S+l,anchorX:R,anchorY:S,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:R,radius:S,startAngle:x,endAngle:I}=p;if(M==null||R==null||S==null||x==null||I==null)return n;let L=(x+I)/2;Math.abs(I-x)>=Math.PI*2-1e-6&&(L=0);const W=M+Math.cos(L)*S,E=R+Math.sin(L)*S;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=oc(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 y1(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=oc(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 x1(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 lc(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 S1(t,e,n=F.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 C1(t,e,n=F.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=lc(s),a=`${l}|${e}`;let r;t._measure&&t._measure.key===a?r=t._measure.value:(r=S1(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 k1(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 w1(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 I1(t,e,n,i=F.calcTextSizeCanvas){const{type:s,style:l}=t,a=C1(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=k1(l.anchor,d,h);c=w1(r,h,u,l.arrowSize||8)}return{type:s,box:r,content:a.content,shape:null,tail:c}}const ac={solid:[],dash:[4,4],dot:[1,3]};function L1(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 T1(t,e,n,i){if(!(i!=null&&i.enabled))return;const s=L1(n,e),l=i.style||{};t.save();try{t.beginPath(),t.strokeStyle=l.stroke||"#9E9E9E",t.lineWidth=l.strokeWidth||1,t.setLineDash(ac[l.dashStyle]||ac.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 M1(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(),te.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 v1(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 R1(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 V1(t,e,n,i){var s;if(!(!n||!((s=n.lines)!=null&&s.length))){t.save();try{t.fillStyle=i.color||"#212121",t.font=lc(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 E1(t,e,n,i){var a;const{type:s,style:l}=e;if(s==="circle"){R1(t,n.shape,l);return}(a=e.connector)!=null&&a.enabled&&s!=="callout"&&T1(t,{x:i.anchorX,y:i.anchorY},n.box,e.connector),s==="callout"?v1(t,n.box,n.tail,l):M1(t,n.box,l),V1(t,n.box,n.content,l)}function W1(t,e,n,i=F.calcTextSizeCanvas){!t||!Array.isArray(e)||!e.length||e.forEach(s=>{try{const l=b1(s,n);if(!l.isVisible)return;const a=y1(s,n),r=s.type==="circle"?"":x1(s.content,a),c=I1(s,l,r,i);E1(t,s,c,l)}catch(l){zn.warn(`[EvChart] annotation render failed (id: ${s&&s.id}):`,l)}})}const G1=300;let gs=class{constructor(e,n,i,s,l,a,r){Object.keys(Kr).forEach(d=>Object.assign(this,Kr[d])),i.brush||(Object.assign(this,EC),Object.assign(this,NC),Object.assign(this,RC),Object.assign(this,BC),Object.assign(this,kC),Object.assign(this,PC),Object.assign(this,CC),Object.assign(this,LC)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,IC),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 n1({isEnabled:()=>!!this.options.workerRender,hooks:{onInitFailure:d=>zn.warn("[EvChart] workerRender 비활성화 — main 렌더로 fallback:",d),onRenderException:d=>zn.warn("[EvChart] workerRender 렌더 예외 — main 렌더로 fallback:",d),onFallback:d=>{d==="unsupported"&&zn.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=[KS(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=AC(this,n),{columns:s,transferList:l}=KC(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||G1,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??F.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(F.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:R,cPadRatio:S,borderRadius:x}=this.options;w.draw({thickness:R,cPadRatio:S,borderRadius:x,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},R=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:R,unSelectedOpacity:h.unSelectedOpacity},e):this.drawPie({selectInfo:M,legendHitInfo:R,unSelectedOpacity:h.unSelectedOpacity},e),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(e);break}case"scatter":{const M=n==null?void 0:n.legend;let R;if(l.use&&l.useSeriesOpacity){const S=this.lastHitInfo,x=this.defaultSelectItemInfo;S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?R={seriesID:S.sId,dataIndex:S.dataIndex}:x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?R={...x}:R=null}this.options.seriesReverse&&(w=this.seriesList[b.at(-1-T)]),w.draw({legendHitInfo:M,selectInfo:R,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}=f1(e);this._normalizedAnnotations=a,this._annotationSource=e,r.forEach(c=>zn.warn(c))}W1(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 bC(e,r,i,a);case"time":return r.categoryMode?new SC(e,r,i,l,a):new gC(e,r,i,a);case"log":return new yC(e,r,i);case"step":return new xC(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,R,S;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=(S=(R=this.options.axesY)==null?void 0:R[0])==null?void 0:S.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 R=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,R),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 R=!!((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():R&&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,DC),Object.assign(gs.prototype,OC);const Z1={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},X1={class:"ev-chart-toolbar"},N1={class:"ev-chart-toolbar__icon"};function P1(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",X1,[o.createElementVNode("div",N1,[(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 rc=ce(Z1,[["render",P1],["__scopeId","data-v-dfbffbab"]]);class B1{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 D1={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},O1={series:{},groups:[],labels:[],data:{}},Y1=t=>nb({...t},O1),z1=t=>t instanceof Date||t!==null&&typeof t=="object"&&typeof t.toDate=="function"&&typeof t.format=="function",jo=t=>rr(t,function e(n){if(z1(n))return n;if(o.isReactive(n))return rr(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()}}},cc=(t,e)=>{var m;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const p=Xe({},g,D1);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}},dc=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(ha(t.width)),height:i(ha(t.height))}});return{wrapper:e,wrapperStyle:n}},hc=(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=x=>{x.data.length&&x.range&&c.value&&m.dragZoom(x)},b=()=>{g.props.options.forEach((x,I)=>{if(x.zoom={...x.zoom,use:c.value,getRangeInfo:C},c.value)x.dragSelection={...x.dragSelection,use:!0,keepDisplay:!1};else{const{use:L,keepDisplay:v}=p.options[I].dragSelection??{};x.dragSelection={use:!!L,keepDisplay:!!v}}})},k=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:x,options:I},L)=>{x.chartIdx=L,g.props.data.push(x),g.props.options.push(I),y.value.push(L)})):(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 x={updateZoomStartIdx:I=>a("update:zoomStartIdx",I),updateZoomEndIdx:I=>a("update:zoomEndIdx",I)};m=new B1(g,p,u,h.value,r,f,x)}},T=x=>{p.data[0].labels.length<=1||(c.value=!c.value,x?x.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),b(),m.setIconStyle(c.value),m.setEventListener(c.value))},w=(x,I)=>{if(m.isAnimationFinish)switch(I){case"dragZoom":T(x.target);break;case"reset":m.initZoom();break;case"previous":case"latest":m.clickMoveZoomArea(I);break}};o.onUpdated(()=>{m&&h.value&&m.setIcon(h.value)});const M=x=>{!He(x.zoom,u.zoom)&&(u.zoom=x.zoom,m?(!u.zoom.toolbar.show&&c.value&&T(),m.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&k())},R=x=>{d.value?(r.value||(p.data=n?jo(x):[jo(x)],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},S=(x,I)=>{if(m.isUseToolbar){m.isUseToolbar=!1;return}c.value&&(m.executeZoom(x,I),m.setZoomAreaMemory(x,I))};return o.watch(()=>[f.start,f.end],([x,I],[L])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")x>=(L??0)?i.value.dataIndex-=x-(L??0):i.value.dataIndex+=L-x;else for(let v=0;v<i.value.dataIndex.length;v++)x>=(L??0)?i.value.dataIndex[v]-=x-(L??0):i.value.dataIndex[v]+=L-x;(f.isUseButton||f.isUseScroll)&&m.executeZoom(x,I)}),o.watch(()=>[f.isUseButton,f.isUseScroll],([x,I],[L,v])=>{L&&!x?m.setZoomAreaMemory(f.start,f.end):v&&!I&&(m.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:p,brushIdx:f,createEvChartZoom:k,setOptionsForUseZoom:M,setDataForUseZoom:R,controlZoomIdx:S,onClickToolbar:w}},F1={name:"EvChart",components:{EvChartToolbar:rc},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}=cc(a,r),C=p(t.data),b=y(t.options),k=o.computed(()=>t.selectedLabel),T=o.computed(()=>t.selectedItem),{wrapper:w,wrapperStyle:M}=dc(b),{evChartZoomOptions:R,evChartToolbarRef:S,createEvChartZoom:x,setOptionsForUseZoom:I,setDataForUseZoom:L,controlZoomIdx:v,onClickToolbar:W}=s?{}:hc(b,{wrapper:w,evChartGroupRef:null},t.selectedLabel?k:T,d),E=()=>typeof performance<"u"?performance.now():Date.now();let G=null,V=null;const X=P=>{var j;G?(P.updateSeries&&(G.updateSeries=!0),P.updateData&&(G.updateData=!0),P.updateLegend&&(G.updateLegend=!0),P.updateTooltip&&(G.updateTooltip=!0),(j=P.updateSelTip)!=null&&j.update&&(G.updateSelTip??(G.updateSelTip={}),G.updateSelTip.update=!0)):G={...P};const H=()=>{const ne=((h==null?void 0:h.deferUntil)??0)-E();if(ne>0){V=setTimeout(H,ne);return}G&&n&&n.update(G),G=null,V=null};clearTimeout(V);const K=E(),Q=(h==null?void 0:h.deferUntil)??0,U=Q>K?Q-K:0;V=setTimeout(H,U)},Z=()=>{var K;let P;b.selectLabel.use?P=m:b.selectSeries.use&&(P=g);const H=(K=t.options.realTimeScatter)!=null&&K.use?{...t.data,groups:[],labels:[]}:C;n=new gs(w.value,H,b,u,f,P,l)},N=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&x(),b.legend.show&&b.legend.external&&n.emitLegendData())};o.watch(()=>t.options,P=>{var j,J;const H=y(P),K=((J=(j=n.options)==null?void 0:j.legend)==null?void 0:J.show)??!1,Q=!He(H.legend.table,n.options.legend.table),U=H.tooltip.use&&!He(H.tooltip,n.options.tooltip);n.options=H,X({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:Q,updateTooltip:U}),H.legend.show&&H.legend.external&&!K&&n.emitLegendData(),s||I(H)},{deep:!b.shallowOptionsWatch,flush:"post"}),o.watch(()=>t.data,P=>{var q,ee;const H=(q=t.options.realTimeScatter)!=null&&q.use?{...P,groups:[],labels:[]}:p(P),K=!He(H.series,n.data.series),Q=!He(H.groups,n.data.groups),U=n.prunedRealTimeScatterSeries,j=!!(U!=null&&U.size)&&Object.keys(H.data??{}).some($=>{var de;return U.has($)&&((de=H.data[$])==null?void 0:de.length)}),J=K||Q||j||t.options.type==="heatMap",ne=K||Q||!He(H.labels,n.data.labels)||!He(H.data,n.data.data);n.data=(ee=t.options.realTimeScatter)!=null&&ee.use?H:jo(H),X({updateSeries:J,updateSelTip:{update:!0,keepDomain:!1},updateData:ne}),!s&&ne&&L(H)},{deep:!b.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(P,H)=>{if(k!=null&&k.value)for(let K=0;K<k.value.dataIndex.length;K++)P>=(H??0)?k.value.dataIndex[K]-=P-(H??0):k.value.dataIndex[K]+=H-P;else T!=null&&T.value&&(P>=(H??0)?T.value.dataIndex-=P-(H??0):T.value.dataIndex+=H-P)}),o.watch(()=>T.value,P=>{const H=t.options.type;n.selectItemByData(P,H)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??k.value,P=>{P!=null&&P.dataIndex&&n.selectLabelByData(P.dataIndex,P==null?void 0:P.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>t.selectedSeries,P=>{var H;(H=b.selectSeries)!=null&&H.use?P.seriesId&&n.selectSeriesByData(P.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],([P,H])=>{v(P,H)}),o.watch(()=>t.realTimeScatterReset,P=>{var H;P&&(Object.keys(n.dataSet??{}).forEach(K=>{n.dataSet[K]&&(n.dataSet[K].dataGroup=[])}),(H=n.prunedRealTimeScatterSeries)==null||H.clear(),e("update:realTimeScatterReset",!1))}),o.watch(()=>{var P;return(P=t.options.realTimeScatter)==null?void 0:P.use},P=>{n.options.realTimeScatter.use=P??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,P=>{P&&t.options.syncHover!==!1&&(P.label==null?n.overlayClear():n.drawSyncedIndicator(P))},{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 P;clearTimeout(V),G=null,V=null,n&&"destroy"in n&&n.destroy(),(P=d==null?void 0:d.value)!=null&&P.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const D=P=>{n==null||n.toggleSeries(P)},O=P=>{n==null||n.highlightSeries(P)},z=()=>{n==null||n.unhighlightSeries()},B=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},Y=ns(()=>{n&&"resize"in n&&n.resize()},t.resizeTimeout);return o.onActivated(()=>{i.value&&Y()}),{wrapper:w,wrapperStyle:M,onResize:Y,redraw:B,toggleSeries:D,highlightSeries:O,unhighlightSeries:z,evChartToolbarRef:S,injectIsChartGroup:s,onClickToolbar:W,normalizedOptions:b,zoomOptions:o.toRef(R??{zoom:{}},"zoom")}}},A1={key:0,ref:"evChartToolbarRef"};function K1(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",A1,[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",K1]]);xi.install=t=>{t.component(xi.name,xi)};const _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"}}}}},U1=()=>{const t=o.ref(!1),e=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:a=>Xe({},a,_1),isExecuteZoom:t,brushSeries:i,evChartGroupRef:e,evChartPropsInGroup:n,groupInteraction:{deferUntil:0}}},J1={name:"EvChartGroup",components:{evChartToolbar:rc},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=(x=h)=>{const I=Number.isFinite(x)?Math.min(Math.max(x,0),d):h,L=u();r.deferUntil=Math.min(Math.max(r.deferUntil,L+I),L+d)};o.provide("deferPollingRedraw",f);const m=o.computed({get:()=>t.groupSelectedLabel,set:x=>e("update:groupSelectedLabel",x)});o.provide("groupSelectedLabel",m);const g=o.ref(null);o.provide("groupHoveredLabel",g),o.watch(()=>t.options.syncHover,x=>{x?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:R,onClickToolbar:S}=hc(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,x=>{M(x)},{deep:!0}),o.watch(()=>t.options,x=>{const I=n(x);w(I)},{deep:!0}),o.watch(()=>[t.zoomStartIdx,t.zoomEndIdx],([x,I])=>{k.isUseButton||k.isUseScroll||R(x,I)}),{evChartGroupRef:l,evChartToolbarRef:C,zoomOptions:o.toRef(p,"zoom"),onClickToolbar:S,deferPollingRedraw:f}}},j1={key:0,ref:"evChartToolbarRef"},Q1={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function $1(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",Q1,[o.renderSlot(t.$slots,"default",{},void 0,!0)],512)],64)}const Si=ce(J1,[["render",$1],["__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 q1=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 ek={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},tk=()=>({getNormalizedBrushOptions:e=>Xe({},e,ek)}),nk={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}=tk(),d=o.computed(()=>c(t.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:m,getNormalizedData:g,getNormalizedOptions:p}=cc(),y=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var L,v;const x=l.props.options[d.value.chartIdx],I={...x,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:[{...(L=x==null?void 0:x.axesX)==null?void 0:L[0],title:{use:!1}}],axesY:[{...(v=x==null?void 0:x.axesY)==null?void 0:v[0],title:{use:!1}}]};return p(I)}),{wrapper:b,wrapperStyle:k}=dc(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,(x,I)=>{var L;x.brush.chartIdx<=((L=s.data)==null?void 0:L.length)-1?n&&!He(I.brush,x.brush)?n.removeBrushWrapper():e&&!He(x,I)&&(e.options=Re(x),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,x=>{if(e){const I=x[d.value.chartIdx];if(I){const L=!He(I.series,e.data.series),v=r.list[d.value.chartIdx];typeof v=="object"&&Object.keys(v).length&&Object.keys(I.series).forEach(W=>{var E;"show"in I.series[W]||(I.series[W].show=((E=v[W])==null?void 0:E.show)??!0)}),e.data=Re(g(I)),e.update({updateSeries:L,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const T=()=>{let x;C.value.selectLabel.use?x=f:C.value.selectSeries.use&&(x=m),e=new gs(b.value,y.value,C.value,h,u,x)},w=()=>{n=new q1(e,y,d,a,b)},M=()=>{e&&e.init()},R=x=>{n&&n.init(x)};o.watch(()=>[a.start,a.end],()=>{var x;b.value&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1&&R()}),o.onMounted(async()=>{d.value.show&&(await T(),await M(),w(),R()),i.value=!0}),o.onUpdated(async()=>{var x;if(d.value.show&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1){const I=r.list[d.value.chartIdx];typeof I=="object"&&Object.keys(I).length&&Object.keys(y.value.series).forEach(L=>{var v;"show"in y.value.series[L]||(y.value.series[L].show=((v=I[L])==null?void 0:v.show)??!0)}),await T(),await M(),w(),R()}}),o.onBeforeUnmount(()=>{e&&"destroy"in e&&e.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{e&&"hideTooltip"in e&&e.hideTooltip()});const S=ns(()=>{e&&"resize"in e&&new Promise(I=>e.resize(I)).then(I=>{I&&R(I)})},0);return o.onActivated(()=>{i.value&&S()}),{evChartBrushOptions:d,evChartBrushRef:b,evChartBrushStyle:k,onResize:S}}};function ik(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(nk,[["render",ik]]);Ci.install=t=>{t.component(Ci.name,Ci)};const sk={name:"TreeGridNode",components:{GridOptionButton:zo},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`})}}},ok=["data-index"],lk=["data-name","data-index"],ak={class:"td-content__wrapper"},rk=["title"],ck={class:"td-content"};function dk(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",ak,[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,rk)):o.createCommentVNode("",!0),o.createElementVNode("div",ck,[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,lk)):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,ok)}const hk=ce(sk,[["render",dk],["__scopeId","data-v-faab3696"]]),uk={name:"EvTreeGridToolbar"},fk={class:"tree-grid-toolbar"};function mk(t,e,n,i,s,l){return o.openBlock(),o.createElementBlock("div",fk,[o.renderSlot(t.$slots,"toolbarWrapper")])}const pk=ce(uk,[["render",mk]]),gk=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}})},bk=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}}},yk=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,R)=>(R.hide||R.hiddenDisplay||(R.width?M.totalWidth+=R.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(),R=b.getBoundingClientRect().right-k,S=s.resizeLine,x=M.left-k+w,I=M.right-k,L=y.clientX,v=M.left-k;b.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const W=G=>{const V=G.clientX-L,X=I+V;let Z=Math.max(x,X);Z=Math.min(R,Z),S.style.left=`${Z}px`},E=()=>{const V=parseInt(S.style.left,10)-v;a.orderedColumns[p]&&(a.orderedColumns[p].width=V,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})}}},xk=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))}}},Sk=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)}}},Ck=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)}}},kk=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()}}},wk=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)}}},Ik=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})}}},Lk=({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")})}}},Tk={name:"EvTreeGrid",components:{TreeGridNode:hk,Toolbar:pk,GridPagination:Er,GridSummary:Nr,ColumnSetting:Pr,GridSortButton:Br,GridOptionButton:zo},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 _,se;return((se=(_=t.option)==null?void 0:_.useGridSetting)==null?void 0:se.use)||!1}),i=o.computed(()=>{var _;return((_=t.option)==null?void 0:_.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 _,se;return((se=(_=t.option)==null?void 0:_.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(_=>_.show)),searchStore:o.computed(()=>c.treeStore.filter(_=>_.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:t.rows,filteredColumns:[],originColumns:o.computed(()=>t.columns.map((_,se)=>{var fe;return{index:se,hiddenDisplay:!1,..._,width:isFinite(_.width)?_.width:void 0,sortOption:{sortType:((fe=_==null?void 0:_.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 _;return((_=t.option.page)==null?void 0:_.use)||!1}),useClient:((Ln=t.option.page)==null?void 0:Ln.useClient)||!1,isInfinite:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.total)||0}),perPage:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.perPage)||20}),visiblePage:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.visiblePage)||8}),order:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.order)||"center"}),showPageInfo:o.computed(()=>{var _;return((_=t.option.page)==null?void 0:_.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}=gk({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 _,se;return((se=(_=t.option)==null?void 0:_.useSelection)==null?void 0:se.use)??!0}),limitCount:o.computed(()=>{var se,fe;let _=(fe=(se=t.option)==null?void 0:se.useSelection)==null?void 0:fe.limitCount;return _=_&&_>=2?_:0,_}),multiple:o.computed(()=>{var _,se;return((se=(_=t.option)==null?void 0:_.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 _,se;return((se=(_=t.option)==null?void 0:_.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 _;return((_=t.option.style)==null?void 0:_.stripe)||!1}),borderStyle:o.computed(()=>{var _;return((_=t.option.style)==null?void 0:_.border)||""}),highlightIdx:o.computed(()=>{var _;return((_=t.option.style)==null?void 0:_.highlight)??-1})}),R=()=>{b.selectedRow.length=0,c.store.forEach(_=>{_.selected=!1})},S=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(_=>{_.checked=!1,_.indeterminate=!1})},{getPagingData:x,updatePagingInfo:I,changePage:L}=Ik({stores:c,pageInfo:d,sortInfo:k,filterInfo:a,elementInfo:l,clearCheckInfo:S}),v=o.ref(0),{updateVScroll:W,updateHScroll:E,onScroll:G}=bk({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:w,pageInfo:d,summaryScroll:v,getPagingData:x,updatePagingInfo:I}),{onRowClick:V,onRowDblClick:X}=xk(b),{onCheck:Z,onCheckAll:N}=Sk({checkInfo:h,stores:c,checkHeader:y,pageInfo:d,getPagingData:x}),{calculatedColumn:D,onResize:O,onShow:z,onColumnResize:B}=yk({resizeInfo:w,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:W,updateHScroll:E,contextInfo:T}),{setTreeNodeStore:Y,handleExpand:P}=kk({stores:c,onResize:O}),{onSort:H,initSortInfo:K,setSortInfo:Q}=Lk({sortInfo:k,stores:c}),{onSearch:U}=wk({stores:c,filterInfo:a,pageInfo:d,getConvertValue:m,onResize:O,checkHeader:y,getPagingData:x,updatePagingInfo:I}),{setPositionColumnSetting:j,initColumnSettingInfo:J,onApplyColumn:ne,setColumnHidden:q}=Dr({stores:c,columnSettingInfo:r,contextInfo:T,onSearch:U,onResize:O}),{setContextMenu:ee,onContextMenu:$,onColumnContextMenu:de,onGridSettingContextMenu:me}=Ck({contextInfo:T,stores:c,selectInfo:b,useGridSetting:n,columnSettingInfo:r,setColumnHidden:q,onSort:H}),ae=_=>{T.gridSettingContextMenuItems.length=0,T.customGridSettingContextMenu.length?me(_):r.isShowColumnSetting=!0},xe=_=>{var se,fe,ke,Ve,Fe,Qe;_.type==="wheel"&&((se=T.menu)==null||se.hide(_)),_.type==="scroll"&&!((fe=_.target.classList)!=null&&fe.contains("table-body"))&&!((Ve=(ke=_.target.offsetParent)==null?void 0:ke.classList)!=null&&Ve.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,T.isShowMenuOnClick=!1,(Fe=T.columnMenu)==null||Fe.hide(_),(Qe=T.gridSettingMenu)==null||Qe.hide())};o.onMounted(()=>{var _;if(c.treeStore=Y(),c.originStore=Re(c.treeStore),(_=t.option)!=null&&_.useSort)Q(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(()=>{O()}),o.watch(()=>{var _;return(_=t.option)==null?void 0:_.useSort},_=>{const se=t.option.hiddenColumnMenuItem,fe=T.hiddenColumnMenuItem;_?(fe.ascending=(se==null?void 0:se.ascending)??!1,fe.descending=(se==null?void 0:se.descending)??!1,Q(t.columns,!1)):(fe.ascending=!0,fe.descending=!0,K(t.columns))}),o.watch(()=>r.isShowColumnSetting,_=>{var se;if(!_){(se=T.gridSettingMenu)==null||se.hide();return}j(e.value)}),o.watch(()=>t.columns,()=>{J()},{deep:!0,immediate:!0}),o.watch(()=>t.checked,_=>{h.checkedRows=_}),o.watch(()=>h.checkedRows,_=>{h.isHeaderChecked=!1;let se=c.store;d.isClientPaging&&(se=x()),se.length&&(se.forEach(fe=>{fe.checked=!!_.find(ke=>ke.index===fe.index)}),y(se)),W()}),o.watch(()=>t.selected,_=>{b.useSelect&&(b.selectedRow=_)}),o.watch(()=>b.selectedRow,_=>{b.useSelect&&(c.store.forEach(se=>{se.selected=!!_.find(fe=>fe.index===se.index)}),W())},{deep:!0}),o.watch(()=>M.highlightIdx,async _=>{await o.nextTick();const se=ke=>{if(!(ke!=null&&ke.children))return;const{children:Ve}=ke;Ve.forEach(Fe=>{const Qe=Fe;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(_>=0){const ke=c.store.find(Fe=>Fe.index===_);if(!ke)return;ke.show=!0,ke.isFilter=!0,fe(ke);const Ve=c.showTreeStore.map(Fe=>Fe.index).indexOf(ke.index);if(d.usePage&&!d.isInfinite){const Fe=Math.ceil(Ve/d.perPage);if(d.highlightPage=Ve===d.perPage?Fe+1:Fe||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,()=>{R()}),o.watch(()=>b.multiple,()=>{R()}),o.watch(()=>t.rows,_=>{c.treeRows=_,c.treeStore=Y(),O()},{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(_=>{var fe;const se=_;return!((fe=t.columns[_.index])!=null&&fe.width)&&!se.resized&&(se.width=0),se}),O()}),o.watch(()=>t.option.searchValue,_=>{o.nextTick(()=>{_!==void 0&&(U((_==null?void 0:_.value)??_),d.isClientPaging&&(S(),R()))})},{immediate:!0}),o.watch(()=>{var _;return(_=t.option.page)==null?void 0:_.currentPage},_=>{var fe;const se=_||1;d.currentPage=(fe=t.option.page)!=null&&fe.isInfinite?1:se},{immediate:!0}),o.watch(()=>d.currentPage,(_,se)=>{o.nextTick(()=>{if(L(se),d.isClientPaging&&_!==se&&(S(),R()),W(),_===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=_=>({column:!0,render:u(_),"non-border":!!M.borderStyle,[_.field]:_.field}),Qo=(_,se)=>{const fe=u(_);return{width:`${_.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"}},$o=_=>`${_}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:D,onResize:O,onShow:z,onColumnResize:B,onRowClick:V,onRowDblClick:X,onCheck:Z,onCheckAll:N,setContextMenu:ee,onContextMenu:$,onSearch:U,handleExpand:P,getColumnClass:Vt,getColumnStyle:Qo,getSlotName:$o,setGridSetting:ae,onApplyColumn:ne,onColumnContextMenu:de,onSort:H,sortIconClass:be}}},Mk={class:"column-list"},vk=["data-index"],Rk=["title","onClick"],Vk=["onClick"],Ek=["onMousedown"],Wk={ref:"table"},Gk=["title"],Zk={key:0},Xk={class:"is-empty"},Nk={ref:"resizeLine",class:"table-resize-line"};function Pk(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",Mk,[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,Vk)],10,Rk)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(k,M),["stop","left"])},null,40,Ek)],14,vk)):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",Wk,[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,Gk))])})),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",Zk,[o.createElementVNode("td",Xk,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",Nk,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(Tk,[["render",Pk],["__scopeId","data-v-9ed705b7"]]);ki.install=t=>{t.component(ki.name,ki)};const Bk={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},Dk=["aria-current"];function Ok(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,Dk)}const Yk={name:"EvPagination",components:{EvIcon:Cn,pageButton:ce(Bk,[["render",Ok]])},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,R=i.value+b-2-C,S=M-1===2?2:-1,x=R+1===w-1?R+1:-1;return[u(1),u(S),...f(M,R),u(x),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}}},zk={class:"pagination"},Hk={key:0,class:"pagination-info"},Fk={key:0,class:"pagination-ellipsis"},Ak=["onClick"];function Kk(t,e,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",zk,[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,Ak))],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",Kk]]);wi.install=t=>{t.component(wi.name,wi)};const _k="3.19.1",Uk=[Gn,Zn,fn,Xn,mn,pn,Nn,Pn,Dn,On,Yn,Fn,qn,Cn,ni,ii,si,oi,li,ai,ri,ci,di,hi,fi,xi,Si,Ci,rs,ds,hs,ki,wi],Jk={version:_k,install:t=>{t&&Uk.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=Fn,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=Yn,le.EvTimePicker=hi,le.EvToggle=On,le.EvTree=di,le.EvTreeGrid=ki,le.EvWindow=li,le.default=Jk,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});