"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[515],{88510:(U,C,l)=>{l.r(C),l.d(C,{default:()=>ne});var e=l(48322),N=l(43266),R=l(52546),L=l(72347),S=l(93183),x=l(14646),$=l(95987),y=l(52371),r=l(67115);const _=r.default.div` ${({theme:{colors:t,mq:s}})=>(0,r.css)` .course-listing__main { margin-top: 4.8rem; @media ${s.large} { display: grid; grid-template-columns: 1fr 3fr; grid-gap: 4rem; } } .course-listing__info { margin-bottom: 2.4rem; min-height: 2.4rem; } .course-listing__results { margin-bottom: 4rem; & h2 { margin-top: 0; margin-bottom: 2rem; } .internal-courses__results { margin-bottom: 6rem; } .internal-courses__results, .online-courses__results { border: 1px solid ${t.greyLight}; } } `} `;var k=l(80383);const b=r.default.div` ${({theme:{colors:t,mq:s}})=>(0,r.css)` display: none; padding: 2rem; font-size: 1.4rem; font-weight: bold; color: ${t.blueAlt}; background-color: ${t.greyLight}; & > span { flex: 0 1 25%; } & > span:first-of-type { flex: 1 0 35%; } & > span:last-of-type { flex: 0 1 20%; } @media ${s.medium} { display: flex; } `} `,z=({labels:t})=>e.createElement(b,null,t?.map(s=>e.createElement("span",{key:`col-${s}`},s))),j=t=>t?.data?Object.values(t.data).map((s,c)=>({title:s?.productName??"No product name provided",path:s?.url??"No url provided",minDuration:s?.minDuration??"No min duration provided",maxDuration:s?.maxDuration??"No max duration provided",intakes:s?.intakes??"No intakes provided",level:s?.level??"No level provided",id:s?.id??`${c}`})).sort((s,c)=>s.title.charCodeAt(0)-c.title?.charCodeAt(0)):[],J=r.default.div` ${()=>(0,r.css)``} `,G=r.default.article` ${({theme:{colors:t,mq:s}})=>(0,r.css)` padding: 2rem; @media ${s.medium} { display: flex; } :nth-of-type(even) { background-color: ${t.greyLight}; } .course-listing-card__link { margin: 0; } .course-listing-card__title { margin: 0; font-size: 1.6rem; line-height: 1.675em; } .course-listing-card__data-row { flex: 0 1 25%; display: block; margin-bottom: 2rem; &:first-of-type { flex: 1 0 35%; } &:last-of-type { flex: 0 1 20%; } &:not(:last-of-type) { padding-right: 2rem; } @media ${s.xsmall} { display: flex; } @media ${s.medium} { display: flex; flex-direction: column; margin: 0; } & span.label { display: block; margin-right: 2rem; font-size: 1.4rem; font-weight: bold; color: ${t.blueAlt}; @media ${s.xsmall} { flex: 0 0 100px; } @media ${s.medium} { display: none; visibility: hidden; } } } .course-listing-card__badge { display: inline-block; padding: 0.4rem 0.8rem; margin: 0 1.2rem 1.2rem 0; font-size: 1.4rem; font-style: italic; color: white; background-color: ${t.blueAlt}; &.clearing__badge { background-color: ${t.red}; } @media ${s.medium} { align-self: flex-start; margin: 1.2rem 0 0 0; } } `} `;var Q=l(75468),V=l(68786);const T=({title:t,courseCode:s,studyModes:c,minDuration:u,maxDuration:n,intakes:g,inClearing:m,level:i,path:o,placement:d,joint:a,distance:E,mPhilOption:p})=>{const h=(0,S.A)().width>=x.C.medium;return e.createElement(G,{className:"course-listing-card"},t&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Course name"),e.createElement(Q.default,{uri:o,className:"course-listing-card__link"},e.createElement("h3",{className:"course-listing-card__title"},t)),h&&d&&d.some(f=>f.key==="0/2/24/834/838")&&e.createElement("div",{className:"course-listing-card__badge"},"Placement offered"),h&&a&&e.createElement("div",{className:"course-listing-card__badge"},"Joint honors"),h&&E&&e.createElement("div",{className:"course-listing-card__badge"},"Distance learning"),h&&p&&e.createElement("div",{className:"course-listing-card__badge"},"MPhil option available"),h&&m&&e.createElement("div",{className:"course-listing-card__badge clearing__badge"},"Available in Clearing")),(u||n)&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Duration"),"Minimum: ",u,n&&n?.length>1?`; Maximum: ${n}`:null),e.createElement("div",{className:"course-listing-card__data-row"},s&&e.createElement(e.Fragment,null,e.createElement("span",{className:"label"},"Course code"),s)),c&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Study mode"),e.createElement("span",{className:"study-mode"},c?.map((f,A,{length:P})=>e.createElement("p",{key:`mode-${A}`},f.duration," ",(0,V.zb)(f.mode),A+1!=P?", ":"")))),g&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Intakes"),g),i&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Level"),i),!h&&d&&d.some(f=>f.key==="0/2/24/834/838")&&e.createElement("div",{className:"course-listing-card__badge"},"Placement offered"),!h&&a&&e.createElement("div",{className:"course-listing-card__badge"},"Joint honors"),!h&&E&&e.createElement("div",{className:"course-listing-card__badge"},"Distance learning"),!h&&p&&e.createElement("div",{className:"course-listing-card__badge"},"MPhil option available"),!h&&m&&e.createElement("div",{className:"course-listing-card__badge clearing__badge"},"Available in Clearing"))},W={id:"",mapper:(t=[])=>t},X=({isLoading:t,labels:s,filters:c,searchTerm:u})=>{const[n,g]=(0,e.useState)(W),{results:m}=(0,L.zK)(n);(0,e.useEffect)(()=>{g({id:"online",config:{customApi:{uri:"https://www.edology.com/api/products/?school=Ïã¸ÛÁùºÏ²Ê½ÁÖéÖ±²¥%20University%20London"}},mapper:j})},[]);let i=[];const o=c.courseLevel?.items?.filter(a=>a.isSelected).map(a=>a.title?.toLowerCase()),d=c.startDate?.items?.filter(a=>a.isSelected).map(a=>a.title?.toLowerCase());return u&&u!==""&&(i=m.filter(a=>a.title.toLowerCase().includes(u.toLowerCase()))),o&&o.length>0&&(i=m.filter(a=>{if(o.indexOf(a.level.toLowerCase())>=0)return a})),d&&d.length>0&&(i=m.filter(a=>{if(a?.intakes&&(a?.intakes.toLowerCase().split(",")).some(p=>p.includes(d)))return a})),!u&&(!o||o.length===0)&&(!d||d.length===0)&&(i=m),!i||i.length===0?null:e.createElement(J,null,e.createElement("h2",null,"Online courses"),t&&e.createElement($.Rh,{container:{height:"400px",margin:"20px auto",textAlign:"center"}}),!t&&e.createElement("div",{className:"online-courses__results"},e.createElement(z,{labels:s}),i.map(a=>e.createElement(T,{...a,key:a.id}))))},Y=r.default.div` ${({theme:{colors:t,mq:s}})=>(0,r.css)` margin-bottom: 1rem; ul { display: inline; margin-left: 1rem; padding: 0; list-style-type: none; } li { display: inline; } button { border: none; background: none; cursor: pointer; color: ${t.blueAlt}; text-decoration: underline; &.active { color: black; text-decoration: none; cursor: default; } } `} `,Z=({options:t,text:s="Results per page:",separator:c="|",className:u="nor__container",pageSize:n,updatePageSize:g})=>{const[m,i]=(0,e.useState)(t||[]);return(0,e.useEffect)(()=>{if(!t||!n)return;const o=[...t];t.some(a=>a.value===n)||(o.push({value:n,label:n.toString()}),o.sort((a,E)=>a.value>=E.value?1:-1)),i(o)},[t,n]),!t||!n?null:e.createElement(Y,{className:u},e.createElement("span",{className:"nor__text"},s),e.createElement("ul",{className:"nor__ul"},m.map((o,d)=>{const a=o.value===n;return e.createElement("li",{key:`nor-option-${o.label}`,className:"nor__li"},e.createElement("button",{className:`nor__button${a?" active":""}`,disabled:a,onClick:()=>g(o.value)},o.label),m[d+1]&&e.createElement("span",{className:"nor__separator"},c))})))};var q=l(8052),ee=l(56950),te=l(30685),se=l(16117),I=l(13909);const B=r.default.div` ${({theme:{colors:t}})=>(0,r.css)` .course-listing__search { margin-bottom: 2rem; font-size: 1.4rem; label { display: block; font-size: inherit; font-weight: 600; color: ${t.blueAlt}; white-space: nowrap; } input[type='search'] { padding: 1.6rem; margin-top: 1.2rem; border: 1px solid ${t.grey}; width: 100%; font-size: 1.6rem; } } .course-listing__reset { display: block; padding: 1.6rem; margin-top: 2rem; border: 0; width: 100%; text-decoration: none; text-align: center; color: ${t.white}; font-weight: 700; background: ${t.pink} url('/_MB34Eg_a9ddca77-24f4-4b24-ba4c-1eccc2167e4e/static-main/img/button-bg.svg') center right no-repeat; cursor: pointer; &:hover, &:focus { text-decoration: underline; } } .course-listing__search-btn { display: block; padding: 1.6rem; margin-top: 2rem; border: 0; width: 100%; text-decoration: none; text-align: center; font-weight: 700; color: ${t.white}; cursor: pointer; background: #00615e url('/_MB34Eg_a9ddca77-24f4-4b24-ba4c-1eccc2167e4e/static-main/img/button-bg.svg') center right no-repeat; &:hover, &:focus { text-decoration: underline; } } `} `,ae=({clearFilters:t,handleChange:s,handleSearchReset:c,handleSubmit:u,filters:n,term:g,updateSelectedFilters:m,updateSearchTerm:i})=>e.createElement(B,{as:"aside"},e.createElement("h2",{className:"sr-only"},"Course search filters"),e.createElement("form",{className:"course-listing__search",onSubmit:u},e.createElement("label",{htmlFor:"search"},"Search"),e.createElement("input",{type:"search",id:"search",title:"search",name:"search",placeholder:"Search course by keyword(s)",onChange:s,value:g})),e.createElement(I.A,{filters:n,clearFilters:t,updateSelectedFilters:m,showReset:!1}),e.createElement("button",{className:"course-listing__search-btn",onClick:()=>i(g)},"Search"),e.createElement("button",{className:"course-listing__reset",onClick:c},"Reset")),le=({clearFilters:t,handleChange:s,handleSearchReset:c,handleSubmit:u,filters:n,term:g,updateSelectedFilters:m,updateSearchTerm:i})=>e.createElement(B,null,e.createElement("form",{className:"course-listing__search",onSubmit:u},e.createElement("label",{htmlFor:"search"},"Search"),e.createElement("input",{type:"search",id:"search",title:"search",name:"search",placeholder:"Search course by keyword(s)",onChange:s,value:g})),e.createElement(se.A,{openTitle:"Filter courses",closeTitle:"Close filter",breakpoint:x.C.large},e.createElement("h2",{className:"sr-only"},"Course search filters"),e.createElement(I.A,{filters:n,clearFilters:t,updateSelectedFilters:m,showReset:!1}),e.createElement("button",{className:"course-listing__reset",onClick:()=>i(g)},"Search"),e.createElement("button",{className:"course-listing__reset",onClick:c},"Reset"))),ne=({mappedEntry:t})=>{const{title:s,clearingTitle:c,meta:u,breadcrumbs:n,internalLabels:g,onlineLabels:m}=t||{},{clearFilters:i,filters:o,paging:d,results:a,resultsInfo:E,isLoading:p,searchTerm:h,updatePageIndex:f,updatePageSize:A,updateSelectedFilters:P,updateSearchTerm:F}=(0,L.iQ)({mappers:k.A}),[O,D]=(0,e.useState)(h||""),re=(0,N.d4)(R.DT.selectors.selectCurrentLocation),H=(0,S.A)().width>=x.C.large,ie=v=>{D(v.target.value)},oe=v=>{v.preventDefault(),F(O)},ce=()=>{i(),F(""),D("")};(0,e.useEffect)(()=>{D(h||"")},[h]);const K={clearFilters:i,handleChange:ie,handleSubmit:oe,handleSearchReset:ce,filters:o,term:O,updateSelectedFilters:P,updateSearchTerm:F};return e.createElement(y.A,null,e.createElement(_,null,e.createElement(te.A,{...u}),e.createElement("div",{className:"wrapper"},e.createElement(ee.A,{...n}),e.createElement("h1",null,re.search.includes("clearing")?c:s),e.createElement("div",{className:"course-listing__main"},H&&e.createElement(ae,{...K}),e.createElement("section",{className:"course-listing__results"},!p&&e.createElement("p",{className:"course-listing__info",dangerouslySetInnerHTML:{__html:E.courseListingResultsText}}),!H&&e.createElement(le,{...K}),e.createElement("section",{className:"internal-courses"},p&&e.createElement($.Rh,{container:{height:"600px",margin:"20px auto",textAlign:"center"}}),!p&&a?.length>0&&e.createElement(e.Fragment,null,e.createElement("h2",{className:"sr-only"},"Course search results"),e.createElement(Z,{options:[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:1e4,label:"all"}],pageSize:d.pageSize,updatePageSize:A}),e.createElement("div",{className:"internal-courses__results"},e.createElement(z,{labels:g}),a.map(v=>e.createElement(T,{...v,key:v.id})))),e.createElement(q.A,{paging:d,updatePageIndex:f})),e.createElement("section",{className:"online-courses"},e.createElement(X,{labels:m,isLoading:p,filters:o,searchTerm:O})))))))}},13909:(U,C,l)=>{l.d(C,{A:()=>$});var e=l(48322),N=l(67115);const L=N.default.div` ${({theme:{mq:y,layout:r}})=>(0,N.css)` @media ${y.mlarge} { flex-basis: 25%; } h5 { margin-top: 0; } > div { padding-bottom: ${r.gutter.smedium}; } .dropdown__select { max-width: 100%; min-width: 100%; } .checkbox { padding: ${r.gutter.smedium} 0; } .search-reset { width: 100%; } `} `;var S=l(20548);const $=({title:y,filters:r,showReset:M=!0,clearFilters:_,updateSelectedFilters:k})=>r?e.createElement(L,null,Object.entries(r).length?e.createElement(e.Fragment,null,y&&e.createElement("h5",null,"Course Filter"),Object.entries(r).map(([w,b])=>b.title?e.createElement(S.A,{key:w,className:b?.items?.length===1?"checkbox":"",clearFilters:_,defaultValue:`Select ${b.title.toLowerCase()}`,filterGroupKey:w,filters:b.items,label:`Filter by ${b.title.toLowerCase()}`,multiSelect:!b.isSingleSelect,updateSelectedFilters:k}):null)):null,M&&e.createElement("button",{className:"search-reset",onClick:()=>_()},"Clear filters")):null}}]);