import{d as u,r as o,e as p,f as a}from"./index-d4a54385.js";const m="_wrap_1mptt_1",f="_notice_1mptt_7",r={wrap:m,notice:f},v=u({name:"TheNoticeBar",props:{text:{type:String,default:""}},setup(s){const e=o(),n=o(),t=p({isActive:!1,wrapWidth:0,contentWidth:0,contentStyle:{transitionDuration:"0s",transform:"translateX(0px)"},time:null}),c=()=>{t.isActive||!n.value||!e.value||(t.isActive=!0,t.contentWidth=n.value.getBoundingClientRect().width,t.wrapWidth=e.value.getBoundingClientRect().width,i())},i=()=>{if(t.contentWidth<=t.wrapWidth||!t.isActive){t.contentStyle.transitionDuration="0s",t.contentStyle.transform="translateX(0px)";return}t.contentStyle.transitionDuration="5s",t.contentStyle.transform="translateX(-100%)",t.time=setTimeout(()=>{t.contentStyle.transitionDuration="0s",t.contentStyle.transform=`translateX(${t.wrapWidth}px)`,requestAnimationFrame(()=>{i()})},5*1e3)},l=()=>{clearTimeout(t.time),t.isActive=!1,t.contentStyle.transitionDuration="0s",t.contentStyle.transform="translateX(0px)",t.time=null};return()=>a("div",{ref:e,class:r.wrap,onMouseenter:()=>c(),onMouseleave:()=>l()},[a("div",{ref:n,style:t.contentStyle,class:r.notice},[s.text])])}});export{v as T};
