PageSourceSearch

https://www.fashfed.com/_next/static/chunks/5897-3887bbce5f80cf43.js

js fashfed.com collected 2026-10-05 07:02:57 UTC 28,394 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5897],{35897:function(e,l,t){t.r(l),t.d(l,{default:function(){return z}});var i=t(57437),n=t(2265),a=t(54365),r=t(99376),o=t(54943),s=t(6481),d=t(34653),c=t(68661),u=t(28249);let v={SİYAH:"#000000",BEYAZ:"#ffffff",GRİ:"#d3d3d3",LACİVERT:"#120a8f",YEŞİL:"#3cb043",MAVİ:"#2a9df4",KREM:"#fffdd0",BEJ:"#f1e8d5",KAHVERENGİ:"#56221c",PEMBE:"#ff78cb",KIRMIZI:"#b90000",SARI:"#ffff00",TURUNCU:"#f38230",RENKLİ:"#f2d4e8",MOR:"#52307c",BORDO:"#90091d",HAKİ:"#82744c",TABA:"#d2b48c",GÜMÜŞ:"#c0c0c0",ALTIN:"#ffd700",ANTRASİT:"#293133",TURKUAZ:"#40e0d0",EKRU:"#f5f5dc",METALİK:"#a9a9a9",BRONZ:"#cd7f32"},p=e=>(null==e?void 0:e.trim().toUpperCase())||"",g=e=>{var l,t,n;let{facet:a,setIsFilterLoading:s,onSelect:c,pendingFilters:g,isSpecialPage:h}=e,m=(0,d.tv)(),f=(0,r.useSearchParams)(),x=(0,r.usePathname)(),{data:y}=(0,u.ot)("pznext-color-filter"),b=()=>{var e;h&&(null===(e=document.getElementById("list-wrapper"))||void 0===e||e.scrollIntoView({behavior:"smooth"}))},k=e=>{var l,t;let i=p(e);return null==y?void 0:null===(t=y.attributes)||void 0===t?void 0:null===(l=t.items)||void 0===l?void 0:l.find(e=>{var l;return p(null==e?void 0:null===(l=e.value)||void 0===l?void 0:l.value)===i})},w=e=>{var l,t,i,n,a;let r=k(e);if("image"===(null==r?void 0:null===(l=r.value)||void 0===l?void 0:l.color_type)){let e=null==r?void 0:null===(a=r.kwargs)||void 0===a?void 0:null===(n=a.value)||void 0===n?void 0:null===(i=n.color_image)||void 0===i?void 0:i.url;if(e)return{backgroundImage:"url(".concat(e,")"),backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:"transparent"}}return(null==r?void 0:null===(t=r.value)||void 0===t?void 0:t.hex_color)?{backgroundColor:r.value.hex_color}:{backgroundColor:v[p(e)]||"transparent"}},j=e=>{let{facet:l,choice:t}=e;null==s||s(!0);let i=new URLSearchParams(f.toString());i.delete("page");let n=i.getAll(l.search_key);n.includes(t.value)?n=n.filter(e=>e!==t.value):n.push(t.value),i.delete(l.search_key),n.forEach(e=>{i.append(l.search_key,e)}),m.push(x+"?"+i.toString(),{scroll:!h}),b()};return(null==a?void 0:a.data)?(0,i.jsx)(o.Accordion,{title:a.name,isCollapse:null==a?void 0:null===(t=a.data)||void 0===t?void 0:null===(l=t.choices)||void 0===l?void 0:l.some(e=>e.is_selected),dataTestId:"filter-".concat(a.name),icons:["minus","plus"],className:"border-b border-gray-600 hidden lg:flex px-0",children:(0,i.jsx)("div",{className:"grid grid-cols-5 gap-2 pt-4 items-start",children:[...(null===(n=a.data)||void 0===n?void 0:n.choices)||[]].sort((e,l)=>(l.quantity||0)-(e.quantity||0)).map((e,l)=>(0,i.jsx)("button",{onClick:()=>c?c({facet:a,choice:e}):j({facet:a,choice:e}),"data-color":e.value,className:"text-xs flex flex-col items-center justify-center",children:(()=>{let l=g?g.includes(String(e.value)):e.is_selected;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"w-5 h-5 rounded-full",style:{...w(e.value),boxShadow:l?"inset 0 0 0 1px #000, inset 0 0 0 4px #fff":"inset 0 0 0 1px #dcdcdc, inset 0 0 0 4px #fff"}},e.label),(0,i.jsx)("div",{className:"text-[10px] ".concat(l?"font-semibold":"font-normal"),children:e.label})]})})()},l+e.label))})},a.key):null},h={[s.L.category]:o.Checkbox,[s.L.multiselect]:o.Checkbox},m=["category_ids","integration_stil","in_stock","page","sorter"],f="integration_renk_tonu",x=["integration_cinsiyet",f,"price"],y=e=>{let{Component:l,facet:t,choices:a,handleSelect:r,pendingFilters:s={}}=e,{t:u}=(0,d.ql)(),[v,p]=(0,n.useState)(""),g=(0,n.useMemo)(()=>v?null==a?void 0:a.filter(e=>{var l,t;return null==e?void 0:null===(t=e.label)||void 0===t?void 0:null===(l=t.toLocaleLowerCase("tr"))||void 0===l?void 0:l.includes(null==v?void 0:v.toLocaleLowerCase("tr"))}):a,[a,v]);return(0,i.jsxs)(i.Fragment,{children:[!x.includes(t.key)&&(0,i.jsxs)("div",{className:"relative mx-6 lg:mx-0 my-3 lg:mb-4 lg:mt-0",children:[(0,i.jsx)(o.Input,{placeholder:u("category.filters.search_placeholder"),value:v,onChange:e=>{p(e.target.value)},className:"w-full pl-16"}),(0,i.jsx)(o.Icon,{name:"search",size:20,className:"absolute top-1/2 -translate-y-1/2 left-6"})]}
1),(0,i.jsx)("div",{className:(0,c.cn)(x.includes(t.key)?"max-h-[521px]":"max-h-[449px]","flex flex-col lg:gap-2 pb-4 lg:max-h-[242px] overflow-y-auto filter-custom-scrollbar pr-1.5"),children:null==g?void 0:g.map((e,n)=>(0,i.jsx)(l,{data:e,name:t.key,className:"cursor-pointer py-[16.5px] px-6 lg:px-0 border-b border-gray-500 lg:py-0 lg:border-none",onChange:l=>r({e:l,facet:t,choice:e}),value:e.value,checked:(s[t.search_key]||[]).includes(String(e.value)),"data-testid":"".concat(e.label.trim()),children:(0,i.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,i.jsx)("div",{children:e.label}),e.quantity&&(0,i.jsxs)("span",{className:"font-normal text-gray-900","data-testid":"filter-count-".concat(t.name.toLowerCase(),"-").concat(n),children:["(",e.quantity,")"]})]})},e.value))})]})},b=e=>{var l;let{t}=(0,d.ql)(),{facets:a,isMenuOpen:u,toggleMenu:v,setIsFilterLoading:p,totalCount:x,sellerOrder:b,isSpecialPage:k}=e,w=(0,r.useSearchParams)(),j=(0,r.usePathname)(),_=(0,d.tv)(),[N,S]=(0,n.useState)(null),[C,L]=(0,n.useState)({}),[E,A]=(0,n.useTransition)(),P=(0,n.useRef)(null);(0,n.useEffect)(()=>{var e;let l=P.current;if(!l)return;let t=null===(e=l.parentElement)||void 0===e?void 0:e.lastElementChild,i=0,n=()=>{if(i=0,!window.matchMedia("(min-width: 1024px)").matches){l.style.removeProperty("--filter-panel-height");return}let e=parseFloat(window.getComputedStyle(l).top)||0,n=Math.max(l.getBoundingClientRect().top,e),a=window.innerHeight-n,r=t&&t!==l?t.getBoundingClientRect().height:0;l.style.setProperty("--filter-panel-height","".concat(Math.round(r?Math.max(Math.min(a,r),320):a),"px"))},a=()=>{i||(i=window.requestAnimationFrame(n))},r=t&&"undefined"!=typeof ResizeObserver?new ResizeObserver(a):null;return r&&t&&r.observe(t),n(),window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a),()=>{i&&window.cancelAnimationFrame(i),null==r||r.disconnect(),window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[u,w]);let I=()=>{var e;k&&(null===(e=document.getElementById("list-wrapper"))||void 0===e||e.scrollIntoView({behavior:"smooth"}))};(0,n.useEffect)(()=>{let e=new URLSearchParams(w.toString()),l={};null==a||a.forEach(t=>{l[t.search_key]=e.getAll(t.search_key)}),L(l),p(!1)},[w,a]),(0,n.useEffect)(()=>{u||S(null)},[u]),(0,n.useEffect)(()=>{E||p(!1)},[E]);let R=null==a?void 0:a.filter(e=>{var l,t;return!(null==m?void 0:m.includes(e.key))&&(null==e?void 0:null===(t=e.data)||void 0===t?void 0:null===(l=t.choices)||void 0===l?void 0:l.some(e=>e.is_selected))}),M=(0,n.useMemo)(()=>(null==R?void 0:R.flatMap(e=>{var l,t,i;return null==e?void 0:null===(i=e.data)||void 0===i?void 0:null===(t=i.choices)||void 0===t?void 0:null===(l=t.filter(e=>e.is_selected))||void 0===l?void 0:l.map(l=>({facet:e,choice:l}))}))||[],[R]),z=(0,n.useMemo)(()=>{let e=new Set;return null==a||a.forEach(l=>{var t,i;if(null==m?void 0:m.includes(l.key))return;let n=C[l.search_key]||[];null==l||null===(i=l.data)||void 0===i||null===(t=i.choices)||void 0===t||t.forEach(t=>{n.includes(String(t.value))&&e.add("".concat(l.search_key,":").concat(t.value))})}),e.size},[a,C]),F=(e,l,t)=>{var i,n,r;let o=null==a?void 0:a.find(l=>l.key===e),s=(null==o?void 0:null===(r=o.data)||void 0===r?void 0:null===(n=r.choices)||void 0===n?void 0:null===(i=n.filter(e=>e.is_selected))||void 0===i?void 0:i.map(e=>e.label))||[];return(null==o?void 0:o.key)===l&&t&&(s=s.includes(t)?s.filter(e=>e!==t):[...s,t]),s.join(", ")||""},T=e=>{var l,t,i;let{facet:n,choice:a}=e,r=String(a.value);L(e=>{let l={...e};if("multiselect"===s.L[n.widget_type]){let e=l[n.search_key]||[];e.includes(r)?l[n.search_key]=e.filter(e=>e!==r):l[n.search_key]=[...e,r]}else l[n.search_key]=[r];return l}),null===(i=window.dataLayer)||void 0===i||i.push({event:"gaEvent",eventCategory:"Filter",eventAction:a.label||"",user_id:(null===(t=window)||void 0===t?void 0:null===(l=t.GLOBALS)||void 0===l?void 0:l.userId)||"",pageType:"ProductListing",brand_filtered:F("integration_marka",n.key,a.label),size_filtered:F("filterable_size",n.key,a.label),color_filtered:F("integration_renk_tonu",n.key,a.label),price_filtered:F("price",n.key,a.label),category_filtered:F("integration_alt_grup",n.key,a.label),gender_filtered:F("integration_cinsiyet",n.key,a.label)})},B=()=>{let e=new URLSearchParams(w.toString());
1return e.delete("page"),Object.entries(C).forEach(l=>{let[t,i]=l;"page"!==t&&(e.delete(t),i.forEach(l=>e.append(t,l)))}),e},U=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];p(!0),A(()=>{_.push(j+"?"+B().toString(),{scroll:!k})}),I(),e&&(S(null),v())},O=e=>{let{facet:l,value:t}=e;p(!0);let i=new URLSearchParams(w.toString());if(i.delete("page"),"multiselect"===s.L[l.widget_type]){let e=i.getAll(l.search_key).filter(e=>e!==t);i.delete(l.search_key),e.forEach(e=>i.append(l.search_key,e))}else i.delete(l.search_key);L(e=>({...e,[l.search_key]:(e[l.search_key]||[]).filter(e=>e!==t)})),_.push(j+"?"+i.toString(),{scroll:!k}),I()};return(0,i.jsxs)("div",{ref:P,className:(0,c.cn)("w-full lg:w-[256px] fixed left-0 top-0 bottom-0 bg-white z-[41] lg:z-30 transition-all ease-in duration-300 lg:self-start lg:flex lg:flex-col lg:text-sm lg:p-0",u?"flex flex-col opacity-100 overflow-auto scroll-lock-mobile lg:sticky lg:top-24 lg:[--filter-panel-height:calc(100vh-15rem)] lg:max-h-[var(--filter-panel-height)]":"opacity-0 invisible absolute -translate-x-full lg:hidden"),children:[(0,i.jsxs)("div",{className:"relative flex justify-center py-5 border-b border-gray-800 lg:hidden",children:[(0,i.jsx)("h3",{className:"text-lg text-center font-bold text-gray-1400",children:(null==N?void 0:N.key)?null==a?void 0:null===(l=a.find(e=>e.key===(null==N?void 0:N.key)))||void 0===l?void 0:l.name:t("category.filters.mobile_title")}),(0,i.jsx)(o.Icon,{name:"close",size:16,className:"absolute right-6 top-1/2 -translate-y-1/2",onClick:v})]}),!(null==N?void 0:N.key)&&(null==M?void 0:M.length)>0&&(0,i.jsx)("div",{className:"flex flex-wrap gap-2 px-6 py-3 border-b border-gray-500 lg:hidden",children:null==M?void 0:M.map(e=>{let{facet:l,choice:t}=e;return(0,i.jsxs)("button",{type:"button",onClick:()=>O({facet:l,value:String(t.value)}),className:"h-8 px-2 border border-gray-700 rounded-sm text-sm text-gray-1400 flex items-center gap-2",children:[(0,i.jsx)("span",{children:t.label}),(0,i.jsx)(o.Icon,{name:"close",size:10})]},"".concat(l.key,"-").concat(t.value))})}),(0,i.jsx)("div",{className:"flex-1 lg:min-h-0 lg:overflow-y-auto filter-custom-scrollbar lg:pr-1.5",children:null==a?void 0:a.map((e,l)=>{var t,r,d,u;let v=null,x=(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.choices)?[...e.data.choices]:[];if("seller_ids"===e.key?x.sort((e,l)=>{var t,i;let n=null!==(t=null==b?void 0:b[e.label.toLocaleLowerCase()])&&void 0!==t?t:Number.MAX_SAFE_INTEGER,a=null!==(i=null==b?void 0:b[l.label.toLocaleLowerCase()])&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return n!==a?n-a:(l.quantity||0)-(e.quantity||0)}):"price"!==e.key&&"integration_beden"!==e.key&&x.sort((e,l)=>(l.quantity||0)-(e.quantity||0)),v=h[e.widget_type]||h[s.L.category],null==m?void 0:m.includes(e.key))return;let w=(null===(r=C[e.search_key])||void 0===r?void 0:r.length)||0;return(0,i.jsxs)(n.Fragment,{children:[!(null==N?void 0:N.key)&&(0,i.jsxs)("div",{onClick:()=>S(e),className:"flex items-center justify-between lg:hidden text-sm px-6 py-[20.5px] border-b border-gray-500",children:[(0,i.jsxs)("div",{className:"leading-[22px]",children:[e.name,w>0&&(0,i.jsxs)("span",{className:"text-secondary font-bold pl-1",children:["(",w,")"]})]}),(0,i.jsx)(o.Icon,{name:"chevron-end",size:12})]}),e.key===(null==N?void 0:N.key)&&(0,i.jsx)("div",{className:"lg:hidden",children:(0,i.jsx)(y,{Component:v,facet:e,choices:x,handleSelect:T,pendingFilters:C},e.key)}),e.key===f?(0,i.jsx)(g,{facet:e,setIsFilterLoading:p,isSpecialPage:k,onSelect:T,pendingFilters:C[e.search_key]||[]},l):(0,i.jsx)(o.Accordion,{title:e.name,isCollapse:null==e?void 0:null===(u=e.data)||void 0===u?void 0:null===(d=u.choices)||void 0===d?void 0:d.some(e=>e.is_selected),dataTestId:"filter-".concat(e.name),titleWrapperClassName:"pb-4",icons:["minus","plus"],className:(0,c.cn)("hidden lg:flex px-6 pb-0 lg:px-0 border-gray-500 last:mb-0",l===(null==a?void 0:a.length)-1&&"border-none"),children:(0,i.jsx)(y,{Component:v,facet:e,choices:x,handleSelect:T,pendingFilters:C})},e.key)]},e.key)})}),(null==R?void 0:R.length)>0&&(0,i.jsx)("div",{onClick:()=>{p(!0);let e=new URLSearchParams(w.toString());e.delete("page"),null==a||a.forEach(l=>e.delete(l.search_key));let l={};
1null==a||a.forEach(e=>{l[e.search_key]=[]}),L(l),_.push(j+"?"+e.toString(),{scroll:!k}),I(),S(null),v()},className:"cursor-pointer text-sm fixed bottom-[100px] left-1/2 -translate-x-1/2 underline text-secondary lg:hidden",children:t("category.filters.clear_all_mobile")}),(z>0||(null==R?void 0:R.length)>0)&&(0,i.jsx)("div",{className:"hidden lg:block shrink-0 bg-white pb-4 pr-1.5",children:(0,i.jsx)(o.Button,{onClick:()=>U(),appearance:"default",className:"w-full",disabled:E,"data-testid":"desktop-apply-filter",children:E?(0,i.jsx)(o.LoaderSpinner,{className:"w-5 h-5 border-current border-t-transparent"}):z>1?"".concat(z," ").concat(t("category.filters.apply_filter")):t("category.filters.apply_filter")})}),(0,i.jsx)("div",{className:"fixed w-full bottom-0 pt-3 pb-5 bg-white px-6 lg:hidden",children:(null==N?void 0:N.key)?(0,i.jsx)(o.Button,{onClick:()=>S(null),appearance:"default",className:"w-full lg:hidden",children:t("category.filters.apply_filter")}):(0,i.jsx)(o.Button,{onClick:()=>U(!0),appearance:"default",className:"w-full lg:hidden",children:t("category.filters.list_button")})})]})},k=()=>(0,i.jsxs)("svg",{width:"19",height:"14",viewBox:"0 0 19 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M0.5 2.02502H18.5",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round"}),(0,i.jsx)("path",{d:"M0.5 6.77283H18.5",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round"}),(0,i.jsx)("path",{d:"M0.5 11.5189H18.5",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round"}),(0,i.jsx)("circle",{cx:"4.7855",cy:"2.025",r:"1.525",fill:"white",stroke:"black"}),(0,i.jsx)("circle",{cx:"14.2743",cy:"6.77283",r:"1.525",fill:"white",stroke:"black"}),(0,i.jsx)("circle",{cx:"7.56284",cy:"11.5189",r:"1.525",fill:"white",stroke:"black"})]}),w=e=>{let{t:l}=(0,d.ql)(),[t,a]=n.useState(!1),{facets:u,totalCount:v,toggleMenu:p,sortOptions:g,setIsFilterLoading:h,isSpecialPage:f,isFilterOpen:x}=e,y=(0,d.tv)(),b=(0,r.useSearchParams)(),w=(0,r.usePathname)(),j=(0,n.useMemo)(()=>{let e=[];return null==u||u.map(l=>{var t,i;return!(null==m?void 0:m.includes(l.key))&&(null==l?void 0:null===(i=l.data)||void 0===i?void 0:null===(t=i.choices)||void 0===t?void 0:t.map(l=>{l.is_selected&&e.push(l)}))}),e.length},[u]),_=()=>{a(!t)},N=()=>{var e;f&&(null===(e=document.getElementById("list-wrapper"))||void 0===e||e.scrollIntoView({behavior:"smooth"}))},S=null==u?void 0:u.filter(e=>{var l,t;return!(null==m?void 0:m.includes(e.key))&&(null==e?void 0:null===(t=e.data)||void 0===t?void 0:null===(l=t.choices)||void 0===l?void 0:l.some(e=>e.is_selected))}),C=(0,n.useMemo)(()=>{var e;return(null==u?void 0:null===(e=u.filter(e=>!(null==m?void 0:m.includes(e.key))))||void 0===e?void 0:e.flatMap(e=>{var l,t,i;return null==e?void 0:null===(i=e.data)||void 0===i?void 0:null===(t=i.choices)||void 0===t?void 0:null===(l=t.filter(e=>e.is_selected))||void 0===l?void 0:l.map(l=>({facet:e,choice:l}))}))||[]},[u]),L=e=>{var l,t,i,n;let{key:a,value:r}=e,o=new URLSearchParams(b.toString());o.delete("page"),o.set(a,r);let s=null==g?void 0:null===(l=g.find(e=>e.value===r))||void 0===l?void 0:l.label;"sorter"===a&&(null===(n=window.dataLayer)||void 0===n||n.push({event:"gaEvent",eventCategory:"Sorting",eventAction:"Sorting",eventLabel:s,user_id:(null===(i=window)||void 0===i?void 0:null===(t=i.GLOBALS)||void 0===t?void 0:t.userId)||"",pageType:"ProductListing"})),y.push(w+"?"+o.toString(),{scroll:!f}),N()},E=e=>{let{facet:l,value:t}=e;h&&h(!0);let i=new URLSearchParams(b.toString());if(i.delete("page"),"multiselect"===s.L[l.widget_type]){let e=i.getAll(l.search_key).filter(e=>e!==t);i.delete(l.search_key),e.forEach(e=>{i.append(l.search_key,e)})}else i.delete(l.search_key);y.push(w+"?"+i.toString(),{scroll:!f}),N()};return(0,i.jsxs)("div",{className:"flex flex-col gap-4 mb-5 text-gray-950 text-sm",children:[(0,i.jsxs)("div",{className:"flex items-center justify-center lg:justify-between",children:[(0,i.jsxs)("div",{className:"hidden lg:flex items-center gap-2",children:[(0,i.jsx)("div",{className:"hidden lg:flex shrink-0 w-full md:w-[287px]",children:(0,i.jsxs)("button",{type:"button",onClick:p,"aria-expanded":x,"data-testid":"desktop-filter-toggle",className:"flex items-center gap-2 text-base font-semibold leading-[1.5] text-gray-1400",children:[(0,i.jsxs)("div",{className:"relative flex",children:[(0,i.jsx)(k,{}),(null==S?void 0:S.length)>0&&(0,i.jsx)("span",{className:"absolute bottom-0 right-0 translate-x-1/2 translate-y-1/2 text-[6px] font-bold text-white bg-secondary rounded-full w-2.5 h-2.5 flex items-center justify-center",children:j})]}),(0,i.jsx)("span",{children:l("category.filters.desktop_title")})]})}),x&&(0,i.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[null==C?void 0:C.map(e=>{let{facet:l,choice:t}=e;return(0,i.jsxs)("button",{type:"button",onClick:()=>E({facet:l,value:String(t.value)}),className:"h-9 px-3 border border-gray-700 rounded-sm text-sm text-gray-1400 flex items-center gap-2",children:[(0,i.jsx)("span",{children:t.label}),(0,i.jsx)(o.Icon,{name:"close",size:10})]},"".concat(l.key,"-").concat(t.value))}),(null==S?void 0:S.length)>0&&(0,i.jsx)("div",{onClick:()=>{var e,l,t;h(!0);let i=new URLSearchParams(b.toString());i.delete("page"),null==u||u.map(e=>{i.delete(e.search_key)}),null===(t=window.dataLayer)||void 0===t||t.push({event:"gaEvent",eventCategory:"Filter",eventAction:"Clear All",user_id:(null===(l=window)||void 0===l?void 0:null===(e=l.GLOBALS)||void 0===e?void 0:e.userId)||"",pageType:"ProductListing",brand_filtered:"",size_filtered:"",color_filtered:"",price_filtered:"",category_filtered:"",gender_filtered:""}),y.push(w+"?"+i.toString(),{scroll:!f}),N()},className:"cursor-pointer underline text-sm text-secondary",children:l("category.filters.clear_all")})]})]}
1),(0,i.jsxs)(o.Button,{className:(0,c.cn)("relative border border-gray-900 text-gray-1400 font-normal rounded-sm flex justify-between mr-3 px-4 bg-white w-40 lg:hidden",j>0&&"bg-gray border-[#724cce] font-semibold"),onClick:()=>p(),"data-testid":"list-filter",children:[j>0?"".concat(j," Filtre"):l("category.filters.mobile_title"),(0,i.jsx)(o.Icon,{name:"chevron-down",size:14})]}),(0,i.jsxs)(o.Button,{className:"relative border border-gray-900 text-gray-1400 font-normal rounded-sm flex justify-between px-4 bg-white w-40 lg:hidden",onClick:_,"data-testid":"list-sorter",children:[null==g?void 0:g.find(e=>{let{is_selected:l}=e;return l}).label,(0,i.jsx)(o.Icon,{name:"chevron-down",size:14})]}),(0,i.jsx)(o.Select,{options:(null==g?void 0:g.length)>0?g:[],value:null==g?void 0:g.find(e=>{let{is_selected:l}=e;return l}).value,"data-testid":"list-sorter",wrapperClassName:"hidden lg:flex",className:"text-base text-gray-1400 pl-4 pr-[35px]",onChange:e=>{h&&h(!0),L({key:"sorter",value:e.currentTarget.value})}})]}),0===v&&(0,i.jsxs)("div",{className:"h-40 flex items-center justify-center  flex-col bg-gray-200 p-4",children:[(0,i.jsx)("div",{className:"text-center",children:(0,i.jsx)("span",{className:"text-lg",children:l("category.search.not_found")})}),(0,i.jsx)("div",{className:"mt-3 text-center",children:(0,i.jsx)(o.Link,{href:"/",className:"underline text-lg",children:l("category.search.link")})})]}),(0,i.jsx)(o.Modal,{portalId:"category-sorters",open:t,setOpen:_,className:"w-full lg:hidden",showCloseButton:!1,type:"drawer",children:(0,i.jsxs)("div",{className:"px-6 pb-7",children:[(0,i.jsxs)("div",{className:"flex items-center justify-center mb-3",children:[(0,i.jsx)("div",{className:"font-bold text-base",children:l("category.filters.sorters")}),(0,i.jsx)("button",{type:"button",onClick:_,className:"ml-auto w-6 h-6 flex items-center justify-center",children:(0,i.jsx)(o.Icon,{name:"close",size:14,className:"!font-semibold"})})]}),(0,i.jsx)("div",{className:"flex flex-col w-full",children:null==g?void 0:g.map((e,l)=>(0,i.jsx)("div",{onClick:()=>{a(!1),h&&h(!0),L({key:"sorter",value:e.value})},className:(0,c.cn)("border-b border-gray-500 py-4 text-base text-center rounded leading-normal",e.label===(null==g?void 0:g.find(e=>{let{is_selected:l}=e;return l}).label)&&"bg-gray-500 font-bold mb-1 py-3"),children:e.label},l))})]})})]})};var j=t(14662),_=t(79224),N=t(22599),S=t(3278),C=t(34952);let L=e=>{let{data:l,setIsFilterLoading:t}=e,a=(0,r.usePathname)(),s=(0,r.useSearchParams)(),d=(0,n.useMemo)(()=>{let e=s.toString()?a+"?"+s.toString():a,t=null==e?void 0:e.replaceAll("/","");return(null==l?void 0:l.find(e=>{var l,i;return(null==e?void 0:null===(i=e.value)||void 0===i?void 0:null===(l=i.link_url)||void 0===l?void 0:l.replaceAll("/",""))===t}))||(null==l?void 0:l.find(e=>{var l,t;return(null==e?void 0:null===(t=e.value)||void 0===t?void 0:null===(l=t.link_url)||void 0===l?void 0:l.replaceAll("/",""))===(null==a?void 0:a.replaceAll("/",""))}))},[l,a,s]);return(0,i.jsx)("div",{className:"",children:(0,i.jsx)("div",{className:"w-full flex overflow-auto",children:null==l?void 0:l.map((e,l)=>{var n,a,r,s,u,v,p;return(0,i.jsx)(o.Link,{href:null!==(p=null==e?void 0:null===(n=e.value)||void 0===n?void 0:n.link_url)&&void 0!==p?p:"#",onClick:()=>t(!0),className:(0,c.cn)("py-2 px-3 text-sm font-medium text-center cursor-pointer text-gray-1100 whitespace-nowrap",(null==d?void 0:null===(r=d.value)||void 0===r?void 0:null===(a=r.link_url)||void 0===a?void 0:a.replaceAll("/",""))===(null==e?void 0:null===(u=e.value)||void 0===u?void 0:null===(s=u.link_url)||void 0===s?void 0:s.replaceAll("/",""))&&"text-black border border-gray-900 rounded-sm"),children:null==e?void 0:null===(v=e.value)||void 0===v?void 0:v.link_text},l)})})})},E=e=>!!e&&(e.startsWith("/")||e.startsWith("http"));function A(e){let{specialPage:l,className:t}=e,n=null==l?void 0:l.banner,a=null==l?void 0:l.banner_mobile;if(!n&&!a)return null;let r=(null==l?void 0:l.name)||"",o=E(null==l?void 0:l.banner_url)?l.banner_url:null,s=(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(N.Image,{src:n,alt:r,width:1350,height:150,unoptimized:!0,crop:"none",className:(0,
1c.cn)("w-full h-auto",a&&"hidden lg:block"),imageClassName:"w-full"}),a&&(0,i.jsx)(N.Image,{src:a,alt:r,width:375,height:90,unoptimized:!0,crop:"none",className:(0,c.cn)("w-full h-auto",n&&"lg:hidden"),imageClassName:"w-full"})]});return o?(0,i.jsx)(N.Link,{href:o,className:(0,c.cn)("block",t),children:s}):(0,i.jsx)("div",{className:t,children:s})}var P=t(33843),I=t(46473),R=t(60195),M=t(90110);function z(e){var l,t,s,u,v,p,g,h,m,f;let{data:x,breadcrumbData:y,sellerOrder:k,productRatings:E}=e,[z,F]=(0,n.useState)(!1),[T,B]=(0,n.useState)(!1),[U,O]=(0,n.useState)(null==x?void 0:x.products),[q,G]=(0,n.useState)(!1),[H,K]=(0,n.useState)((null==x?void 0:null===(l=x.products)||void 0===l?void 0:l.length)||0),[V,Z]=(0,n.useState)([]),{isFilterMenuOpen:W}=(0,_.C)(e=>e.header),Y=(0,r.useSearchParams)(),D=(0,d.tv)(),X=(0,_.T)(),{t:J}=(0,d.ql)(),Q=(0,n.useRef)(Number(null==x?void 0:null===(t=x.pagination)||void 0===t?void 0:t.current_page)||1),$=null==x?void 0:null===(u=x.category)||void 0===u?void 0:null===(s=u.attributes)||void 0===s?void 0:s.pznext_quick_categories,ee=Number(null!==(f=Y.get("page"))&&void 0!==f?f:1);(0,n.useEffect)(()=>{var e;(null==x?void 0:null===(e=x.facets)||void 0===e?void 0:e.some(e=>{var l,t;return null==e?void 0:null===(t=e.data)||void 0===t?void 0:null===(l=t.choices)||void 0===l?void 0:l.some(e=>e.is_selected)}))&&window.matchMedia("(min-width: 1024px)").matches&&X((0,C.GH)())},[]),(0,n.useEffect)(()=>{var e,l;O(null==x?void 0:x.products),K((null==x?void 0:null===(e=x.products)||void 0===e?void 0:e.length)||0),Q.current=Number(null==x?void 0:null===(l=x.pagination)||void 0===l?void 0:l.current_page)||1,B(!1)},[x]);let el=(0,n.useCallback)(async e=>{try{var l,t;let i=(null==x?void 0:null===(l=x.category)||void 0===l?void 0:l.absolute_url)||(null==x?void 0:null===(t=x.special_page)||void 0===t?void 0:t.url)||S.ROUTES.LIST,n=new URL((0,P.EF)(i,{contentType:"application/json",responseType:"json"}),window.location.origin);new URLSearchParams(window.location.search).forEach((e,l)=>{"page"!==l&&n.searchParams.append(l,e)}),G(!0),n.searchParams.append("page",e.toString());let a=await fetch(n);if(!a.ok)return;let r=await a.json();O(e=>[...e,...r.products]),K(e=>e+r.products.length)}catch(e){console.error("Failed to fetch products:",e)}finally{G(!1)}},[x]);return(0,n.useEffect)(()=>{var e;if(ee>1&&(null==x?void 0:null===(e=x.products)||void 0===e?void 0:e.length)===0){let e=new URL(window.location.href);e.searchParams.delete("page"),D.push(e.pathname+e.search,void 0)}},[Y,null==x?void 0:x.products,ee,D]),(0,n.useEffect)(()=>{if((null==V?void 0:V.length)>0){var e;(0,I._W)(V,(null==y?void 0:null===(e=y.map(e=>null==e?void 0:e.label))||void 0===e?void 0:e.join(" > "))||""),Z([])}},[V]),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"xl:container px-2 mx-auto sm:px-4 mb-5 lg:mt-4",children:[null!=$&&(0,i.jsx)("div",{className:"pl-4 mb-5 md:pl-0 md:mt-8 md:mb-6",children:(0,i.jsx)(L,{data:$,setIsFilterLoading:F})}),(0,i.jsx)(A,{specialPage:null==x?void 0:x.special_page,className:"self-stretch -mx-2 sm:-mx-4 lg:mx-0 mb-5"}),(0,i.jsx)(w,{facets:null==x?void 0:x.facets,totalCount:null==x?void 0:null===(v=x.pagination)||void 0===v?void 0:v.total_count,toggleMenu:()=>X((0,C.hg)()),sortOptions:null==x?void 0:x.sorters,setIsFilterLoading:F,isSpecialPage:!!(null==x?void 0:x.special_page),isFilterOpen:W}),(0,i.jsxs)("div",{className:(0,c.cn)("grid grid-cols-[295px_1fr] items-start",!W&&"lg:grid-cols-1"),children:[(0,i.jsx)(b,{facets:null==x?void 0:x.facets,isMenuOpen:W,toggleMenu:()=>X((0,C.hg)()),setIsFilterLoading:F,totalCount:null==x?void 0:null===(p=x.pagination)||void 0===p?void 0:p.total_count,sellerOrder:k,isSpecialPage:!!(null==x?void 0:x.special_page)}),(0,i.jsx)("div",{onClick:()=>X((0,C.zy)()),className:(0,a.Z)("transition-opacity duration-300 ease-linear lg:hidden",W?"fixed bg-black bg-opacity-60 inset-0 z-10 opacity-100":"opacity-0")}),(0,i.jsxs)("div",{className:"flex flex-col items-center lg:items-stretch col-span-2 lg:col-span-1",children:[(null==x?void 0:null===(g=x.products)||void 0===g?void 0:g.length)===0&&1===ee&&(0,i.jsxs)("div",{className:"text-center bg-gray-200 px-5 py-20",children:[(0,i.jsx)("p",{className:"pb-4",children:J("category.search.not_found")}),(0,i.jsx)(N.Link,{className:"underline",href:S.ROUTES.HOME,children:J("category.search.link")})]}),(null==x?void 0:null===(h=x.products)||void 0===h?void 0:h.length)===0&&ee>1&&(0,i.jsx)(N.LoaderSpinner,{}),(0,i.jsx)(M.l,{initialRatings:E,children:(0,i.jsx)(R.FavouritedIdsProvider,{children:(0,i.jsx)("div",{className:(0,a.Z)("grid gap-x-2 md:gap-x-[13px] gap-y-6 md:gap-y-[57px] grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"),children:null==U?void 0:U.map((e,l)=>(0,i.jsx)(j.ProductItem,{product:e,width:259,height:318,index:l,isAddToCartVisible:!0,className:z?"cursor-default pointer-events-none opacity-50":"",setViewProducts:Z,breadcrumbData:y},e.pk))})})}),q&&(0,i.jsx)(N.LoaderSpinner,{className:"mt-8"}),(0,i.jsx)("div",{className:"mx-auto mt-10 lg:mt-11",children:(null==U?void 0:U.length)>0&&(0,i.jsx)(o.Pagination,{total:null==x?void 0:x.pagination.total_count,limit:null==x?void 0:x.pagination.page_size,currentPage:null==x?void 0:null===(m=x.pagination)||void 0===m?void 0:m.current_page,
1numberOfPages:null==x?void 0:x.pagination.num_pages,productCount:H,onPageChange:()=>{var e;let l=Q.current+1;if(l>(null==x?void 0:null===(e=x.pagination)||void 0===e?void 0:e.num_pages)){B(!0);return}Q.current=l,el(l)},type:"list",moreButtonClassName:(0,c.cn)(q&&"pointer-events-none border-gray-600 opacity-75",T&&"hidden")})})]})]})]})})}}}]);
2//# sourceMappingURL=5897-3887bbce5f80cf43.js.map

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.