(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[133,532],{8401:(J,$,a)=>{"use strict";a.d($,{Hl:()=>A,VK:()=>S});var t=a(7168);const T=(0,t.Ay)(()=>a.e(905).then(a.bind(a,9540))),A=(0,t.Ay)(()=>Promise.all([a.e(550),a.e(795)]).then(a.bind(a,8566))),S=(0,t.Ay)(()=>Promise.resolve().then(a.bind(a,3652)))},506:(J,$,a)=>{"use strict";a.r($),a.d($,{default:()=>G});var t=a(985),T=a(8698);const A=n=>({id:n.sys.id??"",uri:n.sys.uri??void 0,title:n.entryTitle??""}),S=n=>{const m=n.dateAndTime.from?(0,T.Yq)(n.dateAndTime.from,"dddd, d MMMM yyyy"):null,d=n.dateAndTime.to?(0,T.Yq)(n.dateAndTime.to,"dddd, d MMMM yyyy"):null,o=(r,E)=>!r||!E?null:r===E?r:`${r} - ${E}`,u=n.dateAndTime.from?(0,T.Yq)(n.dateAndTime.from,"hh:mm tt"):null,f=n.dateAndTime.to?(0,T.Yq)(n.dateAndTime.to,"hh:mm tt"):null,h=(r,E)=>!r||!E?null:r===E?r:`${r} - ${E}`;return{...A(n),date:n.dateAndTime?o(m,d):null,location:n.location??null,summary:n.summary??null,time:n.dateAndTime?h(u,f):null}},B=n=>n.map(m=>{switch(m.sys.contentTypeId){case t.f.event:return S(m);default:return A(m)}});var b=a(4336),P=a(3692);const{getCurrent:Q,getListing:O,getResults:D,getTotalCount:L,getPaging:M,getSelectedFilters:N,getSearchTerm:z,getFilters:j,getIsLoaded:C}=b.selectors.selectListing,W=n=>O(n)?.title,X=n=>L(n),H={searchTerm:n=>z(n),selectedFilters:n=>N(n),allFilters:n=>j(n),currentListing:n=>Q(n),currentPageCount:n=>D(n).length,listingTitle:W,noResultsText:n=>X(n)===0?"No results were found":"",resultsText:n=>{const m=M(n),{pageIndex:d,pageSize:o,totalCount:u,pagesLoaded:f}=m;if(!f)return null;const h=(f[0]||d)*o+1;let r=h+(f.length*o||o)-1;return r>u&&(r=u),`${h} - ${r} of ${u} results`},combinedFilterText:n=>{const m=N(n),d=j(n),o=M(n),u=K(o);return Y(m,d,u)}},I=n=>({noResultsText:R(n),resultsText:(0,P.mapJson)(n,H)}),K=n=>{const{pageIndex:m,pageSize:d,totalCount:o,pagesLoaded:u}=n;if(o===0)return"No results found";if(o===1)return"Showing 1 result";if(!u)return null;const f=(u[0]||m)*d+1;let h=f+(u.length*d||d)-1;return h>o&&(h=o),o<=d?`Showing all ${o} results`:`Showing ${f} - ${h} of ${o} results`},R=n=>{const m=C(n),d=L(n,void 0);return m&&d===0?{title:"No results found",message:"Suggestions",suggestions:["Make sure that all words are spelled correctly","Try different keywords","Try more general keywords"]}:void 0},Y=(n,m,d)=>{const o=[`${d}`];return Object.keys(n).forEach(u=>{const f=m[u],h=n[u];if(h.length>0){const r=h.map(F=>{const k=f.items.find(V=>V.key===F);return k?`${k.title}`:""}).filter(Boolean),E=F=>F.toLowerCase();r.length>0&&o.push(`${f.title==="Date"?"during":"in the category"} ${E(r.join(" "))}`)}}),o.join(" ")},G={results:B,resultsInfo:I}},3216:(J,$,a)=>{"use strict";a.r($),a.d($,{ListingCard:()=>h,default:()=>F});var t=a(8322),T=a(7145),A=a(4336),S=a(506),x=a(7115),B=a(7820),b=a(1541),P=a(7068);const O=({updateSelectedFilters:e,filters:l})=>t.createElement(D,null,Object.keys(l).map(p=>{const s=l[p];return t.createElement(L,{key:p},t.createElement(M,{defaultValue:"",onChange:i=>{e(p,i.target.value)}},t.createElement(N,{value:"",disabled:!0},`Filter by ${s.title}`),s.items.map(i=>t.createElement(N,{key:i.key,value:i.key},i.title))),t.createElement(z,null,t.createElement(b.A,{icon:"arrowDown",size:24})))})),D=x.Ay.div` display: flex; gap: ${e=>e.theme.spacing.xs}; width: 100%; flex-direction: column; @media ${e=>e.theme.mq.min.em.tablet} { flex-direction: row; } `,L=x.Ay.div` position: relative; display: flex; align-items: center; height: 100%; width: 100%; `,M=x.Ay.select` position: relative; height: 100%; width: 100%; appearance: none; padding: 10px 48px 10px 10px; border: 1px solid ${e=>e.theme.colors.light.brand.lightGold}; background-color: ${e=>e.theme.colors.light.neutral.white}; font-size: 1rem; border-radius: 5px; cursor: pointer; &:focus { outline: none; box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); } @media ${e=>e.theme.mq.min.em.laptop} { min-width: 195px; } `,N=x.Ay.option` padding: 10px; background-color: ${e=>e.theme.colors.light.neutral.grey}; color: black; `,z=x.Ay.div` position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; height: 20px; display: flex; align-items: center; `,C=({className:e,label:l,updatePageIndex:p,index:s,disabled:i})=>{const g=y=>{y>-1&&(p(y),c())},c=()=>{try{window.scroll({top:0,left:0})}catch{window.scrollTo(0,0)}};return t.createElement(W,{disabled:i,type:"button",className:e,onClick:()=>g(s)}," ",l==="Back"||l==="Next"?t.createElement("div",{className:"icon"},l==="Back"?"<":">"):l&&l.toString())},W=x.Ay.button` ${({theme:{colors:e}})=>(0,x.AH)` cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: white; width: 48px; height: 48px; border: 0.1rem solid ${e.dark.brand.midBlue}; text-align: center; font-size: 15px; color: ${e.dark.brand.midBlue}; font-weight: 600; border-radius: 5px; &:enabled:hover { background-color: ${e.dark.brand.midBlue}; color: ${e.dark.neutral.white}; } &:disabled { /* opacity: 0.5; */ cursor: default; } &.inactive { color: white; background-color: ${e.dark.brand.midBlue}; } &.active { } .icon { display: flex; align-items: center; justify-content: center; svg { height: 2.4rem; path { fill: black; } } } `} `,H=({paging:e,updatePageIndex:l})=>{const{pageIndex:s,pageCount:i}={...e};let g=Math.max(0,s-Math.floor(3/2)),c=Math.min(i-1,g+3-1);c-g+1<3&&(g=Math.max(0,c-3+1)),c>i-1&&(c=i-1,g=i-3,g<0&&(g=0));const y=[];for(let v=g;v<=c;v++){const w=v===s;y.push(t.createElement("li",{key:v},t.createElement(C,{index:v,key:v,label:v+1,updatePageIndex:l,disabled:w,className:w?"inactive":"active"})))}return t.createElement(Z,{className:"pagination"},i>1&&t.createElement(t.Fragment,null,s>0&&t.createElement("li",null,t.createElement(C,{className:`control prev ${s>0?"":"disabled"}`,disabled:!(s>0),index:s-1,label:"Back",updatePageIndex:l})),y,t.createElement("li",null,t.createElement(C,{className:`control next ${se.theme.spacing.xs}; width: 100%; align-items: center; justify-content: center; list-style: none; `;var I=a(7454),K=a(5241),R=a(8401),Y=a(3266),G=a(2546);const n="#003B5C",m={overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",position:"absolute",inset:0,zIndex:9999,height:"100%",maxHeight:"100vh",backgroundColor:"white"},d=()=>t.createElement("div",{style:m},t.createElement("h3",{className:"sr-only",style:{margin:"0 0 16px 0",fontSize:"16px",color:n}},"Loading..."),t.createElement("svg",{width:"38",height:"38",style:{width:"40px",height:"40px"},viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg"},t.createElement("defs",null,t.createElement("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:"a"},t.createElement("stop",{stopColor:n,stopOpacity:"0",offset:"0%"}),t.createElement("stop",{stopColor:n,stopOpacity:".631",offset:"63.146%"}),t.createElement("stop",{stopColor:n,offset:"100%"}))),t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(1 1)"},t.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",id:"Oval-2",stroke:"url(#a)",strokeWidth:"2"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"})),t.createElement("circle",{fill:n,cx:"36",cy:"18",r:"1"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"})))))),u=({text:e,reset:l})=>t.createElement(f,{className:"no-results-container"},t.createElement("span",{className:"h3"},e?.title?e?.title:"No results found"),t.createElement("div",{className:"text-container"},e?.message&&t.createElement("p",null,e?.message),t.createElement("ul",null,e?.suggestions.map((p,s)=>t.createElement("li",{key:s},p)))),t.createElement(I.A,{className:"reset-btn",onClick:()=>l(),buttonTheme:"secondary",label:"Reset search"})),f=x.Ay.div` .text-container { margin-top: ${e=>e.theme.spacing.s}; p, ul { font-weight: 400; color: ${e=>e.theme.colors.dark.neutral}; } ul { margin-top: ${e=>e.theme.spacing.xs}; li { color: inherit; } } } .reset-btn { margin-top: ${e=>e.theme.spacing.m}; } `,h=({title:e,date:l,location:p,summary:s,time:i,uri:g,className:c,borderColor:y="blue"})=>t.createElement(V,{path:g,className:`listing-card ${c||""}`,borderColor:y},t.createElement("div",{className:"listing-card__content"},t.createElement("p",{className:"h4"},e),t.createElement("p",null,s)),t.createElement("div",{className:"listing-card__tags"},l&&t.createElement("span",{className:"listing-card__tag"},t.createElement(b.A,{icon:"calendar",size:26}),l),i&&t.createElement("span",{className:"listing-card__tag"},t.createElement(b.A,{icon:"clock",size:26}),i),p&&t.createElement("span",{className:"listing-card__tag"},t.createElement(b.A,{icon:"globe",size:38}),p))),r=({searchTerm:e,filters:l,updateSelectedFilters:p,handleReset:s,selectedFilters:i,updateSearchTerm:g})=>t.createElement(t.Fragment,null,t.createElement(P.A,{value:e,submit:g,placeholder:"Search events",isListing:!0}),t.createElement(O,{filters:l,updateSelectedFilters:p}),t.createElement(I.A,{label:"Reset",buttonTheme:"primary",disabled:!(!Object.values(i).every(c=>Array.isArray(c)&&c.length===0)||e!==""),onClick:s})),F=({mappedEntry:e})=>{const{title:l}=e||{},p=(0,Y.d4)(G.DT.selectors.selectRouteLoading),[s,i]=t.useState(!1),{results:g,resultsInfo:c,searchTerm:y,filters:v,updateSearchTerm:w,updateSelectedFilters:q,clearFilters:ee,paging:te,updatePageIndex:ne,selectedFilters:_}=(0,A.iQ)({mappers:S.default}),U=()=>{ee(),w(""),location.href=location.pathname},{width:ae}=(0,K.lW)();return p?t.createElement(d,null):t.createElement(T.A,{meta:{title:{title:l},description:`Find out about ${l} at Worcester`,pageTitle:`Search ${l}`}},t.createElement(k,null,t.createElement("div",{className:"u-container"},l&&t.createElement("h1",null,l),ae>786?t.createElement("div",{className:"listing__search-wrapper"},t.createElement("div",{className:"listing__search-container"},t.createElement(r,{searchTerm:y,filters:v,updateSelectedFilters:q,handleReset:U,selectedFilters:_,updateSearchTerm:w})),c.resultsText.combinedFilterText&&t.createElement(R.VK,{text:c.resultsText.combinedFilterText})):t.createElement("div",{className:"listing__search-wrapper-mobile"},t.createElement("span",{className:"listing__mobile-button-container h4"},"Filter Events",t.createElement("button",{onClick:()=>i(!s),className:"mobile-search-button"},s?t.createElement(b.A,{icon:"close",size:26}):t.createElement(b.A,{icon:"dropdown",size:26}))),s&&t.createElement("div",{className:"listing__search-container"},t.createElement("div",{className:"listing__search-content"},t.createElement(r,{searchTerm:y,filters:v,updateSelectedFilters:q,handleReset:U,selectedFilters:_,updateSearchTerm:w}),c.resultsText.combinedFilterText&&t.createElement(R.VK,{text:c.resultsText.combinedFilterText})))),t.createElement("div",{className:"listing__card-container"},p?t.createElement(d,null):g&&g.length>0?g.map((le,se)=>t.createElement(h,{key:se,...le})):t.createElement(u,{text:c.noResultsText,reset:U})),t.createElement(H,{paging:te,updatePageIndex:ne}))))},k=x.Ay.div` .flow > * + * { margin-block-start: 2em; } .u-container { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.s}; max-width: var(--grid-max-width); padding-inline: var(--grid-gutter); margin-inline: auto; margin-block-start: var(--space-xl-2xl); margin-block-end: var(--space-l-xl); } .listing__card-container { display: grid; grid-template-columns: 1fr; gap: ${e=>e.theme.spacing.m}; @media ${e=>e.theme.mq.min.em.tablet} { grid-template-columns: 1fr 1fr; } @media ${e=>e.theme.mq.min.em.laptop} { grid-template-columns: 1fr 1fr 1fr; } } .listing__search-wrapper { display: flex; flex-direction: column; justify-content: space-between; gap: ${e=>e.theme.spacing.xxs}; background-color: ${e=>e.theme.colors.light.brand.lightestGold}; padding: ${e=>e.theme.spacing.m} ${e=>e.theme.spacing.s}; width: 100%; margin: 0 auto; @media ${e=>e.theme.mq.min.em.laptop} { padding: ${e=>e.theme.spacing.l} ${e=>e.theme.spacing.m}; } } .listing__search-container { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xs}; width: 100%; @media ${e=>e.theme.mq.min.em.laptop} { flex-direction: row; height: 60px; } } .listing__search-content { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xs}; width: 100%; @media ${e=>e.theme.mq.min.em.laptop} { flex-direction: row; gap: ${e=>e.theme.spacing.s}; } } .listing__search-wrapper-mobile { position: relative; display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xs}; padding: ${e=>e.theme.spacing.m} ${e=>e.theme.spacing.s}; &::before { content: ''; position: absolute; top: 0; left: calc(var(--grid-gutter) * -1); width: calc(100% + (var(--grid-gutter) * 2)); margin: 0 auto; height: 100%; z-index: -1; background-color: ${e=>e.theme.colors.light.brand.lightestGold}; } } .listing__mobile-button-container { display: flex; gap: ${e=>e.theme.spacing.xs}; width: 100%; justify-content: space-between; font-weight: 600; .mobile-search-button { background-color: transparent; border: none; cursor: pointer; } } `,V=(0,x.Ay)(B.A)` display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xxs}; cursor: pointer; border: 1px solid ${e=>e.borderColor==="gold"?e.theme.colors.light.brand.gold:e.theme.colors.light.brand.lightBlue}; border-bottom-left-radius: 50px; border-top-right-radius: 50px; padding: ${e=>e.theme.spacing.m}; text-decoration: none; color: ${e=>e.theme.colors.light.brand.darkBlue}; .listing-card__content { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xxs}; padding-bottom: ${e=>e.theme.spacing.xxs}; border-bottom: 1px solid ${e=>e.theme.colors.light.brand.midBlue}; } .listing-card__tags { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xxxs}; } .listing-card__tag { display: flex; align-items: center; gap: ${e=>e.theme.spacing.xxs}; font-weight: 600; svg { min-width: 24px; min-height: 24px; max-width: 24px; max-height: 24px; color: ${e=>e.theme.colors.light.brand.midBlue}; } } `},2634:()=>{}}]);