1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5538],{87730:function(e,t,a){"use strict";a.d(t,{Z:function(){return ArtworkSearch}});var r=a(85893),i=a(11163),l=a(67294),o=a(70290),n=a.n(o),s=a(40768),c=a(43173),d=a(65346),u=a(35070),h=a(80129),g=a.n(h);a(98884);let m="https://www.uffizi.it/";var p=a(79892),f=a(72953),b=a(50723),x=a(2684),v=a(96303);function ArtworkHit(e){let{hit:t}=e,{objectID:a,title:i,image:l,abstract:o,position:n,author:s}=t,c={"Giardino di Boboli":"bg-green","Corridoio Vasariano":"bg-orange","Gli Uffizi":"bg-gold","Palazzo Pitti":"bg-red","Terre degli Uffizi":"bg-black"},d=null==t?void 0:t["categories.lvl0"];return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"card-container group",children:[(0,r.jsx)("div",{className:"".concat({"Giardino di Boboli":"border-green","Corridoio Vasariano":"border-orange","Gli Uffizi":"border-gold","Palazzo Pitti":"border-red","Terre degli Uffizi":"border-black"}[d]," ").concat({"Giardino di Boboli":"after:bg-green","Corridoio Vasariano":"after:bg-orange","Gli Uffizi":"after:bg-gold","Palazzo Pitti":"after:bg-red","Terre degli Uffizi":"after:bg-black"}[d]," image-container md:border-b-0 border-b-[8px] relative overflow-hidden after:absolute after:mix-blend-screen pb-[118.75%]"),children:(0,r.jsx)("img",{className:"card-image object-cover absolute inset-0 w-full h-full",src:l,alt:i})}),(0,r.jsx)("div",{className:"md:h-2 ".concat(c[d])}),(0,r.jsxs)("div",{className:"pt-6 lg:pr-6",children:[(0,r.jsx)("div",{className:"mb-2 line-clamp-2",children:i&&(0,r.jsx)("h2",{className:"block text-lg font-bold group-hover:underline",children:i})}),s&&(0,r.jsx)("h3",{className:"block text-base leading-normal mx-0 px-0 pb-4",children:s})]}),(0,r.jsx)("div",{className:"mb-2",children:d&&(0,r.jsx)("div",{className:"".concat(c[d]," inline-flex items-center px-2 py-2 text-sm text-center text-white rounded-full animate-text-enter"),children:(0,r.jsx)(v.Z,{name:"arrowRight",size:"15",fill:"white"})})})]})},"hit-".concat(a))}var w=a(41664),j=a.n(w),y=a(29153);function ArtworkResults(e){let{locale:t,apiKey:a,...i}=e,{hits:l}=(0,x.O)(i);return(0,r.jsx)("div",{className:"grid grid-cols-1 gap-12 sm:grid-cols-2 sm:gap-x-3 sm:gap-y-10 md:grid-cols-3 lg:grid-cols-3 xl:gap-x-3 xl:gap-y-10 4xl:grid-cols-3",children:l.map(e=>(0,r.jsx)("div",{children:(0,r.jsx)(j(),{prefetch:!1,href:(0,y.Z)({apiKey:a,slug:e.slug},t),children:(0,r.jsx)(ArtworkHit,{hit:e})})},e.objectID))})}var k=a(66097),N=a(64852);let Z=n()("CL36ZUJ4JU","aa3405435c7fb9a7b46c1925714fe196");function ArtworkSearch(e){var t,a,o,n,h,x,v,w;let{locale:j,museumsInfos:y}=e,P="it"===j?"artworks_it":"artworks_en",I="it"===j?"opere/cerca":"artworks/search",[C,_]=(0,l.useState)(!1),z=(0,i.useRouter)(),{asPath:R}=z,[A,L]=(0,l.useState)({}),[S,T]=(0,l.useState)(!1),[U,q]=(0,l.useState)(!1),[E,M]=(0,l.useState)(!1);(0,l.useEffect)(()=>{var e,t;_(!1);let a=function(e,t,a,r){let i=t.split("/"),l=e.pathname.replace(m,"").replace(r,"").replace(i[0],"").replace(i[1],"").split("/").filter(Boolean),{query:o="",page:n,tags:s=[]}=g().parse(e.search.slice(1)),c=Array.isArray(s)?s:[s].filter(Boolean),d=Array.isArray(l)?l:[l].filter(Boolean);return{query:decodeURIComponent(o),page:n,tags:c.map(e=>decodeURIComponent(e)),categories:null==d?void 0:d.map(e=>(function(e,t){let a=null==t?void 0:t.find(t=>t.slug===e);return(null==a?void 0:a.title)||e})(e,a))}}(location,I,y,"it"===j?"":"en"),r={[P]:{query:a.query,page:a.page,hierarchicalMenu:{"categories.lvl0":null!==(e=a.categories)&&void 0!==e?e:[]},refinementList:{tags:null!==(t=a.tags)&&void 0!==t?t:[]}}};L(r),_(!0)},[R]);let handleResetNotification=()=>{T(!0),setTimeout(()=>{T(!1)},500)},handleOpenFilters=()=>{M(!E)},B=(null==A?void 0:null===(a=A.artworks_it)||void 0===a?void 0:null===(t=a.hierarchicalMenu)||void 0===t?void 0:t["categories.lvl0"])?[...null==A?void 0:null===(n=A.artworks_it)||void 0===n?void 0:null===(o=n.hierarchicalMenu)||void 0===o?void 0:o["categories.lvl0"]]:[],D=(null==A?void 0:null===(x=A.artworks_en)||void 0===x?void 0:null===(h=x.hierarchicalMenu)||void 0===h?void 0:h["categories.lvl0"])?[...A.artworks_en.hierarchicalMenu["categories.lvl0"]]:[],F="it"==j?B:D,G=F&&F.map(F.pop,[...F]).join(" | "),H=null==G?void 0:G.split("|").reverse().join(" | "),Q=(null==A?void 0:null===(v=A.artworks_it)||void 0===v?void 0:v.query)||(null==A?void 0:null===(w=A.artworks_en)||void 0===w?void 0:w.query);return(0,r.jsx)("div",{className:"px-[24px] 4xl:container xl:pb-8",children:C&&(0,r.jsxs)(c.p,{searchClient:Z,indexName:P,onStateChange:e=>{var t,a,r,i;let{uiState:l,setUiState:o}=e;o(l),L(l),M(!1);let n={query:l[P].query,page:l[P].page,tags:null!==(r=null===(t=l[P].refinementList)||void 0===t?void 0:t.tags)&&void 0!==r?r:[],categories:null!==(i=null===(a=l[P].hierarchicalMenu)||void 0===a?void 0:a["categories.lvl0"])&&void 0!==i?i:[]},s=function(e,t,a,r,i){let l=e.asPath.split(a)[0];l.endsWith("/")&&(l=l.slice(0,-1));let o={},n="",s=a;if(t.categories){var c;let e=null===(c=t.categories)||void 0===c?void 0:c.map(e=>(function(e,t){let a=t.find(t=>t.title===e);return(null==a?void 0:a.slug)||e})(e,r));(n=e.join("/"))&&(s=i?"artworks":"opere"),l=i?"".concat(m,"/").concat(i):"".concat(m)}t.query&&(o.query=encodeURIComponent(t.query)),1!==t.page&&(o.page=t.page),t.tags&&(o.tags=t.tags.map(e=>encodeURIComponent(e)));
1let d=g().stringify(o,{addQueryPrefix:!0,arrayFormat:"repeat"}),u="".concat(l,"/").concat(n?n+"/":"").concat(s).concat(d);return u}(z,n,I,y,"it"===j?"":"en");z.push(s,void 0,{shallow:!0})},initialUiState:A,children:[(0,r.jsx)(function(){let{items:e,canRefine:t,refine:a}=(0,s.b)();return q(t),""},{}),(0,r.jsxs)("h1",{className:"font-bold text-xl md:text-2xl py-14 pb-8 md:py-11 lg:py-9 lg:col-start-2 lg:col-span-3",children:[(0,k.Z)("artworks",j)," ",H&&H.length>0&&" | ".concat(H)]}),(0,r.jsxs)("div",{className:"flex items-center lg:hidden pb-8 mb-8 border-b border-gray border-dashed",children:[(0,r.jsxs)("button",{className:"flex items-center font-bold text-white bg-black capitalize px-4 py-2 mr-6 whitespace-nowrap",onClick:()=>handleOpenFilters(),children:[(0,r.jsx)(N.Z,{classes:"w-[14px] h-[14px] bg-white group-hover:bg-gray mr-2 transition motion-safe:duration-200",fileName:"filter"}),E&&(0,r.jsxs)(r.Fragment,{children:[(0,k.Z)("search.hide-filters",j)," "]}),!E&&(0,r.jsxs)(r.Fragment,{children:[(0,k.Z)("search.modify-filters",j)," "]})]}),(void 0!==Q||U)&&(0,r.jsx)(f.Z,{cb:()=>handleResetNotification(),locale:j,notifyReset:S})]}),(0,r.jsxs)("div",{className:"lg:flex lg:justify-between",children:[(0,r.jsxs)("div",{className:"".concat(E?"h-auto":"h-0 overflow-hidden"," lg:overflow-auto lg:h-full lg:w-1/4 lg:shrink-0 lg:sticky lg:top-0 lg:z-[1]"),children:[(0,r.jsxs)("div",{className:"mb-10 pb-6 border-b border-gray border-dashed",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(p.Z,{resetNotification:S,locale:j,section:"artworks"})}),(0,r.jsx)("div",{className:"mb-6 pb-6 border-b border-gray border-dashed",children:(0,r.jsx)(d.j,{translations:{rootElementText(e){let{nbHits:t}=e;return"".concat(t," ").concat((0,k.Z)("search.artworks_shown",j)," ")}}})}),(0,r.jsx)("h3",{className:"text-md mb-6",children:(0,k.Z)("search.museums",j)}),(0,r.jsx)(u.D,{attributes:["categories.lvl0","categories.lvl1"],classNames:{root:"text-base",list:"",selectedItemLink:"underline",childList:"[&_.ais-HierarchicalMenu-item]:mb-0 [&_.ais-HierarchicalMenu-link]:pl-5 [&_.ais-HierarchicalMenu-link]:font-normal",parentItem:"cursor-pointer relative",link:"px-3 py-2 cursor-pointer block hover:underline",selectedItem:"",item:"mb-3 font-bold",count:"ml-2 font-normal text-base px-[8px] py-[1px] bg-border rounded-md",label:"cursor-pointer"}})]}),(0,r.jsx)("div",{className:"hidden lg:block",children:(0,r.jsx)(f.Z,{cb:()=>handleResetNotification(),locale:j,notifyReset:S})})]}),(0,r.jsxs)("div",{className:"lg:w-3/4 lg:pl-10",children:[(0,r.jsx)("div",{className:"pb-10",children:(0,r.jsx)(ArtworkResults,{locale:j,apiKey:"artwork"})}),(0,r.jsx)("div",{className:"py-10 w-full ",children:(0,r.jsx)(b.Z,{locale:j})})]})]})]})})}},72953:function(e,t,a){"use strict";a.d(t,{Z:function(){return CustomClearRefinements}});var r=a(85893),i=a(91586),l=a(66097),o=a(64852);function CustomClearRefinements(e){let{cb:t,notifyReset:a,isMainSearch:n=!1,locale:s,...c}=e,{canRefine:d,refine:u}=(0,i.n)(c),h=void 0!=n&&n?(0,l.Z)("search.remove-filters",s):(0,l.Z)("search.reset",s);return(0,r.jsx)("div",{children:a?(0,r.jsxs)("div",{children:[" ",(0,l.Z)("search.resetting",s)]}):(0,r.jsxs)("button",{className:"py-1 capitalize min-w-[120px] front-bold flex items-center underline font-bold",onClick:e=>void(t(),u()),children:[(0,r.jsx)(o.Z,{classes:"w-[14px] h-[14px] bg-black group-hover:bg-gray-dark mr-2 transition motion-safe:duration-200",fileName:"cross"}),h]})})}},79892:function(e,t,a){"use strict";a.d(t,{Z:function(){return CustomSearchBox}});var r=a(85893),i=a(67294),l=a(37386),o=a(66097),n=a(64852);function CustomSearchBox(e){let{query:t,refine:a,clear:s,isSearchStalled:c}=(0,l.l)(e),[d,u]=(0,i.useState)(t),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{e.resetNotification&&(s(),u(""))},[e.resetNotification]),(0,i.useEffect)(()=>{e.initialQuery&&(u(e.initialQuery),a(e.initialQuery))},[e.initialQuery]);let g=e.customPlaceholder?e.customPlaceholder:(0,o.Z)("search.".concat(e.section?e.section+"-":"","placeholder"),e.locale);return(0,r.jsxs)("form",{action:"",role:"search",noValidate:!0,onSubmit:t=>{if(t.preventDefault(),t.stopPropagation(),e.replaceUrl){let e=window.location.href.split("?")[0];window.location.href=e+"?query="+d}else a(d),h.current&&h.current.blur()},onReset:e=>
1{e.preventDefault(),e.stopPropagation(),u(""),h.current&&h.current.focus()},children:[(0,r.jsx)("label",{htmlFor:"search",className:"",children:(0,o.Z)("search.label",e.locale)}),(0,r.jsxs)("div",{className:"mt-6 block md:flex md:items-center w-full relative",children:[(0,r.jsx)("input",{type:"search",ref:h,className:"peer/search w-full h-12 py-1 px-4 text-base text-gray-700 placeholder-gray-600 border rounded-md focus:shadow-outline",autoCorrect:"off",autoCapitalize:"off",autoComplete:"off",spellCheck:"false",placeholder:g,maxLength:512,name:"search","aria-label":(0,o.Z)("layout.search_label",e.locale),id:"search",value:d,onChange:e=>{u(e.currentTarget.value)},required:!0,autoFocus:!0}),(0,r.jsx)("button",{type:"submit",title:(0,o.Z)("layout.search_label",e.locale),className:"absolute top-1 bottom-1 right-10 peer-placeholder-shown/search:right-4 group focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",children:(0,r.jsx)(n.Z,{classes:"w-[14px] h-[14px] bg-black group-hover:bg-gray-dark ml-2 transition motion-safe:duration-200",fileName:"arrowRight"})})]}),(0,r.jsx)("span",{hidden:!c,children:(0,o.Z)("search.searching",e.locale)})]})}},50723:function(e,t,a){"use strict";a.d(t,{Z:function(){return SharedPagination}});var r=a(85893),i=a(67294),l=a(3195),o=a(66097);function getWindowDimensions(){let{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}function SharedPagination(e){let{locale:t,isMainSearch:a=!1,resLength:n}=e,{height:s,width:c}=function(){let[e,t]=(0,i.useState)(getWindowDimensions());return(0,i.useEffect)(()=>{function handleResize(){t(getWindowDimensions())}return window.addEventListener("resize",handleResize),()=>window.removeEventListener("resize",handleResize)},[]),e}(),[d,u]=(0,i.useState)(3);(0,i.useEffect)(()=>{c<479?u(1):c<1439?u(2):u(3)},[c]);let h=a?"hidden":"hidden md:block",g=n&&n<=3?"hidden":"";return(0,r.jsx)(l.t,{padding:d,classNames:{root:"",list:"flex justify-center lg:justify-start",item:"mx-2 group whitespace-nowrap",selectedItem:"[&_a]:bg-black [&_a]:border-black [&_a]:hover:shadow-[0_3px_6px_0px_rgba(0,0,0,0.3)] text-white font-bold",firstPageItem:h,previousPageItem:g,pageItem:"",disabledItem:"",nextPageItem:g,lastPageItem:h,link:"py-1 px-2 sm:py-2 sm:px-4 border-[1px] text-sm sm:text-base font-bold rounded-sm hover:border-black py-2 px-4 "},translations:{firstPageItemText:(0,o.Z)("search-pagination.firstPageItemText",t),previousPageItemText:(0,o.Z)("search-pagination.previousPageItemText",t),nextPageItemText:(0,o.Z)("search-pagination.nextPageItemText",t),lastPageItemText:(0,o.Z)("search-pagination.lastPageItemText",t),pageItemText:e=>{let{currentPage:t,nbPages:a}=e;return"".concat(t)},firstPageItemAriaLabel:(0,o.Z)("search-pagination.firstPageItemAriaLabel",t),previousPageItemAriaLabel:(0,o.Z)("search-pagination.previousPageItemAriaLabel",t),nextPageItemAriaLabel:(0,o.Z)("search-pagination.nextPageItemAriaLabel",t),lastPageItemAriaLabel:(0,o.Z)("search-pagination.lastPageItemAriaLabel",t),pageItemAriaLabel:e=>{let{currentPage:a,nbPages:r}=e;return"".concat((0,o.Z)("search-pagination.gotoPage",t)," ").concat(a," ").concat((0,o.Z)("search-pagination.of",t)," ").concat(r)}}})}},24654:function(){}}]);
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.