1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5070],{2068:(e,o,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/shopee/intelligence-lab",function(){return r(60625)}])},60625:(e,o,r)=>{"use strict";r.r(o),r.d(o,{default:()=>T});var l=r(37876),n=r(14232),a=r(87263),t=r(31331),i=r(11054),s=r(61428),c=r(94515),d=r(27481),u=r(65965),h=r(68474),m=r(451),x=r(78423),p=r(84676),f=r(9858),g=r(1413),A=r(35078),b=r(13085),j=r(10638),v=r(97444),_=r(34293),y=r(46520),S=r(72528),k=r(45852),w=r(87326),C=r(51369),N=r(94559),B=r(22528),M=r(70825);let z=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}),E=new Intl.NumberFormat("pt-BR");function T(){var e,o,r,T,I;let[W,F]=(0,n.useState)(""),[P,R]=(0,n.useState)([]),[D,G]=(0,n.useState)([]),[L,q]=(0,n.useState)(null),[H,O]=(0,n.useState)(""),[U,K]=(0,n.useState)(""),[X,Y]=(0,n.useState)(null),[V,J]=(0,n.useState)(null),Q=async()=>{var e,o,r;O(""),q("sample");try{let[o,r]=await Promise.all([N.A.get("/api/shopee/intelligence-lab/capabilities"),N.A.get("/api/shopee/intelligence-lab/sample-eans",{params:{limit:20}})]);J(o.data),R((null==(e=r.data)?void 0:e.items)||[])}catch(e){O((null==(r=e.response)||null==(o=r.data)?void 0:o.error)||e.message||"Falha ao carregar amostra")}finally{q(null)}};(0,n.useEffect)(()=>{Q()},[]);let Z=e=>{G(o=>{let r=o.filter(o=>o.ean!==e.ean);return[e,...r]})},$=async e=>{let{data:o}=await N.A.post("/api/shopee/intelligence-lab/search-ean",{ean:e});return Z(o),o},ee=async()=>{var e,o,r;let l=String(W||"").replace(/\D/g,"");if(l.length<8)return void O("Informe um EAN/GTIN v\xe1lido (8â14 d\xedgitos).");O(""),K(""),q("one");try{let o=await $(l);"blocked_login_wall"===o.market_status?K(o.channel_hint||o.market_error||"Mercado bloqueado sem sess\xe3o Shopee."):(null==(e=o.offers)?void 0:e.length)&&K("".concat(o.offers.length," an\xfancio(s) para EAN ").concat(o.ean,"."))}catch(e){O((null==(r=e.response)||null==(o=r.data)?void 0:o.error)||e.message||"Falha na busca")}finally{q(null)}},eo=async()=>{O(""),K(""),q("batch");try{let{data:e}=await N.A.post("/api/shopee/intelligence-lab/search-eans",{eans:P.map(e=>e.ean),limit:15});G(e.results||[]),e.summary?K(e.summary):K("Consultados ".concat(e.count," EANs \xb7 bloqueados: ").concat(e.blocked_count||0,"."))}catch(r){var e,o;O((null==(o=r.response)||null==(e=o.data)?void 0:e.error)||r.message||"Falha no lote")}finally{q(null)}};return(0,l.jsxs)(B.A,{requiredPermission:"shopee.bi.view",children:[(0,l.jsx)(M.zY,{title:"Shopee \xb7 Lab por EAN",subtitle:"Potencial de mercado via EAN/GTIN â an\xfancios de todos os sellers, n\xe3o s\xf3 a nossa loja.",right:(0,l.jsx)(a.A,{direction:"row",spacing:1,alignItems:"center",children:(0,l.jsx)(k.A,{sx:{color:M.lm.muted}})})}),(0,l.jsxs)(t.A,{severity:"info",sx:{mb:2},children:["Na Shopee ",(0,l.jsx)("strong",{children:"n\xe3o h\xe1 cat\xe1logo"})," como no ML. A aposta \xe9 buscar o EAN na vitrine (`sold` â ritmo da UI, `historical_sold` = acumulado) e agregar pre\xe7os dos sellers. A Open API oficial ",(0,l.jsx)("strong",{children:"n\xe3o faz isso"})," â s\xf3 devolve dados da nossa loja."]}),(null==V||null==(o=V.ean_search)||null==(e=o.public_storefront)?void 0:e.server_status)?(0,l.jsxs)(t.A,{severity:"warning",sx:{mb:2},children:["Canal servidor hoje: ",V.ean_search.public_storefront.server_status,(null==(r=V.ean_search.public_storefront.next_channels)?void 0:r.length)?(0,l.jsxs)(l.Fragment,{children:[" ","Pr\xf3ximos canais: ",V.ean_search.public_storefront.next_channels.join(" \xb7 "),"."]}):null]}):null,H?(0,l.jsx)(t.A,{severity:"error",sx:{mb:2},onClose:()=>O(""),children:H}):null,U?(0,l.jsx)(t.A,{severity:"success",sx:{mb:2},onClose:()=>K(""),children:U}):null,(0,l.jsxs)(i.A,{sx:{...M.Cy,p:2,mb:2},children:[(0,l.jsx)(s.A,{variant:"subtitle2",fontWeight:700,sx:{mb:1},children:"Consultar EAN (item que vendemos ou ainda n\xe3o)"}),(0,l.jsxs)(a.A,{direction:{xs:"column",sm:"row"},spacing:1,alignItems:{sm:"center"},children:[(0,l.jsx)(c.A,{size:"small",placeholder:"EAN / GTIN",value:W,onChange:e=>F(e.target.value),sx:{...M.W_,width:{xs:"100%",sm:220}},inputProps:{inputMode:"numeric"}}),(0,l.jsx)(d.A,{variant:"contained",startIcon:"one"===L?(0,l.jsx)(u.A,{size:16,color:"inherit"}):(0,l.jsx)(w.A,{}),disabled:!!L,onClick:ee,sx:{textTransform:"none",boxShadow:"none"},children:"Buscar no mercado"}),(0,l.jsx)(d.A,{variant:"outlined",disabled:!!L||!P.length,onClick:eo,sx:{textTransform:"none"},children:"batch"===L?"Consultando amostraâ¦":"Amostrar ".concat(Math.min(15,P.length)," EANs que vendemos")})]}),P.length?(0,l.jsxs)(s.A,{variant:"caption",color:"text.secondary",display:"block",sx:{mt:1},children:["Amostra pronta: ",P.length," EANs do cadastro com listing Shopee (ex.:"," ",P.slice(0,3).map(e=>e.ean).join(", "),")."]}):(0,l.jsx)(s.A,{variant:"caption",color:"text.secondary",display:"block",sx:{mt:1},children:"sample"===L?"Carregando amostraâ¦":"Nenhum EAN com listing Shopee no cadastro."})]}),(0,l.jsx)(h.A,{component:i.A,sx:{...M.Cy,overflow:"auto"},children:(0,l.jsxs)(m.A,{size:"small",sx:M.e8,children:[(0,l.jsx)(x.A,{children:(0,l.jsxs)(p.A,{children:[(0,l.jsx)(f.A,{children:"EAN"}),(0,l.jsx)(f.A,{children:"Produto (SI / busca)"}),(0,l.jsx)(f.A,{children:"Status mercado"}),(0,l.jsx)(f.A,{align:"right",children:"An\xfancios"}),(0,l.jsx)(f.A,{align:"right",children:"Pre\xe7o m\xe9d."}),(0,l.jsx)(f.A,{align:"right",children:"Pre\xe7o minâm\xe1x"}),(0,l.jsx)(f.A,{align:"right",children:"Ritmo m\xe1x (/m\xeas*)"}),(0,l.jsx)(f.A,{align:"right",children:"Nossa sale"}),(0,l.jsx)(f.A,{width:100,children:"Sellers"})]})}),(0,l.jsxs)(g.A,{children:[D.length?null:(0,l.jsx)(p.A,{children:(0,l.jsx)(f.A,{colSpan:9,children:(0,l.jsx)(s.A,{variant:"body2",color:"text.secondary",children:"Busque um EAN ou rode a amostra. A coluna Sellers abre o box com nome/pre\xe7o/ritmo de cada an\xfancio."})})}),D.map(e=>{var o,r,n,a,t,i,c,u;let h="ok"===(u=e.market_status)?{label:"Mercado OK",color:"success"}:"blocked_login_wall"===u?{label:"Bloqueado (login)",color:"warning"}:"empty"===u?{label:"Sem an\xfancios",color:"default"}:"error"===u?{label:"Erro",color:"error"}:{label:u||"â",color:"default"},m=e.potential||{},x=(null==(o=e.our_product)?void 0:o.title)||(null==(n=e.offers)||null==(r=n[0])?void 0:r.name)||"â";return(0,l.jsxs)(p.A,{hover:!0,children:[(0,l.jsxs)(f.A,{children:[(0,l.jsx)(s.A,{variant:"body2",fontWeight:700,sx:{fontVariantNumeric:"tabular-nums"},children:e.ean}),e.search_url?(0,l.jsxs)(A.A,{href:e.search_url,target:"_blank",rel:"noopener noreferrer",variant:"caption",underline:"hover",children:["abrir busca ",(0,l.jsx)(C.A,{sx:{fontSize:11,verticalAlign:"middle"}})]}):null]}),(0,l.jsxs)(f.A,{children:[(0,l.jsx)(s.A,{variant:"body2",noWrap:!0,sx:{maxWidth:260},children:x}),(null==(a=e.our_product)?void 0:a.sku)?(0,l.jsxs)(s.A,{variant:"caption",color:"text.secondary",children:["SKU ",e.our_product.sku]}):(0,l.jsx)(s.A,{variant:"caption",color:"text.secondary",children:"Sem cadastro SI / ainda n\xe3o vendemos"})]}),(0,l.jsx)(f.A,{children:(0,l.jsx)(b.A,{size:"small",color:h.color,label:h.label,variant:"outlined"})}),(0,l.jsx)(f.A,{align:"right",children:null!=m.offers_count?E.format(m.offers_count):"â"}),(0,l.jsx)(f.A,{align:"right",children:null!=m.price_avg?z.format(m.price_avg):"â"}),(0,l.jsx)(f.A,{align:"right",children:null!=m.price_min&&null!=m.price_max?"".concat(z.format(m.price_min)," â ").concat(z.format(m.price_max)
1):"â"}),(0,l.jsx)(f.A,{align:"right",children:null!=m.sold_month_max?E.format(m.sold_month_max):"â"}),(0,l.jsx)(f.A,{align:"right",children:(null==(t=e.our_product)?void 0:t.our_sold_lifetime)!=null?E.format(e.our_product.our_sold_lifetime):"â"}),(0,l.jsx)(f.A,{children:(0,l.jsxs)(d.A,{size:"small",disabled:!(null==(i=e.offers)?void 0:i.length),onClick:()=>Y(e),sx:{textTransform:"none"},children:["ver (",(null==(c=e.offers)?void 0:c.length)||0,")"]})})]},e.ean)})]})]})}),(0,l.jsx)(s.A,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:"* Na UI Shopee, `sold` costuma ser o ritmo recente (tratamos como /m\xeas aproximado); `historical_sold` \xe9 acumulado. Sem cat\xe1logo, o potencial \xe9 o melhor ritmo entre os an\xfancios da busca por EAN + faixa de pre\xe7o."}),(0,l.jsxs)(j.A,{open:!!X,onClose:()=>Y(null),maxWidth:"md",fullWidth:!0,children:[(0,l.jsxs)(v.A,{children:["Sellers \xb7 EAN ",null==X?void 0:X.ean]}),(0,l.jsxs)(_.A,{dividers:!0,children:[(null==X||null==(T=X.offers)?void 0:T.length)?(0,l.jsxs)(m.A,{size:"small",children:[(0,l.jsx)(x.A,{children:(0,l.jsxs)(p.A,{children:[(0,l.jsx)(f.A,{children:"Seller / shop"}),(0,l.jsx)(f.A,{children:"An\xfancio"}),(0,l.jsx)(f.A,{align:"right",children:"Pre\xe7o"}),(0,l.jsx)(f.A,{align:"right",children:"Ritmo (sold)"}),(0,l.jsx)(f.A,{align:"right",children:"Hist\xf3rico"}),(0,l.jsx)(f.A,{width:48})]})}),(0,l.jsx)(g.A,{children:X.offers.map(e=>(0,l.jsxs)(p.A,{hover:!0,children:[(0,l.jsxs)(f.A,{children:[(0,l.jsx)(s.A,{variant:"body2",fontWeight:600,children:e.shop_name||e.shop_id||"â"}),(0,l.jsxs)(s.A,{variant:"caption",color:"text.secondary",children:["shop ",e.shop_id]})]}),(0,l.jsx)(f.A,{children:(0,l.jsx)(s.A,{variant:"body2",noWrap:!0,sx:{maxWidth:280},children:e.name||e.item_id})}),(0,l.jsx)(f.A,{align:"right",children:null!=e.price?z.format(e.price):"â"}),(0,l.jsx)(f.A,{align:"right",children:null!=e.sold_month?E.format(e.sold_month):"â"}),(0,l.jsx)(f.A,{align:"right",children:null!=e.historical_sold?E.format(e.historical_sold):"â"}),(0,l.jsx)(f.A,{children:e.permalink?(0,l.jsx)(A.A,{href:e.permalink,target:"_blank",rel:"noopener noreferrer",children:(0,l.jsx)(C.A,{sx:{fontSize:16}})}):null})]},"".concat(e.shop_id,"-").concat(e.item_id)))})]}):(0,l.jsx)(s.A,{variant:"body2",color:"text.secondary",children:"Sem an\xfancios neste resultado."}),(null==X||null==(I=X.potential)?void 0:I.price_avg)!=null?(0,l.jsxs)(y.A,{sx:{mt:2},children:[(0,l.jsx)(b.A,{size:"small",label:"Pre\xe7o m\xe9dio ".concat(z.format(X.potential.price_avg))})," ",(0,l.jsx)(b.A,{size:"small",label:"Ritmo m\xe1x ".concat(E.format(X.potential.sold_month_max||0))})]}):null]}),(0,l.jsx)(S.A,{children:(0,l.jsx)(d.A,{onClick:()=>Y(null),sx:{textTransform:"none"},children:"Fechar"})})]})]})}},70825:(e,o,r)=>{"use strict";r.d(o,{Cy:()=>s,WL:()=>d,W_:()=>c,e8:()=>u,hj:()=>x,lm:()=>t,qs:()=>m,zY:()=>i});var l=r(37876);r(14232);var n=r(46520),a=r(61428);let t={pageBg:"#f4f6fb",cardBorder:"#e7e9f0",fieldFill:"#f8fafc",fieldBorder:"#e2e8f0",headFill:"#f8fafc",headBorder:"#eef2f7",rowBorder:"#f1f5f9",primary:"#1976d2",primaryDark:"#1565c0",ink:"#0f172a",text:"#334155",textStrong:"#1e293b",muted:"#64748b",faint:"#94a3b8",outline:"#cbd5e1"};function i(e){let{title:o,subtitle:r,right:i,sx:s}=e;return(0,l.jsxs)(n.A,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,mb:2,flexWrap:"wrap",...s},children:[(0,l.jsxs)(n.A,{children:[(0,l.jsx)(a.A,{variant:"h4",component:"h1",sx:{fontWeight:700,letterSpacing:"-0.02em",color:t.ink,fontSize:{xs:"1.4rem",sm:"1.65rem"},lineHeight:1.15},children:o}),r&&(0,l.jsx)(a.A,{variant:"body2",sx:{color:"text.secondary",mt:.25},children:r})]}),i]})}let s={bgcolor:"#fff",border:"1px solid ".concat(t.cardBorder),borderRadius:"12px",boxShadow:"none"},c={"& .MuiOutlinedInput-root":{borderRadius:"8px",bgcolor:t.fieldFill,fontSize:13,"& fieldset":{borderColor:t.fieldBorder},"&:hover fieldset":{borderColor:t.outline}},"& .MuiInputLabel-root":{fontSize:13,color:t.muted}},d={border:"none","& .MuiDataGrid-columnHeaders":{backgroundColor:"".concat(t.headFill," !important"),borderBottom:"1px solid ".concat(t.headBorder)},"& .MuiDataGrid-columnHeader":{backgroundColor:"".concat(t.headFill," !important")},"& .MuiDataGrid-columnHeaderTitle":{fontWeight:600,fontSize:11,color:t.muted},"& .MuiDataGrid-columnSeparator":{display:"none !important"},"& .MuiDataGrid-cell":{borderBottom:"1px solid ".concat(t.rowBorder),fontSize:12,color:t.text},"& .MuiDataGrid-footerContainer":{borderTop:"1px solid ".concat(t.rowBorder),backgroundColor:t.headFill}},u={"& .MuiTableCell-head":{backgroundColor:t.headFill,color:t.muted,fontWeight:600,fontSize:11,borderBottom:"1px solid ".concat(t.headBorder),py:1},"& .MuiTableCell-stickyHeader":{backgroundColor:"".concat(t.headFill," !important")},"& .MuiTableCell-body":{fontSize:12,color:t.text,borderBottom:"1px solid ".concat(t.rowBorder)},"& .MuiTableSortLabel-root, & .MuiTableSortLabel-root:hover, & .MuiTableSortLabel-root.Mui-active":{color:"".concat(t.muted," !important")},"& .MuiTableSortLabel-icon":{color:"".concat(t.muted," !important")}},h={green:["#e8f5e9","#2e7d32"],orange:["#fff3e0","#ef6c00"],red:["#feebee","#d32f2f"],blue:["#e3f2fd","#1565c0"],amber:["#fff8e1","#b45309"],neutral:["#eef2f7","#546e7a"]};function m(e){let{label:o,tone:r="neutral",width:a}=e,[t,i]=h[r]||h.neutral;
1return(0,l.jsx)(n.A,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:a?"flex-start":"center",bgcolor:t,color:i,fontSize:10,fontWeight:500,px:1,py:"2px",borderRadius:"999px",lineHeight:1.4,width:a||"auto",whiteSpace:"nowrap"},children:o})}let x={"& .MuiToggleButton-root":{textTransform:"none",fontSize:12,fontWeight:500,color:t.muted,border:"1px solid ".concat(t.fieldBorder),borderRadius:"7px !important",px:1.5,py:.5,mr:.75,"&.Mui-selected":{bgcolor:t.primary,color:"#fff","&:hover":{bgcolor:t.primaryDark}}}}}},e=>{var o=o=>e(e.s=o);e.O(0,[7661,7715,5242,5776,4515,3207,8419,2528,636,6593,8792],()=>o(2068)),_N_E=e.O()}]);
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.