PageSourceSearch

https://rastyle.co.ke/static/js/5256.e72ad59e.chunk.js

js rastyle.co.ke collected 2026-10-08 04:25:52 UTC 18,842 bytes, 3 lines download raw bytes

1/*! For license information please see 5256.e72ad59e.chunk.js.LICENSE.txt */
2"use strict";(globalThis.webpackChunkfrontend||=[]).push([[5256],{56581(e,t,i){i.d(t,{A:()=>h});var a=i(49198),o=i(19933),s=i(55191),r=i(45451),n=i(10025),l=i(94183),d=i(99187),c=i(43535),m=i(38933),p=i(25577),g=i(85582);const u="https://rastyle.co.ke";function h(e){let{entityId:t,entityType:i="creator",entityName:h="",size:x="md",variant:y="default",onFollowChange:f}=e;const{isAuthenticated:v}=(0,d.As)(),[b,w]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),[_,k]=(0,a.useState)(!1);(0,a.useEffect)(()=>{v&&t&&l.A.get(`${u}/api/follow/status?entity_id=${encodeURIComponent(t)}&entity_type=${encodeURIComponent(i)}`,(0,m.xH)()).then(e=>{w(e.data.following),k(!0)}).catch(()=>k(!0))},[v,t,i]);const A=async e=>{if(e.preventDefault(),e.stopPropagation(),v){if(!j){N(!0);try{b?(await l.A.delete(`${u}/api/follow`,(0,m.xH)({data:{entity_id:t,entity_type:i}})),w(!1),null===f||void 0===f||f(!1),(0,p.t)({entityId:t,entityType:i,following:!1}),c.oR.success(`Unfollowed ${h||i}`)):(await l.A.post(`${u}/api/follow`,{entity_id:t,entity_type:i},(0,m.xH)()),w(!0),null===f||void 0===f||f(!0),(0,p.t)({entityId:t,entityType:i,following:!0}),c.oR.success(`Following ${h||i}!`))}catch(o){var a;const e=null===(a=o.response)||void 0===a?void 0:a.status;c.oR.error(401===e?"Your session expired. Sign in again to follow.":"Follow could not be saved. Try again.")}finally{N(!1)}}}else c.oR.error("Sign in to follow")};if(!_&&v)return null;return"icon"===y?(0,g.jsx)("button",{onClick:A,disabled:j,"data-testid":`follow-btn-${i}-${t}`,className:"w-9 h-9 rounded-sm flex items-center justify-center transition-colors "+(b?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-white/5 text-muted-foreground border border-white/10 hover:bg-white/10"),title:b?"Unfollow":"Follow",children:j?(0,g.jsx)(o.A,{className:"w-4 h-4 animate-spin"}):(0,g.jsx)(r.A,{className:"w-4 h-4 "+(b?"fill-current":"")})}):(0,g.jsx)("button",{onClick:A,disabled:j,"data-testid":`follow-btn-${i}-${t}`,className:`inline-flex items-center font-semibold rounded-sm transition-all ${{xs:"px-2 py-0.5 text-[10px] gap-0.5",sm:"px-3 py-1 text-xs gap-1",md:"px-4 py-2 text-sm gap-1.5",lg:"px-6 py-2.5 text-sm gap-2"}[x]} ${b?"bg-green-500/10 text-green-400 border border-green-500/30 hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/30":"bg-green-500 text-black hover:bg-green-400"}`,children:j?(0,g.jsx)(o.A,{className:"w-4 h-4 animate-spin"}):b?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(s.A,{className:"w-4 h-4"})," Following"]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(n.A,{className:"w-4 h-4"})," Follow"]})})}},32687(e,t,i){var a=i(36012),o=i(49198),s=i(94183),r=i(85582);const n="Rastyle Republik",l="https://www.rastyle.co.ke".replace(/\/+$/,""),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;if(!e)return t;try{return new URL(e,`${l}/`).toString()}catch{return t}};let c=null,m=!1;const p=e=>{let{title:t,description:i,image:l,url:p,canonicalPath:g,canonical:u,type:h="website",noindex:x=!1,jsonLd:y,event:f,creator:v,imageAlt:b,imageWidth:w=1200,imageHeight:j=630,locale:N}=e;const[_,k]=(0,o.useState)(c);(0,o.useEffect)(()=>{m||(async()=>{if(m)return c;try{const e=await s.A.get("https://rastyle.co.ke/api/og-meta/public");e.data&&e.data.og_title&&(c=e.data)}catch{}return m=!0,c})().then(e=>{e&&k(e)})},[]);const A=/Rastyle\s+Kenya/i.test((null===_||void 0===_?void 0:_.og_site_name)||"")?n:(null===_||void 0===_?void 0:_.og_site_name)||n,$=((e,t)=>{const i=String(e||"").trim().replace(/Rastyle\s+Kenya/gi,n);return i?i.toLowerCase().includes(t.toLowerCase())?i:`${i} | ${t}`:t})(t||(null===_||void 0===_?void 0:_.og_title),A),C=i||(null===_||void 0===_?void 0:_.og_description)||"The global reggae community. Music, events, culture. One love, one platform.",S=d(l||(null===_||void 0===_?void 0:_.og_cover)||(null===_||void 0===_?void 0:_.og_logo)||"/og-image.jpg"),E=d(u||g||p||"/"),R=b||(null===_||void 0===_?void 0:_.og_image_alt)||`${$} social preview`,F=N||(null===_||void 0===_?void 0:_.og_locale)||"en_KE",M=(null===_||void 0===_?void 0:_.twitter_card)||"summary_large_image";let I=y||null;var O,T,z,H,L;(!I&&f&&(I={"@context":"https://schema.org","@type":"MusicEvent",name:f.name,startDate:f.date,endD
2ate:f.end_date,location:{"@type":"Place",name:f.venue,address:f.venue_address||f.city},description:f.description,image:f.image,offers:f.price?{"@type":"Offer",price:f.price,priceCurrency:f.currency||"KES",availability:"https://schema.org/InStock",url:E}:void 0,organizer:f.organizer?{"@type":"Organization",name:f.organizer}:void 0}),!I&&v)&&(I={"@context":"https://schema.org","@type":"MusicGroup",name:v.display_name,description:v.bio,image:v.profile_image,url:E,genre:"Reggae",sameAs:[(null===(O=v.socials)||void 0===O?void 0:O.instagram)&&`https://instagram.com/${v.socials.instagram}`,(null===(T=v.socials)||void 0===T?void 0:T.twitter)&&`https://twitter.com/${v.socials.twitter}`,null===(z=v.socials)||void 0===z?void 0:z.youtube_channel,(null===(H=v.socials)||void 0===H?void 0:H.spotify_artist_id)&&`https://open.spotify.com/artist/${v.socials.spotify_artist_id}`].filter(Boolean)});return L=I,(0,o.useEffect)(()=>{if(!L)return;const e="rastyle-jsonld";let t=document.getElementById(e);return t||(t=document.createElement("script"),t.id=e,t.type="application/ld+json",document.head.appendChild(t)),t.textContent=JSON.stringify(L),()=>{const t=document.getElementById(e);t&&t.remove()}},[L]),(e=>{let{description:t,image:i,imageAlt:a,imageHeight:s,imageWidth:r,locale:n,noindex:l,siteName:d,title:c,twitterCard:m,twitterSite:p,type:g,url:u}=e;(0,o.useEffect)(()=>{const e=[{tag:"link",selector:'link[rel="canonical"]',attributes:{rel:"canonical",href:u}},{tag:"meta",selector:'meta[name="description"]',attributes:{name:"description",content:t}},{tag:"meta",selector:'meta[property="og:type"]',attributes:{property:"og:type",content:g}},{tag:"meta",selector:'meta[property="og:title"]',attributes:{property:"og:title",content:c}},{tag:"meta",selector:'meta[property="og:description"]',attributes:{property:"og:description",content:t}},{tag:"meta",selector:'meta[property="og:image"]',attributes:{property:"og:image",content:i}},{tag:"meta",selector:'meta[property="og:image:alt"]',attributes:{property:"og:image:alt",content:a}},{tag:"meta",selector:'meta[property="og:image:width"]',attributes:{property:"og:image:width",content:String(r)}},{tag:"meta",selector:'meta[property="og:image:height"]',attributes:{property:"og:image:height",content:String(s)}},{tag:"meta",selector:'meta[property="og:locale"]',attributes:{property:"og:locale",content:n}},{tag:"meta",selector:'meta[property="og:url"]',attributes:{property:"og:url",content:u}},{tag:"meta",selector:'meta[property="og:site_name"]',attributes:{property:"og:site_name",content:d}},{tag:"meta",selector:'meta[name="twitter:card"]',attributes:{name:"twitter:card",content:m}},{tag:"meta",selector:'meta[name="twitter:title"]',attributes:{name:"twitter:title",content:c}},{tag:"meta",selector:'meta[name="twitter:description"]',attributes:{name:"twitter:description",content:t}},{tag:"meta",selector:'meta[name="twitter:image"]',attributes:{name:"twitter:image",content:i}},{tag:"meta",selector:'meta[name="twitter:image:alt"]',attributes:{name:"twitter:image:alt",content:a}},...p?[{tag:"meta",selector:'meta[name="twitter:site"]',attributes:{name:"twitter:site",content:p}}]:[],...l?[{tag:"meta",selector:'meta[name="robots"]',attributes:{name:"robots",content:"noindex,nofollow"}}]:[]].map(e=>{let{tag:t,selector:i,attributes:a}=e,o=document.head.querySelector(i);const s=!o;o||(o=document.createElement(t),document.head.appendChild(o));const r=Object.fromEntries(Object.keys(a).map(e=>[e,o.getAttribute(e)]));return Object.entries(a).forEach(e=>{let[t,i]=e;o.setAttribute(t,i)}),{attributes:a,created:s,element:o,previous:r}});return()=>{e.forEach(e=>{let{attributes:t,created:i,element:a,previous:o}=e;i?a.remove():Object.keys(t).forEach(e=>{const t=o[e];null===t?a.removeAttribute(e):a.setAttribute(e,t)})})}},[t,i,a,s,r,n,l,d,c,m,p,g,u])})({description:C,image:S,imageAlt:R,imageHeight:(null===_||void 0===_?void 0:_.og_image_height)||j,imageWidth:(null===_||void 0===_?void 0:_.og_image_width)||w,locale:F,noindex:x,siteName:A,title:$,twitterCard:M,twitterSite:null===_||void 0===_?void 0:_.twitter_site,type:h,url:E}),(0,r.jsx)(a.mg,{children:(0,r.jsx)("title",{children:$})})};i.d(t,["A",0,p])},25577(e,t,i){const a="rastyle:following-changed";i.d(t,["I",0,a,"t",0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"undefined"!==typeof window&&"undefined"!==typeof CustomEvent&&window.dispatchEvent(new CustomEvent(a,{detail:e}))}])},15256(e,t,i){i.r(t),i.d(t,{default:()=>k});var a=i(49198),o=i(98379),s=i(58625),r=i(19933),n=i(67656),l=i(72500),d=i(12465),c=i(94522),m=i(45451),p=i(21439),g=i(99520),u=i(41472),h=i(26661),x=i(86855),y=i(94183),f=i(99187),v=i(56581),b=i(32687),w=i(85582);const j="https://rastyle.co.ke",N={dj:c.A,artist:n.A,producer:g.A,radio_station:u.A,record_label:l.A,venue:p.A},_=[{id:"creators",label:"Creators",icon:x.A},{id:"tipsters",label:"Tipsters",icon:h.A},{id:"venues",label:"Venues",icon:p.A},{id:"cities",label:"Cities",icon:p.A},{id:"radio",label:"Radio",icon:u.A}];function k(){var e,t,i,n,l,c;const{isAuthenticated:p}=(0,f.As)(),[g,u]=(0,a.useState)({creators:[],tipsters:[],venues:[],cities:[],radio:[]}),[k,A]=(0,a.useState)([]),[$,C]=(0,a.useState)([]),[S,E]=(0,a.useState)("creators"),[R,F]=(0,a.useState)(!0);if((0,a.useEffect)(()=>{p&&Promise.all([y.A.get(`${j}/api/follow/my-following`,{withCredentials:!0}),y.A.get(`${j}/api/follow/feed?limit=10`,{withCredentials:!0}),y.A.get(`${j}/api/follow/tipster-picks-feed?limit=15`,{withCredentials:!0}).catch(()=>({data:{feed:[]}}))]).then(e=>{let[t,i,a]=e;u({tipsters:[],...t.data}),A(i.data.feed||[]),C(a.data.feed||[])}).catch(console.error).finally(()=>F(!1))},[p]),!p)return(0,w.jsxs)("div",{className:"min-h-screen bg-background pt-24 pb-12 text-center",children:[(0,w.jsx)(m.A,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground opacity-40"}),(0,w.jsx)("p",{className:"text-lg font-semibold",children:"Sign in to see who you follow"}),(0,w.jsx)(o.N_,{to:"/login",className:"text-sm text-green-400 hover:underline mt-2 inline-block",children:"Sign In"})]});const M=g[S]||[],I=((null===(e=g.creators)||void 0===e?void 0:e.length)||0)+((null===(t=g.tipsters)||void 0===t?void 0:t.length)||0)+((null===(i=g.venues)||void 0===i?void 0:i.length)||0)+((null===(n=g.cities)||void 0===n?void 0:n.length)||0)+((null===(l=g.radio)||void 0===l?void 0:l.length)||0);return(0,w.jsxs)("div",{className:"min-h-screen bg-background pt-24 pb-16","data-testid":"following-page",children:[(0,w.jsx)(b.A,{title:"Following \u2014 Rastyle Republik",description:"Creators, venues, and cities you follow.",url:"/following"}),(0,w.jsx)("div",{className:"max-w-5xl mx-auto px-4",children:(0,w.jsxs)("div",{className:"flex flex-col md:flex-row gap-8",children:[(0,w.jsxs)("div",{className:"flex-1",children:[(0,w.jsxs)("h1",{className:"font-heading text-2xl sm:text-3xl font-bold flex items-center gap-2 mb-2","data-testid":"following-title",children:[(0,w.jsx)(m.A,{className:"w-7 h-7 text-green-400"}),"Following ",(0,w.jsxs)("span",{className:"text-muted-foreground text-lg font-normal",children:["(",I,")"]})]}),(0,w.jsx)("p",{className:"text-sm text-muted-foreground mb-6",children:"Manage who and what you follow on Rastyle."}),(0,w.jsx)("div",{className:"flex gap-2 mb-6 overflow-x-auto","data-testid":"following-tabs",children:_.map(e=>{const t=(g[e.id]||[]).length;return(0,w.jsxs)("button",{onClick:()=>E(e.id),"data-testid":`tab-${e.id}`,className:"flex items-center gap-1.5 px-4 py-2 rounded-sm text-sm font-medium whitespace-nowrap transition-colors "+(S===e.id?"bg-green-500 text-black":"bg-white/5 text-muted-foreground hover:bg-white/10"),children:[(0,w.jsx)(e.icon,{className:"w-4 h-4"}),e.label," (",t,")"]},e.id)})}),R?(0,w.jsx)("div",{className:"py-12 flex justify-center",children:(0,w.jsx)(r.A,{className:"w-8 h-8 animate-spin text-green-400"})}):0===M.length?(0,w.jsxs)("div",{className:"py-12 text-center text-muted-foreground","data-testid":"following-empty",children:[(0,w.jsx)(m.A,{className:"w-10 h-10 mx-auto mb-2 opacity-30"}),(0,w.jsxs)("p",{className:"text-sm",children:["You're not following any ",S," yet."]}),(0,w.jsx)(o.N_,{to:"tipsters"===S?"/odds":"/aktivate",className:"text-sm text-green-400 hover:underline mt-2 inline-block",children:"tipsters"===S?"Browse the Odds Room Leaderboard":"Discover Creators"})]}):(0,w.jsx)("div",{className:"space-y-3","data-testid":"following-list",children:M.map((e,t)=>{const i="tipsters"===S?h.A:N[e.creator_type]||x.A;return(0,w.jsxs)(s.P.div,{initial:{opacity:0,y:10}
2,animate:{opacity:1,y:0},transition:{delay:.03*t},className:"flex items-center gap-4 p-4 border border-white/10 bg-card rounded-sm","data-testid":`following-item-${t}`,children:[(0,w.jsx)("div",{className:"w-12 h-12 rounded-sm bg-white/5 overflow-hidden flex-shrink-0",children:e.profile_image?(0,w.jsx)("img",{src:e.profile_image,alt:e.display_name,className:"w-full h-full object-cover"}):(0,w.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,w.jsx)(i,{className:"w-5 h-5 text-muted-foreground"})})}),(0,w.jsxs)("div",{className:"flex-1 min-w-0",children:["cities"===S?(0,w.jsxs)("p",{className:"font-semibold text-sm",children:[e.city,e.country?`, ${e.country}`:""]}):"tipsters"===S?(0,w.jsx)(o.N_,{to:"/odds",className:"font-semibold text-sm hover:text-green-400 transition-colors",children:e.display_name||e.entity_id}):(0,w.jsx)(o.N_,{to:e.slug?`/creator/${e.slug}`:"#",className:"font-semibold text-sm hover:text-green-400 transition-colors",children:e.display_name||e.entity_id}),(0,w.jsx)("p",{className:"text-xs text-muted-foreground capitalize",children:"cities"===S?"City":"radio"===S?"Radio Station":"tipsters"===S?`Tipster \xb7 ${e.wins||0} wins \xb7 ${e.win_rate||0}% (${e.played||0} picks)`:(e.creator_type||"").replace("_"," ")})]}),(0,w.jsx)(v.A,{entityId:e.entity_id,entityType:e.entity_type,entityName:e.display_name||e.city||"",size:"sm"})]},e.entity_id||t)})})]}),(0,w.jsx)("div",{className:"w-full md:w-80",children:"tipsters"===S?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)("h2",{className:"font-heading text-lg font-bold mb-4 flex items-center gap-2",children:[(0,w.jsx)(h.A,{className:"w-5 h-5 text-yellow-400"}),"Latest Picks"]}),0===$.length?(0,w.jsx)("div",{className:"p-6 border border-white/10 bg-card rounded-sm text-center text-muted-foreground text-sm","data-testid":"picks-feed-empty",children:0===(null===(c=g.tipsters)||void 0===c?void 0:c.length)?"Follow tipsters in the Odds Room to see their picks here.":"No picks yet from your followed tipsters."}):(0,w.jsx)("div",{className:"space-y-2.5","data-testid":"tipster-picks-feed",children:$.map((e,t)=>{const i="won"===e.outcome?"border-emerald-500/40 bg-emerald-500/[0.06]":"lost"===e.outcome?"border-red-500/40 bg-red-500/[0.06]":"border-white/10 bg-card",a="won"===e.outcome?"bg-emerald-400":"lost"===e.outcome?"bg-red-400":"bg-amber-400";return(0,w.jsxs)(o.N_,{to:"/odds",className:`block p-3 border rounded-sm hover:brightness-125 transition ${i}`,"data-testid":`pick-feed-item-${t}`,children:[(0,w.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1",children:[(0,w.jsxs)("span",{className:"text-[10px] uppercase tracking-wider font-bold text-yellow-300/80 inline-flex items-center gap-1",children:[(0,w.jsx)(h.A,{className:"w-3 h-3"})," ",e.tipster_display]}),(0,w.jsxs)("span",{className:"inline-flex items-center gap-1 text-[9px] uppercase tracking-wider",children:[(0,w.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${a}`}),e.outcome]})]}),(0,w.jsx)("p",{className:"text-xs font-semibold leading-tight mb-0.5",children:e.match_label}),e.league&&(0,w.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:e.league}),(0,w.jsxs)("p",{className:"text-sm font-bold text-rastyle-orange truncate",children:["\u2192 ",e.option_label]}),(0,w.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1 font-mono",children:e.voted_at?new Date(e.voted_at).toLocaleString():""})]},t)})})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)("h2",{className:"font-heading text-lg font-bold mb-4 flex items-center gap-2",children:[(0,w.jsx)(d.A,{className:"w-5 h-5 text-yellow-400"}),"From Your Creators"]}),0===k.length?(0,w.jsx)("div",{className:"p-6 border border-white/10 bg-card rounded-sm text-center text-muted-foreground text-sm","data-testid":"feed-empty",children:"Follow creators to see their latest activity here."}):(0,w.jsx)("div",{className:"space-y-3","data-testid":"follow-feed",children:k.map((e,t)=>{var i,a,s,r,n,l;return(0,w.jsxs)(o.N_,{to:null!==(i=e.event)&&void 0!==i&&i.event_id?`/events/${e.event.event_id}`:"#",className:"block p-3 border border-white/10 bg-card rounded-sm hover:border-green-500/30 transition-colors","data-testid":`feed-item-${t}`,children:[(0,w.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(null===(a=e.creator)||void 0===a?void 0:a.profile_image)&&(0,w.jsx)("img",{src:e.creator.profile_image,alt:"",className:"w-5 h-5 rounded-full object-cover"}),(0,w.jsx)("span",{className:"text-xs font-semibold truncate",children:null===(s=e.creator)||void 0===s?void 0:s.display_name})]}),(0,w.jsx)("p",{className:"text-sm font-semibold truncate",children:(null===(r=e.event)||void 0===r?void 0:r.title)||(null===(n=e.event)||void 0===n?void 0:n.name)}),(null===(l=e.event)||void 0===l?void 0:l.schedule)&&(0,w.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:new Date(e.event.schedule).toLocaleDateString()})]},t)})})]})})]})})]})}},72500(e,t,i){const a=(0,i(54235).A)("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
2],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);i.d(t,["A",0,a])},94522(e,t,i){const a=(0,i(54235).A)("disc-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]]);i.d(t,["A",0,a])},10025(e,t,i){const a=(0,i(54235).A)("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);i.d(t,["A",0,a])}}]);
3//# sourceMappingURL=5256.e72ad59e.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.