"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[651],{6810:function(e,t,a){var n=a(7294);t.Z=function(e){var t=e.isSubmit,a=void 0===t?"false":t,l=e.btnType,i=e.id,r=e.label,c=e.clickAction,s=e.additionalClass,o=void 0===s?"":s,m=e.isOutline,d=void 0===m?"false":m;return n.createElement(n.Fragment,null,n.createElement("button",{id:i,type:"true"==a?"submit":"button",className:"button button-"+("secondary"==l&&"true"==d?"secondary-outline":l)+" "+o,onClick:c},r))}},7934:function(e,t,a){var n=a(7294),l=a(5444),i=a(6125),r=a(6810);t.Z=function(e){var t=e.title,a=e.subtitle,c=e.contents,s=(e.cardStyle,e.bgColor),o=e.searchUrl,m=e.cardType,d=(0,n.useState)(3),u=d[0],g=d[1],p={year:"numeric",month:"long",day:"numeric"};function v(e){var t=e.getHours(),a=e.getMinutes(),n=t>=12?"PM":"AM";return(t=(t%=12)||12)+":"+(a=a<10?"0"+a:a)+" "+n}return(0,n.useEffect)((function(){g(3)}),[o]),n.createElement(n.Fragment,null,n.createElement("div",{className:"cta-list-container",style:s?{backgroundColor:s}:{}},n.createElement("div",{className:"cta-list-content"},n.createElement("div",{className:"additional-options-container uk-align-center ",id:"additional-options"},t?n.createElement("div",{className:"cta-list-header-text"},n.createElement("h2",{id:"cta-list-container-title",className:"uk-text-center"},t),' : ""'):"",a?n.createElement("div",{className:"uk-text-center additional-options-subtitle"},a):"",n.createElement("div",{className:0!=c.length?"uk-child-width-1-3@xl uk-child-width-1-3@m uk-child-width-1-2@s uk-child-width-1-1@xs uk-grid cta-card-grid":"uk-child-width-1-3@xl uk-child-width-1-3@m uk-child-width-1-2@s uk-child-width-1-1@xs uk-grid no-results-message","uk-grid":"true"},0!=c.length?c.slice(0,u).map((function(e,t){var a,r,c,s,o,m=e.Description?e.Description.length>250?e.Description=e.Description.substring(0,250).replace(/\*\*/g,"")+"...":e.Description.replace(/\*\*/g,""):"";return n.createElement("div",{key:t,className:"cta-card uk-animation-scale-up article-link"},n.createElement("div",{className:"uk-card uk-card-default cta-card"},n.createElement("div",{className:"uk-card-media-top"},null!==(a=e.Image)&&void 0!==a&&a.gatsbyImageData?n.createElement(i.G,{className:"cta-card-image",image:e.Image.gatsbyImageData,alt:""}):"",null!==(r=e.Image)&&void 0!==r&&null!==(c=r.localFile)&&void 0!==c&&c.childImageSharp.gatsbyImageData?n.createElement(i.G,{className:"cta-card-image",image:e.Image.localFile.childImageSharp.gatsbyImageData,alt:""}):"",e.ImageURL?n.createElement(i.G,{image:e.ImageURL,alt:""}):""),n.createElement("div",{className:"uk-card-body cta-card-body"},"news"===e.CardType?n.createElement("div",{className:"align-cards"},n.createElement(l.Link,{to:"/"+(null===(s=e.created_at)||void 0===s?void 0:s.split("T")[0].replace(/-/g,"/"))+"/"+e.Slug.toLowerCase(),className:"uk-card-title cta-card-title"},e.Title.length>50?e.Title=e.Title.substring(0,50)+"...":e.Title)):"event"===e.CardType?n.createElement("div",{className:"align-cards"},n.createElement(l.Link,{to:"/events/"+e.Slug.toLowerCase(),className:"uk-card-title cta-card-title"},e.Title.length>50?e.Title=e.Title.substring(0,50)+"...":e.Title)):"shop"===e.CardType?n.createElement("div",{className:"align-cards"},n.createElement(l.Link,{to:"/shop/"+e.Slug.toLowerCase(),className:"uk-card-title cta-card-title"},e.Title.length>50?e.Title=e.Title.substring(0,50)+"...":e.Title)):n.createElement("p",{className:"uk-card-title cta-card-title"},e.Title),e.CardType&&"event"==e.CardType?e.FromDate&&e.ToDate?new Date(e.FromDate).toLocaleDateString("en-US",p)==new Date(e.ToDate).toLocaleDateString("en-US",p)?n.createElement("p",{className:"date"},new Date(e.FromDate).toLocaleDateString("en-US",p)," ",v(new Date(e.FromDate))," - ",v(new Date(e.ToDate))," "):n.createElement("p",{className:"date"},new Date(e.FromDate).toLocaleDateString("en-US",p)," - ",new Date(e.ToDate).toLocaleDateString("en-US",p)):n.createElement("p",{className:"date"},e.FromDate):e.CardType&&"news"==e.CardType&&e.Author?n.createElement("p",{className:"date"},"by ",e.Author," | News"):"",n.createElement("p",{className:"description-height"},m),e.Description?e.CardType&&"event"==e.CardType?n.createElement(l.Link,{to:"/events/"+e.Slug.toLowerCase(),className:"find-out-more"},"find out more »"):e.CardType&&"news"==e.CardType?n.createElement(l.Link,{to:"/"+(null===(o=e.created_at)||void 0===o?void 0:o.split("T")[0].replace(/-/g,"/"))+"/"+e.Slug.toLowerCase(),className:"find-out-more"},"find out more »"):e.CardType&&"shop"==e.CardType?n.createElement(l.Link,{to:"/shop/"+e.Slug.toLowerCase(),className:"find-out-more"},"find out more »"):"":"")))})):n.createElement("div",{className:"no-content-list"},n.createElement("h2",null,"event"==m?"We have lots of exciting events coming up – please visit our socials for all the information and follow us to keep up to date.":"No Results Found"),n.createElement("p",null,"event"==m?"":"The page you requested could not be found. Try refining your search, or use the navigation above to locate the post."))),n.createElement("div",{className:"show-more"},ua})).map((function(e,t){s.push({Title:e.Title,URL:e.URL,URLLabel:e.URLLabel,Image:e.Image,FromDate:e.FromDate,ToDate:e.ToDate,Alt:e.Alt,Slug:e.Slug,Description:e.Description,DescriptionCharLimit:e.DescriptionCharLimit,CardType:"event"})})):"",s?n.createElement(r.Z,{contents:s,cardType:"event"}):"")))))}}}]); //# sourceMappingURL=component---src-pages-events-js-462438ba828414f5cdbb.js.map