import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{A as t,D as n,I as r,P as i,Xt as a,Yt as o,et as s,k as c,qt as l,rt as u}from"./vue-vendor-DMUmTARL.js";import{in as d}from"./icons-vendor-Db5MGAkr.js";import{t as f}from"./_plugin-vue_export-helper-CWyGVBf-.js";import{t as p}from"./MonitorSparkline-DLtKCHCy.js";var m=[`aria-label`],h={class:`flex items-baseline justify-between gap-2`},g={class:`flex min-w-0 items-center gap-1.5 text-xs text-zinc-500`},_={class:`truncate`},v={class:`shrink-0 text-sm font-semibold tabular-nums text-zinc-900 dark:text-zinc-100`},y={class:`mt-2 h-9`},b=[`title`],x=[`aria-label`],S={class:`flex items-baseline justify-between gap-2`},C={class:`truncate text-xs font-medium text-secondary`},w={class:`mt-1.5 flex items-baseline gap-1`},T={class:`truncate text-xl font-bold tracking-tight text-primary`},E={key:0,class:`shrink-0 text-xs font-medium text-placeholder`},D=[`title`],O={class:`mt-2 h-8`},k={key:2,class:`zf-monitor-micro-card`},A={class:`truncate text-xs font-medium text-secondary`},j={class:`mt-1.5 flex items-baseline gap-1`},M={class:`truncate text-base font-bold leading-tight tracking-tight text-primary`},N={key:0,class:`shrink-0 text-xs font-medium text-placeholder`},P={key:0,class:`mt-2 space-y-1`},F=r({__name:`MonitorMicroCardItem`,props:{title:{},value:{},unit:{default:``},historyData:{default:()=>[]},clickable:{type:Boolean,default:!1},accentVar:{default:`--zf-chart-primary`},subtitle:{default:``},timestamps:{default:()=>[]},valueFormatter:{type:Function,default:void 0},yRange:{default:void 0},smoothEwma:{type:Boolean,default:!0},demoStyle:{type:Boolean,default:!1},accentColor:{default:`#3b82f6`},active:{type:Boolean,default:!1}},emits:[`click`],setup(e,{emit:r}){let f=r;return(r,F)=>{let I=d;return e.clickable&&e.demoStyle?(s(),t(`button`,{key:0,type:`button`,class:l([`rounded-xl border p-4 text-left transition`,e.active?`border-transparent bg-zinc-50 ring-2 dark:bg-zinc-800/60`:`border-zinc-100 bg-zinc-50/60 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-800/30 dark:hover:bg-zinc-800/50`]),style:o(e.active?{"--tw-ring-color":e.accentColor}:void 0),"aria-label":`查看${e.title}详细趋势图`,onClick:F[0]||=e=>f(`click`)},[n(`div`,h,[n(`span`,g,[n(`span`,{class:`h-2 w-2 shrink-0 rounded-full`,style:o({backgroundColor:e.accentColor})},null,4),n(`span`,_,a(e.title),1)]),n(`span`,v,a(e.value)+a(e.unit),1)]),n(`div`,y,[i(p,{points:e.historyData||[],"color-var":e.accentVar,color:e.accentColor,area:``,timestamps:e.timestamps,"value-formatter":e.valueFormatter,"y-range":e.yRange,"smooth-ewma":e.smoothEwma},null,8,[`points`,`color-var`,`color`,`timestamps`,`value-formatter`,`y-range`,`smooth-ewma`])]),e.subtitle?(s(),t(`div`,{key:0,class:`mt-1 truncate text-[11px] text-zinc-400`,title:e.subtitle},a(e.subtitle),9,b)):c(``,!0)],14,m)):e.clickable?(s(),t(`button`,{key:1,type:`button`,class:`zf-monitor-micro-card micro-card--clickable group`,"aria-label":`查看${e.title}详细趋势图`,onClick:F[1]||=e=>f(`click`)},[n(`div`,S,[n(`span`,C,a(e.title),1),i(I,{class:`h-3.5 w-3.5 shrink-0 text-placeholder transition-colors group-hover:text-zp`})]),n(`div`,w,[n(`span`,T,a(e.value),1),e.unit?(s(),t(`span`,E,a(e.unit),1)):c(``,!0)]),e.subtitle?(s(),t(`span`,{key:0,class:`mt-1 block truncate text-[11px] leading-tight text-placeholder`,title:e.subtitle},a(e.subtitle),9,D)):c(``,!0),n(`div`,O,[i(p,{points:e.historyData||[],"color-var":e.accentVar,timestamps:e.timestamps,"value-formatter":e.valueFormatter,"y-range":e.yRange,"smooth-ewma":e.smoothEwma},null,8,[`points`,`color-var`,`timestamps`,`value-formatter`,`y-range`,`smooth-ewma`])])],8,x)):(s(),t(`div`,k,[n(`span`,A,a(e.title),1),n(`div`,j,[n(`span`,M,a(e.value),1),e.unit?(s(),t(`span`,N,a(e.unit),1)):c(``,!0)]),r.$slots.extra?(s(),t(`div`,P,[u(r.$slots,`extra`,{},void 0,!0)])):c(``,!0)]))}}}),I=e({default:()=>L}),L=f(F,[[`__scopeId`,`data-v-91afb101`]]);export{I as n,L as t};