1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[660,6397],{8806:(e,t,a)=>{a.r(t),a.d(t,{default:()=>x});var r=a(37876),l=a(12832),s=a(41244),n=a(26645),i=a(42082),o=a(24130),c=a(8114),u=a(59541),d=a(9365),h=a(70001),m=a(34824),p=a(18847),f=a.n(p),b=a(14e3),g=a(14232),v=a(88992),w=a(51720);let y=f()(()=>a.e(6860).then(a.bind(a,36860)),{loadableGenerated:{webpack:()=>[36860]},ssr:!1}),A=(0,g.forwardRef)((e,t)=>{let{defaultValues:a}=e,n=(0,m.useRouter)(),i=(0,b.useRouter)(),o=(0,b.usePathname)();(0,g.useEffect)(()=>{if(n&&!n.isReady)return},[n,o]);let c=(0,v.mN)({defaultValues:a}),{handleSubmit:u,setValue:d,watch:h,getFieldState:p}=c,f=(0,g.useRef)(null),w=h("search");(0,g.useEffect)(()=>{let e;return p("search").isDirty&&a.search&&""===w&&(e=setTimeout(()=>{var e;null==(e=f.current)||e.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))},200)),()=>{e&&clearTimeout(e)}},[a.search,p,w]);let y=(0,g.useCallback)(async e=>{let t=Object.fromEntries(Object.entries({...e,page:0,sort_by:a.sort_by}).filter(e=>
1{let[t,a]=e;return""!==a&&null!=a&&!1!==a})),r=new URLSearchParams(t).toString();(r||Object.keys(a).length!==Object.keys(t).length)&&(n?await n.push({query:t},void 0,{shallow:!0}):await i.push("".concat(o,"?").concat(r)))},[a,n,i,o]);return(0,r.jsx)(v.Op,{...c,children:(0,r.jsx)("form",{className:"flex flex-col w-full",onSubmit:u(y),autoComplete:"off",ref:f,children:(0,r.jsxs)("div",{className:"flex flex-col w-full md:flex-row md:w-10/12 lg:w-8/12 gap-y-4 gap-x-6",children:[(0,r.jsx)("div",{ref:t,className:"w-full",children:(0,r.jsx)(l.A,{label:"Search",type:"educationArt",className:"w-full",...c.register("search"),onPress:e=>{var t;d("search",e.title),"Artwork"===e.type&&d("athena_id",e.data.athena_id),null==(t=f.current)||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0})),"Artwork"===e.type&&d("athena_id","")}})}),(0,r.jsx)(s.Ay,{classNames:"w-full md:w-10/12",type:"submit",children:"Search"})]})})})});A.displayName="EducationArtSearchForm";let x=()=>{let[e,t]=(0,g.useState)([]),[a,l]=(0,g.useState)(0),[s,p]=(0,g.useState)(!0),f=(0,g.useRef)(null),v=(0,g.useRef)(null),x=(0,m.useRouter)(),j=(0,b.useRouter)(),C=(0,b.useSearchParams)(),L=(0,g.useMemo)(()=>null!=C?C:new URLSearchParams,[C]),N=(0,b.useParams)(),E=(0,b.usePathname)();(0,g.useEffect)(()=>{if(x&&!x.isReady)return},[x,L,E,N]);let _=(0,g.useMemo)(()=>{let e={};
1return N&&Object.entries(N).forEach(t=>{let[a,r]=t;Array.isArray(r)?e[a]=r.join("/"):r&&(e[a]=r)}),L.forEach((t,a)=>{e[a]=t}),e},[L,N]),k=async e=>{if(x)await x.push({query:{..._,sort_by:e}},void 0,{shallow:!0});else{let t=new URLSearchParams({..._,sort_by:e}).toString();await j.push("".concat(E,"?").concat(t))}},R=[{accessorFn:e=>({imageUrl:null==e?void 0:e.image_thumbnail,alt:""}),header:"Thumbnail",size:160,cell:e=>(0,r.jsx)(c.E4,{alt:"",src:e.getValue().imageUrl})},{accessorKey:"title",header:"Title",size:300,cell:e=>(0,r.jsx)("p",{className:"!m-0 text-16 md:text-21 w-full md:py-4 table-header",children:e.getValue()})},{accessorFn:e=>{var t,a,r,l;let s=null==e||null==(t=e.culture)?void 0:t.reduce((e,t,a)=>a>0?e+", ".concat(t):e+t,""),n=null==e||null==(a=e.creators)?void 0:a.map(e=>null==e?void 0:e.name).join(", "),i=s||(null==e||null==(r=e.culture)?void 0:r.join(", ")),o=n||(null==e||null==(l=e.creators)?void 0:l.join(", "));return o||i?"".concat(o||"Unknown",", ").concat(i):"Unknown"},size:200,accessorKey:"creatorsDescriptions",header:"Artist, Culture",cell:e=>(0,r.jsx)("p",{className:"!m-0 md:py-4",children:e.getValue()})},{accessorKey:"creation_date",header:()=>(0,r.jsx)("div",{className:"pl-4",children:"Date Created"}),minSize:160,cell:e=>(0,r.jsx)("div",{className:"pl-4",children:e.getValue()?e.getValue():"Unknown"})},{accessorKey:"technique",header:"Materials",cell:e=>(0,r.jsx)("div",{children:e.getValue()?e.getValue():"Unknown"})},{accessorKey:"creditline",header:"Credit Line",cell:e=>(0,r.jsx)("div",{children:e.getValue()?e.getValue():"Unknown"})},{accessorKey:"accession_number",header:"Object Number",cell:e=>(0,r.jsx)("div",{children:e.getValue()?e.getValue():"Unknown"})}];(0,g.useEffect)(()=>{let e=new AbortController;return(async()=>{p(!0);let{search:a,sort_by:r,page:s,athena_id:n}=_,i=(e=>{switch(e){case"Culture: A-Z":return"culture asc";case"Culture: Z-A":default:return"culture desc";case"Title: A-Z":return"title asc";case"Title: Z-A":return"title desc";case"Materials: A-Z":return"technique asc";case"Materials: Z-A":return"technique desc"}})(r),o=s?Number.parseInt(s)*c.md:void 0,{data:u,cancelled:d}=await (0,h.qK)(a,i,o,n,e);if(!d){if(u){var m;l(null==u||null==(m=u.info)?void 0:m.total),t(null==u?void 0:u.data)}p(!1)}})(),()=>{e.abort()}},[_]);let S=async e=>{if(x)await x.push({query:{..._,page:e.selected}},void 0,{shallow:!0});else{let t=new URLSearchParams({..._,page:e.selected.toString()}).toString();await j.push("".concat(E,"?").concat(t))}v.current&&v.current.scrollIntoView({behavior:"instant"}),f.current&&(f.current.scrollLeft=0)},T=(0,u.A)({totalItems:a,itemsPerPage:c.md,currentPage:(null==_?void 0:_.page)?Number.parseInt(_.page):0,currentItems:null==e?void 0:e.length,resultsAsItems:!0}),{isMobile:P}=(0,d.Ay)(),V=!x||x.isReady;return(0,r.jsxs)(n.s9,{className:"min-h-[31.875rem]",children:[V&&(0,r.jsx)(A,{ref:v,defaultValues:_}),(0,r.jsxs)("div",{className:"flex justify-between mt-4 md:mt-16 flex-col md:flex-row",children:[(0,r.jsx)("h2",{className:"body-2 mb-4 md:mb-0 filter-and-results-header",children:s?null:T}),(0,r.jsx)(o.A,{term:(null==_?void 0:_.sort_by)||"Culture: A-Z",options:["Culture: A-Z","Culture: Z-A","Title: A-Z","Title: Z-A","Materials: A-Z","Materials: Z-A"],popoverMenuCLasses:"bg-white z-10",onChangeTerm:k,containerClasses:"mb-6 md:mb-0"})]}),P?(0,r.jsx)(w.A,{data:e||[],tableColumns:R}):(0,r.jsx)(i.A,{isLoading:s,ref:f,data:e||[],tableColumns:R,ariaLabel:"Education Art"}),!s&&a>c.md&&(0,r.jsx)("div",{className:"mt-10",children:(0,r.jsx)(y,{currentPage:(null==_?void 0:_.page)?Number.parseInt(_.page):0,pageCount:Math.ceil(a/c.md),onPageChange:S})})]})}},9982:(e,t,a)=>{a.d(t,{iP:()=>l,pA:()=>s});let r=null;function l(e,t="assertive",a=7e3){r?r.announce(e,t,a):(r=new n,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"undefined"!=typeof jest)?r.announce(e,t,a):setTimeout(()=>{r?.isAttached()&&r?.announce(e,t,a)},100))}function s(e){r&&r.clear(e)}class n{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"undefined"!=typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",a=7e3){if(!this.node)return;let r=document.createElement("div");"object"==typeof e?(r.setAttribute("role","img"),r.setAttribute("aria-labelledby",e["aria-labelledby"])):r.textContent=e,"assertive"===t?this.assertiveLog?.appendChild(r):this.politeLog?.appendChild(r),""!==e&&setTimeout(()=>{r.remove()},a)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}}},36397:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(37876);let l=()=>(0,r.jsx)("span",{className:"absolute text-red-alert top-2 right-2 pointer-events-none","aria-hidden":"true",children:"*"})},51166:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(14232),l=a(41145),s=function(){return(s=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var l in t=arguments[a])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};let n=r.forwardRef(function(e,t){var a=r.useContext(l.h),n=s(s({},a),e);return r.createElement("svg",s({width:"1.5em",height:"1.5em",strokeWidth:1.5,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:t},n),r.createElement("path",{d:"M6 15l6-6 6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))})}}]);
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.