import{d as w,r as z,k as s,ai as c,o as i,M as d,O as C,a as l,J as N,U as h,T as m,P as U,V as J,I as u}from"./vue.adf17aba.js";import{T as O}from"./index.05a2d588.js";import{_ as P}from"./_plugin-vue_export-helper.c27b6911.js";const j={class:"metric-value"},q={class:"metric-pre"},A=w({name:"MCard",__name:"mCard",props:{modelValue:{},metricItems:{},color:{}},emits:["update:modelValue","change-metric"],setup(x,{emit:k}){const t=x,p=k,n=z(t.modelValue),B=(e,a)=>{p("update:modelValue",e),p("change-metric",e,a)},o=s(()=>{const e=t.metricItems.find(a=>a.value===n.value);return e||null}),T=s(()=>{const e={"border-top-color":"rgb(232, 244, 255)"};return t.color&&(e["border-top-color"]=t.color),e}),_=s(()=>{var e;return(((e=o.value)==null?void 0:e.gapVal)??-1)>0}),r=s(()=>_.value?"green":"red");return(e,a)=>{const b=c("Top"),I=c("Bottom"),S=c("el-icon"),M=c("el-card");return i(),d(M,{class:"metric-card"},{default:C(()=>{var v,V,f,g,y;return[l("div",{class:"metric-card__color",style:N(T.value)},null,4),h(O,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=D=>n.value=D),options:t.metricItems,onChange:B},null,8,["modelValue","options"]),l("div",j,m((v=o.value)==null?void 0:v.metricVal),1),l("div",q,[l("span",null,m((V=o.value)==null?void 0:V.preVal)+"  ",1),U(h(S,{style:{display:"inline-block","padding-top":"2px"}},{default:C(()=>[_.value?(i(),d(b,{key:0,class:u(r.value)},null,8,["class"])):(i(),d(I,{key:1,class:u(r.value)},null,8,["class"]))]),_:1},512),[[J,(f=o.value)==null?void 0:f.gapVal]]),l("span",{class:u(r.value)},m((g=o.value)!=null&&g.gapVal?((y=o.value)==null?void 0:y.gapVal)+"%":""),3)])]}),_:1})}}});const H=P(A,[["__scopeId","data-v-a765336d"]]);export{H as default};
