1try{let t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new t.Error).stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="0d3686d1-f161-411d-bcfb-c45310856264",t._sentryDebugIdIdentifier="sentry-dbid-0d3686d1-f161-411d-bcfb-c45310856264")}catch(Et){}import{j as t,r as s}from"./CSvdPb0x.js";import{y as e,E as r,aM as i,b9 as o,ba as n,m as a,ar as c,bb as p,bc as l,ac as m,bd as d,be as j,B as u,M as f,w as g,C as x,bf as b,K as h,bg as y,a0 as w,bh as v,Y as N,bi as C,bj as S,a3 as k,a5 as I,bk as R,bl as P,b4 as F,bm as D,bn as T,a6 as _,bo as A,aa as E,al as M,Q,P as O,j as V,bp as z,W as B}from"./B97aNPiN.js";import{M as U}from"./d_-4U5x5.js";import{i as $}from"./DCHY8sqf.js";import{R as W}from"./CY8cQ993.js";import{T as q}from"./Cg-7Socg.js";import{S as L,w as G,M as H}from"./BI8q97kc.js";import{a as K,b as Y}from"./BfH2VZ3C.js";import{S as X}from"./DfVMJpPI.js";import{S as Z,w as J}from"./5e445giP.js";import{S as tt}from"./RttuD3zJ.js";import{r as st}from"./bEk3WlYt.js";import{c as et,b as rt}from"./BQBf8qiH.js";import{M as it}from"./CBHfe312.js";import{M as ot}from"./C8dDjXkp.js";import{I as nt}from"./xWQkj5fJ.js";import{w as at}from"./DLQ7iBWV.js";import{w as ct}from"./DJTRbDeS.js";import{E as pt}from"./DKQcAySO.js";import{o as lt}from"./B1ZiUPWr.js";import{s as mt}from"./c8krnEz6.js";import{A as dt}from"./CZMl08nH.js";import"./D6ESIijv.js";import"./D3KWheBM.js";import"./DESFCnyf.js";import"./BR9VQVrr.js";import"./D5svBDoD.js";import"./Cf_NF55G.js";import"./B8CUchad.js";import"./BQF-onrJ.js";import"./BYR1In7Y.js";import"./DEiN8Bkx.js";import"./Bt2yE8kX.js";import"./D2GXW8lJ.js";import"./DT52DgjP.js";import"./Cg1OXW4j.js";import"./Bz-7_Q-0.js";import"./BaL-ZCxl.js";import"./BQSyaNcd.js";import"./CAyTAnN2.js";import"./CNaVHDLY.js";import"./BWjW2jqs.js";import"./CXtzmVxC.js";import"./DUwRiPDS.js";import"./BF3UiNMX.js";import"./Da4skhiT.js";import"./CXWp9cdr.js";import"./CPA8Uqeh.js";import"./CeJddcXJ.js";import"./BIXfgLkj.js";import"./DLVCmabe.js";import"./ff6i4Wve.js";import"./C43MIjsr.js";import"./Df5RJ5JE.js";import"./C-vGpTGl.js";import"./BmmbonwE.js";import"./CQKAqX2C.js";import"./CQVm9aBs.js";import"./CBTsH07P.js";import"./DvnBTJ75.js";import"./Dzh1XIbH.js";import"./ATZPVOqD.js";import"./KUr_Y0dk.js";import"./D6kIWFie.js";import"./CvaRn6VU.js";import"./MlzqJSOK.js";import"./jUFefnff.js";import"./DEnCK5Jp.js";import"./d2xVIsy7.js";import"./DjEfLjA6.js";import"./Bg94ZyCx.js";import"./BPGio2Ff.js";import"./DVQ0qK3O.js";import"./DDRd_XHV.js";import"./Ds2PnQ6u.js";import"./B02epDWn.js";import"./Czst8sKF.js";import"./DHK1uDD3.js";import"./Cx00W7wh.js";import"./CJz1pDFE.js";import"./HPWBEMzx.js";import"./NSd1cqAZ.js";import"./B22b47Sn.js";import"./CmzOoEdT.js";import"./lzQCBy2t.js";import"./CIw8zNTk.js";import"./DdVSpNQB.js";import"./BoqE1S3b.js";import"./ByMIb03H.js";import"./flhUXwQP.js";import"./3utiQB6j.js";import"./ADlqMn6f.js";import"./KqG1GbuE.js";import"./AL7FHFGH.js";import"./BPcKcRJ_.js";import"./ZeVYdY8O.js";import"./uHiaOiuY.js";import"./CZCDi26P.js";import"./Dvumqfw0.js";import"./Bz5qA9hm.js";import"./Bnp5m8Mc.js";import"./CdwrBtpn.js";import"./BQIKJIwT.js";import"./Dp-QQYMQ.js";import"./B0wraNcL.js";const jt=({sort:s,search:m,sortOrder:d,onFilter:j})=>{const{isDesktop:u}=e(r),f=i(o,{key:s||n})?.label,g=u?{offset:[-100,0]}:{offset:[0,0]},x=a(o,({label:t})=>({label:t,value:t})),b=t=>j([{filter:l,newValue:t}]);return t.jsxs(L,{className:`flex ai-c ${u&&"jc-fe position-r"}`,children:[t.jsx("label",{className:"m-r-5 fz-13 regular",children:"Sort By:"}),t.jsx(c,{size:"large",value:f,disabled:!!m,className:"bg-transparent",onChange:t=>{const{key:s}=i(o,{label:t})||{};return j([{filter:p,newValue:s}])},dropdownAlign:g,styles:{popup:{root:{width:"240px"}}},options:x,popupRender:s=>t.jsxs(t.Fragment,{children:[t.jsx("div",{onMouseDown:t=>t.preventDefault(),className:"w-p-100 p-10",children:t.jsx(q,{onToggle:b,activeKey:d})}),s]})})]})},ut=m(d).attrs({className:"position-r"}).withConfig({componentId:"sc-1ew0oen-0"})(["overflow:",";height:",";"],({isActiveFindingHubAddon:t})=>!t&&"hidden",({isActiveFindingHubAddon:t})=>!t&&"calc(100vh - 66px)"),ft=m.div.attrs({className:"m-t-30"}).withConfig({componentId:"sc-1ew0oen-1"})(["","{margin:0;}"],K),gt=m.div.withConfig({componentId:"sc-1ew0oen-2"})(["height:100%;overflow:hidden;.import-btn{button{width:100%;}}"]),xt=m.div.withConfig({componentId:"sc-1ew0oen-3"})(["","{padding:0;.ant-skeleton-title{margin-top:0;}.ant-skeleton-paragraph{padding:0 20px;}}"],Y),bt=m.div.withConfig({componentId:"sc-1ew0oen-4"})(["max-width:516px;@media (max-width:1199px){max-width:unset;}"]),ht=m.div.attrs({className:"flex"}).withConfig({componentId:"sc-1ew0oen-5"})(["@media (max-width:1599px){flex-direction:column;.ant-btn{margin-left:0;}}"]),yt=G(({filters:s,onFilter:e,onResetFilters:r})=>t.jsxs(ht,{children:[t.jsx(W,{gutter:12,align:"middle",type:"flex",className:"m-b-15",children:a(j,({component:r,...i},o)=>t.jsx(r,{value:s[i.filter]||i?.defaultValue,onChange:e,...i},o))}),t.jsx("div",{className:"flex ai-fe m-b-25",children:t.jsx(u,{type:"text",className:"m-l-10",icon:t.jsx(f,{}),onClick:r,children:"Clear Filters"})})]})),wt=g(({filters:s={},onFilter:e=()=>{},onResetFilters:r})=>{const i=s[x],o=s[b],n=s[p],a=s[l];return t.jsxs(t.Fragment,{children:[t.jsx(yt,{filters:s,onFilter:e,onResetFilters:r}),t.jsx(Z,{category:i,onFilter:e}),t.jsx(tt,{category:i,onFilter:e}),t.jsxs(W,{type:"flex",align:"middle",justify:"space-between",children:[t.jsx(h,{xxl:10,xl:10,lg:0,sm:0,xs:0,children:t.jsx(X,{filter:b,search:o,onFilter:e})}),t.jsx(jt,{sort:n,search:o,sortOrder:a,filter:p,onFilter:e})]})]})}),vt=()=>t.jsx(xt,{children:t.jsx(it,{paragraph:3})}),Nt=({currency:s,...e})=>{const r=y(e,s);return t.jsx(et,{children:a(r,({icon:s,title:e},r)=>t.jsxs("div",{className:"br-4 p-10 flex gap-5 ai-c",children:[t.jsx("span",{className:"p-10 br-4 flex ai-c jc-c bg-secondary",children:s}),e]},r))})};Nt.propTypes={productScore:w.number,interactionRate:w.number,soldQty:w.string,reviewsQty:w.string,currency:w.string,price:w.number,profit:w.number};const Ct=({onProduct:s,...i})=>{const{isDesktop:o}=e(r);return t.jsxs(bt,{children:[t.jsx(Nt,{...i}),t.jsx(v,{}),t.jsx(ot,{productScore:i.productScore}),t.jsx("div",{className:"flex ai-c jc-c m-t-20",children:t.jsx(u,{size:"large",type:o?"link":"default",className:N({"w-p-100":!o}),onClick:s,children:"More Info"})})]})};Ct.propTypes={onProduct:w.func.isRequired,productScore:w.number,interactionRate:w.number,soldQty:w.string,reviewsQty:w.string,currency:w.string,price:w.number,profit:w.number};const St=({stats:s})=>t.jsx("div",{className:"flex jc-sb jc-sa gap-10",children:a(C,({icon:e,key:r,label:i},o)=>t.jsxs("div",{className:"flex column ai-c",children:[t.jsxs("h3",{className:"flex ai-c gap-5 c-warning",children:[t.jsx(e,{size:"20",width:"24",height:"24"}),t.jsxs("span",{className:"c-primary",children:["price"===r&&S(s[r],{currency:s.currency}),"interactionRate"===r&&`${s[r]}%`]})]}),t.jsx("p",{children:i})]},o))});St.propTypes={stats:w.shape({price:w.number,interactionRate:w.number,currency:w.string})};const kt=({id:e,title:r,categoryName:i,onProduct:o,mixpanelData:n})=>{const a=s.useRef(null);return t.jsx("h4",{ref:t=>
1{a?.current?.disconnect(),a.current=new IntersectionObserver(([{isIntersecting:t}])=>{t&&(I("View Product",n),R(i,e,P))}),t&&a.current.observe(t)},className:"pointer fz-15 m-b-15 ellipsis line-clamp ff-regular min-h-50",onClick:o,children:t.jsx(k,{title:r,children:r})})};kt.propTypes={title:w.string.isRequired,onProduct:w.func.isRequired,mixpanelData:w.object};const It={"Click Category":"Marketplace","Click Location":"trending_products_front_page"},Rt={import:{...It,"Click Name":"import_product"},open:{...It,"Click Name":"open_product"}},Pt=at(ct((Ft=s.memo(({id:s,idOnSite:e,index:r,title:i,allImages:o,imgUrl:n,sellingPlatform:a,createdAt:c,region:p,price:l,currency:m,categoryName:d,mixpanelData:j,...u})=>{const f={...u.analytics,price:l,soldQty:(u.soldQty||0).toLocaleString(),reviewsQty:(u.reviewsQty||0).toLocaleString(),interactionRate:st(u.adsStats?.interactionRate,2),productScore:st(u.productScore,2),currency:m},g=(t=>(t+1)%4==0?"bottomRight":"bottom")(r),{onImportClickEvent:x,onAnalyticsToggledEvent:b}=function(t,s){return{onImportClickEvent:()=>s("import"),onAnalyticsToggledEvent:()=>I("View Window",{...t,"Window Name":"trending_products_analytics"})}}(j,u.onSendEvent),h=()=>{window.open(`${_}${A}/${s}`,"_blank"),u.onSendEvent()};return s?t.jsxs(gt,{children:[t.jsx(rt,{createdAt:c,onProduct:h,onVisibleChange:b,images:o,imgUrl:n,placement:g,tooltipContent:t.jsx(Ct,{onProduct:h,...f})}
1),t.jsxs("div",{className:"p-15",children:[t.jsx(kt,{id:s,title:i,categoryName:d,onProduct:h,mixpanelData:j}),t.jsx(St,{stats:{price:l,interactionRate:st(u.adsStats?.interactionRate,2),currency:m}}),t.jsx(nt,{block:!0,className:"m-t-15 w-p-100",id:s,type:T,title:i,imgUrl:n||o?.[0],idOnSite:e,siteName:a,mixpanelData:j,onImportCb:x,parentCategoryId:d,region:p,uploadType:T,customRegion:D,isOls:!0,bysButtonEntryPoint:pt.TRENDING_PRODUCTS,bysButtonProductId:s})]})]}):t.jsx(vt,{})}),s=>{const{idOnSite:e,categoryName:r,index:i,sellingPlatform:o}=s,n={"Product Buy Id":e,"Product Category":r,"Product Index":i,Supplier:o,"Buy Site":o,"Filter Query":F(window.location.search,"?","")};return t.jsx(Ft,{mixpanelData:n,onSendEvent:(t="open")=>I("Click",{...Rt[t],...n}),...s})})));var Ft;const Dt=Array.from({length:20}),Tt={limit:20,sort_order:mt.DESC,sort_field:n},_t=g(e=>{const{products:r,isMore:i,handleGetProducts:o}=(({filters:t})=>{const[e,r]=s.useState(Dt),[i,o]=s.useState(!1),n=s.useRef(),a=lt(t,(t,s)=>s===x&&t===dt),c=s.useCallback(async(t=0)=>{n.current?.abort();const s=new AbortController;n.current=s,!t&&r(Dt);const{success:e,data:{results:i=[],totalResults:c}={}}=await E.getMarketplaceTrendingProductsList({...Tt,...a,offset:t},{signal:s.signal});s.signal.aborted||(e?(r(s=>t?[...s,...i]:i),o(c>t+i.length)):(!t&&r([]),o(!1)))},[t]);return s.useEffect(()=>(c(),()=>n.current?.abort()),[t]),{products:e,isMore:i,handleGetProducts:c}})(e);return r.length?t.jsxs(ft,{children:[t.jsx(W,{type:"flex",gutter:[30,50],children:a(r,(s,e)=>t.jsx(Pt,{needUpdate:i&&r.length-11===e&&!!s&&r.length,onUpdate:o,index:e,height:520,...s},e))}),i&&t.jsx(M,{size:"large",className:"w-p-100 flex jc-c m-t-20"})]}):t.jsx(H,{mainText:"We didn't find any results"})}),At=J(()=>{const s=e(Q,{addonType:B}),r=e(O);return V(z),t.jsxs(ut,{isActiveFindingHubAddon:s,children:[t.jsx(U,{pageName:z}),!r&&!s&&t.jsx($,{}),t.jsx(wt,{}),t.jsx(_t,{})]})});export{At as default};
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.