1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[618],{78386:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/activations",function(){return i(40761)}])},40761:function(e,t,i){"use strict";i.r(t),i.d(t,{__N_SSG:function(){return eC},default:function(){return eS}});var r=i(52322),a=i(67472),n=i(34873),l=i(39097),o=i.n(l),s=i(2784),d=i(28879),c=i.n(d),u=i(10329),x=i(25303),p=i(3456),h=i(48036),g=i(7896);i(28316);var v=i(99575);let m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let i=(0,s.forwardRef)((e,i)=>{let{asChild:r,...a}=e,n=r?v.g7:t;return(0,s.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,s.createElement)(n,(0,g.Z)({},a,{ref:i}))});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),f=(0,s.forwardRef)((e,t)=>{let{ratio:i=1,style:r,...a}=e;return(0,s.createElement)("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/i}%`},"data-radix-aspect-ratio-wrapper":""},(0,s.createElement)(m.div,(0,g.Z)({},a,{ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})))});var w=i(96577),j=i.n(w),b=i(71977),k=i.n(b);let y=(0,n.F4)({"0%":{opacity:0,transform:"scale(0.9)"},"100%":{opacity:1,transform:"scale(1)"}}),E=(0,n.zo)("div",{display:"block",minWidth:0,transition:"all 0.2s ease-out",borderRadius:"12px",background:"$whiteA025",borderStyle:"solid",padding:"8px",borderWidth:"1px",borderColor:"$whiteA050",willChange:"transform",animation:"".concat(y," 500ms cubic-bezier(0.16, 1, 0.3, 1)"),"&:hover":{transform:"scale(0.97)"}}),I=(0,n.zo)(f,{borderRadius:"4px",overflow:"hidden",marginBottom:"8px",background:"$whiteA050"});I.defaultProps={ratio:2},(0,n.zo)("div",{borderRadius:"inherit",width:"100%",height:"100%",position:"absolute",transition:"all 1000ms ease",variants:{loading:{true:{backdropFilter:"blur(40px)"}}}});let C=(0,n.zo)(j(),{borderRadius:"inherit",width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",transition:"all 1000ms ease",variants:{loading:{true:{opacity:0}}}}),S=(0,n.zo)("div",{position:"absolute",top:"8px",left:"8px",display:"flex",alignItems:"center",gap:"8px"}),z=(0,n.zo)("div",{animation:"".concat(y," 500ms cubic-bezier(0.16, 1, 0.3, 1)"),display:"flex",alignItems:"center",gap:"4px",borderRadius:"4px",padding:"0px 8px",fontSize:"12px",height:"20px",lineHeight:"12px",fontWeight:500,background:"$whiteA800",color:"$black",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...k().style,variants:{variant:{success:{background:"linear-gradient(62.88deg, #A2F9FF -2.44%, #5BFA7E 101.34%)",color:"$black"},disabled:{background:"#606060",color:"$white"},warning:{background:"linear-gradient(90deg, #FFBE5E 0%, #E3CA46 100%)",color:"$white"},default:{background:"$whiteA800",color:"$black"}},thin:{true:{fontWeight:400}}}}),A=(0,n.zo)("span",{}),T=(0,n.zo)("svg",{width:"12px",height:"12px",strokeWidth:"2px",flexShrink:0}),B={Root:E,ImageRoot:I,Image:C,BadgeList:S,Badge:z,BadgeLabel:A,BadgeIcon:T,Footer:(0,n.zo)("div",{marginBottom:"4px"}),Text:(0,n.zo)("div",{fontSize:"14px",lineHeight:"22px",fontWeight:500,color:"$white",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",variants:{variant:{secondary:{color:"$whiteA500",fontWeight:400}},noShrink:{true:{flexShrink:0}}}}),Avatar:(0,n.zo)(n.qE,{width:"20px",height:"20px",flexShrink:0})},R=e=>(0,s.useMemo)(()=>{let{tracksTabActivation:t}=e,{startDate:i,endDate:r}=t,a=new Date(i).valueOf(),n=new Date(r).valueOf(),l=Date.now();return n<l?{label:"CLOSED",variant:"disabled"}:a>l?{label:"UPCOMING"}:n-864e5<l?{label:"CLOSING SOON",variant:"warning"}:{label:"OPEN",variant:"success"}},[e]),$=e=>{var t,i;let{data:r}=u.z.useTracks({params:{perPage:0,mediaCollectionId:e}});return(null==r?void 0:null===(i=r.pages[0])||void 0===i?void 0:null===(t=i.meta)||void 0===t?void 0:t.total)||0},O=e=>{let{mcExtra:t,mc:i}=e,{label:a,variant:l}=R(t),o=$(i.id);return(0,r.jsxs)(B.BadgeList,{children:[(0,r.jsx)(B.Badge,{variant:l,children:(0,r.jsx)(B.BadgeLabel,{children:a})}),o>0&&(0,r.jsxs)(B.Badge,{children:[(0,r.jsx)(B.BadgeIcon,{as:n.PJ.Q}),(0,r.jsx)(B.BadgeLabel,{children:o})]})]})},P=e=>{var t,i,r;let{mc:a,mcExtra:n}=e,{tracksTabActivation:l}=n,o=(null==l?void 0:null===(i=l.customCoverImage)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:t.attributes.url)||(null===(r=a.coverImage)||void 0===r?void 0:r.url),[d,c]=(0,s.use
1State)(!0);return{src:o,loading:d,handleLoad:()=>c(!1)}},F=e=>{let{mc:t,mcExtra:i}=e,{src:a,loading:n,handleLoad:l}=P({mc:t,mcExtra:i});return(0,r.jsxs)(B.ImageRoot,{children:[(0,r.jsx)(B.Image,{src:a,loading:n,onLoadingComplete:l,fill:!0,alt:"cover image"}),(0,r.jsx)(O,{mc:t,mcExtra:i})]})},N=e=>(0,s.useMemo)(()=>{let{tracksTabActivation:t}=e,{startDate:i,endDate:r}=t,a=new Date(i).valueOf(),n=new Date(r).valueOf(),l=Date.now();return n<l?c()(n).fromNow():a>l?"In ".concat(c()(a).fromNow(!0)):"".concat(c()(n).fromNow(!0)," left")},[e]),W=e=>{var t;let{mc:i,mcExtra:a}=e,{tracksTabActivation:l}=a,{title:o,prize:s}=l,{user:d}=i,c=d.displayName||(0,h.R)(d.walletAddress),u=N(a);return(0,r.jsxs)(B.Footer,{children:[(0,r.jsxs)(n.xu,{row:!0,alignCenter:!0,justifyBetween:!0,mb:"4",gap:"8",children:[(0,r.jsx)(B.Text,{children:o}),(0,r.jsx)(B.Text,{noShrink:!0,children:u})]}),(0,r.jsxs)(n.xu,{row:!0,alignCenter:!0,justifyBetween:!0,gap:"8",children:[(0,r.jsx)(p.C,{user:d,children:(0,r.jsxs)(n.xu,{row:!0,alignCenter:!0,gap:"8",children:[(0,r.jsx)(B.Avatar,{src:null===(t=d.profilePicture)||void 0===t?void 0:t.url}),(0,r.jsx)(B.Text,{variant:"secondary",children:c})]})}),s&&(0,r.jsx)(x.V,{children:s})]})]})},D=e=>{let{mc:t,mcExtra:i}=e;return(0,r.jsxs)(B.Root,{as:o(),href:"/packs/".concat(t.slug,"/?tab=tracks"),children:[(0,r.jsx)(F,{mc:t,mcExtra:i}),(0,r.jsx)(W,{mc:t,mcExtra:i})]})};var _=i(18144),M=i(85346),L=i(78774),H=i(10714),G=i(41395),V=i(99661);let U=(0,n.zo)(n.h2,{fontFamily:"inherit",paddingTop:"48px",display:"flex",flexDirection:"column",gap:"32px","@tablet":{alignItems:"center",flexDirection:"row"},"@desktop":{gap:"96px"},minWidth:0}),q=(0,n.zo)(f,{borderRadius:"12px",overflow:"hidden",marginBottom:"8px",background:"$whiteA100"});q.defaultProps={ratio:1.5},(0,n.zo)("div",{borderRadius:"inherit",width:"100%",height:"100%",position:"absolute",transition:"all 1000ms ease",variants:{loading:{true:{backdropFilter:"blur(40px)"}}}});let K=(0,n.zo)(j(),{borderRadius:"inherit",width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",transition:"all 1000ms ease",variants:{loading:{true:{opacity:0}}}}),Q=(0,n.zo)(n.qE,{width:"20px",height:"20px",flexShrink:0}),X={Root:U,ImageRoot:q,Image:K,Avatar:Q,Text:(0,n.zo)("div",{fontSize:"14px",lineHeight:"20px",fontWeight:500,color:"$whiteA800",variants:{variant:{title:{fontSize:"28px",lineHeight:"32px",fontWeight:500,color:"$white",...k().style},subtitle:{fontWeight:500,color:"$whiteA600"},description:{margin:"-14px 0",color:"$whiteA600",fontWeight:400}},ellipsis:{true:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},noShrink:{true:{flexShrink:0}}}}),Badge:(0,n.zo)("div",{display:"flex",alignItems:"center",gap:"4px",borderRadius:"4px",padding:"0px 8px",fontSize:"12px",height:"24px",lineHeight:"12px",fontWeight:500,background:"$whiteA800",color:"$black",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...k().style,variants:{variant:{success:{background:"linear-gradient(62.88deg, #A2F9FF -2.44%, #5BFA7E 101.34%)",color:"$black"},disabled:{background:"#606060",color:"$white"},warning:{background:"linear-gradient(90deg, #FFBE5E 0%, #E3CA46 100%)",color:"$white"}}}}),Button:(0,n.zo)(n.zx,{fontWeight:500,text:"14",...k().style})},Z=(0,s.createContext)(null),J=()=>(0,s.useContext)(Z),Y=e=>{var t,i,r;let{mc:a,mcExtra:n}=e,{tracksTabActivation:l}=n,o=(null==l?void 0:null===(i=l.customCoverImage)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:t.attributes.url)||(null===(r=a.coverImage)||void 0===r?void 0:r.url),[d,c]=(0,s.useState)(!0);return{src:o,loading:d,handleLoad:()=>c(!1)}},ee=e=>{let{mc:t,mcExtra:i}=e,{src:a,loading:n,handleLoad:l}=Y({mc:t,mcExtra:i});return(0,r.jsx)(X.ImageRoot,{children:(0,r.jsx)(X.Image,{src:a,loading:n,onLoadingComplete:l,fill:!0,alt:"cover image"})})},et=e=>{let{mcExtra:t}=e,i=(0,s.useMemo)(()=>{let e=Date.now(),{tracksTabActivation:i}=t,{startDate:r,endDate:a}=i,n=new Date(r).valueOf(),l=new Date(a).valueOf();return n>e?(0,M.B)(n):(0,M.B)(l)},[t]);return(0,r.jsx)(n.xu,{row:!0,children:(0,r.jsx)(G.IT,{until:i,css:{flexBasis:"400px"}})})},ei=e=>{let{tracksTabActivation:t}=e,i=Date.now(),{startDate:r,endDate:a}=t,n=new Date(r).valueOf(),l=new Date(a).valueOf();return n>i?"upcoming":l<i?"ended":"live"},er=e=>
1{let[t,i]=(0,s.useState)(ei(e));return(0,s.useEffect)(()=>{let t=setInterval(()=>i(ei(e)),1e3);return()=>clearInterval(t)},[e]),t},ea=e=>{let{mc:t,mcExtra:i,onClick:a}=e,{isLoading:n,isTokenHolder:l}=(0,V._n)(),s=er(i);return"upcoming"===s?null:"ended"===s?(0,r.jsx)(o(),{href:"/packs/".concat(t.slug,"?tab=tracks"),children:(0,r.jsx)(X.Button,{wide:!0,variant:"primaryInverted",children:"VIEW ENTRIES"})}):l?(0,r.jsx)(X.Button,{wide:!0,variant:"primaryInverted",onClick:a,children:"SUBMIT ENTRY"}):(0,r.jsx)(o(),{href:"/packs/".concat(t.slug,"?tab=details"),children:(0,r.jsx)(X.Button,{wide:!0,variant:"primaryInverted",loading:n,children:"PURCHASE KIT"})})},en=e=>{let{mc:t,mcExtra:i}=e,[a,l]=(0,s.useState)(!1),d="/packs/".concat(t.slug);return(0,r.jsxs)(n.xu,{row:!0,gap:"16",mt:"8",wrap:"true",children:[(0,r.jsx)(ea,{mc:t,mcExtra:i,onClick:()=>l(!0)}),(0,r.jsx)(o(),{href:d,children:(0,r.jsx)(X.Button,{wide:!0,variant:"secondaryInverted",children:"VIEW KIT"})}),(0,r.jsx)(H.t,{isOpen:a,onClose:()=>l(!1),mediaCollectionId:t.id})]})},el=()=>{var e;let t=J(),i=(0,L.xl)(),{user:a}=i,{tracksTabActivation:l}=t,o=a.displayName||(0,h.R)(a.walletAddress),{label:s,variant:d}=R(t);return(0,r.jsxs)(n.xu,{column:!0,alignStretch:!0,css:{minWidth:0,flex:1},gap:"16",children:[(0,r.jsxs)(n.xu,{row:!0,alignCenter:!0,gap:"16",children:[(0,r.jsx)(p.C,{user:a,children:(0,r.jsxs)(n.xu,{row:!0,alignCenter:!0,gap:"8",children:[(0,r.jsx)(X.Avatar,{src:null===(e=a.profilePicture)||void 0===e?void 0:e.url}),(0,r.jsx)(X.Text,{variant:"subtitle",ellipsis:!0,children:o})]})}),(0,r.jsx)(X.Badge,{variant:d,children:s})]}),(0,r.jsx)(X.Text,{variant:"title",ellipsis:!0,children:null==l?void 0:l.title}),(null==l?void 0:l.description)&&(0,r.jsx)(X.Text,{variant:"description",dangerouslySetInnerHTML:{__html:null==l?void 0:l.description}}),(0,r.jsx)(et,{mcExtra:t}),(0,r.jsx)(en,{mc:i,mcExtra:t})]})},eo=()=>{let e=J(),t=(0,L.xl)();return(0,r.jsx)(n.xu,{css:{minWidth:0,flex:1},children:(0,r.jsx)(ee,{mc:t,mcExtra:e})})},es=e=>{let{children:t,mcExtra:i}=e,{data:a}=_.Hm.useMediaCollection({idOrSlug:null==i?void 0:i.mediaCollectionId});return a&&i?(0,r.jsx)(L.nR.Provider,{value:a,children:(0,r.jsx)(V.wz,{edition:a.edition,children:(0,r.jsx)(Z.Provider,{value:i,children:t})})}):null},ed=e=>{let{mcExtra:t}=e;return(0,r.jsx)(es,{mcExtra:t,children:(0,r.jsxs)(X.Root,{children:[(0,r.jsx)(eo,{}),(0,r.jsx)(el,{})]})})};var ec=i(73443),eu=i(99454);let ex=(0,n.zo)(n.h2,{paddingTop:"48px",minHeight:"100vh",boxSizing:"border-box",paddingBottom:"32px"}),ep={Root:ex,Title:(0,n.zo)("h1",{text:"32",fontWeight:900,margin:0,marginBottom:"24px",textTransform:"uppercase",variants:{centered:{true:{textAlign:"center"}}},...k().style}),Grid:(0,n.zo)("div",{display:"grid",gap:"16px",gridTemplateColumns:"1fr","@media only screen and (min-width: 500px)":{gridTemplateColumns:"repeat(1, 1fr)"},"@media only screen and (min-width: 700px)":{gridTemplateColumns:"repeat(2, 1fr)"},"@media only screen and (min-width: 1000px)":{gridTemplateColumns:"repeat(3, 1fr)"}}),Spinner:(0,n.zo)("div",{display:"flex",justifyContent:"center",alignItems:"center",height:"64px","& > svg":{width:"24px",height:"24px"}})};var eh=i(82066),eg=i(52333);class ev{async getMany(e){let{params:t}=e,{data:i}=await eg.o.get(this.urlPrefix,{params:t});return i}async getOne(e){let{id:t,params:i}=e,{data:r}=await eg.o.get("".concat(this.urlPrefix,"/").concat(t),{params:i});return r}constructor(e){this.urlPrefix=e}}let em=new ev("/api/media-collection-extras"),ef=e=>{let{params:t,options:i}=e;return(0,eh.useInfiniteQuery)(["mcExtras",t],e=>{let{pageParam:i}=e;return em.getMany({params:{...t,pagination:{page:i||1,...t.pagination}}})},{getNextPageParam:e=>{let{meta:t}=e,{page:i,pageCount:r}=t;return i<r?i+1:void 0},getPreviousPageParam:e=>{let{meta:t}=e,{page:i}=t;return i>1?i-1:void 0},...i})},ew={populate:{tracksTabActivation:{populate:"*"}},filters:{tracksTabActivation:{title:{$notNull:!0}}},sort:["tracksTabActivation.endDate:desc"]},ej=()=>{let{data:e,fetchNextPage:t,hasNextPage:i,...r}=ef({params:ew});return{activations:(0,s.useMemo)(()=>(null==e?void 0:e.pages.flatMap(e=>e.data.map(e=>e.attributes)))||[],[e]),fetchNextPage:t,hasNextPage:i,...r}},eb=e=>{let{isLoading:t}=e;return t?(0,r.jsx)(ep.Spinner,{children:(0,r.jsx)(n.$j,{})}):null},ek=()=>{let{activations:e,hasNextPage:t,fetchNextPage:i,isLoading:a}=ej(),{data:n,isLoading:l}
1=_.Hm.useMediaCollections({params:{perPage:1e3,ids:e.map(e=>e.mediaCollectionId)}}),o=(0,s.useMemo)(()=>new Map((0,eu.Dy)(n).map(e=>[e.id,e])),[n]);return(0,r.jsxs)(ep.Root,{children:[(0,r.jsx)(ep.Title,{children:"BROWSE ACTIVATIONS"}),(0,r.jsx)(ep.Grid,{as:ec.v.Root,dataLength:e.length,next:i,hasMore:t,loader:(0,r.jsx)(r.Fragment,{}),children:e.map(e=>{let t=o.get(e.mediaCollectionId);return t?(0,r.jsx)(D,{mc:t,mcExtra:e},t.id):null})}),(0,r.jsx)(eb,{isLoading:a||l})]})};var ey=i(40625),eE=i(54373),eI=i(69123),eC=!0,eS=e=>{let{activationPageData:t}=e;(0,eE.D)();let i=null==t?void 0:t.meta,n=null==t?void 0:t.featuredActivation;return(0,r.jsxs)(a.Ar,{children:[(0,r.jsx)(eI.w,{meta:i}),(0,r.jsxs)(ey.l.Root,{children:[(0,r.jsx)(ed,{mcExtra:n}),(0,r.jsx)(ek,{}),(0,r.jsx)(ey.l.Flare,{layout:"left"}),(0,r.jsx)(ey.l.Flare,{layout:"right"})]})]})}}},function(e){e.O(0,[636,388,127,575,745,472,619,888,774,179],function(){return e(e.s=78386)}),_N_E=e.O()}]);
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.