PageSourceSearch

https://www.almanea.sa/version1791122132545/_next/static/chunks/pages/%5B...catId%5D-9b56e44650309b8b.js

js almanea.sa collected 2026-10-04 14:05:49 UTC 23,853 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5198],{9856:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[...catId]",function(){return r(23273)}])},12422:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return createAsyncLocalStorage}});let r=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");let FakeAsyncLocalStorage=class FakeAsyncLocalStorage{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}};let n=globalThis.AsyncLocalStorage;function createAsyncLocalStorage(){return n?new n:new FakeAsyncLocalStorage}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},88427:function(e,t,r){"use strict";function clientHookInServerComponentError(e){}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return clientHookInServerComponentError}}),r(10260),r(67294),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30636:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return ReadonlyURLSearchParams},useSearchParams:function(){return useSearchParams},usePathname:function(){return usePathname},ServerInsertedHTMLContext:function(){return s.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return s.useServerInsertedHTML},useRouter:function(){return useRouter},useParams:function(){return useParams},useSelectedLayoutSegments:function(){return useSelectedLayoutSegments},useSelectedLayoutSegment:function(){return useSelectedLayoutSegment},redirect:function(){return u.redirect},permanentRedirect:function(){return u.permanentRedirect},RedirectType:function(){return u.RedirectType},notFound:function(){return c.notFound}});let n=r(67294),o=r(89031),a=r(11593),l=r(88427),i=r(6160),s=r(30252),u=r(37866),c=r(49363),d=Symbol("internal for urlsearchparams readonly");function readonlyURLSearchParamsError(){return Error("ReadonlyURLSearchParams cannot be modified")}let ReadonlyURLSearchParams=class ReadonlyURLSearchParams{[Symbol.iterator](){return this[d][Symbol.iterator]()}append(){throw readonlyURLSearchParamsError()}delete(){throw readonlyURLSearchParamsError()}set(){throw readonlyURLSearchParamsError()}sort(){throw readonlyURLSearchParamsError()}constructor(e){this[d]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e),this.size=e.size}};function useSearchParams(){(0,l.clientHookInServerComponentError)("useSearchParams");let e=(0,n.useContext)(a.SearchParamsContext),t=(0,n.useMemo)(()=>e?new ReadonlyURLSearchParams(e):null,[e]);return t}function usePathname(){return(0,l.clientHookInServerComponentError)("usePathname"),(0,n.useContext)(a.PathnameContext)}function useRouter(){(0,l.clientHookInServerComponentError)("useRouter");let e=(0,n.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function useParams(){(0,l.clientHookInServerComponentError)("useParams");let e=(0,n.useContext)(o.GlobalLayoutRouterContext),t=(0,n.useContext)(a.PathParamsContext);return(0,n.useMemo)(()=>(null==e?void 0:e.tree)?function getSelectedParams(e,t){void 0===t&&(t={});let r=e[1];for(let e of Object.values(r)){let r=e[0],n=Array.isArray(r),o=n?r[1]:r;if(!o||o.startsWith("__PAGE__"))continue;let a=n&&("c"===r[2]||"oc"===r[2]);a?t[r[0]]=r[1].split("/"):n&&(t[r[0]]=r[1]),t=getSelectedParams(e,t)}return t}(e.tree):t,[null==e?void 0:e.tree,t])}function useSelectedLayoutSegments(e){void 0===e&&(e="children"),(0,l.clientHookInServerComponentError)("use
1SelectedLayoutSegments");let{tree:t}=(0,n.useContext)(o.LayoutRouterContext);return function getSelectedLayoutSegmentPath(e,t,r,n){let o;if(void 0===r&&(r=!0),void 0===n&&(n=[]),r)o=e[1][t];else{var a;let t=e[1];o=null!=(a=t.children)?a:Object.values(t)[0]}if(!o)return n;let l=o[0],s=(0,i.getSegmentValue)(l);return!s||s.startsWith("__PAGE__")?n:(n.push(s),getSelectedLayoutSegmentPath(o,t,!1,n))}(t,e)}function useSelectedLayoutSegment(e){void 0===e&&(e="children"),(0,l.clientHookInServerComponentError)("useSelectedLayoutSegment");let t=useSelectedLayoutSegments(e);return 0===t.length?null:t[0]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49363:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{notFound:function(){return notFound},isNotFoundError:function(){return isNotFoundError}});let r="NEXT_NOT_FOUND";function notFound(){let e=Error(r);throw e.digest=r,e}function isNotFoundError(e){return(null==e?void 0:e.digest)===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37866:function(e,t,r){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectType:function(){return n},getRedirectError:function(){return getRedirectError},redirect:function(){return redirect},permanentRedirect:function(){return permanentRedirect},isRedirectError:function(){return isRedirectError},getURLFromRedirectError:function(){return getURLFromRedirectError},getRedirectTypeFromError:function(){return getRedirectTypeFromError}});let a=r(23743),l="NEXT_REDIRECT";function getRedirectError(e,t,r){void 0===r&&(r=!1);let n=Error(l);n.digest=l+";"+t+";"+e+";"+r;let o=a.requestAsyncStorage.getStore();return o&&(n.mutableCookies=o.mutableCookies),n}function redirect(e,t){throw void 0===t&&(t="replace"),getRedirectError(e,t,!1)}function permanentRedirect(e,t){throw void 0===t&&(t="replace"),getRedirectError(e,t,!0)}function isRedirectError(e){if("string"!=typeof(null==e?void 0:e.digest))return!1;let[t,r,n,o]=e.digest.split(";",4);return t===l&&("replace"===r||"push"===r)&&"string"==typeof n&&("true"===o||"false"===o)}function getURLFromRedirectError(e){return isRedirectError(e)?e.digest.split(";",3)[2]:null}function getRedirectTypeFromError(e){if(!isRedirectError(e))throw Error("Not a redirect error");return e.digest.split(";",3)[1]}(o=n||(n={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23743:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return o}});let n=r(12422),o=(0,n.createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6160:function(e,t){"use strict";function getSegmentValue(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return getSegmentValue}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30252:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ServerInsertedHTMLContext:function(){return a}
1,useServerInsertedHTML:function(){return useServerInsertedHTML}});let n=r(77697),o=n._(r(67294)),a=o.default.createContext(null);function useServerInsertedHTML(e){let t=(0,o.useContext)(a);t&&t(e)}},23415:function(e,t,r){"use strict";var n=r(85893),o=r(41664),a=r.n(o),l=r(5434),i=r(67294),s=r(11163),u=r(15999),c=r(17908);t.Z=(0,i.memo)(function(){let e=(0,s.useRouter)(),{categoryData:t}=(0,i.useContext)(u.I),[r,o]=(0,i.useState)([]);return(0,i.useEffect)(()=>{var r,n;let a=null==e?void 0:null===(r=e.query)||void 0===r?void 0:r.catId,l=null==a?void 0:null===(n=a.map(e=>(0,c.HI)(null==t?void 0:t.children_data,"url_key",e)))||void 0===n?void 0:n.filter(e=>null==e?void 0:e.id);o(l)},[e.query,null==t?void 0:t.children_data]),(0,n.jsx)("div",{className:"w-[80%] max-[570px]:w-[98%] mx-auto mt-0 mb-5 min-h-6",children:(null==r?void 0:r.length)?(0,n.jsxs)("div",{className:"flex items-center p-2 bg-white rounded-md",children:[(0,n.jsx)(a(),{href:"/",className:"duration-200 hover:text-red",children:"en"===e.locale?"Home":"الرئيسية"}),(0,n.jsx)(l.AeI,{size:"20px",className:"mx-2 ".concat("en"===e.locale?"rotate-0":"rotate-180")}),r.map((t,o)=>{var i;let s=null==r?void 0:null===(i=r.slice(0,o+1).map(e=>null==e?void 0:e.url_key))||void 0===i?void 0:i.join("/");return(0,n.jsxs)("div",{className:"flex items-center justify-center",children:[(null==r?void 0:r.length)-1>o?(0,n.jsx)(a(),{href:"/".concat(s),className:"duration-200 hover:text-red",children:null==t?void 0:t.name}):(0,n.jsx)("h1",{className:"duration-200 text-red",children:null==t?void 0:t.name}),r.length-1>o&&(0,n.jsx)(l.AeI,{size:"20px",className:"mx-2 ".concat("en"===e.locale?"rotate-0":"rotate-180")})]},o)})]}):null})})},20873:function(e,t,r){"use strict";r.d(t,{Z:function(){return Description}});var n=r(85893),o=r(22315),a=r(67294),l=r(18234);function Description(e){let{desc:t=null}=e,[r,i]=(0,a.useState)(!1),s=parseTextFromHTML(t||""),{isClient:u}=(0,o.Z)();return u&&t&&(0,n.jsxs)("div",{className:" mx-auto my-5 bg-slate-50 p-3 rounded-lg *:transition-all *:ease-linear *:duration-500 ease-linear flex justify-between gap-4",children:[r?(0,n.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,l.I)(t)},className:"duration-1000"}):(0,n.jsx)("p",{className:"line-clamp-1",children:s}),(0,n.jsx)("svg",{onClick:()=>i(e=>!e),className:"w-5 h-5 shrink-0 transition duration-500 ".concat(r&&"-rotate-180"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]})}function parseTextFromHTML(e){return e.replace(/<[^>]*>/g,"").replace(/\&nbsp;/g," ")}parseTextFromHTML('<p class="my-2" style="text-align: center;"><span style="font-size: 16px;">اكتشف تشكيلة متنوعة من الجوالات والتابلت من المنيع التي تشمل أحدث الموديلات من&nbsp;<a href="https://www.almanea.sa/samsung-c-7558"><strong>سامسونج</strong></a>،&nbsp;هواوي،&nbsp;و<a href="https://www.almanea.sa/apple-c-7552"><strong>أبل</strong></a>.&nbsp;نقدم لك أحدث الابتكارات والتقنيات من هذه العلامات التجارية لتلبية جميع احتياجاتك الرقمية. من الأجهزة عالية الأداء إلى التقنيات المتقدمة، اختر من بين منتجاتنا لتجربة مميزة تجمع بين التصميم العصري والتكنولوجيا المتطورة. استعرض تشكيلتنا للحصول على أفضل الخيارات التي تناسب أسلوب حياتك وتفضيلاتك الشخصية.</span></p>')},70806:function(e,t,r){"use strict";var n=r(85893);t.Z=e=>{let{className:t}=e;return(0,n.jsx)("div",{className:"".concat(t," animate-pulse bg-gray-100 ")})}},74231:function(e,t,r){"use strict";var n=r(85893),o=r(67737),a=r(96663),l=r(41664),i=r.n(l);let BannerItem=e=>{let{src:t,href:r,alt:l,aspectRatio:s,width:u,height:c}=e;return(0,n.jsx)(i(),{href:r||"/#",className:"w-full aspect-[".concat(s,"] overflow-hidden relative rounded-xl"),children:(0,n.jsx)(o.Z,{priority:!0,src:(0,a.validateImgSrc)(t),width:u,height:c,alt:l,className:"object-fill w-full h-auto transition-transform duration-500 hover:scale-[1.01] relative "})})};t.Z=e=>{let{banners:t,img:r,name:l}=e;if((null==t?void 0:t.length)>0){let e="grid grid-cols-1 md:grid-cols-".concat(null==t?void 0:t.length," gap-4"),r="".concat(null==t?void 0:t.length,"/1"),o=1600/(null==t?void 0:t.length);return(0,n.jsx)("div",{className:"w-full my-5 mx-auto ".concat(e),children:null==t?void 0:t.map((e,t)=>(0,n.jsx)(BannerItem,{href:e.url,src:e.image_src,alt:l,aspectRatio:r,width:o,height:210},t))})}return r?(0,n.jsx)("div",{className:"relative w-full overflow-hidden aspect-[1440/350]",children:(0,n.jsx)(o.Z,{priority:!0,src:(0,a.validateImgSrc)(r),width:1440,height:350,qual
1ity:100,className:"object-contain w-full h-full relative"})}):null}},79256:function(e,t,r){"use strict";var n=r(85893),o=r(9008),a=r.n(o),l=r(11163),i=r(85499);let s={ar:{title:"المنيع | جولات، الكترونيات، أجهزة منزلية",description:"تسوق الإلكترونيات، الهواتف الذكية، الأجهزة المنزلية، المزيد من أكثر من 20 علامة تجارية عالمية في المملكة العربية السعودية. احصل على توصيل مجاني للطلبات التي تزيد عن 299 ريال سعودي."},en:{title:"Almanea | Smartphones, Electronics, Appliances, and More",description:" Shop electronics, smartphones, appliances, and more from more than 20 international brands in Saudi Arabia. Get free deliver on orders above 299 SAR."}},withProtocol=e=>e?/^https?:\/\//i.test(e)?e:"https://".concat(e):"",toAbsoluteImage=e=>e?/^https?:\/\//i.test(e)?e:e.startsWith("/")?"".concat(withProtocol("www.almanea.sa")).concat(e):e:"",withResize=e=>e?"".concat(e).concat(e.includes("?")?"&":"?","width=600"):"",u=["new","refurbished","used"],normalizeCondition=e=>{if(null==e||""===e)return"";let t=String(e).trim().toLowerCase();return u.includes(t)?t:["1","true","yes"].includes(t)?"new":["0","false","no","old"].includes(t)?"used":""};t.Z=e=>{var t,r;let{title:o,description:u,keywords:c,image:d,imageUrl:f,pathname:p,ogType:m="website",condition:v,brand:h,availability:g,priceAmount:y,priceCurrency:_,isPLP:x=!1,children:b}=e,{locale:j,asPath:S}=(0,l.useRouter)(),w=(p||S||"").split("?")[0].split("#")[0],P=x?o:o||(null===(t=s[j])||void 0===t?void 0:t.title),E=x?u:u||(null===(r=s[j])||void 0===r?void 0:r.description),R=f?toAbsoluteImage(f):d?"".concat("https://imgs.dev-almanea.com","/media/catalog/product").concat(d):"",L=withResize(R),C=(0,i.n)(w,j),N=normalizeCondition(v);return(0,n.jsxs)(a(),{children:[(0,n.jsx)("title",{children:P}),(0,n.jsx)("meta",{name:"title",content:P}),(0,n.jsx)("meta",{name:"description",content:E}),(0,n.jsx)("meta",{name:"keywords",content:c||""}),(0,n.jsx)("meta",{property:"og:type",content:m}),(0,n.jsx)("meta",{property:"og:url",content:C}),(0,n.jsx)("meta",{property:"og:title",content:P}),(0,n.jsx)("meta",{property:"og:description",content:E}),L&&(0,n.jsx)("meta",{property:"og:image",content:L}),h&&(0,n.jsx)("meta",{property:"product:brand",content:String(h)}),g&&(0,n.jsx)("meta",{property:"product:availability",content:String(g)}),N&&(0,n.jsx)("meta",{property:"product:condition",content:N}),y&&(0,n.jsx)("meta",{property:"product:price:amount",content:String(y)}),_&&(0,n.jsx)("meta",{property:"product:price:currency",content:String(_)}),(0,n.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,n.jsx)("meta",{name:"twitter:url",content:C}),(0,n.jsx)("meta",{name:"twitter:title",content:P}),(0,n.jsx)("meta",{name:"twitter:description",content:E}),L&&(0,n.jsx)("meta",{name:"twitter:image",content:L}),b]})}},41556:function(e,t,r){"use strict";r.d(t,{Y:function(){return n}});let n=["delivery_within_24_hours","option_text_delivery_within_24_hours","sku","_media_","attributes","back_orders","product_fees","eligible_for_tabby","eligible_for_tamara","option_text_brand","url_key","image","name","prices_with_tax","rewrite_url","short_description","description","seller_id","seller_logo","seller_name","_media_","fast_delivery","stock","label","custom_related_products","option_text_brand","_category_","_configurables","type_id","entity_id","suggest","preorder_note","not_for_sale","1101","1102","1103","1104","1105","1106","1107","1108","1109","1110","1111","1112","1113","1114","1115","1116","1117"].map(e=>"select=".concat(e)).join("&")},51718:function(e,t,r){"use strict";var n=r(11163),o=r(96663);t.Z=()=>{let e=(0,n.useRouter)(),{pathname:t,query:r}=e,a={...r};return{getFilterObj:a,setFilterQueryHandler:r=>{let n={...a,...r},l=(0,o.clearFalsyKeysFromObject)(n);e.push({pathname:t,query:l},void 0,{shallow:!0,scroll:!1})},resetFilterQueryHandler:()=>{e.push({pathname:t,query:{}},void 0,{shallow:!0,scroll:!1})}}}},23273:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return k},default:function(){return _catId_}});
1var n=r(85893),o=r(67294),a=r(15999),l=r(17908),i=r(85499),s=r(79256),u=r(23415),c=r(74231),d=r(11163),f=r(22315),p=r(39332),m=r(70806),head=e=>{var t,r;let{id:v,device:h,cat:g}=e,{categoryData:y}=(0,o.useContext)(a.I),_=(null==g?void 0:g.id)?g:(0,l.HI)(null==y?void 0:y.children_data,"id",v),{isClient:x}=(0,f.Z)(),{locale:b,asPath:j}=(0,d.useRouter)(),S=(0,p.usePathname)(),w=(null===(t=S.split("/"))||void 0===t?void 0:t.length)===2,P=j.split("?")[0].split("#")[0],E=(0,i.n)(P,b);return(0,n.jsxs)("div",{className:"",children:[(0,n.jsxs)("div",{className:"w-[80%] max-[570px]:w-[98%] mx-auto mt-6",children:[(0,n.jsx)(s.Z,{title:(null==_?void 0:_.meta_title)||(null==_?void 0:_.name),description:(null==_?void 0:_.meta_description)||"",imageUrl:"https://imgs.dev-almanea.com/media/wysiwyg/logo/logo.png",pathname:P,isPLP:!0,children:(0,n.jsx)("link",{rel:"canonical",href:E})}),!x&&w?(0,n.jsx)(m.Z,{className:" aspect-[1440/350] rounded-lg"}):(0,n.jsx)(c.Z,{banners:(null==_?void 0:null===(r=_.banners)||void 0===r?void 0:r[h])||[],img:null==_?void 0:_.category_desktop_image1,name:null==_?void 0:_.name})]}),(0,n.jsx)(u.Z,{})]})},v=r(5233),h=r(57330),g=o.memo(e=>{let{products:t,t:r}=e;return(0,n.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:null==t?void 0:t.map(e=>{let{_source:t}=e;return(0,n.jsx)(h.default,{product:t,t:r},t.sku)})})}),y=r(41556),_=r(57259);let getCategoryProducts=async e=>{let{handshake:t,categoryId:r,regionId:n,pageSize:o=32,pageNo:a=0,query:l={},filterCodes:i=[]}=e,{price:s,sort:u,fast_delivery:c,...d}=l,[f,p]=(null==s?void 0:s.split(","))||[null,null],[m="position",v="ASC"]=(null==u?void 0:u.split("-"))||[],h=i.reduce((e,t)=>(d[t]&&(e[t]=d[t].split(",")),e),{}),g=n&&"NaN"!=n&&"undefined"!=n?n:"1101",x={method:"get",url:"/facets/categoryV2/".concat(r,"?").concat(y.Y),...t?{headers:{Authorization:"Bearer ".concat(t)}}:{},params:{pageNo:a,pageSize:o,sortBy:m,sortDir:v,minPrice:f,maxPrice:p,...h,fast_delivery:!!c||null,regionId:g,select:g}};try{let e=await (0,_.Z)(x);return e.data}catch(e){throw Error("Failed to fetch category products: ".concat(e.message))}};var x=r(75362),b=r(51718),j=r(47041),S=r(5152),w=r.n(S);let P=w()(()=>r.e(4822).then(r.bind(r,84822)),{loadableGenerated:{webpack:()=>[84822]}}),E=w()(()=>r.e(6845).then(r.bind(r,56845)),{loadableGenerated:{webpack:()=>[56845]}}),R=w()(()=>r.e(693).then(r.bind(r,40693)),{loadableGenerated:{webpack:()=>[40693]}});var products_wrapper=function(e){let{serSideProducts:t,serverSideTotalProduct:r,categoryId:a,filters:l,serverSidePages:i,device:s}=e,{t:u}=(0,v.$G)("category"),c=(0,j.getCookie)("region_id"),{query:f,locale:p}=(0,d.useRouter)(),m=Number(null==f?void 0:f.p)||1,{setFilterQueryHandler:h}=(0,b.Z)(),y=(0,o.useMemo)(()=>l.map(e=>e.code),[l]),[_,S]=(0,o.useState)([...t]),[w,L]=(0,o.useState)(r),[C,N]=(0,o.useState)(i),{trigger:I}=(0,x.Z)(()=>[a,32,m-1,f,y,p,c],async()=>await getCategoryProducts({handshake:void 0,categoryId:a,pageSize:32,regionId:c,pageNo:m-1,query:f,filterCodes:y}),{revalidateOnMount:!1,revalidateOnFocus:!1,onError:e=>{console.error("Error fetching data:",e)},onSuccess:e=>{S(e.products),L(e.totalProduct),N(e.pages+1)}});return(0,o.useEffect)(()=>{I()},[p,c]),(0,o.useEffect)(()=>{I()},[f]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"max-[768px]:hidden flex justify-between items-center border rounded-md p-3",children:[(0,n.jsx)(R,{t:u}),(0,n.jsx)(E,{t:u,currentPage:m,total:w})]}),(0,n.jsx)(g,{products:_,t:u}),(0,n.jsx)(P,{currentPage:m,pageCount:C,onPageChange:e=>h({p:e}),t:u,device:s})]})},L=r(20873);let flattenCategories=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],traverse=e=>{for(let r of e)t.push(r),Array.isArray(null==r?void 0:r.children_data)&&traverse(null==r?void 0:r.children_data)};return traverse(e),t},useExcludeFilters=e=>{let{filters:t=[],categoryId:r}=e,{categoryData:n}=(0,o.useContext)(a.I);return(0,o.useMemo)(()=>{var e,o,a;if(!(null==t?void 0:t.length)||!(null==n?void 0:n.children_data)||!r)return[];let l=flattenCategories(null==n?void 0:n.children_data),i=null==l?void 0:l.find(e=>String(null==e?void 0:e.id)===String(r)),s=(null==i?void 0:null===(a=i.exclude_product_attribute)||void 0===a?void 0:null===(o=a.split(","))||void 0===o?void 0:null===(e=o.map(e=>null==e?void 0:e.trim()))||void 0===e?void 0:e.filter(Boolean))||[];return null==t?void 0:t.filter(e=>!(null==s?void 0:s.includes(null==e?void 0:e.code)))},[t,null==n?void 0:n.children_data,r])},C=w()(()=>Promise.all([r.e(3903),r.e(7531)]).then(r.bind(r,54290)),{loadableGenerated:{webpack:()=>[54290]},ssr:!1}),N=w()(()=>Promise.all([r.e(6556),r.e(6893),r.e(3903),r.e(1688)]).then(r.bind(r,99146)),{loadableGenerated:{webpack:()=>[99146]},ssr:!1});var wrapper=e=>{let{data:t,categoryId:r,device:i}=e,{products:s,filters:u,totalProduct:c,pages:d}=t,f=useExcludeFilters({filters:u,categoryId:r}),{categoryData:p}=(0,o.useContext)(a.I),m=(0,l.HI)(null==p?void 0:p.children_data,"id",r);return(0,n.jsxs)("div",{className:"w-[80%] max-[570px]:w-[98%] mx-auto mt-5 relative grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[(0,n.jsx)("div",{className:"max-[768px]:hidden",children:(0,n.jsx)(C,{filters:f})}),(0,n.jsx)("div",{className:"hidden max-[768px]:block col-span-2",children:(0,n.jsx)(N,{filters:f})}),(0,n.jsx)("div",{className:"flex flex-col col-span-2 gap-4 md:col-span-3",children:(0,n.jsx)(products_wrapper,{serSideProducts:s,serverSideTotalProduct:c,categoryId:r,filters:f,serverSidePages:d,device:i})}),(null==m?void 0:m.category_text_description)&&(0,n.jsx)("div",{className:"col-span-2 md:col-span-4",children:(0,n.jsx)(L.Z,{desc:null==m?void 0:m.category_text_description})})]})},I=r(82642),k=!0,_catId_=e=>
1{let{data:t,id:r,device:i,cat:s}=e,{categoryData:u}=(0,o.useContext)(a.I),c=(null==s?void 0:s.id)?s:(0,l.HI)(null==u?void 0:u.children_data,"id",r);return(0,o.useEffect)(()=>{(0,I.zw)((null==c?void 0:c.name)||null,r,(null==t?void 0:t.totalProduct)||null,(null==c?void 0:c.category_icon)||null)},[r]),(0,n.jsxs)("div",{children:[(0,n.jsx)(head,{id:r,device:i,cat:c}),(0,n.jsx)(wrapper,{device:i,data:t,categoryId:r})]})}},39332:function(e,t,r){e.exports=r(30636)}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=9856)}),_N_E=e.O()}]);
2//# sourceMappingURL=[...catId]-9b56e44650309b8b.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.