1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6214],{29703:function(e,s,t){t.d(s,{U:function(){return n},q:function(){return a}});let n="List is successfully created",a="Default"},66214:function(e,s,t){t.d(s,{J:function(){return f}});var n=t(27573),a=t(7653),l=t(78031),r=t(39416),o=t(87354),d=t(67968),i=t(95239),c=t(73957),u=t(29986),m=t(20021),x=t(19369),p=t(29703);function f(e){let{className:s,defaultValue:t,onChange:f,defaultListName:h,useFirst:v=!0,disabled:j}=e,[b,g]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null!=t?t:""),[C,y]=(0,a.useState)(t?void 0:null!=h?h:p.q),[I,P]=(0,a.useState)(t?"":null!=h?h:p.q),{lists:k}=(0,m.j)();(0,a.useEffect)(()=>{f&&!t&&f(void 0,null!=h?h:p.q)},[t]),(0,a.useEffect)(()=>{if(!t&&v){var e;let s=null==k?void 0:null===(e=k.at(0))||void 0===e?void 0:e.id;s&&D(s)}},[k]);let S=(0,a.useMemo)(()=>k.map(e=>({label:e.name,value:e.id})),[k]),D=(0,a.useCallback)(e=>{y(void 0),w(e),g(!1),f&&f(e)},[f]),Z=async()=>{f&&(w(""),y(I),g(!1),f(void 0,I))},E=(0,a.useMemo)(()=>{var e,s;return(0,x.c8)(null!==(s=N?null===(e=S.find(e=>e.value===N))||void 0===e?void 0:e.label:C)&&void 0!==s?s:"")},[N,S,C]);return(0,n.jsxs)(d.Popover,{open:b,onOpenChange:g,children:[(0,n.jsx)(d.PopoverTrigger,{asChild:!0,children:(0,n.jsxs)(i.z,{variant:"outline",role:"combobox","aria-expanded":b,className:(0,u.cn)("w-[200px] justify-between",s),disabled:j,children:[E,(0,n.jsx)(l.Z,{className:"opacity-50"})]})}),(0,n.jsx)(d.PopoverContent,{align:"start",className:(0,u.cn)("w-[200px] p-0",s),children:(0,n.jsxs)(c.Command,{className:"md:min-w-[250px]",children:[(0,n.jsx)(c.CommandInput,{value:I,onInput:e=>{P(e.currentTarget.value)},placeholder:"Search lists...",className:"h-9"}),(0,n.jsxs)(c.CommandList,{className:"max-h-[150px]",children:[(0,n.jsx)(c.CommandEmpty,{className:"p-0 m-0",children:(0,n.jsxs)(i.z,{variant:"secondary",className:"w-full",onClick:Z,children:[(0,n.jsx)(r.Z,{className:"mr-2 h-4 w-4"}),"Create a new list"]})}),(0,n.jsx)(c.CommandGroup,{children:S.map(e=>(0,n.jsxs)(c.CommandItem,{value:e.label,onSelect:()=>{D(e.value)},children:[e.label,(0,n.jsx)(o.Z,{className:(0,u.cn)("ml-auto",N===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}t(71277),t(57617)},57617:function(e,s,t){t.d(s,{l:function(){return D}});var n=t(27573),a=t(1259),l=t(94328),r=t(67968),o=t(95239),d=t(6392),i=t(34365),c=t(59051),u=t(56692),m=t(7653),x=t(29986),p=t(19369),f=t(8301);let h=e=>{let{className:s,progress:t,file:a,fileName:l,badge:r,icon:h,onRemove:v,loading:j,children:b,compact:g=!1}=e,N=(0,m.useMemo)(()=>{if(!a)return"";let e=a.size,s=["byte","Kb","Mb","Gb"],t=e,n=0;for(;t>=1024&&n<s.length-1;)t/=1024,n++;return t=parseFloat(t.toFixed(2)),"".concat(t," ").concat(s[n])},[a]),w=(0,m.useMemo)(()=>"".concat(t," %"),[t]);return(0,n.jsxs)("div",{className:(0,x.cn)("relative flex items-center rounded-md border p-4",{"!pt-11":r&&!g},s),children:[r&&(0,n.jsx)("div",{className:(0,x.cn)("absolute top-2",g&&"right-2"||"left-2"),children:(0,n.jsx)(d.C,{variant:"secondary",className:(0,x.cn)("pointer-events-none",{"bg-destructive text-white":r===f.D.ERROR,"bg-green-400 dark:bg-green-800":r===f.D.DONE,"bg-blue-400 dark:bg-blue-800 text-white":r===f.D.SCANNING}),children:r})}),v&&(0,n.jsx)(o.z,{className:"absolute top-1 right-1 rounded-full w-7 h-7",variant:"ghost",size:"icon",onClick:()=>{v&&v()},children:(0,n.jsx)(c.Z,{size:16})}),null!=h?h:(0,n.jsx)(u.Z,{}),(0,n.jsxs)("div",{className:"flex-1 space-y-3 ml-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium leading-none text-start",children:(0,p.c8)((null==a?void 0:a.name)||l,10)}),(0,n.jsx)(i.Progress,{className:(0,x.cn)({"animate-pulse":j}),value:t}),a&&(0,n.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,n.jsx)("span",{children:N})," ",(0,n.jsx)("span",{children:w})]})]}),b]})};var v=t(93533),j=t(85504),b=t(91332),g=t(40177),N=t(30609),w=t(31790),C=t(76227),y=t(40841),I=t(88146);function P(e,s){return(0,m.useMemo)(()=>{if(s)return s;if(!(null==e?void 0:e.length))return;let t=["productId",...e].join("\n");return"data:text/csv;charset=utf-8,".concat(encodeURIComponent(t))},[s,e])}function k(e){let{Icon:s,text:t,value:a}=e;return(0,n.jsxs)("div",{className:"flex flex-row gap-x-2 items-center justify-start first:border-none first:pt-0 border-t border-border/50 py-2",children:[(0,n.jsx)(s,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,n.jsxs)("span",{className:"text-sm",children:[t,": ",a]})]})}function S(e){var s,t;let{item:a,showListLink:r}=e,[o,d]=(0,m.useState)(!1),i=P(a.notFoundPreview,a.notFoundDownloadUrl),
1c=P(a.errorPreview,a.errorDownloadUrl),u=null!==(s=a.notFoundCount)&&void 0!==s?s:0,p=null!==(t=a.errorCount)&&void 0!==t?t:0;return(0,n.jsxs)(l.Collapsible,{open:o,onOpenChange:d,children:[(0,n.jsx)(l.CollapsibleTrigger,{className:"w-full text-left",children:(0,n.jsx)(h,{compact:!0,className:(0,x.cn)("border bg-primary-foreground cursor-pointer transition-all duration-200","hover:shadow-md hover:border-primary/20",o&&"shadow-md border-primary/20 rounded-b-none"),fileName:a.fileName,badge:a.status,loading:a.status!==f.D.DONE&&a.status!==f.D.ERROR&&a.status!==f.D.PARTIAL,progress:a.status===f.D.PROCESSING?a.parsingProgress:a.importProgress},a.uploadId)}),(0,n.jsx)(l.CollapsibleContent,{className:"rounded-b-md border border-t-0 border-primary/20 bg-primary-foreground px-4 py-2 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",children:(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)(k,{Icon:v.Z,text:"Parsing success",value:a.parsingProgress.toFixed()+"%"}),(0,n.jsx)(k,{Icon:j.Z,text:"Products parsed",value:a.parsedCount.toFixed()}),(0,n.jsx)(k,{Icon:b.Z,text:"Imported products",value:a.importedCount.toFixed()}),(0,n.jsx)(k,{Icon:g.Z,text:"Not found",value:i?(0,n.jsxs)("a",{href:i,download:"not-found-".concat(a.uploadId,".csv"),className:"font-medium underline underline-offset-4 hover:underline-offset-[5px]",children:[u," (download CSV)"]}):u.toString()}),p>0&&(0,n.jsx)(k,{Icon:N.Z,text:"Errors",value:c?(0,n.jsxs)("a",{href:c,download:"errors-".concat(a.uploadId,".csv"),className:"font-medium text-destructive underline underline-offset-4 hover:underline-offset-[5px]",children:[p," (download CSV)"]}):(0,n.jsx)("span",{className:"text-destructive",children:p})}),a.listId&&r&&(0,n.jsx)(k,{Icon:w.Z,text:"Go to",value:(0,n.jsx)(I.default,{className:"font-medium underline underline-offset-4 hover:underline-offset-[5px]",href:"/dashboard/my-lists/".concat(a.listId),children:"list"})})]})})]})}let D=e=>{let{position:s="static",showListLink:t}=e,{uploads:l}=(0,a.G)(),{isImporting:d}=(0,y.xh)();if(0===l.length)return;let i="fixed"===s;return(0,n.jsxs)(r.Popover,{children:[(0,n.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,n.jsxs)(o.z,{size:i?"default":"icon",className:(0,x.cn)("h-7 w-7 relative",i&&"fixed z-10 bottom-9 right-32 w-auto h-auto"),variant:"ghost",children:[(0,n.jsx)(C.Z,{className:(0,x.cn)("h-6 w-6",i&&"h-4 w-4 mr-2")}),i?"Uploads":"",d&&(0,n.jsxs)("span",{className:"absolute top-0 left-0 flex h-3 w-3 -translate-x-1 -translate-y-1",children:[(0,n.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),(0,n.jsx)("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}),(0,n.jsx)(r.PopoverContent,{side:i?"top":"bottom",className:"min-w-[280px] max-w-[320px] max-h-[420px] overflow-x-clip overflow-y-auto bg-secondary",children:(0,n.jsx)("div",{className:"grid grid-cols-1 gap-y-2",children:l.map(e=>(0,n.jsx)(S,{item:e,showListLink:t},e.uploadId))})})]})}}}]);
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.