PageSourceSearch

https://accounts.wisedataagency.com/assets/js/QrCodeStats-DFamkBO7.js

js wisedataagency.com collected 2026-09-24 14:02:59 UTC 6,255 bytes, 1 lines download raw bytes

1import{u as G,d as D,r as j,j as e}from"./vendor-BlJ90GWG.js";import{u as E,l as A,aj as F,a6 as P,P as S,a_ as I,x as f,au as L,bo as _,e as $,an as M,c as V,c9 as K}from"./index-BIHwndtW.js";import{B as z}from"./BackButton-BZFMqPGI.js";import{B as U}from"./BarChart-33-kTduU.js";import"./charts-i6LaAsIH.js";import{q as W,a as q,u as O,Q as Y,d as R}from"./useQrCodesQuery-DEfR9X-k.js";import"./pdf-Ba4Lif-1.js";import"./qr-code-styling-DqD3164O.js";(function(){try{var t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};t.SENTRY_RELEASE={id:"0d78e8d78eda4804299eff0767f9df5613e65c75"};var i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="3f6f91b3-c712-450c-907e-48f971811789",t._sentryDebugIdIdentifier="sentry-dbid-3f6f91b3-c712-450c-907e-48f971811789")}catch(l){}})();function H(t,i={}){const l=E(),{enabled:c=!0}=i;return A({queryKey:W.stats(l,t),queryFn:()=>q.stats(l,t),staleTime:30*1e3,enabled:c&&!!t})}const J="_container_1h8ny_1",X="_content_1h8ny_7",Z="_header_1h8ny_13",ee="_titleContainer_1h8ny_19",se="_title_1h8ny_19",ae="_subtitle_1h8ny_33",te="_topGrid_1h8ny_43",ne="_previewCard_1h8ny_50",ie="_downloadActions_1h8ny_61",re="_metricsColumn_1h8ny_68",oe="_section_1h8ny_74",ce="_sectionTitle_1h8ny_80",le="_chartCard_1h8ny_87",de="_chartPlaceholder_1h8ny_94",he="_listsGrid_1h8ny_103",ue="_listCard_1h8ny_109",me="_rankedList_1h8ny_119",_e="_rankedRow_1h8ny_128",xe="_rankedLabel_1h8ny_142",ye="_rankedPct_1h8ny_150",pe="_rankedValue_1h8ny_156",je="_empty_1h8ny_162",fe="_errorState_1h8ny_169",s={container:J,content:X,header:Z,titleContainer:ee,title:se,subtitle:ae,topGrid:te,previewCard:ne,downloadActions:ie,metricsColumn:re,section:oe,sectionTitle:ce,chartCard:le,chartPlaceholder:de,listsGrid:he,listCard:ue,rankedList:me,rankedRow:_e,rankedLabel:xe,rankedPct:ye,rankedValue:pe,empty:je,errorState:fe},Ce=t=>{const i=String(t).split("-");return i.length===3?`${i[2]}/${i[1]}`:t};function Se(){var C,g,N,b,v,k,T;const{id:t}=G(),i=D(),c=`${F()}/utils/qr-code`,{data:o,isLoading:y,isError:u}=O(t),{data:p,isLoading:d}=H(t),n=(C=o==null?void 0:o.data)!=null?C:null,a=(g=p==null?void 0:p.data)!=null?g:null,h=j.useMemo(()=>{var r;return(r=a==null?void 0:a.scansLast30Days)!=null?r:[]},[a]),Q=j.useMemo(()=>({categories:h.map(r=>Ce(r.date)),series:h.map(r=>{var m;return Number((m=r.scans)!=null?m:0)})}),[h]),B=j.useMemo(()=>h.reduce((r,m)=>{var w;return r+Number((w=m.scans)!=null?w:0)},0),[h]);return u?e.jsxs(P,{children:[e.jsx(S,{title:"QR Code"}),e.jsxs("div",{className:s.errorState,role:"alert",children:[e.jsx(I,{size:32,"aria-hidden":"true"}),e.jsx("p",{children:"QR Code não encontrado ou sem acesso."}),e.jsx(f,{variant:"primary",onClick:()=>i(c),children:"Voltar"})]})]}):e.jsxs(P,{children:[e.jsx(S,{title:n!=null&&n.name?`QR Code — ${n.name}`:"Estatísticas do QR Code"}),e.jsx("div",{className:s.container,children:e.jsxs("div",{className:s.content,children:[e.jsxs("div",{className:s.header,children:[e.jsx(z,{to:c,label:"Voltar para a lista"}),e.jsxs("div",{className:s.titleContainer,children:[e.jsx("h1",{className:s.title,children:(N=n==null?void 0:n.name)!=null?N:"QR Code"}),e.jsx("p",{className:s.subtitle,children:n==null?void 0:n.destinationUrl})]})]}),e.jsxs("div",{className:s.topGrid,children:[e.jsx("section",{className:s.previewCard,children:n?e.jsxs(e.Fragment,{children:[e.jsx(Y,{data:n.encodedUrl||n.trackedUrl,design:n.designConfig||{},size:220}),e.jsxs("div",{className:s.downloadActions,children:[e.jsx(f,{variant:"outline",size:"sm",icon:e.jsx(L,{}),onClick:()=>R(n,"png"),children:"Baixar PNG"}),e.jsx(f,{variant:"outline",size:"sm",icon:e.jsx(L,{}),onClick:()=>R(n,"svg"),children:"Baixar SVG"})]})]}):null}),e.jsxs("div",{className:s.metricsColumn,children:[e.jsx(_,{title:"Total de leituras",value:(b=a==null?void 0:a.totalScans)!=null?b:0,icon:$,color:"primary",subtitle:"Desde a criação",loading:d}),e.jsx(_,{title:"Últimos 30 dias",value:B,icon:M,color:"info",subtitle:"Scans no período",loading:d}),e.jsx(_,{title:"Cidades alcançadas",value:(k=(v=a==null?void 0:a.topCities)==null?void 0:v.length)!=null?k:0,icon:V,color:"success",subtitle:"Distintas",loading:d}),Number((T=a==null?void 0:a.scansWhileInactive)!=null?T:0)>0&&e.jsx(_,{title:"Leituras com QR desativado",value:a.scansWhileInactive,icon:K,color:"warning",subt
1itle:"Material ainda em circulação",loading:d})]})]}),e.jsxs("section",{className:s.section,children:[e.jsx("h2",{className:s.sectionTitle,children:"Leituras nos últimos 30 dias"}),e.jsx("div",{className:s.chartCard,children:d||y?e.jsx("div",{className:s.chartPlaceholder,children:"Carregando…"}):e.jsx(U,{data:Q,height:280})})]}),e.jsxs("div",{className:s.listsGrid,children:[e.jsxs("section",{className:s.listCard,children:[e.jsx("h2",{className:s.sectionTitle,children:"Top países"}),e.jsx(x,{items:a==null?void 0:a.topCountries,labelKey:"country",emptyText:"Sem leituras ainda."})]}),e.jsxs("section",{className:s.listCard,children:[e.jsx("h2",{className:s.sectionTitle,children:"Top estados"}),e.jsx(x,{items:a==null?void 0:a.topStates,labelKey:"state",emptyText:"Sem leituras ainda."})]}),e.jsxs("section",{className:s.listCard,children:[e.jsx("h2",{className:s.sectionTitle,children:"Top cidades"}),e.jsx(x,{items:a==null?void 0:a.topCities,labelKey:"city",formatLabel:r=>r.state?`${r.city} — ${r.state}`:r.city,emptyText:"Sem leituras ainda."})]}),e.jsxs("section",{className:s.listCard,children:[e.jsx("h2",{className:s.sectionTitle,children:"Origem (referrer)"}),e.jsx(x,{items:a==null?void 0:a.referrers,labelKey:"source",emptyText:"Sem leituras ainda."})]})]})]})})]})}function x({items:t,labelKey:i,emptyText:l,formatLabel:c}){return!t||t.length===0?e.jsx("p",{className:s.empty,children:l}):e.jsx("ul",{className:s.rankedList,children:t.slice(0,8).map((o,y)=>{var u;return e.jsxs("li",{className:s.rankedRow,children:[e.jsx("span",{className:s.rankedLabel,children:c?c(o):o[i]}),e.jsxs("span",{className:s.rankedPct,children:[Math.round(o.percentage),"%"]}),e.jsx("span",{className:s.rankedValue,children:Number((u=o.scans)!=null?u:0).toLocaleString("pt-BR")})]},`${o[i]}-${y}`)})})}export{Se 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.