1function __vite__mapDeps(indexes) { 2 if (!__vite__mapDeps.viteFileDeps) { 3 __vite__mapDeps.viteFileDeps = ["assets/CustomDateRangePicker--Q6V_lmU.js","assets/mui-CRsYZxVY.js","assets/vendor-Dwao9eNC.js","assets/index-TALscxEc.js","assets/query-8ViTdhdk.js","assets/datePickers-BIJXYOKG.js","assets/icons-D8aatgQ4.js","assets/lab-DSem1Osk.js","assets/index-TuPg2doO.css","assets/CustomDateRangePicker-C4hWU8xu.css"] 4 } 5 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 6} 7import{j as e,R as De,I as L,as as se,an as ke,ar as v,a7 as f,T as S,ac as w,at as re,n as A,X as Te,ai as Fe,Z as Ie,aq as Be,O as Re,N as $,C as Ue,ab as Ae,S as B,aj as qe,Q as U,aR as He,aA as pe}from"./mui-CRsYZxVY.js";import{r as x}from"./vendor-Dwao9eNC.js";import{a as Xe,b as Ke,u as Ve}from"./query-8ViTdhdk.js";import{c1 as Ne,b as Qe,cc as Ye,b7 as Ge,fC as ne,b8 as Je,eR as Ze,_ as ea,ce as aa,aK as q,fD as Z,fE as ee,bl as ta,b2 as sa,bm as _e,bn as ra,bo as na,cI as fe,cJ as je,cK as oa,v as ia,cF as oe,a$ as la,bh as ca,bk as ge,fF as be,bi as da,bj as ua,bK as ae,ca as ha,T as xa,e9 as ma,K as ye,b3 as Se}from"./index-TALscxEc.js";import{n as pa,b as ve}from"./notaFiscalDanfe-BoR-dr4F.js";import{M as ie,af as Le,ag as Me,ah as fa,h as ja,a as we,l as Oe,ai as ga,aj as ba,ak as ya,al as Sa,am as va,C as wa,T as Ca,H as Da}from"./icons-D8aatgQ4.js";import{s as ka}from"./subMonths-Doy3XBcY.js";import"./datePickers-BIJXYOKG.js";import"./lab-DSem1Osk.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="d20bcc6e-7944-4fc2-bc1e-e27402250daf",a._sentryDebugIdIdentifier="sentry-dbid-d20bcc6e-7944-4fc2-bc1e-e27402250daf")})()}catch{}const Ta=Ne.isNativePlatform(),Fa={pendente:"info",autorizado:"success",rejeitado:"error",cancelado:"neutral",erro:"error"},Ia={pendente:"Processando",autorizado:"Autorizada",rejeitado:"Rejeitada",cancelado:"Cancelada",erro:"Erro"},te={nfe:"NF-e",nfce:"NFC-e"},Ce={nfe:"#8865FE",nfce:"#3B82F6"},Ra=()=>{const a=Xe();return Ke({mutationFn:async({nfId:r})=>{const{data:i}=await q.delete(`/fiscal/nota/${r}`);return i},onSuccess:()=>{a.invalidateQueries({queryKey:["notas-fiscais-all"]}),a.invalidateQueries({queryKey:["notas-fiscais"]})}})},Aa=({nf:a,selectEnabled:r,selected:i,onToggleSelect:n,longPressEvents:u,onErro:d})=>{const j=Qe(),m=Ra(),[g,p]=x.useState(null),[y,b]=x.useState(!1),{runShare:l}=Ye(),o=Ce[a.tipo]||Ce.nfe,D=te[a.tipo]||a.tipo,H=pa(a),R=`Nota fiscal ${te[a.tipo]||a.tipo.toUpperCase()} #${a.numero}`,M=async()=>{p(null);try{const{blob:c,fileName:T}=await ve(a);await Z(c,T,{title:R,dialogTitle:"Salvar ou compartilhar a DANFE"})}catch(c){if(ee(c))return;console.error("Error downloading PDF:",c),d==null||d("Não foi possÃvel baixar a DANFE. Tente novamente.")}},X=async()=>{p(null);try{const c=await q.get(`/fiscal/nota/${a.id}/xml`,{responseType:"blob"});await Z(new Blob([c.data],{type:"application/xml"}),`${H}.xml`,{title:R,dialogTitle:"Salvar ou compartilhar o XML"})}catch(c){if(ee(c))return;console.error("Error downloading XML:",c),d==null||d("Não foi possÃvel baixar o XML. Tente novamente.")}},K=c=>(c.stopPropagation(),l(O)),O=async()=>{try{const{blob:c,fileName:T}=await ve(a);if(!Ta&&navigator.share&&navigator.canShare){const C=new File([c],T,{type:c.type});if(navigator.canShare({files:[C]})){await navigator.share({title:R,files:[C]});return}}await Z(c,T,{title:R,dialogTitle:"Compartilhar nota fiscal"})}catch(c){ee(c)||console.error("Error sharing NF:",c)}},V=async()=>{var c,T;b(!1),p(null);try{await m.mutateAsync({nfId:a.id})}catch(C){console.error("Error cancelling NF:",C),d==null||d(((T=(c=C==null?void 0:C.response)==null?void 0:c.data)==null?void 0:T.error)||"Não foi possÃvel cancelar a nota fiscal. Tente novamente.")}},Q=new Date(a.data_emissao).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}
7),k=Number(a.valor_total).toLocaleString("pt-BR",{style:"currency",currency:"BRL"});return e.jsxs(e.Fragment,{children:[e.jsx(De,{disablePadding:!0,secondaryAction:!r&&a.status==="autorizado"?e.jsx(L,{onClick:c=>{c.stopPropagation(),p(c.currentTarget)},children:e.jsx(ie,{fontSize:"small"})}):void 0,children:e.jsxs(se,{sx:{py:1.5},onClick:()=>{r?n==null||n():a.pedido_id&&j(`/orders/${a.pedido_id}`)},...r?{}:(u==null?void 0:u())??{},children:[r&&e.jsx(ke,{edge:"start",checked:!!i,tabIndex:-1,disableRipple:!0,onClick:c=>{c.stopPropagation(),n==null||n()},sx:{mr:1}}),e.jsx(v,{sx:{minWidth:56},children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.5},children:[e.jsx(Ge,{color:o,children:e.jsx(ne,{sx:{fontSize:20}})}),!!a.numero&&e.jsxs(S,{sx:{fontSize:"11px",fontWeight:600,lineHeight:1,maxWidth:48,textAlign:"center",wordBreak:"break-word",color:o},children:["#",a.numero]})]})}),e.jsx(w,{disableTypography:!0,primary:e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:.5},children:[e.jsx(S,{noWrap:!0,sx:{...Je,flex:1,minWidth:0,mr:1},children:a.destinatario_nome||"Consumidor"}),e.jsx(S,{sx:Ze,children:Q})]}),e.jsx(S,{sx:{fontSize:"1rem",fontWeight:700,mb:.75},children:k}),e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(S,{variant:"caption",color:"text.secondary",noWrap:!0,children:[D,a.pedido_id?` · Pedido #${a.pedido_id}`:""]}),e.jsx(ea,{label:Ia[a.status]||a.status,tint:Fa[a.status]||"error"})]}),a.configuracao_fiscal&&e.jsx(S,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{mt:.25,display:"block"},children:a.configuracao_fiscal.nome_razao_social}),a.motivo_rejeicao&&e.jsx(S,{variant:"caption",color:"error.main",sx:{mt:.5,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",overflowWrap:"anywhere"},children:a.motivo_rejeicao})]})})]})}),e.jsxs(re,{anchorEl:g,open:!!g,onClose:()=>p(null),children:[e.jsxs(A,{onClick:c=>{p(null),K(c)},children:[e.jsx(v,{children:e.jsx(aa,{size:20})}),e.jsx(w,{children:"Compartilhar"})]}),e.jsxs(A,{onClick:M,children:[e.jsx(v,{children:e.jsx(Le,{fontSize:"small"})}),e.jsx(w,{children:a.tipo==="nfce"?"Baixar DANFE":"Baixar PDF"})]}),e.jsxs(A,{onClick:X,children:[e.jsx(v,{children:e.jsx(Me,{fontSize:"small"})}),e.jsx(w,{children:"Baixar XML"})]}),e.jsxs(A,{onClick:()=>{p(null),b(!0)},sx:{color:"error.main"},children:[e.jsx(v,{sx:{color:"inherit"},children:e.jsx(fa,{fontSize:"small"})}),e.jsx(w,{children:"Cancelar nota"})]})]}),e.jsxs(Te,{open:y,onClose:()=>b(!1),children:[e.jsx(Fe,{children:"Cancelar nota fiscal"}),e.jsx(Ie,{children:e.jsxs(Be,{children:["Tem certeza que deseja cancelar a"," ",te[a.tipo]||a.tipo.toUpperCase()," #",a.numero,"? Esta ação não pode ser desfeita."]})}),e.jsxs(Re,{children:[e.jsx($,{onClick:()=>b(!1),children:"Voltar"}),e.jsx($,{onClick:V,color:"error",disabled:m.isPending,children:"Cancelar nota"})]})]})]})},Na=ta(()=>sa(()=>import("./CustomDateRangePicker--Q6V_lmU.js").then(a=>a.a),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),_a=[{value:"all",label:"Todas"},{value:"thisMonth",label:"Este mês"},{value:"thisWeek",label:"Esta semana"},{value:"lastMonth",label:"Mês passado"}],La=({selectedOption:a,onOptionChange:r,customDateRange:i,onCustomDateRangeChange:n})=>{const u=Ue(),[d,j]=x.useState(!1),m=x.useMemo(()=>({startDate:new Date(Date.now()-7*24*60*60*1e3),endDate:new Date}),[]),g=i||m,p=()=>{const l=D=>String(D).padStart(2,"0"),o=D=>`${l(D.getDate())}/${l(D.getMonth()+1)}`;return`${o(g.startDate)} - ${o(g.endDate)}`},y=(l,o)=>{_e(ra.Light),l==="custom"?j(!0):r(l),o.currentTarget&&o.currentTarget.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},b=(l,o)=>{n==null||n({startDate:l,endDate:o}),r("custom")};return e.jsxs(e.Fragment,{children:[e.jsxs(Ae,{direction:"row",spacing:1,sx:{overflowX:"auto",px:u.spacing(2),"&::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none","scrollbar-width":"none"},children:[e.jsx(B,{avatar:e.jsx(qe,{children:e.jsx(ja,{sx:{fontSize:"14px"}})}),label:a==="custom"?p():"Personalizado",onClick:l=>y("custom",l),color:a==="custom"?"primary":"default",variant:"filled",sx:{fontWeight:500,flexShrink:0,height:32}}),_a.map(l=>e.jsx(B,{label:l.label,onClick:o=>y(l.value,o),color:a===l.value?"primary":"default",variant:"filled",sx:{fontWeight:500,flexShrink:0,height:32}},l.value))]}),d&&e.jsx(x.Suspense,{fallback:null,children:e.jsx(Na,{open:d,onClose:()=>j(!1),onApply:b,initialStartDate:g.startDate,initialEndDate:g.endDate})})]})},Ma=[{value:"all",label:"Todas as notas",icon:e.jsx(Oe,{})},{value:"autorizado",label:"Autorizadas",icon:e.jsx(ga,{}),color:"success.main"},{value:"pendente",label:"Processando",icon:e.jsx(ba,{}),color:"info.main"},{value:"rejeitado",label:"Rejeitadas",icon:e.jsx(ya,{}),color:"error.main"},{value:"cancelado",label:"Canceladas",icon:e.jsx(Sa,{})},{value:"erro",label:"Com erro",icon:e.jsx(va,{}),color:"error.main"}],Oa=[{value:"all",label:"NF-e e NFC-e",icon:e.jsx(Oe,{})},{value:"nfe",label:"NF-e",icon:e.jsx(ne,{})},{value:"nfce",label:"NFC-e",icon:e.jsx(ne,{})}],Pa=({open:a,onClose:r,selectedStatus:i,selectedTipo:n,onApply:u,onClearAll:d})=>{const[j,m]=x.useState(i),[g,p]=x.useState(n);x.useEffect(()=>{a&&(m(i),p(n))},[a,i,n]);const y=j!=="all"||g!=="all",b=()=>{u(j,g),r()},l=()=>{m("all"),p("all"),d(),r()};return e.jsxs(Te,{open:a,onClose:r,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[e.jsxs(Fe,{children:[e.jsx(S,{component:"div",variant:"h6",fontWeight:600,children:"Filtros"}),e.jsx(S,{component:"div",variant:"body2",color:"text.secondary",children:"Selecione os filtros para refinar sua busca"})]}),e.jsx(Ie,{children:e.jsxs(f,{children:[e.jsx(S,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,sx:{mt:1},children:"Status da nota"}),e.jsx(U,{sx:{mb:3},children:Ma.map(o=>e.jsxs(se,{onClick:()=>m(o.value),selected:j===o.value,children:[e.jsx(v,{children:e.jsx(f,{sx:{color:o.color||"text.primary"},children:o.icon})}),e.jsx(w,{primary:o.label,primaryTypographyProps:{fontWeight:j===o.value?600:4
700}}),j===o.value&&e.jsx(we,{color:"primary"})]},o.value))}),e.jsx(S,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Tipo de nota"}),e.jsx(U,{children:Oa.map(o=>e.jsxs(se,{onClick:()=>p(o.value),selected:g===o.value,children:[e.jsx(v,{children:e.jsx(f,{sx:{color:"text.primary"},children:o.icon})}),e.jsx(w,{primary:o.label,primaryTypographyProps:{fontWeight:g===o.value?600:400}}),g===o.value&&e.jsx(we,{color:"primary"})]},o.value))})]})}),e.jsxs(Re,{sx:{p:2,gap:1,flexDirection:y?"row":"column"},children:[y&&e.jsx($,{onClick:l,color:"inherit",fullWidth:!0,children:"Limpar"}),e.jsx($,{onClick:b,variant:"contained",fullWidth:!0,children:"Aplicar"})]})]})},Ea=Ne.isNativePlatform(),Wa=()=>{const[a,r]=x.useState(!1);return{exportNotas:async(n,u)=>{var d,j;if(n.length===0)return{ok:!1};r(!0);try{const m=await q.post("/fiscal/notas/export",{ids:n,format:u},{responseType:"blob"}),g=na(new Date,"yyyy-MM-dd_HH-mm-ss"),p=`notas-fiscais_${u}_${g}.zip`,y=new Blob([m.data],{type:"application/zip"});if(Ea){const b=new FileReader,l=await new Promise(D=>{b.onloadend=()=>D(b.result.split(",")[1]),b.readAsDataURL(y)});await fe.writeFile({path:p,data:l,directory:je.Cache,recursive:!0});const{uri:o}=await fe.getUri({directory:je.Cache,path:p});await oa.share({title:"Notas fiscais",text:`${n.length} nota(s) fiscal(is) em ${u.toUpperCase()}`,url:o,dialogTitle:"Compartilhar notas fiscais"})}else{const b=window.URL.createObjectURL(y),l=document.createElement("a");l.href=b,l.download=p,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(b)}return{ok:!0}}catch(m){return(j=(d=m==null?void 0:m.message)==null?void 0:d.toLowerCase())!=null&&j.includes("cancel")||(m==null?void 0:m.name)==="AbortError"?{ok:!1,canceled:!0}:(console.error("Error exporting notas fiscais:",m),{ok:!1})}finally{r(!1)}},isExporting:a}},za={autorizado:"Autorizadas",pendente:"Processando",rejeitado:"Rejeitadas",cancelado:"Canceladas",erro:"Com erro"},$a={nfe:"NF-e",nfce:"NFC-e"},Ba=(a,r,i)=>Ve({queryKey:["notas-fiscais-all",a,r,(i==null?void 0:i.start.toISOString())??null,(i==null?void 0:i.end.toISOString())??null],queryFn:async()=>{const n=new URLSearchParams;a!=="all"&&n.set("tipo",a),r!=="all"&&n.set("status",r),i&&(n.set("data_inicio",i.start.toISOString()),n.set("data_fim",i.end.toISOString()));const{data:u}=await q.get(`/fiscal/notas?${n.toString()}`);return u.data||[]}});function Ua(a){const r=oe(a),i=new Date,n=new Date(i.getFullYear(),i.getMonth(),i.getDate()),u=new Date(n);u.setDate(u.getDate()-1);const d=new Date(r.getFullYear(),r.getMonth(),r.getDate());return d.getTime()===n.getTime()?"Hoje":d.getTime()===u.getTime()?"Ontem":r.toLocaleDateString("pt-BR",{day:"2-digit",month:"long",...r.getFullYear()!==i.getFullYear()?{year:"numeric"}:{}})}const Za=()=>{const[a,r]=ia(),i=a.get("query")||"",n=a.get("status")||"all",u=a.get("tipo")||"all",d=a.get("dateRangeOption")||"all",j=a.get("startDate"),m=a.get("endDate"),[g,p]=x.useState(!1),[y,b]=x.useState(()=>{if(j&&m)try{return{startDate:oe(j),endDate:oe(m)}}catch{return null}return null}),l=x.useMemo(()=>{const t=new Date;switch(d){case"thisMonth":return{start:ge(t),end:be(t)};case"thisWeek":return{start:da(t,{weekStartsOn:1}),end:ua(t,{weekStartsOn:1})};case"lastMonth":{const s=ka(t,1);return{start:ge(s),end:be(s)}}case"custom":return y?{start:la(y.startDate),end:ca(y.endDate)}:null;default:return null}},[d,y]),{data:o,isLoading:D,isError:H}=Ba(u,n,l),R=n!=="all"||u!=="all",M=R||d!=="all"||!!i.trim(),X=(t,s)=>{const h=new URLSearchParams(a);t!=="all"?h.set("status",t):h.delete("status"),s!=="all"?h.set("tipo",s):h.delete("tipo"),r(h,{replace:!0})},K=()=>{const t=new URLSearchParams(a);t.delete("status"),t.delete("tipo"),r(t,{replace:!0})},O=t=>{const s=new URLSearchParams(a);s.delete(t),r(s,{replace:!0})},V=t=>{const s=new URLSearchParams(a);t==="all"?(s.delete("dateRangeOption"),s.delete("startDate"),s.delete("endDate")):t==="custom"?s.set("dateRangeOption",t):(s.set("dateRangeOption",t),s.delete("startDate"),s.delete("endDate")),r(s,{replace:!0})},Q=t=>{b(t);const s=new URLSearchParams(a);s.set("dateRangeOption","custom"),s.set("startDate",t.startDate.toISOString()),s.set("endDate",t.endDate.toISOString()),r(s,{replace:!0})},k=x.useMemo(()=>
7{let t=o||[];if(i.trim()&&(t=t.filter(s=>{var h,z;return ae(i,s.destinatario_nome||"Consumidor")||ae(i,(h=s.numero)==null?void 0:h.toString())||ae(i,(z=s.pedido_id)==null?void 0:z.toString())})),l){const s=l.start.getTime(),h=l.end.getTime();t=t.filter(z=>{const me=new Date(z.data_emissao).getTime();return me>=s&&me<=h})}return[...t].sort((s,h)=>new Date(h.data_emissao).getTime()-new Date(s.data_emissao).getTime())},[o,i,l]),c=x.useMemo(()=>{const t=new Map;for(const s of k){const h=Ua(s.data_emissao);t.has(h)||t.set(h,{label:h,items:[]}),t.get(h).items.push(s)}return Array.from(t.values())},[k]),{exportNotas:T,isExporting:C}=Wa(),[P,Y]=x.useState(!1),[F,E]=x.useState([]),[le,G]=x.useState(null),[ce,W]=x.useState(null),[J,_]=x.useState({open:!1,severity:"success",message:""}),Pe=`${i}|${n}|${u}|${d}|${j}|${m}`;x.useEffect(()=>{E([])},[Pe]);const Ee=ha(()=>{_e(),Y(!0)},{cancelOnMovement:!0}),N=x.useMemo(()=>k.map(t=>t.id),[k]),I=F.length,de=x.useMemo(()=>{const t=k.filter(s=>F.includes(s.id));return t.length>0&&t.every(s=>s.tipo==="nfce")?"Baixar DANFE":"Baixar PDF"},[k,F]),We=t=>{E(s=>s.includes(t)?s.filter(h=>h!==t):[...s,t])},ze=()=>{G(null),Y(!0)},ue=()=>{Y(!1),E([]),W(null)},he=x.useMemo(()=>{if(N.length===0)return{checked:!1,indeterminate:!1};const t=N.filter(s=>F.includes(s)).length;return t===0?{checked:!1,indeterminate:!1}:t===N.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},[N,F]),$e=()=>{const t=N.length>0&&N.every(s=>F.includes(s));E(t?[]:[...N])},xe=async t=>{W(null);const s=F.length;if(s===0)return;const h=await T(F,t);h.canceled||(h.ok?(_({open:!0,severity:"success",message:`${s} nota(s) exportada(s) em ${t.toUpperCase()}.`}),ue()):_({open:!0,severity:"error",message:"Não foi possÃvel exportar as notas. Tente novamente."}))};return e.jsxs(f,{sx:{width:"100%",display:"flex",flexDirection:"column",flexGrow:1},children:[e.jsx(xa,{title:P?I===0?"Selecionar notas":`${I} selecionada${I>1?"s":""}`:"Histórico de notas",navigateBack:P?void 0:!0,children:P?e.jsxs(e.Fragment,{children:[e.jsx(L,{color:"inherit",onClick:ue,children:e.jsx(wa,{})}),e.jsx(L,{color:"inherit",onClick:t=>W(t.currentTarget),children:e.jsx(ie,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ma,{}),e.jsx(He,{color:"primary",variant:"dot",invisible:!R,sx:{"& .MuiBadge-badge":{right:6,top:6},ml:1},children:e.jsx(L,{color:"inherit",onClick:()=>p(!0),children:e.jsx(Ca,{})})}),k.length>0&&e.jsx(L,{color:"inherit",onClick:t=>G(t.currentTarget),children:e.jsx(ie,{})})]})}),e.jsxs(f,{sx:{pt:2,pb:2},children:[e.jsx(La,{selectedOption:d,onOptionChange:V,customDateRange:y||void 0,onCustomDateRangeChange:Q}),R&&e.jsx(f,{sx:{px:2,pt:1},children:e.jsxs(Ae,{direction:"row",spacing:1,flexWrap:"wrap",rowGap:1,children:[n!=="all"&&e.jsx(B,{label:za[n],onDelete:()=>O("status"),variant:"filled",color:"primary"}),u!=="all"&&e.jsx(B,{label:$a[u],onDelete:()=>O("tipo"),variant:"filled",color:"secondary"})]})})]}),e.jsx(f,{sx:{px:2,pb:2},children:D?e.jsx(U,{sx:{backgroundColor:"background.paper",borderRadius:2},children:Array.from({length:5}).map((t,s)=>e.jsxs(De,{sx:{py:2},children:[e.jsx(v,{sx:{minWidth:56},children:e.jsx(f,{sx:{width:40,height:40,borderRadius:"10px",backgroundColor:"#f3f4f6"}})}),e.jsx(w,{primary:e.jsx(f,{sx:{width:"60%",height:14,borderRadius:1,backgroundColor:"#f3f4f6",mb:1}}),secondary:e.jsx(f,{sx:{width:"40%",height:10,borderRadius:1,backgroundColor:"#f3f4f6"}})})]},s))}):H?e.jsx(ye,{primaryText:"Erro ao carregar notas fiscais"}):k.length===0?e.jsx(ye,{primaryText:M?"Nenhuma nota encontrada":"Nenhuma nota fiscal emitida",secondaryText:M?"Tente remover a palavra-chave de busca ou os filtros selecionados.":void 0}):c.map(t=>e.jsxs(f,{children:[e.jsx(f,{sx:{px:1,py:1.5},children:e.jsx(S,{variant:"caption",display:"block",fontWeight:600,color:"text.secondary",sx:{textTransform:"capitalize"},children:t.label})}),e.jsx(U,{sx:{backgroundColor:"background.paper",borderRadius:2,mb:1},children:t.items.map(s=>e.jsx(Aa,{nf:s,selectEnabled:P,selected:F.includes(s.id),onToggleSelect:()=>We(s.id),longPressEvents:Ee,onErro:h=>_({open:!0,message:h,severity:"error"})},s.id))})]},t.label))}),e.jsx(Pa,{open:g,onClose:()=>p(!1),selectedStatus:n,selectedTipo:u,onApply:X,onClearAll:K}),e.jsx(re,{anchorEl:le,open:!!le,onClose:()=>G(null),children:e.jsxs(A,{onClick:ze,children:[e.jsx(v,{children:e.jsx(Da,{fontSize:"small"})}),e.jsx(w,{children:"Selecionar"})]})}),e.jsxs(re,{anchorEl:ce,open:!!ce,onClose:()=>W(null),children:[e.jsxs(A,{onClick:$e,children:[e.jsx(v,{children:e.jsx(ke,{checked:he.checked,indeterminate:he.indeterminate,tabIndex:-1,disableRipple:!0,size:"small",sx:{p:0}})}),e.jsx(w,{children:"Selecionar todos"})]}),e.jsxs(A,{onClick:()=>xe("pdf"),disabled:I===0||C,children:[e.jsx(v,{children:e.jsx(Le,{fontSize:"small"})}),e.jsx(w,{children:I>0?`${de} (${I})`:de})]}),e.jsxs(A,{onClick:()=>xe("xml"),disabled:I===0||C,children:[e.jsx(v,{children:e.jsx(Me,{fontSize:"small"})}),e.jsx(w,{children:I>0?`Baixar XML (${I})`:"Baixar XML"})]})]}),e.jsx(pe,{open:C,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(f,{sx:{width:"100%",maxWidth:420,px:2},children:e.jsx(Se,{severity:"info",children:"Preparando arquivo para download..."})})}),e.jsx(pe,{open:J.open,autoHideDuration:4e3,onClose:()=>_(t=>({...t,open:!1})),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(f,{sx:{width:"100%",maxWidth:420,px:2},children:e.jsx(Se,{severity:J.severity,onClose:()=>_(t=>({...t,open:!1})),children:J.message})})})]})};export{Za 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.