(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{"3n7M":function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/challenge-event",function(){return a("PZ9O")}])},KQm4:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a("a3WO");var l=a("BsWD");function i(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(l.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},PZ9O:function(e,t,a){"use strict";a.r(t),a.d(t,"__N_SSP",(function(){return h}));var n=a("KQm4"),l=a("q1tI"),i=a.n(l),c=a("OS56"),s=a.n(c),r=a("mwIZ"),o=a.n(r),u=a("E+oP"),v=a.n(u),m=a("FLYf"),d=a("s+CV"),f=(a("L9L9"),a("gF98")),g=(a("2v50"),i.a.createElement),h=!0;t.default=function(e){var t=e.pageData,a=void 0===t?{}:t,c=a.componentData,r=void 0===c?{}:c,u=r.sliderImage,h=void 0===u?[]:u,b=r.upcomingChallenges,N=r.upcomingEvents,y=r.archived,E=a.meta,O=o()(y,"data",[]),w=Object(l.useState)([]),S=w[0],j=w[1],k=Object(l.useState)([]),A=k[0],P=k[1],C=Object(l.useState)(p[0]),_=C[0],x=C[1],I=Object(l.useState)(!1),T=I[0],L=I[1],F=Object(l.useState)(0),M=F[0],B=F[1],D=Object(l.useState)(!1),V=D[0],W=D[1],H=Object(l.useRef)(null),Z=function(e){H&&H.current&&!H.current.contains(e.target)&&W(!1)};Object(l.useEffect)((function(){M&&O&&O.length>0&&j(Object(n.a)(O))}),[M]),Object(l.useEffect)((function(){setTimeout((function(){document&&document.documentElement.clientWidth<768?B(2):B(3)}),1e3)}),[]),Object(l.useEffect)((function(){document.addEventListener("mousedown",Z)}),[]),Object(l.useEffect)((function(){if(S&&S.length>M){L(!0);var e=S.slice(0,M);P(e)}else{var t=S&&S instanceof Array&&S.length||0,a=S instanceof Array&&S.slice(0,t);L(!1),P(a)}}),[S]),Object(l.useEffect)((function(){var e=A&&A.length||0;(S&&S.length||0)<=e&&L(!1)}),[A]),Object(l.useEffect)((function(){if(o()(_,"value")){var e=O&&O instanceof Array&&O.length>0&&O.filter((function(e){return _&&_.value&&e.type===_.value}));j(e)}else j(O)}),[_]);var J=o()(b,"data",[]).length||0,K=o()(N,"data",[]).length||0,Q=O.length||0,R=function(e){return(e<10?"0":"")+e};return g(i.a.Fragment,null,g(f.a,E),g("div",{className:"challenges-events-page"},g("div",{className:"cePageFirstFold"},g("div",{className:"cePageSliderBlock"},g("div",{className:"cePageSlider"},g(s.a,{dots:!0,arrows:!0,infinite:!0,slidesToShow:1,slidesToScroll:1,pauseOnHover:!0,autoplay:!0,autoplaySpeed:5e3},h&&h.map((function(e,t){return g("div",{className:"cePageSliderImage",key:t},g("figure",null,g("img",{src:e.image.url,alt:e.image.alt})))}))))),g("div",{className:"events-count"},g("ul",null,g("li",null,g("div",null,g("h3",null,R(J)),g("p",null,"Challenges"))),g("li",null,g("div",null,g("h3",null,R(K)),g("p",null,"Events"))),g("li",null,g("div",null,g("h3",null,R(Q)),g("p",null,"Archive")))))),!v()(o()(b,"data"))&&g("div",{className:"upcoming-challenges"},g("figure",{className:"trophy-icon"},g("img",{src:"/assets/images/trophy-icon.svg",alt:"trophy-icon"})),g("figure",{className:"events-page-vector-bg"},g("img",{src:"/assets/images/events-page-vector-bg.svg",alt:"events-page-vector-bg"})),g(m.a,{list:o()(b,"data",[]),type:d.a.CHALLENGE,title:o()(b,"label","")})),!v()(o()(N,"data"))&&g("div",{className:"upcoming-events"},g("figure",{className:"events-layer"},g("img",{src:"/assets/images/events-layer-6.svg",alt:"events-layer"})),g("figure",{className:"movie-ticket"},g("img",{src:"/assets/images/movie-ticket.svg",alt:"movie-ticket"})),g(m.a,{type:d.a.EVENT,list:o()(N,"data",[]),title:o()(N,"label","")})),O&&O instanceof Array&&O.length>0&&g("div",{className:"archive-wrapper"},g("div",{className:"container"},g("div",{className:"archive-title"},g("h1",{className:"title2"},y.label?y.label:null),g("div",{ref:H,className:"challenges-events-selection",onClick:function(){W(!V)}},g("div",{className:"selected-title ".concat(V?"active":"")},_.text),g("ul",{className:V?"active":""},p.map((function(e,t){return g("li",{key:t,onClick:function(){x(e)}},e.text)})))))),g("div",{className:"container"},A&&A instanceof Array&&A.length>0?g("div",{className:"archive-block"},A.map((function(e,t){return g(d.b,{key:t,cardDetail:e,type:d.a.ARCHIVE})}))):g("div",{className:"no-data text-center"},"No Archived ",_&&_.value&&_.text||""," found.")),T&&g("div",{className:"viewMoreBtnWrap"},g("button",{className:"viewMoreBtn",onClick:function(e){!function(){var e=A&&A.length||0,t=M+e,a=S&&S.slice(0,t)||[];P(a)}()}},"View More"," ")))))};var p=[{text:"Select All",value:""},{text:"Challenges",value:"challenges"},{text:"Events",value:"events"}]}},[["3n7M",0,1,2,3,4,5,7,6,10,45,44,8]]]);