1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1539],{41539:function(l,e,t){"use strict";t.r(e);var n=t(85893),o=t(67294),i=t(95401),a=t(41664),s=t.n(a),d=t(25675),r=t.n(d),c=t(11163);e.default=(0,o.memo)(function(l){var e,t,a;let{products:d}=l,[v,m]=(0,o.useState)(""),[x,h]=(0,o.useState)(null==d?void 0:null===(e=d[0])||void 0===e?void 0:e.name),f=(0,c.useRouter)();(0,o.useEffect)(()=>{f.push("/search",void 0,{shallow:!0})},[]),(0,o.useEffect)(()=>{f.query.q&&"string"==typeof f.query.q&&m(f.query.q)},[f.query.q]);let p=u(d,v,x);return(0,n.jsx)("section",{className:"pt-20",children:(0,n.jsx)("div",{className:"container mx-auto px-4 bg-white",children:(0,n.jsxs)("div",{className:"flex flex-wrap -mx-3 mb-24",children:[!v&&(0,n.jsx)("div",{className:"block w-full sm:w-1/3 lg:w-1/4 px-3",children:(0,n.jsxs)("div",{className:"lg:mb-6 py-5 lg:py-10 px-6 lg:px-12 font-custom bg-gray-50",children:[(0,n.jsx)("h1",{className:"mb-8 text-2xl font-bold font-heading",children:"Category"}),d&&(0,n.jsx)("ul",{children:null==d?void 0:d.map((l,e)=>(0,n.jsx)("li",{className:"mb-4 ".concat(x===(null==l?void 0:l.name)?" font-bold text-webriq-darkblue":"hover:text-webriq-blue"),children:(0,n.jsx)("button",{className:"lg:text-lg",type:"button",onClick:()=>h(null==l?void 0:l.name),children:null==l?void 0:l.name})},e))})]})}),p&&(0,n.jsxs)("div",{className:"w-full ".concat(!v&&"lg:w-3/4"," px-3"),children:[v&&(0,n.jsx)("h1",{className:"text-4xl font-bold font-heading",children:"Showing ".concat(null==p?void 0:p.length,' results for "').concat(v,'"')}),(null==p?void 0:p.length)!==0?(0,n.jsx)("div",{className:"flex flex-wrap -mx-3",children:null==p?void 0:p.map((l,e)=>{var o,d,c,u,m,x,h,f,p,b,g;return(0,n.jsx)("div",{className:"w-full sm:w-1/2 ".concat(v?"md:w-1/4":"md:w-1/3"," px-3 mb-8"),children:(0,n.jsx)("div",{className:"p-6",children:(0,n.jsxs)(s(),{className:"block px-6 mt-6 mb-2 text-center",href:"/products/".concat(null==l?void 0:null===(o=l.slug)||void 0===o?void 0:o.current),children:[(null==l?void 0:null===(d=l.productInfo)||void 0===d?void 0:d.images)?(0,n.jsx)(r(),{className:"mb-5 mx-auto h-56 w-full object-contain hover:scale-110 transition-all duration-700",src:(0,i.uH)(null==l?void 0:null===(m=l.productInfo)||void 0===m?void 0:null===(u=m.images)||void 0===u?void 0:null===(c=u[0])||void 0===c?void 0:c.image),width:350,height:250,alt:null!==(t=null==l?void 0:null===(f=l.productInfo)||void 0===f?void 0:null===(h=f.images)||void 0===h?void 0:null===(x=h[0])||void 0===x?void 0:x.alt)&&void 0!==t?t:"product-image-".concat(e+1)}):(0,n.jsx)(r(),{className:"mb-5 mx-auto h-56 w-full object-contain hover:scale-110 transition-all duration-700",src:"https://cdn.sanity.io/images/9itgab5x/production/9523d40461371b7b4948456c57bb663bd8998c4a-500x362.png",width:350,height:250,alt:null!==(a=null==l?void 0:null===(g=l.productInfo)||void 0===g?void 0:null===(b=g.images)||void 0===b?void 0:null===(p=b[0])||void 0===p?void 0:p.alt)&&void 0!==a?a:"product-image-".concat(e+1)}),(null==l?void 0:l.name)&&(0,n.jsx)("h2",{className:"mb-2 text-xl font-heading",children:null==l?void 0:l.name}),(null==l?void 0:l.price)&&(0,n.jsxs)("p",{className:"text-lg font-bold font-heading text-webriq-darkblue",children:["$",null==l?void 0:l.price]})]})})},e)})}):(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)(r(),{className:"w-96 h-96 object-contain mx-auto",src:"https://cdn.sanity.io/images/9itgab5x/production/951b1f5f26048374711fa6800e0b542528240432-982x638.png",width:384,height:384,alt:"no-query-results"}),(0,n.jsx)("span",{className:"mb-6 text-4xl text-webriq-darkblue font-bold",children:"Whoops!"}),(0,n.jsx)("p",{className:"my-8 text-gray-700",children:'No results for query "'.concat(v,'". Kindly try another keyword.')})]})]})]})})})});let u=(l,e,t)=>{if(e){let t=l.flatMap(l=>l.products||[]).reduce((l,e)=>{let t=l.findIndex(l=>l.ecwidProductId===e.ecwidProductId);return -1===t&&l.push(e),l},[]).filter(l=>l.name.toLowerCase().includes(e.toLowerCase()));return t}{let e=l&&(null==l?void 0:l.filter(l=>(null==l?void 0:l.name)===t));return e[0].products}}},95401:function(l,e,t){"use strict";t.d(e,{YI:function(){return i.YI},t2:function(){return c},uH:function(){return r}});var n=t(6803),o=t.n(n),i=t(35300),a=t(70386),s=t(55536);let d=o()(s.v),r=l=>{var e;return(null==l?void 0:l.asset)&&(null===(e=d.image(l).format("webp"))||void 0===e?void 0:e.url())},c=l=>{var e;return(null==l?void 0:l.asset)&&(null===(e=d.image(l).format("jpg"))||void 0===e?void 0:e.url())};(0,a.R2)(s.v)},11163:function(l,e,t){l.exports=t(96885)}}]);
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.