var t=Object.defineProperty,e=Object.defineProperties,o=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,n=(e,o,a)=>o in e?t(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a;import{t as i,br as s,c as u,r as c,S as b,v as d,x as f,a1 as m,H as g,I as v,B as p,u as y,M as h,ar as C,y as _,L as k,a0 as x,bD as w}from"./vendor-core-B-NFAs71.js";import{i as O}from"./index-BhVZTysP.js";const j={key:0,class:"basic-banner__meteors"},$={class:"basic-banner__content"},M=["src"],D=i((P=((t,e)=>{for(var o in e||(e={}))r.call(e,o)&&n(t,o,e[o]);if(a)for(var o of a(e))l.call(e,o)&&n(t,o,e[o]);return t})({},{name:"ArtBasicBanner"}),B={__name:"index",props:{height:{default:"11rem"},title:{},subtitle:{},boxStyle:{default:"!bg-theme/60"},decoration:{type:Boolean,default:!0},buttonConfig:{default:()=>({show:!0,text:"查看",color:"#fff",textColor:"#333",radius:"6px"})},meteorConfig:{default:()=>({enabled:!1,count:10})},imageConfig:{default:()=>({src:"",width:"8rem",bottom:"-3rem",right:"0",height:"4rem"})},titleColor:{default:"white"},subtitleColor:{default:"white"}},emits:["click","buttonClick"],setup(t,{emit:e}){const o=O(),{isDark:a}=s(o),r=t,l=e,n=u(()=>{var t,e;return null!=(e=null==(t=r.buttonConfig)?void 0:t.color)?e:"#fff"}),i=u(()=>{var t,e;return null!=(e=null==(t=r.buttonConfig)?void 0:t.textColor)?e:"#333"}),w=u(()=>{var t,e;return null!=(e=null==(t=r.buttonConfig)?void 0:t.radius)?e:"6px"}),D=c([]);return b(()=>{var t,e,o;(null==(t=r.meteorConfig)?void 0:t.enabled)&&(D.value=function(t){const e=100/t;return Array.from({length:t},(t,o)=>({x:o*e+Math.random()*e,speed:Math.random()>.5?5+3*Math.random():2+2*Math.random(),delay:5*Math.random()}))}(null!=(o=null==(e=r.meteorConfig)?void 0:e.count)?o:10))}),(e,o)=>{var r;return f(),d("div",{class:g(["art-card basic-banner",[{"has-decoration":t.decoration},t.boxStyle]]),style:m({height:t.height}),onClick:o[1]||(o[1]=t=>l("click"))},[(null==(r=t.meteorConfig)?void 0:r.enabled)&&y(a)?(f(),d("div",j,[(f(!0),d(h,null,C(D.value,(t,e)=>(f(),d("span",{key:e,class:"meteor",style:m({top:"-60px",left:`${t.x}%`,animationDuration:`${t.speed}s`,animationDelay:`${t.delay}s`})},null,4))),128))])):v("",!0),p("div",$,[_(e.$slots,"title",{},()=>[t.title?(f(),d("p",{key:0,class:"basic-banner__title",style:m({color:t.titleColor})},k(t.title),5)):v("",!0)],!0),_(e.$slots,"subtitle",{},()=>[t.subtitle?(f(),d("p",{key:0,class:"basic-banner__subtitle",style:m({color:t.subtitleColor})},k(t.subtitle),5)):v("",!0)],!0),_(e.$slots,"button",{},()=>{var e,a;return[(null==(e=t.buttonConfig)?void 0:e.show)?(f(),d("div",{key:0,class:"basic-banner__button",style:m({backgroundColor:n.value,color:i.value,borderRadius:w.value}),onClick:o[0]||(o[0]=x(t=>l("buttonClick"),["stop"]))},k(null==(a=t.buttonConfig)?void 0:a.text),5)):v("",!0)]},!0),_(e.$slots,"default",{},void 0,!0),t.imageConfig.src?(f(),d("img",{key:0,class:"basic-banner__background-image",src:t.imageConfig.src,style:m({width:t.imageConfig.width,bottom:t.imageConfig.bottom,right:t.imageConfig.right}),loading:"lazy",alt:"背景图片"},null,12,M)):v("",!0)])],6)}}},e(P,o(B))));var P,B;const S=w(D,[["__scopeId","data-v-ea2581fc"]]);export{S as _};
