import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{Q as t,Z as n,nt as r}from"./element-plus-vendor-BF9PNysW.js";import{A as i,D as a,I as o,N as s,O as c,P as l,Xt as u,et as d,ht as f,nt as p,qt as m,x as h}from"./vue-vendor-DMUmTARL.js";import{t as g}from"./_plugin-vue_export-helper-CWyGVBf-.js";import{t as _}from"./ZPinyinSelect-DRMKnqqN.js";import{t as v}from"./TrendChart-qGF9GYVX.js";var y={class:`rounded-zf-lg border border-border-light bg-surface p-5 sm:p-6`},b={class:`mb-4 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`},x={class:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center`},S={class:`flex max-w-full items-center gap-1 overflow-x-auto pb-1 text-xs`},C=[`onClick`],w={class:`text-xs text-secondary`},T=o({__name:`DownloadStatsAnalysis`,props:{trendData:{},trendLoading:{type:Boolean},smooth:{type:Boolean},hideEmpty:{type:Boolean},granularity:{},hourDisabled:{type:Boolean},rangeLabel:{},scopeLabel:{},selectedScopes:{},scopes:{},storageKey:{},storageOptions:{}},emits:[`update:smooth`,`update:hideEmpty`,`granularity-change`,`scope-all`,`scope-toggle`,`storage-change`],setup(e,{emit:o}){let g=o,T=e=>[`flex shrink-0 items-center gap-1.5 rounded-zf-sm px-2.5 py-1.5 font-medium transition-all duration-300 ease-in-out`,e?`bg-zp/10 text-zp`:`text-secondary hover:bg-page hover:text-primary`],E=e=>{g(`storage-change`,typeof e==`string`?e:void 0)};return(o,D)=>{let O=r,k=_,A=n,j=t;return d(),i(`section`,y,[a(`div`,b,[D[4]||=a(`div`,null,[a(`h2`,{class:`text-sm font-semibold text-primary`},`下载趋势`),a(`p`,{class:`mt-0.5 text-xs text-placeholder`},`筛选影响概览、趋势与下方维度分析`)],-1),a(`div`,x,[l(k,{"model-value":e.storageKey,clearable:``,filterable:``,placeholder:`全部存储源`,class:`w-full sm:w-48`,onChange:E},{default:f(()=>[(d(!0),i(h,null,p(e.storageOptions,e=>(d(),c(O,{key:e.storageKey,label:e.storageName||e.storageKey,value:e.storageKey},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`]),a(`div`,S,[a(`button`,{type:`button`,class:m(T(!e.selectedScopes.length)),onClick:D[0]||=e=>g(`scope-all`)},` 全部 `,2),(d(!0),i(h,null,p(e.scopes,t=>(d(),i(`button`,{key:t.key,type:`button`,class:m(T(e.selectedScopes.includes(t.key))),onClick:e=>g(`scope-toggle`,t.key)},[a(`span`,{class:m([`h-2 w-2 rounded-full`,t.colorClass])},null,2),s(` `+u(t.label),1)],10,C))),128))])])]),l(v,{"trend-data":e.trendData,loading:e.trendLoading,smooth:e.smooth,"hide-empty":e.hideEmpty,"chart-height-class":`h-72 sm:h-80 xl:h-96`,"export-file-name":`download-trend`,"onUpdate:smooth":D[2]||=e=>g(`update:smooth`,e),"onUpdate:hideEmpty":D[3]||=e=>g(`update:hideEmpty`,e)},{title:f(()=>[a(`span`,w,u(e.rangeLabel)+` · `+u(e.scopeLabel),1)]),"toolbar-prepend":f(()=>[l(j,{"model-value":e.granularity,size:`small`,onChange:D[1]||=e=>g(`granularity-change`,e)},{default:f(()=>[l(A,{value:`day`},{default:f(()=>[...D[5]||=[s(`按天`,-1)]]),_:1}),l(A,{value:`hour`,disabled:e.hourDisabled,title:e.hourDisabled?`日期范围超过 7 天时不支持按小时统计`:``},{default:f(()=>[...D[6]||=[s(` 按小时 `,-1)]]),_:1},8,[`disabled`,`title`])]),_:1},8,[`model-value`])]),_:1},8,[`trend-data`,`loading`,`smooth`,`hide-empty`])])}}}),E=e({default:()=>D}),D=g(T,[[`__scopeId`,`data-v-4c007a49`]]);export{E as n,D as t};