1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1540],{11540:(e,t,o)=>{o.d(t,{exportDreToExcel:()=>h,exportDreToPdf:()=>u});var n=o(74495);let l={green:"FF052D2B",lime:"FFB1FE7B",limeTint:"FFECFEDB",white:"FFFFFFFF",ink:"FF1D1D1F",muted:"FF6B7280",zebra:"FFF7F8FA",border:"FFE5E5EA"},a={style:"thin",color:{argb:l.border}},r={top:a,left:a,bottom:a,right:a},i="Eudoxus Sans",c=["janeiro","fevereiro","mar\xe7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],d=["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],s=e=>e.charAt(0).toUpperCase()+e.slice(1),g=e=>{let[t,o]=e.split("-").map(Number);return{y:t||0,m:(o||1)-1}},p=(e,t)=>{let o=[...e].sort();if(0===o.length)return t;let n=g(o[0]),l=g(o[o.length-1]);return 1===o.length?"".concat(s(c[n.m])," de ").concat(n.y):n.y===l.y?"".concat(s(c[n.m])," a ").concat(c[l.m]," de ").concat(l.y):"".concat(s(c[n.m])," de ").concat(n.y," a ").concat(c[l.m]," de ").concat(l.y)},m=e=>new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(e),h=async e=>{let{rows:t,window:o,periodLabel:a}=e,c=p(o,a),s=new n.Workbook,h=s.addWorksheet("DRE",{views:[{showGridLines:!1}]});h.columns=[{width:3},{width:46},{width:16},{width:13},{width:13},{width:3}],h.mergeCells("A1:F4");let u=h.getCell("A1");u.fill={type:"pattern",pattern:"solid",fgColor:{argb:l.green}},u.alignment={vertical:"middle"},h.getCell("B2").value="Cargoos",h.getCell("B2").font={name:i,size:18,bold:!0,color:{argb:l.lime}},h.getCell("B6").value="Demonstrativo do per\xedodo",h.getCell("B6").font={name:i,size:13,bold:!0,color:{argb:l.green}},h.getCell("B7").value="Per\xedodo: ".concat(c),h.getCell("B7").font={name:i,size:10,color:{argb:l.muted}},h.getCell("B8").value="Gerado em ".concat(m(Date.now())),h.getCell("B8").font={name:i,size:10,color:{argb:l.muted}};let b=[2,3,4,5],f=(e,t)=>3===e?"right":(e=>4===e||5===e)(e)?"center":"left",v=h.getRow(10);for(let e of(v.getCell(2).value="Linha",v.getCell(3).value="Valor",v.getCell(4).value="% receita",v.getCell(5).value="Varia\xe7\xe3o",b)){let t=v.getCell(e);t.fill={type:"pattern",pattern:"solid",fgColor:{argb:l.green}},t.font={name:i,size:10,bold:!0,color:{argb:l.white}},t.border=r,t.alignment={vertical:"middle",horizontal:f(e,0)}}v.height=20,t.forEach((e,t)=>{var o,n;let a=h.getRow(11+t),c=1===e.level;for(let t of(a.getCell(2).value=e.deduction?"(â) ".concat(e.label):e.label,a.getCell(3).value=e.deduction?"â ".concat(e.value):e.value,a.getCell(4).value=null!=(o=e.share)?o:"â",a.getCell(5).value=null!=(n=e.delta)?n:"â",b)){let o=a.getCell(t);o.border=r,o.font={name:i,size:10,bold:!!e.result,color:{argb:e.result?l.green:c?l.muted:l.ink}},o.alignment={vertical:"middle",horizontal:f(t,e.level),...2===t&&c?{indent:2}:{}},e.result?o.fill={type:"pattern",pattern:"solid",fgColor:{argb:l.limeTint}}:c&&(o.fill={type:"pattern",pattern:"solid",fgColor:{argb:l.zebra}})}a.height=18}),((e,t)=>{let o=URL.createObjectURL(e),n=document.createElement("a");n.href=o,n.download=t,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(o)})(new Blob([await s.xlsx.writeBuffer()],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),"".concat(((e,t)=>{let o=[...e].sort();if(0===o.length)return"dre-".concat(t.toLowerCase().replace(/\s+/g,"-"));let n=g(o[0]),l=g(o[o.length-1]);return 1===o.length?"dre-".concat(d[n.m],"-").concat(n.y):n.y===l.y?"dre-".concat(d[n.m],"-").concat(d[l.m],"-").concat(l.y):"dre-".concat(d[n.m],"-").concat(n.y,"-a-").concat(d[l.m],"-").concat(l.y)})(o,a),".xlsx"))},u=e=>{let{rows:t,window:o,periodLabel:n}=e,l=p(o,n),a=t.map(e=>{var t,o;return'\n <tr class="'.concat((e=>[e.result?"result":"",1===e.level?"comp":""].filter(Boolean).join(" "))(e),'">\n <td class="lbl">').concat(e.deduction?"(â) ":"").concat(e.label,'</td>\n <td class="value">').concat(e.deduction?"â ":"").concat(e.value,'</td>\n <td class="num">').concat(null!=(t=e.share)?t:"â",'</td>\n <td class="num">').concat(null!=(o=e.delta)?o:"â","</td>\n </tr>")}).join(""),r="".concat(window.location.origin,"/logo.svg"),i='<!doctype html>\n<html lang="pt-BR">\n<head>\n<meta charset="utf-8" />\n<title>Relat\xf3rio DRE, '.concat(l,'</title>\n<style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: \'DM Sans\', system-ui, sans-serif; color: #1d1d1f; padding: 48px 44px; }\n .head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid #B1FE7B; }\n .brand .logo { height: 46px; width: auto; display: block; }\n .brand .logo-fallback { color: #052D2B; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }\n .head .ctx { text-align: right; }\n .head .ctx .period { font-size: 13px; font-weight: 500; color: #052D2B; }\n .head .ctx .gen { font-size: 11px; color: #6B7280; margin-top: 3px; }\n h1 { font-size: 15px; font-weight: 500; color: #052D2B; margin: 28px 0 16px; }\n table { width: 100%; border-collapse: collapse; }\n thead th { padding: 8px 10px; font-size: 10.5px; font-weight: 500; color: #fff; background: #052D2B; text-align: left; }\n thead th.num { text-align: center; }\n thead th.value { text-align: right; }\n td { padding: 9px 10px; font-size: 12.5px; color: #6B7280; border-bottom: 1px solid #EEF0F2; }\n td.value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }\n td.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; color: #6B7280; }\n tr.comp td.lbl { padding-left: 28px; color: #6B7280; }\n tr.comp td { background: #FBFCFD; }\n tr.result td { color: #052D2B; font-weight: 500; background: #F7FBF4; border-top: 1px solid #052D2B1f; border-bottom-color: #052D2B1f; }\n tr.result td.num { color: #052D2B; }\n .foot { margin-top: 28px; font-size: 10.5px; color: #6B7280; }\n @media print { body { padding: 24px; } .head { padding-top: 0; } }\n</style>\n</head>\n<body>\n <div class="head">\n <div class="brand">\n <img class="logo" src="').concat(r,'" alt="Cargoos" onerror="this.style.display=\'none\';this.nextElementSibling.style.display=\'block\';" />
1\n <span class="logo-fallback" style="display:none">Cargoos</span>\n </div>\n <div class="ctx">\n <div class="period">').concat(l,'</div>\n <div class="gen">Gerado em ').concat(m(Date.now()),'</div>\n </div>\n </div>\n <h1>Demonstrativo do per\xedodo</h1>\n <table>\n <thead>\n <tr>\n <th class="lbl">Linha</th>\n <th class="value">Valor</th>\n <th class="num">% receita</th>\n <th class="num">Varia\xe7\xe3o</th>\n </tr>\n </thead>\n <tbody>').concat(a,"</tbody>\n </table>\n <p class=\"foot\">Relat\xf3rio gerado pela Cargoos, sua central de intelig\xeancia para o Mercado Livre.</p>\n <script>window.addEventListener('load', () => { window.print(); });<\/script>\n</body>\n</html>"),c=window.open("","_blank","width=840,height=920");c&&(c.document.write(i),c.document.close())}}}]);
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.