PageSourceSearch

https://shopaz.com/_next/static/chunks/810-44bfc742b55645e9.js

js shopaz.com collected 2026-10-02 01:44:08 UTC 8,774 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[810],{17947:(e,t,n)=>{n.d(t,{A:()=>o});var l=n(95155),a=n(85203),r=n.n(a);n(12115);let u={h1:"text-[64px]",h2:"text-[32px]",h3:"text-2xl",h4:"text-xl",h5:"text-lg",h6:"text-base",p:"text-sm",span:"text-xs"},o=e=>{let{type:t="p",className:n,children:a,title:o,onClick:i,onKeyDown:c}=e,s=u[t],d=r()(s,n,"poppins");return(0,l.jsx)(t,{className:d,title:o,onClick:i,onKeyDown:c,children:a})}},57552:(e,t,n)=>{n.d(t,{NY:()=>b,F3:()=>P,Oh:()=>p,gF:()=>F,r6:()=>R,Gs:()=>q,fE:()=>T,uv:()=>x,Fo:()=>k,VQ:()=>D,_h:()=>y,d9:()=>m,aP:()=>g,Un:()=>_,c0:()=>Q,gg:()=>S});var l=n(91803),a=n(53921),r=n(58174),u=n(53455);async function o(e){var t;let n=await (0,a.rV)(r.bo,"catalog/products/".concat(e,"/rating"),{headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:"0"},params:{t:new Date().getTime()}});return null==n||null==(t=n.data)?void 0:t.data}let i=e=>(0,u.useQuery)({queryKey:["productRaitings",e],queryFn:()=>o(e),staleTime:0,gcTime:0,refetchOnWindowFocus:!1});var c=n(36358),s=n(99776),d=n(80549);async function v(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=await (0,l.Jt)(r.o1,"search/best-selling?page=1&pageSize=".concat(t),{next:{revalidate:null!=(e=r.U_.getBestSellingProducts)?e:0,tags:["best_selling_products"]}});return null==n?void 0:n.data}let g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,u.useQuery)({queryKey:["getBestSellingProducts",e],queryFn:()=>v(e),enabled:t})},h=e=>{let{basePath:t="search/intelligent",facets:n,queries:l,count:a,facetString:r,includeHideUnavailable:u=!0,extraParams:o}=e,i=[];if(r)i.push("facets=".concat(encodeURIComponent(r)));else if(null==n?void 0:n.length){let e=encodeURIComponent((0,c.wS)(n));i.push("facets=".concat(e))}let s=Array.isArray(l)?l:[];if(s.length){let e=s.filter(e=>e&&"string"==typeof e.key&&e.key.length>0&&void 0!==e.value&&null!==e.value),t=(0,c.qR)(e.map(e=>{var t;return{key:e.key,value:null!=(t=e.value)?t:""}}));t&&i.push(t)}i.push("hideUnavailableItems=".concat(u?"true":"false")),"number"==typeof a&&i.push("count=".concat(a)),o&&Object.entries(o).forEach(e=>{let[t,n]=e;null!=n&&0!==t.length&&i.push("".concat(t,"=").concat(encodeURIComponent(String(n))))});let d=i.filter(Boolean).join("&");return d?"".concat(t,"?").concat(d):t},f=e=>{var t;return(null!=(t=null==e?void 0:e.items)?t:[]).some(e=>{var t;return(null!=(t=null==e?void 0:e.sellers)?t:[]).some(e=>{var t,n;return Number(null!=(n=null==e||null==(t=e.commertialOffer)?void 0:t.AvailableQuantity)?n:0)>0})})};async function y(e,t,n,a,u,o){var i,c,s,d,v,g,y;let p=(null==o?void 0:o.includeUnavailable)===!0,m=h({facets:e,queries:t,count:a,includeHideUnavailable:!p}),w=await (0,l.Jt)(r.o1,m,{signal:u,headers:{"X-Locale":n},next:{revalidate:null!=(s=r.U_.intelligentSearch)?s:0,tags:["intelligent_search"]}}),_=null!=(d=null==w||null==(i=w.data)?void 0:i.products)?d:[],b=null!=(v=null==w||null==(c=w.data)?void 0:c.recordsFiltered)?v:0;return{...w,success:null!=(g=null==w?void 0:w.success)&&g,data:{...null!=(y=null==w?void 0:w.data)?y:{},products:p?_:_.filter(f),recordsFiltered:b}}}async function p(e,t){var n;return await (0,l.Jt)(r.o1,h({basePath:"search/banners",facetString:"category-1/".concat(t,"-").concat(e),includeHideUnavailable:!1,extraParams:{locale:t}}),{next:{revalidate:null!=(n=r.U_.getBanners)?n:0,tags:["banners"]}})}let m=(e,t,n)=>(0,u.useQuery)({queryKey:["banners",e,t],queryFn:()=>p(e,t),enabled:!!e&&n});async function w(e){var t;return e&&0!==e.length?await (0,l.Jt)(r.o1,"search/intelligent?query=sku.id:".concat(e.map(e=>e.skuId).filter(e=>"undefined"!==e&&""!==e&&null!==e).join(";")),{next:{revalidate:null!=(t=r.U_.intelligentSearchForGettingProductsById)?t:0,tags:["product_skus"]}}):[]}let _=e=>(0,u.useQuery)({queryKey:["getProductBySkuId",e],queryFn:()=>w(e),enabled:Array.isArray(e)&&e.length>0});async function b(e,t,n,a){var u;let o=[];if((null==e?void 0:e.length)>0){let t=encodeURIComponent((0,c.wS)(e));o.push("facets=".concat(t))}n&&o.push("query=".concat(encodeURIComponent(n)));let i=o.length>0?"search/intelligent-facets?".concat(o.join("&")):"search/intelligent-facets";return await (0,l.Jt)(r.o1,i,{signal:a,headers:{"X-Locale":(0,c.MH)(t)},next:{revalidate:null!=(u=r.U_.facetIntelligentSearch)?u:0,tags:["intelligent_search"]}})}let x=async function(e,t){var n;let a=await (0,l.Jt)(r.bo,"catalog/skus/".concat(e,"/context"),{headers:{"X-Locale":t},next:{revalidate:null!=(n=r.U_.getSkuDetails)?n:0,tags:["sku_details","sku_details_".concat(e)
1]}});return null==a?void 0:a.data},k=async function(e,t){var n;let a=await (0,l.Jt)(r.bo,"catalog/products/".concat(e,"/skus"),{headers:{"X-Locale":t}});return null!=(n=null==a?void 0:a.data)?n:[]};async function U(e,t){return await (0,a.xs)(r.bo,"catalog/products/".concat(e,"/reviews"),t)}let S=e=>{let t=(0,s.useQueryClient)();return(0,d.useMutation)({mutationFn:async t=>{var n;let l=await U(e,t);if((null==l||null==(n=l.data)?void 0:n.success)===!1)throw Error(l.data.error||"An unknown error occurred.");return l},onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:["getReviews"]}),t.invalidateQueries({queryKey:["productRaitings"]})])}})};function P(e,t,n){var l;let a=null!=(l=null==e?void 0:e.length)?l:0;return 0===a?0:a<n?a:null!=t?t:a}async function q(e,t,n,l){var u;let o=await (0,a.rV)(r.bo,"catalog/products/".concat(e,"/reviews?page=").concat(t,"&pageSize=").concat(n,"&orderBy=ReviewDateTime:").concat(l,"&status=true"),{headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:"0"},params:{t:new Date().getTime()}});return null==o||null==(u=o.data)?void 0:u.data}let C={data:[],range:{total:0,from:0,to:0}};function I(e){let t=new Set,n=[];for(let l of e){if(null==l||""===l)continue;let e=String(l);t.has(e)||(t.add(e),n.push(e))}return n}async function F(e,t,n,l){let a=I(e);return 0===a.length?C:1===a.length?q(a[0],t,n,l):function(e,t,n){let l=new Map,a=0;for(let t of e){var r,u,o,i,c,s;let e=null!=(u=null==t?void 0:t.data)?u:[];for(let n of(a+=null!=(o=null==t||null==(r=t.range)?void 0:r.total)?o:e.length,e)){let e=n.id||"".concat(null!=(i=n.reviewerName)?i:"","-").concat(null!=(c=n.reviewDateTime)?c:"","-").concat(null!=(s=n.text)?s:"");l.has(e)||l.set(e,n)}}let d=[...l.values()].sort((e,t)=>{var l,a;let r=new Date(null!=(l=e.reviewDateTime)?l:0).getTime(),u=new Date(null!=(a=t.reviewDateTime)?a:0).getTime();return"asc"===n?r-u:u-r});return{data:d.slice(0,t),range:{total:a,from:+!!d.length,to:Math.min(t,d.length)}}}(await Promise.all(a.map(e=>q(e,t,n,l).catch(()=>C))),n,l)}function Q(e,t){var n;let{data:l}=i(e),{data:a}=i(t||e),{data:r}=((e,t,n,l)=>{let a=I(e);return(0,u.useQuery)({queryKey:["getReviews",a,t,n,l],queryFn:()=>F(a,t,n,l),enabled:a.length>0,staleTime:0,gcTime:0})})([e,t],1,100,"desc");return function(e,t,n){var l;let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=null!=(l=null==e?void 0:e.length)?l:0,u=P(e,t,n);return 0!==r&&(r<n||null!=t&&r>=t)?{average:e.reduce((e,t)=>{var n;return e+(null!=(n=t.rating)?n:0)},0)/r,totalCount:u}:{average:a,totalCount:u}}(null==r?void 0:r.data,null==r||null==(n=r.range)?void 0:n.total,100,function(e,t){var n,l,a,r,u,o;let i=null!=(n=null==e?void 0:e.totalCount)?n:0,c=null!=(l=null==t?void 0:t.totalCount)?l:0;return i+c===0?null!=(r=null!=(a=null==e?void 0:e.average)?a:null==t?void 0:t.average)?r:0:((null!=(u=null==e?void 0:e.average)?u:0)*i+(null!=(o=null==t?void 0:t.average)?o:0)*c)/(i+c)}(l,a))}async function T(e){var t,n;let a=await (0,l.Jt)(r.bo,"catalog/products/".concat(e,"/similars"),{next:{revalidate:null!=(n=r.U_.getSimillarProductsByProductId)?n:0,tags:["similar_products","similar_products_".concat(e)]}}),u=null==a||null==(t=a.data)?void 0:t.filter(e=>{var t;return null==e||null==(t=e.items)?void 0:t.some(e=>e.sellers.some(e=>{var t;return(null==e||null==(t=e.commertialOffer)?void 0:t.AvailableQuantity)>0}))});return null!=u?u:[]}async function D(e){var t,n;let a=await (0,l.Jt)(r.bo,"catalog/products/".concat(e,"/suggestions"),{next:{revalidate:null!=(n=r.U_.getSuggestionsProductsByProductId)?n:0,tags:["suggestions_by_product","suggestions_by_product_".concat(e)]}}),u=null==a||null==(t=a.data)?void 0:t.filter(e=>{var t;return null==e||null==(t=e.items)?void 0:t.some(e=>e.sellers.some(e=>{var t;return(null==e||null==(t=e.commertialOffer)?void 0:t.AvailableQuantity)>0}))});return null!=u?u:[]}async function R(e){var t,n;let a=await (0,l.Jt)(r.bo,"catalog/products/".concat(e,"/specifications"),{next:{revalidate:null!=(t=r.U_.getProductDetailsByProductId)?t:0,tags:["product_specifications","product_specifications_".concat(e)]}});return null!=(n=null==a?void 0:a.data)?n:[]}}}]);

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.