PageSourceSearch

https://www.euhu.co.uk/_next/static/chunks/pages/search-d55f30ffadd6ef24.js

js euhu.co.uk collected 2026-10-04 05:21:38 UTC 29,174 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9603],{35243:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/search",function(){return n(53667)}])},95798:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75"}))});e.exports=a},31999:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"}))});e.exports=a},91964:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"}))});e.exports=a},13874:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5"}))});e.exports=a},24655:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5"}))});e.exports=a},64729:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"}))});e.exports=a},81561:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"}))});e.exports=a},24229:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}))});e.exports=a},21134:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"}))});e.exports=a},70915:function(e,t,n){"use strict";let r=n(67294),a=r.forwardRef(function(e,t){let{title:n,titleId:a,...s}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:t,"aria-labelledby":a},s),n?r.createElement("title",{id:a},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"}))});e.exports=a},48346:function(e,t,n){"use strict";n.d(t,{y:function(){return c}});var r=n(85893),a=n(18202),s=n(33299);n(67294);var l=n(50239),i=n(68183),o=n(60621);function c(e){let{builderContent:t}
1=e,n=(0,a.useIsPreviewing)(),l=(0,s.useSession)();return t||n?(0,r.jsx)(a.BuilderComponent,{model:"intro-header-section",content:t||{},renderLink:i.Link,data:(0,o.i)({session:l.data})}):null}a.builder.init(l.O.NEXT_PUBLIC_BUILDER_API_KEY,!1)},34261:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(85893),a=n(67294),s=n(83915),l=n(86501),i=n(68917),o=n(11163),c=n(55490);function u(e){let{lessonId:t,href:n,published:u,contentType:d,className:p,title:h,description:m,children:f,backgroundImageUrl:v,canDelete:g,canDuplicate:b,canEdit:x,onDeleteSuccess:y,onDuplicateSuccess:w,showSignupModal:j,subscriptionProvider:k,slug:P="",cpd:N,cpdComplete:C,cpdHours:S}=e,[E,D]=(0,a.useState)(""),L=(0,o.useRouter)(),T=s.h.lessons.delete.useMutation({onSuccess:()=>{y&&y()}}),M=s.h.lessons.duplicate.useMutation({onSuccess:e=>{w&&w(e.id||"",e.slug)}});async function I(){t&&await l.ZP.promise(T.mutateAsync({lessonId:t,slug:P}),{error:"Deletion failed",loading:"Deleting lesson...",success:"Lesson deleted"})}async function B(){if(t)try{await l.ZP.promise(M.mutateAsync({lessonId:t,duplicateLessonRequest:{sharedContentId:null}}),{error:"Duplication failed",loading:"Duplicating content...",success:"Content duplicated"})}catch(e){}}return(0,r.jsx)(i.Z,{onCardDelete:I,onCardDuplicate:B,onCardInfoClick:function(){var e;D(null!==(e=t===E?"":t)&&void 0!==e?e:"")},onCardEdit:function(){L.push((0,c.M)({type:"content",id:t||"",mode:"editor",slug:P,subSection:"details"}))},"data-testid":"lesson-card",href:n,title:h,description:m,selected:t===E,backgroundImageUrl:v,published:u,showSignupModal:j,contentType:d,canDelete:g,canDuplicate:b,canEdit:x,className:p,subscriptionProvider:k,cpd:N,cpdComplete:C,cpdHours:S,children:f},t)}},87121:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(85893),a=n(67294),s=n(83915),l=n(86501),i=n(68917);function o(e){let{planId:t,href:n,published:o,showSignupModal:c,contentType:u,className:d,title:p,description:h,children:m,backgroundImageUrl:f,canDelete:v,canDuplicate:g,canEdit:b,subscriptionProvider:x,onDuplicateSuccess:y,onDeleteSuccess:w}=e,[j,k]=(0,a.useState)(""),P=s.h.plans.delete.useMutation({onSuccess:()=>{w&&w()}}),N=s.h.plans.duplicate.useMutation({onSuccess:e=>{y&&y(e.id||"",e.slug)}});async function C(){t&&await l.ZP.promise(P.mutateAsync({planId:t}),{error:"Deletion failed",loading:"Deleting plan...",success:"Plan deleted"})}async function S(){if(t)try{await l.ZP.promise(N.mutateAsync({planId:t,duplicatePlanRequest:{sharedContentId:null}}),{error:"Duplication failed",loading:"Duplicating plan...",success:"Plan duplicated"})}catch(e){}}return(0,r.jsx)(i.Z,{onCardDelete:C,onCardDuplicate:S,onCardInfoClick:function(){var e;k(null!==(e=t===j?"":t)&&void 0!==e?e:"")},"data-testid":"plan-card",href:n,title:p,description:h,selected:t===j,backgroundImageUrl:f,published:o,showSignupModal:c,contentType:u,canDelete:v,canDuplicate:g,canEdit:b,className:d,subscriptionProvider:x,children:m},t)}},83688:function(e,t,n){"use strict";n.d(t,{w:function(){return i}});var r=n(85893),a=n(94184),s=n.n(a),l=n(11163);function i(e){let{children:t,className:n,tag:a="div",variant:i="default"}=e,o=(0,l.useRouter)(),c=t.startsWith("<")?t:"<p>".concat(t,"</p>");return(0,r.jsx)(a,{onClick:e=>{!(!(e.target instanceof HTMLAnchorElement)||[e.altKey,e.ctrlKey,e.shiftKey,e.metaKey].some(Boolean))&&e.target.href.startsWith("/")&&(e.preventDefault(),o.push(e.target.href))},className:s()(n,"prose-a:font-black prose-a:text-teal","hover:prose-a:text-teal-light focus:prose-a:text-teal-dark","default"===i&&"prose max-w-none","tight"===i&&"prose prose-tight max-w-none leading-snug"),dangerouslySetInnerHTML:{__html:c}})}n(67294)},41453:function(e,t,n){"use strict";n.d(t,{j:function(){return f}});var r=n(85893),a=n(67294),s=n(87536),l=n(29208),i=n.n(l),o=n(32866),c=n(52586),u=n(2767),d=n(94184),p=n.n(d),h=n(84849);let m=(0,a.forwardRef)((e,t)=>{let{showSkeleton:n,name:a,checked:s,disabled:l=!1,onChange:i,screenReaderText:o,label:c,error:d,"data-testid":m}=e;return(0,r.jsxs)(u.r.Group,{children:[c&&(0,r.jsx)(u.r.Label,{className:"block text-base font-black text-primary",children:c}),n?(0,r.jsx)(h.Z,{height:24,width:44}):(0,r.jsxs)(u.r,{ref:t,"data-testid":m,disabled:l,name:a,checked:s,onChange:i,className:p()("relative inline-flex h-6 w-11 items-center rounded-full disabled:bg-neutral-200",{"bg-primary":s&&!d,"bg-grey":!s&&!
1d,"bg-error":d}),children:[o&&(0,r.jsx)("span",{className:"sr-only",children:o}),(0,r.jsx)("span",{className:p()("inline-block h-4 w-4 transform rounded-full bg-white transition",{"translate-x-6":s,"translate-x-1":!s})})]})]})});m.displayName="Switch";let f=e=>{let{name:t,control:n,rules:a,errors:l,className:u,...d}=e,p=i()(l,t),h=!!(l&&p);return(0,r.jsxs)("div",{className:u,children:[(0,r.jsx)(s.Qr,{control:n,name:t,rules:a,render:e=>{let{field:{onChange:n,value:a}}=e;return(0,r.jsx)(m,{name:t,error:h,checked:a,onChange:n,...d})}}),l&&(0,r.jsx)(o.B,{errors:l,name:t,render:e=>{let{message:t}=e;return(0,r.jsx)(c.J,{className:"mt-1",children:t})}})]})}},97480:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(85893),a=n(64019),s=n(83421),l=n(94184),i=n.n(l),o=n(67294),c=n(38106),u=n(7920),d=n(17376),p=n(42255);let h={full:"min-h-full","fit-content":""},m={left:"mr-auto",top:"mb-auto",right:"ml-auto",bottom:"mt-auto",center:"justify-center items-center","top-left":"mb-auto mr-auto","top-right":"mb-auto ml-auto","bottom-left":"mt-auto mr-auto","bottom-right":"mt-auto ml-auto"};function f(e){let{show:t,onClose:n,title:l,modalClassName:f="max-w-lg",closeButtonClassName:v="",position:g="center",height:b="full",children:x,onCloseEnd:y}=e,w=i()("gtm-close-modal","ml-auto h-6 w-6 shrink-0","rounded-full","bg-red hover:bg-red/80 focus:bg-red/80 text-white",v);function j(){n&&n()}return(0,r.jsx)(a.u,{show:t,enter:"transition duration-100 ease-out",enterFrom:"transform scale-100 opacity-0",enterTo:"transform scale-100 opacity-100",leave:"transition duration-300 ease-out",leaveFrom:"transform scale-100 opacity-100",leaveTo:"transform scale-100 opacity-0",afterLeave:y,children:(0,r.jsxs)(s.V,{onClose:j,className:"fixed inset-0 z-50 overflow-y-auto",children:[(0,r.jsx)(a.u.Child,{enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)(c.Z,{})}),(0,r.jsx)(a.u.Child,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-50",enterTo:"opacity-100 delay-100 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-50",children:(0,r.jsx)("div",{className:i()("flex",m[g],h[b]),children:(0,r.jsxs)(s.V.Panel,{as:u.s,disablePadding:!0,className:i()("relative z-10 mx-4 my-4 w-full px-6 pb-2 pt-4 sm:mx-10 sm:px-12 sm:pt-8 lg:mx-10",f),variant:n?"closable":"default",children:[(0,r.jsx)(s.V.Title,{className:"mb-6 text-h3 font-black",children:l}),n&&(0,r.jsx)(p.hU,{size:"custom",className:i()("absolute right-3 top-3",w),variant:"header",onClick:j,children:(0,r.jsx)(d.Tw,{className:"h-6 w-6"})}),(0,r.jsx)("div",{children:"function"==typeof x?x({onClose:j}):x})]})})})]})})}},59960:function(e,t,n){"use strict";n.d(t,{f:function(){return l}});var r=n(18202),a=n(11163),s=n(83915);function l(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{asPath:l,isReady:i,query:o}=(0,a.useRouter)(),c=(0,r.useIsPreviewing)(),u="string"==typeof o.previewPath?"/".concat(o.previewPath):Array.isArray(o.previewPath)&&o.previewPath.length>0?"/".concat(o.previewPath.join("/")):null;return s.h.builder.getIntroHeader.useQuery({basePath:null!==(t=null!==(e=n.urlPathOverride)&&void 0!==e?e:u)&&void 0!==t?t:l,preview:c},{enabled:i})}},53667:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return U}});var r,a,s=n(85893),l=n(67294),i=n(94184),o=n.n(i),c=n(36040),u=n(87829),d=n(11163),p=n(41296),h=n(2962),m=n(50867),f=n(7920),v=n(90048),g=n(70544),b=n(87536);function x(e){let{currentSearchPhrase:t,className:n,buttons:r,onSubmit:a}=e,{register:i,handleSubmit:o,formState:{errors:c},reset:u}=(0,b.cI)({defaultValues:{phrase:t||""}});(0,l.useEffect)(()=>{u({phrase:t})},[t,u]);let d=o(e=>{let{phrase:t}=e;return a(t)});return(0,s.jsx)(f.s,{className:n,variant:"faded",children:(0,s.jsx)("form",{onSubmit:d,children:(0,s.jsxs)("div",{children:[(0,s.jsx)(g._,{className:"mb-2 font-black",htmlFor:"phrase",children:"Search"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(m.y,{placeholder:"E.g. The Tudors, Easter, handwriting, arithmetic...",autoFocus:!0,className:"grow",id:"phrase",name:"phrase",register:i,rules:{minLength:{value:2,message:"Search phrases must be at least 2 characters long."},maxLength:{value:100,message:"Search phrases must be less than 100 characters long."}},errors:c}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(v.zx,{submit:!0,
1className:"grow",children:"Search"}),r]})]})]})})})}var y=n(96487),w=n(53922),j=n(55166),k=n(71682),P=n(33299),N=n(51145);let C=[{value:N.X.NameAsc,label:"Name A-Z"},{value:N.X.NameDesc,label:"Name Z-A"},{value:N.X.DateAsc,label:"Date - Old to New"},{value:N.X.DateDesc,label:"Date - New to Old"}];var S=n(83915),E=n(64501),D=n(10785),L=n(41453);let T={sortBy:N.X.DateDesc,contentTypes:[],authorIds:[],contentProviders:[],subscriptionProviders:[],isCPD:!1},M=e=>{var t,n,r,a;let{submitForm:i,filters:o}=e,{handleSubmit:c,control:u,reset:d}=(0,b.cI)(),p=(0,P.useSession)(),h=S.h.search.getSearchResultsAuthors.useQuery(void 0,{retry:!1}),m=S.h.subscriptionProviders.get.useQuery(void 0,{retry:!1}),f=S.h.contentProviders.get.useQuery(void 0,{retry:!1}),x=c(e=>{i(e)});return(0,l.useEffect)(()=>{o&&d(o)},[d,o]),(0,s.jsx)("form",{onSubmit:x,children:(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)(j.Z,{tag:"h3",className:"mr-auto",children:"Sorting"}),(0,s.jsx)(g._,{htmlFor:"sortBy",children:"Sort By"}),(0,s.jsx)(w.i,{name:"sortBy",placeholder:"Select sorting...",className:"mb-1",control:u,options:C}),(0,s.jsxs)("span",{className:"flex justify-between gap-2",children:[(0,s.jsx)("div",{className:"flex",children:(0,s.jsx)(j.Z,{tag:"h3",className:"mr-auto",children:"Filtering"})}),(0,s.jsx)("div",{className:"flex gap-1",children:(0,s.jsx)(v.zx,{"data-testid":"search-clear-all-button",size:"sm",variant:"text",color:"default",className:"ml-auto underline",onClick:()=>{d(T)},children:"Clear all"})})]}),(0,s.jsx)(g._,{htmlFor:"contentType",children:"Content Type"}),(0,s.jsx)(w.i,{"data-testid":"search-content-type",name:"contentTypes",placeholder:"Select content type...",className:"mb-1",isMultiple:!0,isClearable:!0,control:u,options:[...(0,k.gT)((null===(a=p.data)||void 0===a?void 0:null===(r=a.user)||void 0===r?void 0:null===(n=r.details)||void 0===n?void 0:n.permissions)||null),{value:"Plan",label:"Plan"}]}),(0,s.jsx)(L.j,{"data-testid":"search-is-cpd",name:"isCPD",label:"CPD Accredited",control:u,className:"flex flex-col gap-2"}),(0,s.jsx)(g._,{htmlFor:"authors",children:"Authors"}),(0,s.jsx)(w.i,{"data-testid":"search-authors",name:"authorIds",placeholder:"Select Authors...",className:"mb-1",control:u,isMultiple:!0,isClearable:!0,options:(null===(t=h.data)||void 0===t?void 0:t.map(e=>({value:e.id||"",label:e.author||""})))||[]}),(0,s.jsx)(g._,{htmlFor:"contentProviders",children:"Provider"}),(0,s.jsx)(w.i,{"data-testid":"search-content-providers",name:"contentProviders",placeholder:"Select Provider...",className:"mb-1",control:u,isMultiple:!0,isClearable:!0,options:(0,E.lE)(f.data||[])}),(0,s.jsx)(g._,{htmlFor:"subscriptionProviders",children:"Subscription"}),(0,s.jsx)(w.i,{"data-testid":"search-subscription-providers",name:"subscriptionProviders",placeholder:"Select Subscription ...",className:"mb-1",control:u,isMultiple:!0,isClearable:!0,options:(0,D.m)(m.data||[])}),(0,s.jsx)("div",{children:(0,s.jsx)(v.zx,{submit:!0,type:"submit",block:!0,className:"gtm-btn-plans-apply-filters min-w-1/4 my-4 ml-auto mr-auto",children:"Apply Filters"})})]})})};var I=n(91718),B=n(63208),A=n(13026),O=n(55284),_=n(87121),R=n(34261),F=n(55490),Z=n(72901),z=n(59960);function H(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return!!n}))}function U(){var e,t,n,r,a,i;let m=(0,p.X)(),f=(0,d.useRouter)(),{phrase:v,...g}=f.query,b="string"==typeof f.query.phrase?f.query.phrase:"",w=function(e){let t="true"===e.isCPD||"false"!==e.isCPD&&void 0;return{authorIds:(0,A.yb)(e.authorIds),contentTypes:(0,A.yb)(e.contentTypes),sortBy:(0,A.op)(e.sortBy)||N.X.DateDesc,contentProviders:(0,A.yb)(e.contentProviders),subscriptionProviders:(0,A.yb)(e.subscriptionProviders),isCPD:t}}(g),[j,P]=(0,l.useState)(1),[C,D]=(0,l.useState)(20),[L,T]=(0,l.useState)(!1),U=e=>{T(e)},W=S.h.search.getSearchResults.useQuery(function(e,t,n,r){switch(null==t?void 0:t.sortBy){case N.X.NameDesc:return{phrase:e,...t,page:n,pageSize:r,sortBy:"Name",isDescending:!0};case N.X.NameAsc:return{phrase:e,...t,page:n,pageSize:r,sortBy:"Name",isDescending:!1};case N.X.DateDesc:return{phrase:e,...t,page:n,pageSize:r,sortBy:"Date",isDescending:!0};case N.X.DateAsc:return{phrase:e,...t,page:n,pageSize:r,sortBy:"Date",isDescending:!1};default:return{phrase:e,...t,page:n,pageSize:r}}}(b,w,j,C),{enabled:b.length>=2&&"authenticated"===m.status});function X(){var e,t;(null===(t=W.data)||void 0===t?void 0:null===(e=t.page)||void 0===e?void 0:e.length)===1&&j>1?P(j-1):W.refetch()}function q(e,t){f.push((0,F.M)({type:"content",id:e,slug:t,mode:"editor",subSection:"details"}))}function V(e,t){f.push((0,F.M)({type:"plans",mode:"viewer",id:e,slug:t,subSection:null}))}let K=S.h.contentProviders.get.useQuery(void 0,{retry:!1}),Q=(0,z.f)(),{title:Y="Search",body:G}=(null===(e=Q.data)||void 0===e?void 0:e.data)||{};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.PB,{title:Y}),(0,s.jsx)(Z.O,{className:"mb-4",isLoading:Q.isLoading,title:Y,body:G,builderContent:null===(t=Q.data)||void 0===t?void 0:t.builderContent,variant:"default"}),!f.query.hideSearch&&(0,s.jsx)(x,{currentSearchPhrase:b,className:"mb-4",buttons:(0,s.jsx)(I.Z,{filterCount:w?(0,A.Nh)(w,["sortBy"]):0,onClick:()=>U(!0)}),onSubmit:e=>{P(1),f.push({href:"/search",query:H({...w,phrase:e})}),W.refetch()}}),w&&(0,s.jsx)(O.u,{className:"mb-2",filters:w,onFilterRemove:e=>{P(1);let t=new URL(f.pathname,window.location.origin);
1Object.entries(e).forEach(e=>{let[n,r]=e;if(r){if(Array.isArray(r)){r.forEach(e=>{t.searchParams.append(n,e)});return}if("boolean"==typeof r){t.searchParams.append(n,r?"true":"false");return}t.searchParams.append(n,r)}}),b&&t.searchParams.append("phrase",b),f.push(t)},keyIgnoreList:["sortBy"]}),W.isInitialLoading&&(0,s.jsx)(c.Z,{position:"screen-center"}),!v&&!W.isInitialLoading&&(0,s.jsx)("p",{className:"col-span-full p-2 text-center",children:"Enter a search phrase above to find content or plans"}),v&&!W.isInitialLoading&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:o()("grid-col-1 mx-auto grid gap-4","sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"),children:[!(null===(n=W.data)||void 0===n?void 0:n.page.length)&&(0,s.jsx)("p",{className:"col-span-full p-2 text-center",children:"There is no content available which matches your search query"}),null===(a=W.data)||void 0===a?void 0:null===(r=a.page)||void 0===r?void 0:r.map(e=>{var t,n,r,a,l,i,o,c;let u=null!==(n=null===(t=e.keyStages)||void 0===t?void 0:t.map(e=>e.replace("Key Stage ","KS")))&&void 0!==n?n:[],d=null!==(r=e.years)&&void 0!==r?r:[],p=null!==(a=e.subjects)&&void 0!==a?a:[],h=[(0,E.C0)((null==K?void 0:K.data)||[],e.contentProvider||""),...p,...u,...d];return"Plan"===e.contentType?(0,s.jsx)(_.Z,{"data-testid":"search-plan-card",title:e.name,backgroundImageUrl:e.imageUrl,showSignupModal:e.subscriptionProvider||(0,k.WN)(e.contentType||"")?"both":null,contentType:e.contentType,href:(0,F.M)({type:"plans",mode:"viewer",id:null!==(l=e.id)&&void 0!==l?l:"",slug:e.slug,subSection:"plan"}),planId:e.id,onDeleteSuccess:X,onDuplicateSuccess:V,description:null!==(i=e.description)&&void 0!==i?i:"",subscriptionProvider:e.subscriptionProvider,...e.access,canDuplicate:!1,children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs font-black text-primary","data-testid":"plan-card-author",children:["Plan by ",e.author]}),h.length>0&&(0,s.jsx)("p",{title:h.join(", "),className:"line-clamp-2 text-xs text-primary","data-testid":"plan-card-key-stages-years-subjects",children:h.join(", ")})]})},e.id):(0,s.jsx)(R.Z,{"data-testid":"search-lesson-card",title:e.name,slug:e.slug,backgroundImageUrl:e.imageUrl,showSignupModal:e.subscriptionProvider||(0,k.WN)(e.contentType||"")?"actions":null,contentType:e.contentType,href:(0,F.M)({type:"content",id:null!==(o=e.id)&&void 0!==o?o:"",slug:e.slug,subSection:"sections",sectionId:null,mode:"viewer"}),description:null!==(c=e.description)&&void 0!==c?c:"",lessonId:e.id,onDeleteSuccess:X,onDuplicateSuccess:q,subscriptionProvider:e.subscriptionProvider,...e.access,canDuplicate:!1,cpd:e.isCPD,cpdHours:e.estimatedCPDHours,children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs font-black text-primary","data-testid":"search-card-author",children:[(0,k.CO)(e.contentType)," by"," ",e.author]}),h.length>0&&(0,s.jsx)("p",{title:h.join(", "),className:"line-clamp-2 text-xs text-primary","data-testid":"plan-card-key-stages-years-subjects",children:h.join(", ")})]})},e.id)})]}),(0,s.jsx)(u.Z,{"data-testid":"search-page-pager",className:"mt-4",page:j,pageSize:C,totalCount:(null===(i=W.data)||void 0===i?void 0:i.totalCount)||0,onPageChange:function(e){scrollTo({behavior:"smooth",top:0}),P(e)},onPageSizeChange:function(e){scrollTo({behavior:"auto",top:0}),D(e),P(1)}})]}),(0,s.jsx)(y.Z,{title:(0,s.jsx)(B.d,{className:"w-20"}),isOpen:L,toggleOpen:U,className:"min-w-[25vw]",children:(0,s.jsx)(M,{filters:w,submitForm:e=>{P(1),f.push({href:"/search",query:H({...e,phrase:v})}),U(!1)}})})]})}(r=a||(a={})).Name="Name",r.Date="Date"},55490:function(e,t,n){"use strict";function r(e,t){let{type:n,subSection:r,sharedContentId:a}=e,s=e.id||"__",l=e.slug||"__",i=e.mode,o="content"===n&&"sections"===r?e.sectionId:null,c=[n,i,s,l,r,o].filter(Boolean).join("/"),u=new URLSearchParams(t);a&&u.append("sharedContentId",a),u.sort();let d=u.toString()?"?".concat(u.toString()):"";return"/".concat(c).concat(d)}n.d(t,{M:function(){return r}})},2767:function(e,t,n){"use strict";n.d(t,{r:function(){return y}});var r=n(67294),a=n(83619),s=n(59656),l=n(71237),i=n(67257),o=n(57110),c=n(40947),u=n(68354);let d=(0,r.createContext)(null),p=(0,a.yV)(function(e,t){let{passive:n=!1,...l}=e,i=function e(){let t=(0,r.useContext)(d);if(null===t){let t=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),u="headlessui-label-".concat((0,s.M)()),p=(0,c.T)(t);(0,o.e)(()=>
1i.register(u),[u,i.register]);let h={ref:p,...i.props,id:u};return n&&("onClick"in h&&delete h.onClick,"onClick"in l&&delete l.onClick),(0,a.sY)({ourProps:h,theirProps:l,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})});var h=n(29138),m=n(217),f=n(51228),v=n(22983),g=n(89327);let b=(0,r.createContext)(null);b.displayName="GroupContext";let x=r.Fragment,y=Object.assign((0,a.yV)(function(e,t){let{checked:n,defaultChecked:o=!1,onChange:d,name:p,value:h,...x}=e,y="headlessui-switch-".concat((0,s.M)()),w=(0,r.useContext)(b),j=(0,r.useRef)(null),k=(0,c.T)(j,t,null===w?null:w.setSwitch),[P,N]=(0,g.q)(n,d,o),C=(0,u.z)(()=>null==N?void 0:N(!P)),S=(0,u.z)(e=>{if((0,i.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),C()}),E=(0,u.z)(e=>{e.key===l.R.Space?(e.preventDefault(),C()):e.key===l.R.Enter&&(0,v.g)(e.currentTarget)}),D=(0,u.z)(e=>e.preventDefault()),L=(0,r.useMemo)(()=>({checked:P}),[P]),T={id:y,ref:k,role:"switch",type:(0,m.f)(e,j),tabIndex:0,"aria-checked":P,"aria-labelledby":null==w?void 0:w.labelledby,"aria-describedby":null==w?void 0:w.describedby,onClick:S,onKeyUp:E,onKeyPress:D};return r.createElement(r.Fragment,null,null!=p&&P&&r.createElement(f._,{features:f.A.Hidden,...(0,a.oA)({as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:P,name:p,value:h})}),(0,a.sY)({ourProps:T,theirProps:x,slot:L,defaultTag:"button",name:"Switch"}))}),{Group:function(e){let[t,n]=(0,r.useState)(null),[s,l]=function(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)(()=>function(e){let n=(0,u.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),a=(0,r.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return r.createElement(d.Provider,{value:a},e.children)},[t])]}(),[i,o]=(0,h.f)(),c=(0,r.useMemo)(()=>({switch:t,setSwitch:n,labelledby:s,describedby:i}),[t,n,s,i]);return r.createElement(o,{name:"Switch.Description"},r.createElement(l,{name:"Switch.Label",props:{onClick(){t&&(t.click(),t.focus({preventScroll:!0}))}}},r.createElement(b.Provider,{value:c},(0,a.sY)({ourProps:{},theirProps:e,defaultTag:x,name:"Switch.Group"}))))},Label:p,Description:h.d})},89327:function(e,t,n){"use strict";n.d(t,{q:function(){return s}});var r=n(67294),a=n(68354);function s(e,t,n){let[s,l]=(0,r.useState)(n),i=void 0!==e;return[i?e:s,(0,a.z)(e=>(i||l(e),null==t?void 0:t(e)))]}},217:function(e,t,n){"use strict";n.d(t,{f:function(){return l}});var r=n(67294),a=n(57110);function s(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";if("string"==typeof n&&"button"===n.toLowerCase())return"button"}function l(e,t){let[n,l]=(0,r.useState)(()=>s(e));return(0,a.e)(()=>{l(s(e))},[e.type,e.as]),(0,a.e)(()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&l("button")},[n,t]),n}},22983:function(e,t,n){"use strict";function r(e,t){return e?e+"["+t+"]":t}function a(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n){for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type){e.click();return}}}n.d(t,{g:function(){return a},t:function(){return function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];
1for(let[s,l]of Object.entries(t))!function t(n,a,s){if(Array.isArray(s))for(let[e,l]of s.entries())t(n,r(a,e.toString()),l);else s instanceof Date?n.push([a,s.toISOString()]):"boolean"==typeof s?n.push([a,s?"1":"0"]):"string"==typeof s?n.push([a,s]):"number"==typeof s?n.push([a,"".concat(s)]):null==s?n.push([a,""]):e(s,a,n)}(a,r(n,s),l);return a}}})}},function(e){e.O(0,[2946,6950,2888,9774,179],function(){return e(e.s=35243)}),_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.