1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3258],{73258:(e,r,t)=>{t.r(r),t.d(r,{default:()=>q});var l=t(37876),s=t(14232),i=t(89099),o=t(48230),n=t.n(o),d=t(35831),p=t(32937),u=t(28439),a=t(42922),c=t(69327),m=t(58471),x=t(72658),h=t(37203),y=t(62848),g=t(42586),f=t(16966),j=t(26094),C=t(84088),b=t(39746),I=t(58792);let P=({optionList:e,filterType:r,productListHooks:t})=>{let{onSelectFilter:i}=t,{t:o}=(0,d.Bd)(),[n,p]=(0,s.useState)(e),[u,a]=(0,s.useState)(""),c=(r="")=>{let t=r.trim().replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");if(""===t)p(e);else{let r=RegExp(t,"ig");p((0,b.Ay)(e,e=>e.filter(e=>r.test(e.name))))}a(r)};return(0,s.useEffect)(()=>{if(""===u)p(e);else{let r=RegExp(u,"ig");p((0,b.Ay)(e,e=>e.filter(e=>r.test(e.name))))}},[e]),(0,l.jsxs)("div",{style:{minHeight:"260px"},children:[(0,l.jsx)("div",{style:{padding:"1rem 0rem"},children:(0,l.jsx)(g.Xv,{variant:"outlined",value:u,placeholder:o("arr324"),onChange:e=>c(e.target.value),InputProps:{endAdornment:u?(0,l.jsx)("div",{style:{cursor:"pointer"},title:"Clear",children:(0,l.jsx)(I.A,{style:{fontSize:20,marginTop:"5px",marginRight:"5px"},htmlColor:"#9f9f9f",onClick:()=>{c("")}})}):(0,l.jsx)("div",{style:{cursor:"pointer"},title:"Search",children:(0,l.jsx)(C.A,{style:{fontSize:25,marginTop:"5px"},htmlColor:"#666666"})})}})}),n.length>0?n.slice(0,5).map((e,t)=>(0,l.jsxs)(g.Xy,{className:e.check?"active":"",onClick:()=>i(e.id,r),children:[(0,l.jsx)("span",{children:e.name}),e.check&&(0,l.jsx)(j.A,{sx:{color:"#c66ee2"},fontSize:"small"})]},t)):(0,l.jsx)(g.ph,{children:o("arr204")})]})};var v=t(56820);let N=({productListHooks:e})=>{let{t:r}=(0,d.Bd)(),t=(0,i.useRouter)(),{brandId:o,mId:x,catgId:h,group:f,type:j,search:C,promoId:b,searchField:I,searchfield:P}=t.query,{categoryList:N}=e,A=(0,v.jm)(t.asPath),[q,k]=(0,s.useState)([]);return(0,s.useEffect)(()=>{let e=N?.current;if(!e?.length)return;let r=null!=h?Number(h):null,t=null!=f?Number(f):null,l=null!=j?Number(j):null,s=[];e.forEach(e=>{let i=e.prodCatgId;r===i||e.subCategories?.some(e=>e.prodCatgId===r&&e.prodGroupId===t)?s.push(i):e.subCategories?.some(e=>e.subCategories?.some(e=>e.prodCatgId===r&&e.prodGroupId===t&&e.prodTypeId===l))&&s.push(i)}),k(s)},[N?.current,h,f,j]),N?.current.map(r=>(0,l.jsxs)(p.A,{sx:{p:1,marginBottom:"10px"},children:[(0,l.jsxs)(p.A,{sx:{display:"flex",justifyContent:"space-between",fontWeight:"bold",borderBottom:"solid 1px #979797",paddingBottom:"15px",marginBottom:"8px",fontSize:"16px"},children:[(0,l.jsx)(n(),{href:e.buildLinkUrl(r.targetUrl?.asUrl??A,{catgId:r.prodCatgId,group:void 0,type:void 0})||(0,y.JB)({brandId:o,mId:x,catgId:r.prodCatgId,search:C,searchField:I,searchfield:P,promoId:e.promoId,prodType:e.filterProdType},A),title:r.content,children:`${r.content} ${r.totalCount&&r.totalCount>0?`(${r.totalCount})`:""}`}),(0,l.jsx)(a.A,{sx:{p:0,"> svg":{stroke:"black"}},onClick:()=>{var e;return e=r.prodCatgId,void k(q.includes(e)?q.filter(r=>r!==e):q.concat(e))},children:q.includes(r.prodCatgId)?(0,l.jsx)(c.A,{}):(0,l.jsx)(m.A,{})})]}),(0,l.jsx)(u.A,{in:q.includes(r.prodCatgId),timeout:"auto",unmountOnExit:!0,children:(0,l.jsx)(g._n,{children:r.subCategories?.map((r,t)=>(0,l.jsxs)(p.A,{sx:{my:"5px"},children:[(0,l.jsx)(n(),{href:e.buildLinkUrl(r.targetUrl?.asUrl??A,{catgId:r.prodCatgId,group:r.prodGroupId,type:void 0})||(0,y.JB)({brandId:o,mId:x,catgId:r.prodCatgId,group:r.prodGroupId,search:C,searchField:I,searchfield:P,promoId:e.promoId,prodType:e.filterProdType},A),style:{fontWeight:"bold",padding:"0.5rem 0rem"},className:r.prodCatgId===Number(h)&&r.prodGroupId===Number(f)?"active":"",title:r.content,children:r.content}),(0,l.jsx)(p.A,{sx:{m:"0.5rem 0 0.5rem 0"},children:r.subCategories?.map((r,t)=>(0,l.jsx)(n(),{href:e.buildLinkUrl(r.targetUrl?.asUrl??A,{catgId:r.prodCatgId,group:r.prodGroupId,type:r.prodTypeId})||(0,y.JB)({brandId:o,mId:x,catgId:r.prodCatgId,group:r.prodGroupId,type:r.prodTypeId,search:C,searchField:I,searchfield:P,promoId:e.promoId,prodType:e.filterProdType},A),style:{fontSize:13,padding:"0.5rem 0rem"},className:r.prodCatgId===Number(h)&&r.prodGroupId===Number(f)&&r.prodTypeId===Number(j)?"active":"",title:r.content,children:r.content},t))})]},t))})})]},r.prodCatgId))},A=({productListHooks:e})=>{let{t:r}=(0,d.Bd)(),{filterList:t,selectedFilters:o,isFiltersUpdated:n,minPrice:u,maxPrice:a,defaultMinPrice:y,defaultMaxPrice:j,setIsFiltersUpdated:C,updatedPriceFilter:b}
1=e,[I,v]=(0,s.useState)(o.current?o.current.map(e=>e.filterType):[]),N=(0,i.useRouter)();(0,s.useEffect)(()=>{T([N.query.lowerPrice?Number(N.query.lowerPrice):u||y,N.query.upperPrice?Number(N.query.upperPrice):a||j])},[N.query.lowerPrice]),(0,s.useEffect)(()=>{T([N.query.lowerPrice?Number(N.query.lowerPrice):u||y,N.query.upperPrice?Number(N.query.upperPrice):a||j])},[N.query.upperPrice]),(0,s.useEffect)(()=>{E(!1),T([N.query.lowerPrice?Number(N.query.lowerPrice):u||y,N.query.upperPrice?Number(N.query.upperPrice):a||j])},[u,a]);let A=!!N.query?.lowerPrice||!!N.query?.upperPrice,[q,k]=(0,s.useState)(A),[w,T]=(0,s.useState)([N.query.lowerPrice?Number(N.query.lowerPrice):u||y,N.query.upperPrice?Number(N.query.upperPrice):a||j]),[S,E]=(0,s.useState)(!1),B=(0,h.A)(e=>e.setShowPopupBlockType),U=(0,h.A)(e=>e.setShowFilterType);(0,s.useEffect)(()=>{n&&C(!1)},[n]);let G=()=>{E(!1),w[0]>=(u||y)&&w[1]<=(a||j)&&w[0]<=w[1]?b(w):w.every(e=>e>=(u||y)&&e<=(a||j))?(T([w[1],w[0]]),b([w[1],w[0]])):(w[0]<(u||y)||w[0]>(a||j)?w[1]>=(u||y)&&w[1]<=(a||j)?T([N.query.lowerPrice?Number(N.query.lowerPrice):u||y,w[1]]):T([N.query.lowerPrice?Number(N.query.lowerPrice):u||y,N.query.upperPrice?Number(N.query.upperPrice):a||j]):T([w[0],N.query.upperPrice?Number(N.query.upperPrice):a||j]),E(!0))};return(0,l.jsxs)(p.A,{sx:{padding:"8px"},children:[(0,l.jsx)(p.A,{sx:{p:"40px 0px 0.75rem",fontSize:16,fontWeight:"bold"},children:r("arr506").toUpperCase()}),t?.map((t,s)=>(0,l.jsxs)(p.A,{sx:{p:"1rem 0"},children:[(0,l.jsxs)(g.Wh,{onClick:()=>{var e;return e=t.filterType,void v(I.includes(e)?I.filter(r=>r!==e):[...I,e])},children:[!!t.filterType&&(0,l.jsx)("h3",{children:t.filterHeader}),I.includes(t.filterType)?(0,l.jsx)(c.A,{}):(0,l.jsx)(m.A,{})]}),I.includes(t.filterType)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(P,{optionList:t.filters,filterType:t.filterType,productListHooks:e}),t.filters?.length>5&&(0,l.jsx)(g.x0,{onClick:()=>{U(t.filterType),B(h.k.Filter)},title:r("arr48"),children:r("arr48")})]})]},s)),(0,l.jsxs)(p.A,{sx:{p:"1rem 0"},children:[(0,l.jsxs)(g.Wh,{onClick:()=>{k(!q)},children:[(0,l.jsx)("h3",{children:r("arr173")}),q?(0,l.jsx)(c.A,{}):(0,l.jsx)(m.A,{})]}),q&&(0,l.jsxs)(g.iU,{children:[(0,l.jsx)("div",{className:"slider",children:(0,l.jsx)(x.Ay,{color:"secondary",style:{width:"90%"},size:"small",value:w,onChange:(e,r)=>{T(r)},onChangeCommitted:()=>{G()},max:a,min:u})}),(0,l.jsxs)("div",{className:"filter-range",children:[(0,l.jsx)(g.aC,{type:"number",startAdornment:(0,l.jsx)("span",{children:"$"}),value:w[0],onChange:e=>{T([Number(e.target.value),w[1]])},onKeyDown:e=>{"Enter"===e.key&&G()}}),"-",(0,l.jsx)(g.aC,{type:"number",startAdornment:(0,l.jsx)("span",{children:"$"}),value:w[1],onChange:e=>{T([w[0],Number(e.target.value)])},onKeyDown:e=>{"Enter"===e.key&&G()}})]}),S&&(0,l.jsxs)("div",{className:"error-msg",children:["*Please enter a number between ",u," and ",a,"."]}),(0,l.jsx)("div",{className:"search-button",children:(0,l.jsx)(f.A,{theme:"purple",sx:{height:"30px",mt:"12px",textTransform:"lowercase"},onClick:()=>{G()},children:r("arr331").toLowerCase()})})]})]}),(0,l.jsx)(p.A,{sx:{textAlign:"center",mt:2},children:(0,l.jsx)(g.n3,{onClick:e.onClearFilter,disabled:!e.selectedFilters.current,children:r("arr330")})})]})},q=({productListHooks:e})=>{let{categoryList:r,filterList:t}=e,s=!!r.current&&r.current.length>0,i=!!t&&t.length>0;return(0,l.jsxs)(g.aH,{children:[s&&(0,l.jsx)(N,{productListHooks:e}),i&&(0,l.jsx)(A,{productListHooks:e})]})}}}]);
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.