PageSourceSearch

https://rastyle.co.ke/static/js/9155.a5b0ffd0.chunk.js

js rastyle.co.ke collected 2026-10-08 04:21:49 UTC 17,163 bytes, 3 lines download raw bytes

1/*! For license information please see 9155.a5b0ffd0.chunk.js.LICENSE.txt */
2"use strict";(globalThis.webpackChunkfrontend||=[]).push([[3261,9155],{32687(e,t,a){var o=a(36012),n=a(49198),i=a(94183),r=a(85582);const s="Rastyle Republik",l="https://www.rastyle.co.ke".replace(/\/+$/,""),c=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 d=null,m=!1;const p=e=>{let{title:t,description:a,image:l,url:p,canonicalPath:h,canonical:u,type:g="website",noindex:x=!1,jsonLd:b,event:w,creator:y,imageAlt:v,imageWidth:f=1200,imageHeight:k=630,locale:j}=e;const[N,_]=(0,n.useState)(d);(0,n.useEffect)(()=>{m||(async()=>{if(m)return d;try{const e=await i.A.get("https://rastyle.co.ke/api/og-meta/public");e.data&&e.data.og_title&&(d=e.data)}catch{}return m=!0,d})().then(e=>{e&&_(e)})},[]);const $=/Rastyle\s+Kenya/i.test((null===N||void 0===N?void 0:N.og_site_name)||"")?s:(null===N||void 0===N?void 0:N.og_site_name)||s,A=((e,t)=>{const a=String(e||"").trim().replace(/Rastyle\s+Kenya/gi,s);return a?a.toLowerCase().includes(t.toLowerCase())?a:`${a} | ${t}`:t})(t||(null===N||void 0===N?void 0:N.og_title),$),C=a||(null===N||void 0===N?void 0:N.og_description)||"The global reggae community. Music, events, culture. One love, one platform.",R=c(l||(null===N||void 0===N?void 0:N.og_cover)||(null===N||void 0===N?void 0:N.og_logo)||"/og-image.jpg"),S=c(u||h||p||"/"),I=v||(null===N||void 0===N?void 0:N.og_image_alt)||`${A} social preview`,E=j||(null===N||void 0===N?void 0:N.og_locale)||"en_KE",U=(null===N||void 0===N?void 0:N.twitter_card)||"summary_large_image";let z=b||null;var L,T,q,O,M;(!z&&w&&(z={"@context":"https://schema.org","@type":"MusicEvent",name:w.name,startDate:w.date,endDate:w.end_date,location:{"@type":"Place",name:w.venue,address:w.venue_address||w.city},description:w.description,image:w.image,offers:w.price?{"@type":"Offer",price:w.price,priceCurrency:w.currency||"KES",availability:"https://schema.org/InStock",url:S}:void 0,organizer:w.organizer?{"@type":"Organization",name:w.organizer}:void 0}),!z&&y)&&(z={"@context":"https://schema.org","@type":"MusicGroup",name:y.display_name,description:y.bio,image:y.profile_image,url:S,genre:"Reggae",sameAs:[(null===(L=y.socials)||void 0===L?void 0:L.instagram)&&`https://instagram.com/${y.socials.instagram}`,(null===(T=y.socials)||void 0===T?void 0:T.twitter)&&`https://twitter.com/${y.socials.twitter}`,null===(q=y.socials)||void 0===q?void 0:q.youtube_channel,(null===(O=y.socials)||void 0===O?void 0:O.spotify_artist_id)&&`https://open.spotify.com/artist/${y.socials.spotify_artist_id}`].filter(Boolean)});return M=z,(0,n.useEffect)(()=>{if(!M)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(M),()=>{const t=document.getElementById(e);t&&t.remove()}},[M]),(e=>{let{description:t,image:a,imageAlt:o,imageHeight:i,imageWidth:r,locale:s,noindex:l,siteName:c,title:d,twitterCard:m,twitterSite:p,type:h,url:u}=e;(0,n.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:h}},{tag:"meta",selector:'meta[property="og:title"]',attributes:{property:"og:title",content:d}},{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:a}},{tag:"meta",selector:'meta[property="og:image:alt"]',attributes:{property:"og:image:alt",content:o}},{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(i)}},{tag:"meta",selector:'meta[property="og:locale"]',attributes:{property:"og:locale",content:s}},{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:c}},{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:d}},{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:a}},{tag:"meta",selector:'meta[name="twitter:image:alt"]',attributes:{name:"twitter:image:alt",content:o}},...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:a,attributes:o}=e,n=document.head.querySelector(a);const i=!n;n||(n=document.createElement(t),document.head.appendChild(n));const r=Object.fromEntries(Object.keys(o).map(e=>[e,n.getAttribute(e)]));
2return Object.entries(o).forEach(e=>{let[t,a]=e;n.setAttribute(t,a)}),{attributes:o,created:i,element:n,previous:r}});return()=>{e.forEach(e=>{let{attributes:t,created:a,element:o,previous:n}=e;a?o.remove():Object.keys(t).forEach(e=>{const t=n[e];null===t?o.removeAttribute(e):o.setAttribute(e,t)})})}},[t,a,o,i,r,s,l,c,d,m,p,h,u])})({description:C,image:R,imageAlt:I,imageHeight:(null===N||void 0===N?void 0:N.og_image_height)||k,imageWidth:(null===N||void 0===N?void 0:N.og_image_width)||f,locale:E,noindex:x,siteName:$,title:A,twitterCard:U,twitterSite:null===N||void 0===N?void 0:N.twitter_site,type:g,url:S}),(0,r.jsx)(o.mg,{children:(0,r.jsx)("title",{children:A})})};a.d(t,["A",0,p])},93261(e,t,a){a.r(t);var o=a(81232),n=a(58625),i=a(55191),r=a(27227),s=a(60719),l=a(97021),c=a(19737),d=a(23041),m=a(64759),p=a(15396),h=a(49198),u=a(43535),g=a(94183),x=a(85582);const b=(e,t,a,o)=>{try{g.A.post("https://rastyle.co.ke/api/shareable-content/record-share",{platform:e,content_type:t||"content",content_id:a||void 0,url:o||void 0},{withCredentials:!0,timeout:3e3}).catch(()=>{})}catch{}},w=e=>{const t="undefined"!==typeof window?window.location.href:"https://rastyle.co.ke/",a="undefined"!==typeof window?window.location.origin:"https://rastyle.co.ke";try{return new URL(e||t,a).toString()}catch{return t}},y=e=>{let{title:t,url:a,description:g="",type:y="content",contentId:v="",compact:f=!1,label:k="Share",className:j=""}=e;const[N,_]=(0,h.useState)(!1),[$,A]=(0,h.useState)(!1),C=(0,h.useRef)(null),R=w(a),S=g||`Check out "${t}" on Rastyle Republik! #FeelTheVibe #MyStyleIsRastyle`;(0,h.useEffect)(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&_(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const I=[{name:"Twitter / X",icon:p.A,action:()=>{const e=`https://twitter.com/intent/tweet?text=${encodeURIComponent(S)}&url=${encodeURIComponent(R)}`;window.open(e,"_blank","width=550,height=420"),b("twitter",y,v,R),_(!1)},color:"hover:text-blue-400"},{name:"Facebook",icon:r.A,action:()=>{const e=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(R)}&quote=${encodeURIComponent(S)}`;window.open(e,"_blank","width=550,height=420"),b("facebook",y,v,R),_(!1)},color:"hover:text-blue-500"},{name:"WhatsApp",icon:c.A,action:()=>{const e=`https://wa.me/?text=${encodeURIComponent(S+" "+R)}`;window.open(e,"_blank"),b("whatsapp",y,v,R),_(!1)},color:"hover:text-green-500"},{name:"Telegram",icon:d.A,action:()=>{const e=`https://t.me/share/url?url=${encodeURIComponent(R)}&text=${encodeURIComponent(S)}`;window.open(e,"_blank"),b("telegram",y,v,R),_(!1)},color:"hover:text-blue-400"},{name:"LinkedIn",icon:l.A,action:()=>{const e=`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(R)}`;window.open(e,"_blank","width=550,height=420"),b("linkedin",y,v,R),_(!1)},color:"hover:text-blue-600"}];return(0,x.jsxs)("div",{className:`relative ${j}`,ref:C,"data-testid":"share-button-container",children:[(0,x.jsxs)("button",{onClick:async()=>{if(navigator.share)try{await navigator.share({title:t,text:S,url:R}),b("native",y,v,R)}catch(e){"AbortError"!==e.name&&_(!0)}else _(!0)},"data-testid":"share-button",className:"flex items-center gap-2 transition-colors duration-300 "+(f?"p-2 hover:bg-white/10 rounded-full":"px-3 py-2 hover:bg-white/10 rounded-sm"),title:`${k} ${t||"Rastyle Republik"}`,"aria-label":`${k} ${t||"Rastyle Republik"}`,children:[(0,x.jsx)(m.A,{className:f?"w-4 h-4":"w-5 h-5"}),!f&&(0,x.jsx)("span",{className:"text-sm",children:k})]}),(0,x.jsx)(o.N,{children:N&&(0,x.jsxs)(n.P.div,{initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"absolute right-0 mt-2 w-52 glass-card rounded-sm p-2 z-50 shadow-xl","data-testid":"share-menu",children:[(0,x.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground border-b border-white/10 mb-2",children:"Share to..."}),I.map(e=>{const t=e.icon;return(0,x.jsxs)("button",{onClick:e.action,"data-testid":`share-${e.name.toLowerCase().replace(/\s+/g,"-")}`,className:`w-full flex items-center gap-3 px-3 py-2.5 hover:bg-white/10 rounded-sm transition-colors duration-200 ${e.color}`,children:[(0,x.jsx)(t,{className:"w-4 h-4"}),(0,x.jsx)("span",{className:"text-sm",children:e.name})]},e.name)}),(0,x.jsx)("div",{className:"border-t border-white/10 mt-2 pt-2",children:(0,x.jsxs)("button",{onClick:async()=>{try{await navigator.clipboard.writeText(R),A(!0),u.oR.success("Link copied to clipboard!"),setTimeout(()=>A(!1),2e3),b("copy",y,v,R)}catch(e){u.oR.error("Failed to copy link")}_(!1)},"data-testid":"share-copy-link",className:"w-full flex items-center gap-3 px-3 py-2.5 hover:bg-white/10 rounded-sm transition-colors duration-200",children:[$?(0,x.jsx)(i.A,{className:"w-4 h-4 text-accent"}):(0,x.jsx)(s.A,{className:"w-4 h-4"}),(0,x.jsx)("span",{className:"text-sm",children:$?"Copied!":"Copy Link"})]})})]})})]})};a.d(t,["ShareBar",0,e=>{let{title:t,url:a,type:o="content",contentId:n="",className:i=""}=e;const s=w(a),l=`Check out "${t}" on Rastyle Republik!`,m=[{icon:p.A,label:"Twitter",color:"bg-blue-500 hover:bg-blue-600",action:()=>{window.open(`https://twitter.com/intent/tweet?text=${encodeURIComponent(l)}&url=${encodeURIComponent(s)}`,"_blank"),b("twitter",o,n,s)}},{icon:r.A,label:"Facebook",color:"bg-blue-600 hover:bg-blue-700",action:()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(s)}`,"_blank"),b("facebook",o,n,s)}},{icon:c.A,label:"WhatsApp",color:"bg-green-500 hover:bg-green-600",action:()=>{window.open(`https://wa.me/?text=${encodeURIComponent(l+" "+s)}`,"_blank"),b("whatsapp",o,n,s)}},{icon:d.A,label:"Telegram",color:"bg-blue-400 hover:bg-blue-500",action:()=>{window.open(`https://t.me/share/url?url=${encodeURIComponent(s)}&text=${encodeURIComponent(l)}`,"_blank"),b("telegram",o,n,s)}}];return(0,x.jsxs)("div",{className:`flex items-center gap-2 ${i}`,"data-testid":"share-bar",children:[(0,x.jsx)("span",{className:"text-sm text-muted-foreground mr-2",children:"Share:"}),m.map(e=>{const t=e.icon;return(0,x.jsx)("button",{onClick:e.action,"data-testid":`share-bar-${e.label.toLowerCase()}`,className:`p-2 rounded-full ${e.color} text-white transition-colors`,title:`Share on ${e.label}`,children:(0,x.jsx)(t,{className:"w-4 h-4"})},e.label)})]})},"default",0,y,"resolveShareUrl",0,w])},99155(e,t,a){a.r(t),a.d(t,{default:()=>u});var o=a(49198),n=a(98379),i=a(94183),r=a(58625),s=a(19933),l=a(82844),c=a(31816),d=a(32687),m=a(93261),p=a(2220),h=a(85582);function u(){var e,t;const{slug:a}=(0,n.g)(),u=(0,n.Zp)(),[g,x]=(0,o.useState)(null),[b,w]=(0,o.useState)(!0);if((0,o.useEffect)(()=>{let e=!1;return i.A.get(`https://rastyle.co.ke/api/afrika-shop/collections/${a}`).then(t=>{e||(x(t.data),w(!1))}).catch(()=>{e||w(!1)}),()=>{e=!0}},[a]),b)return(0,h.jsx)("div",{className:"min-h-screen bg-black flex items-center justify-center",children:(0,h.jsx)(s.A,{className:"w-8 h-8 animate-spin text-emerald-400"})});if(!g)return(0,h.jsxs)("div",{className:"min-h-screen bg-black flex flex-col items-center justify-center p-6",children:[(0,h.jsx)(p.A,{}),(0,h.jsx)("h1",{className:"font-heading text-3xl font-extrabold uppercase mb-2",children:"Collection not found"}),(0,h.jsx)("p",{className:"text-zinc-400 mb-6",children:"It may have been unpublished or renamed."}),(0,h.jsx)(n.N_,{to:"/afrika-shop",className:"px-4 py-2 bg-emerald-500 text-black font-bold uppercase tracking-wider text-xs rounded-sm",children:"Back to shop"})]});const y=g.items||[],v=g.cover_image||(null===(e=y[0])||void 0===e||null===(t=e.images)||void 0===t?void 0:t[0])||"";return(0,h.jsxs)("div",{className:"min-h-screen bg-black","data-testid":"shop-collection-
2page",children:[(0,h.jsx)(d.A,{title:`${g.name} \u2014 Rastyle Shop`,description:g.description||`Shop the ${g.name} collection on Rastyle.`,image:v,url:`/afrika-shop/collections/${g.slug}`,type:"product.group"}),(0,h.jsx)(p.A,{}),(0,h.jsx)("section",{className:`relative pt-24 pb-10 bg-gradient-to-br ${g.accent_color||"from-emerald-500/30 via-emerald-500/10 to-transparent"} overflow-hidden`,children:(0,h.jsxs)("div",{className:"max-w-6xl mx-auto px-5 sm:px-8 relative z-10",children:[(0,h.jsxs)("button",{onClick:()=>u(-1),className:"inline-flex items-center gap-1 text-zinc-300 hover:text-white text-xs font-mono uppercase tracking-wider mb-6","data-testid":"collection-back-btn",children:[(0,h.jsx)(l.A,{className:"w-4 h-4"})," Back"]}),(0,h.jsxs)("div",{className:"flex flex-col sm:flex-row gap-6 items-start sm:items-end",children:[v&&(0,h.jsx)("img",{src:v,alt:g.name,className:"w-40 h-40 sm:w-56 sm:h-56 object-cover rounded-sm border border-white/10 shadow-2xl"}),(0,h.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,h.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-[0.25em] text-emerald-300 mb-2",children:"Rastyle Shop \xb7 Collection"}),(0,h.jsx)("h1",{className:"font-heading text-4xl sm:text-6xl font-black uppercase tracking-tight mb-3",children:g.name}),g.description&&(0,h.jsx)("p",{className:"text-zinc-300 text-base sm:text-lg max-w-2xl mb-4",children:g.description}),(0,h.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,h.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs font-mono uppercase tracking-wider text-zinc-400",children:[(0,h.jsx)(c.A,{className:"w-3.5 h-3.5"})," ",y.length," item",1===y.length?"":"s"]}),(0,h.jsx)(m.default,{title:`${g.name} on Rastyle Shop`,url:`/afrika-shop/collections/${g.slug}`,type:"collection"})]})]})]})]})}),(0,h.jsx)("section",{className:"py-10 max-w-6xl mx-auto px-5 sm:px-8",children:0===y.length?(0,h.jsxs)("div",{className:"text-center py-16 text-zinc-500",children:[(0,h.jsx)(c.A,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),(0,h.jsx)("p",{children:"No products in this collection yet."})]}):(0,h.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4 sm:gap-5",children:y.map((e,t)=>{var a;return(0,h.jsx)(r.P.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.03*t},"data-testid":`collection-product-${t}`,children:(0,h.jsxs)(n.N_,{to:`/afrika-shop/${e.product_id}`,className:"group block rounded-sm overflow-hidden border border-white/5 bg-zinc-900/50 hover:border-emerald-400/40 transition-all",children:[(0,h.jsx)("div",{className:"aspect-square overflow-hidden",children:(0,h.jsx)("img",{src:(null===(a=e.images)||void 0===a?void 0:a[0])||"",alt:e.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform",loading:"lazy"})}),(0,h.jsxs)("div",{className:"p-3",children:[(0,h.jsx)("p",{className:"text-sm font-bold line-clamp-1",children:e.title}),(0,h.jsxs)("p",{className:"text-xs text-emerald-300 font-bold mt-1",children:["KSh ",Number(e.price_kes||0).toLocaleString()]})]})]})},e.product_id)})})})]})}},82844(e,t,a){const o=(0,a(54235).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);a.d(t,["A",0,o])},60719(e,t,a){const o=(0,a(54235).A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);a.d(t,["A",0,o])},97021(e,t,a){const o=(0,a(54235).A)("linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);a.d(t,["A",0,o])},64759(e,t,a){const o=(0,a(54235).A)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);a.d(t,["A",0,o])}}]);
3//# sourceMappingURL=9155.a5b0ffd0.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.