import{o as d,c as _,x as h,a as t,Q as x,p as b,n as f,r as y,h as n,w as z,u as s,i as g,t as v,j as $,k,s as B,F as C,E as S}from"./app-D4Dqsdnh.js";const F=t("path",{d:"M15.5 0L19.5087 9.9825L30.2414 10.7102L21.9862 17.6075L24.6107 28.0398L15.5 22.32L6.38933 28.0398L9.01379 17.6075L0.758624 10.7102L11.4913 9.9825L15.5 0Z",fill:"currentColor"},null,-1),M=[F],N={__name:"Star",props:{classes:String},setup(e){return(r,c)=>(d(),_("svg",{width:"31",height:"29",viewBox:"0 0 31 29",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:h(e.classes)},M,2))}},V={class:"container space-y-8 text-center"},A={class:"lg:text-3xl"},R={__name:"Favorite",props:{slug:String,favorited:Boolean,size:String},setup(e){const r=x(),c=b(()=>r.props.auth.user),a=f(!1),o=e,l=f(o.favorited?o.favorited:!1);let u=async()=>{c.value?(await S.post(`api/favorites/${o.slug}`),l.value=!l.value):a.value=!0},m=()=>{a.value=!1};return(i,p)=>{const w=y("Link");return d(),_(C,null,[t("button",{type:"button",onClick:p[0]||(p[0]=z((...L)=>s(u)&&s(u)(...L),["prevent"])),class:h([[l.value?"text-bpi-yellow":"text-bpi-slate-blue",e.size==="large"?"left-2 top-2 size-11":"left-2 top-2 size-8 lg:size-9"],"clip-star absolute transition-colors ease-in-out"])},[n(N,{class:"size-full"})],2),n(B,{show:a.value,close:s(m)},{default:g(()=>[t("div",V,[t("h5",A,v(i.$t("onlyAvailableToRegisteredUsers")),1),n(w,{href:i.route("registration."+s($)()),class:"btn btn-yellow"},{default:g(()=>[k(v(i.$t("registration")),1)]),_:1},8,["href"])])]),_:1},8,["show","close"])],64)}}};export{R as _};