PageSourceSearch

https://gemr.com.br/assets/DashboardPage-Ckx8BL5G.js

js gemr.com.br collected 2026-10-02 00:44:32 UTC 13,320 bytes, 1 lines download raw bytes

1import{r,p as H,c as y,g as V,j as t,b as A,x as w,I as Z}from"./index-CFVpjUXR.js";import{e as f}from"./Calendar.es-BGD3jJjL.js";import{c as j}from"./CheckCircle.es-VrsrE652.js";import{c as k}from"./CircleNotch.es-Bn7kR9Y7.js";import{t as E}from"./IdentificationCard.es-DE4-zBQK.js";import{o as L}from"./UserMinus.es-C5fowSl9.js";import{u as M}from"./useQuery-Dy5EPh7-.js";const $=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M220.49,59.51l-40-40A12,12,0,0,0,172,16H92A20,20,0,0,0,72,36V56H56A20,20,0,0,0,36,76V216a20,20,0,0,0,20,20H164a20,20,0,0,0,20-20V196h20a20,20,0,0,0,20-20V68A12,12,0,0,0,220.49,59.51ZM160,212H60V80h67l33,33Zm40-40H184V108a12,12,0,0,0-3.51-8.49l-40-40A12,12,0,0,0,132,56H96V40h71l33,33Zm-56-28a12,12,0,0,1-12,12H88a12,12,0,0,1,0-24h44A12,12,0,0,1,144,144Zm0,40a12,12,0,0,1-12,12H88a12,12,0,0,1,0-24h44A12,12,0,0,1,144,184Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M208,72V184a8,8,0,0,1-8,8H176V104L136,64H80V40a8,8,0,0,1,8-8h80Z",opacity:"0.2"}),r.createElement("path",{d:"M213.66,66.34l-40-40A8,8,0,0,0,168,24H88A16,16,0,0,0,72,40V56H56A16,16,0,0,0,40,72V216a16,16,0,0,0,16,16H168a16,16,0,0,0,16-16V200h16a16,16,0,0,0,16-16V72A8,8,0,0,0,213.66,66.34ZM168,216H56V72h76.69L168,107.31v84.53c0,.06,0,.11,0,.16s0,.1,0,.16V216Zm32-32H184V104a8,8,0,0,0-2.34-5.66l-40-40A8,8,0,0,0,136,56H88V40h76.69L200,75.31Zm-56-32a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h48A8,8,0,0,1,144,152Zm0,32a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h48A8,8,0,0,1,144,184Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M213.66,66.34l-40-40A8,8,0,0,0,168,24H88A16,16,0,0,0,72,40V56H56A16,16,0,0,0,40,72V216a16,16,0,0,0,16,16H168a16,16,0,0,0,16-16V200h16a16,16,0,0,0,16-16V72A8,8,0,0,0,213.66,66.34ZM136,192H88a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm0-32H88a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm64,24H184V104a8,8,0,0,0-2.34-5.66l-40-40A8,8,0,0,0,136,56H88V40h76.69L200,75.31Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M212.24,67.76l-40-40A6,6,0,0,0,168,26H88A14,14,0,0,0,74,40V58H56A14,14,0,0,0,42,72V216a14,14,0,0,0,14,14H168a14,14,0,0,0,14-14V198h18a14,14,0,0,0,14-14V72A6,6,0,0,0,212.24,67.76ZM170,216a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2h77.51L170,106.49Zm32-32a2,2,0,0,1-2,2H182V104a6,6,0,0,0-1.76-4.24l-40-40A6,6,0,0,0,136,58H86V40a2,2,0,0,1,2-2h77.51L202,74.49Zm-60-32a6,6,0,0,1-6,6H88a6,6,0,0,1,0-12h48A6,6,0,0,1,142,152Zm0,32a6,6,0,0,1-6,6H88a6,6,0,0,1,0-12h48A6,6,0,0,1,142,184Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M213.66,66.34l-40-40A8,8,0,0,0,168,24H88A16,16,0,0,0,72,40V56H56A16,16,0,0,0,40,72V216a16,16,0,0,0,16,16H168a16,16,0,0,0,16-16V200h16a16,16,0,0,0,16-16V72A8,8,0,0,0,213.66,66.34ZM168,216H56V72h76.69L168,107.31v84.53c0,.06,0,.11,0,.16s0,.1,0,.16V216Zm32-32H184V104a8,8,0,0,0-2.34-5.66l-40-40A8,8,0,0,0,136,56H88V40h76.69L200,75.31Zm-56-32a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h48A8,8,0,0,1,144,152Zm0,32a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h48A8,8,0,0,1,144,184Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M210.83,69.17l-40-40A4,4,0,0,0,168,28H88A12,12,0,0,0,76,40V60H56A12,12,0,0,0,44,72V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V196h20a12,12,0,0,0,12-12V72A4,4,0,0,0,210.83,69.17ZM172,216a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4h78.34L172,105.66Zm32-32a4,4,0,0,1-4,4H180V104a4,4,0,0,0-1.17-2.83l-40-40A4,4,0,0,0,136,60H84V40a4,4,0,0,1,4-4h78.34L204,73.66Zm-64-32a4,4,0,0,1-4,4H88a4,4,0,0,1,0-8h48A4,4,0,0,1,140,152Zm0,32a4,4,0,0,1-4,4H88a4,4,0,0,1,0-8h48A4,4,0,0,1,140,184Z"}))]]),N=r.forwardRef((a,e)=>r.createElement(H,{ref:e,...a,weights:$}));N.displayName="FilesIcon";function F(){const a=y.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e={queryKey:["dashboard"],queryFn:D},a[0]=e):e=a[0],M(e)}async function D(){return(await V("/api/dashboard")).data}const R=new Intl.DateTimeFormat("pt-BR",{timeZone:"UTC"});function b(a){const e=y.c(15),{label:u,value:h,icon:x,color:g,background:o}=a,i=`flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl ${o} ${g}`;let l;e[0]!==x?(l=t.jsx(x,{size:28,weight:"duotone"}),e[0]=x,e[1]=l):l=e[1];let s;
1e[2]!==i||e[3]!==l?(s=t.jsx("div",{className:i,children:l}),e[2]=i,e[3]=l,e[4]=s):s=e[4];let d;e[5]!==u?(d=t.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:u}),e[5]=u,e[6]=d):d=e[6];let c;e[7]!==h?(c=t.jsx("p",{className:"text-3xl font-black text-[#111118] dark:text-white",children:h}),e[7]=h,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=t.jsxs("div",{children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let n;return e[12]!==s||e[13]!==m?(n=t.jsxs("div",{className:"flex items-center gap-5 rounded-2xl border border-gray-100 bg-white p-5 shadow-sm dark:border-white/5 dark:bg-[#111128]",children:[s,m]}),e[12]=s,e[13]=m,e[14]=n):n=e[14],n}function v(a){const e=y.c(9),{title:u,items:h,dateField:x,emptyMessage:g}=a;let o;e[0]!==u?(o=t.jsx("h3",{className:"border-b border-gray-100 px-5 py-4 font-bold text-gray-900 dark:border-white/5 dark:text-white",children:u}),e[0]=u,e[1]=o):o=e[1];let i;e[2]!==x||e[3]!==g||e[4]!==h?(i=h.length===0?t.jsx("p",{className:"px-5 py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:g}):t.jsx("ul",{className:"divide-y divide-gray-100 dark:divide-white/5",children:h.map(s=>{const d=s[x],c=s.section??s.sections?.join(", ");return t.jsxs("li",{className:"flex items-center justify-between gap-4 px-5 py-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-semibold text-gray-900 dark:text-white",children:s.name}),t.jsx("p",{className:"truncate text-xs text-gray-500 dark:text-gray-400",children:[c,s.branch].filter(Boolean).join(" · ")||"Sem seção"})]}),d&&t.jsx("time",{className:"shrink-0 text-sm font-bold text-amber-600 dark:text-amber-400",children:R.format(new Date(`${d}T00:00:00Z`))})]},`${s.id}-${x}`)})}),e[2]=x,e[3]=g,e[4]=h,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i?(l=t.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white shadow-sm dark:border-white/5 dark:bg-[#111128]",children:[o,i]}),e[6]=o,e[7]=i,e[8]=l):l=e[8],l}const B=()=>{const a=y.c(22),{data:e,isLoading:u,isError:h,refetch:x}=F();let g;a[0]!==e?.directorate?.sections?(g=e?.directorate?.sections.reduce(S,{youth:0,adults:0}),a[0]=e?.directorate?.sections,a[1]=g):g=a[1];const o=g;if(u){let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center justify-center gap-3 p-16 text-gray-500 dark:text-gray-400",children:[t.jsx(k,{size:24,className:"animate-spin"}),t.jsx("span",{children:"Carregando seu painel..."})]}),a[2]=n):n=a[2],n}if(h||!e){let n;a[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("p",{className:"font-bold",children:"Não foi possível carregar a dashboard."}),a[3]=n):n=a[3];let p;return a[4]!==x?(p=t.jsx("div",{className:"p-4 md:p-8",children:t.jsxs("div",{className:"rounded-2xl border border-red-200 bg-red-50 p-6 text-red-700 dark:border-red-500/20 dark:bg-red-500/10 dark:text-red-300",children:[n,t.jsx("button",{className:"mt-3 text-sm font-bold underline",onClick:()=>{x()},children:"Tentar novamente"})]})}),a[4]=x,a[5]=p):p=a[5],p}let i;a[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("header",{children:[t.jsx("h1",{className:"mb-2 text-3xl font-black text-[#111118] dark:text-white",children:"Dashboard"}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Informações importantes para os seus perfis no grupo."})]}),a[6]=i):i=a[6];let l;a[7]!==e.scoutLeader?(l=e.scoutLeader&&t.jsxs("section",{"aria-labelledby":"dashboard-escotista",children:[t.jsx("h2",{id:"dashboard-escotista",className:"mb-4 text-lg font-bold text-gray-900 dark:text-white",children:"Escotista"}),t.jsxs("div",{className:"mb-5 grid grid-cols-1 gap-5 sm:grid-cols-2 xl:grid-cols-5",children:[t.jsx(b,{label:"Pedidos feitos",value:e.scoutLeader.badgeRequests,icon:A,color:"text-primary",background:"bg-primary/10"}),t.jsx(b,{label:"Prontos para entrega",value:e.scoutLeader.readyForDelivery,icon:j,color:"text-green-600",background:"bg-green-50 dark:bg-green-500/10"}),t.jsx(b,{label:"Jovens isentos",value:e.scoutLeader.exemptYouth,icon:w,color:"text-blue-600",background:"bg-blue-50 dark:bg-blue-500/10"}),t.jsx(b,{label:"Registros a vencer",value:e.scoutLeader.expiringRegistrations,icon:E,color:"text-amber-600",background:"bg-amber-50 dark:bg-amber-500/10"}),t.jsx(b,{label:"Próximos eventos",value:e.scoutLeader.upcomingEvents,icon:f,color:"text-violet-600",background:"bg-violet-50 dark:bg-violet-500/10"})]}),t.jsx(v,{title:"Jovens próximos da idade máxima do ramo",items:e.scoutLeader.agingOutYouth,dateField:"transitionDate",emptyMessage:"Nenhum jovem próximo do Caminho ou da Partida"})]}),a[7]=e.scoutLeader,a[8]=l):l=a[8];let s;a[9]!==e.secretary?(s=e.secretary&&t.jsxs("section",{"aria-labelledby":"dashboard-secretaria",children:[t.jsx("h2",{id:"dashboard-secretaria",className:"mb-4 text-lg font-bold text-gray-900 dark:text-white",children:"Secretaria"}),t.jsxs("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 xl:grid-cols-3",children:[t.jsx(b,{label:"Certificados pendentes",value:e.secretary.pendingCertificates,icon:Z,color:"text-amber-600",background:"bg-amber-50 dark:bg-amber-500/10"}),t.jsx(b,{label:"Aguardando entrega",value:e.secretary.toDeliver,icon:j,color:"text-green-600",background:"bg-green-50 dark:bg-green-500/10"}),t.jsx(b,{label:"Aguardando geração",value:e.secretary.toGenerate,icon:k,color:"text-blue-600",background:"bg-blue-50 dark:bg-blue-500/10"})]})]}),a[9]=e.secretary,a[10]=s):s=a[10];let d;a[11]!==e.directorate||a[12]!==o?.adults||a[13]!==o?.youth?(d=e.directorate&&t.jsxs("section",{"aria-labelledby":"dashboard-diretoria",className:"space-y-5",children:[t.jsx("h2",{id:"dashboard-diretoria",className:"text-lg font-bold text-gray-900 dark:text-white",children:"Diretoria"}),t.jsxs("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:[t.jsx(b,{label:"Documentos publicados",value:e.directorate.documents,icon:N,color:"text-pink-600",background:"bg-pink-50 dark:bg-pink-500/10"}),t.jsx(b,{label:"Próximos eventos",value:e.directorate.upcomingEvents,icon:f,color:"text-violet-600",background:"bg-violet-50 dark:bg-violet-500/10"})]}),t.jsxs("div",{className:"overflow-hidden rounded-2xl border border-gray-100 bg-white shadow-sm dark:border-white/5 dark:bg-[#111128]",children:[t.jsx("h3",{className:"border-b border-gray-100 px-5 py-4 font-bold text-gray-900 dark:border-white/5 dark:text-white",children:"Membros por seção"}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left text-sm",children:[t.jsx("thead",{className:"bg-gray-50 text-xs uppercase text-gray-500 dark:bg-white/5 dark:text-gray-400",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-5 py-3",children:"Seção"}),t.jsx("th",{className:"px-5 py-3",children:"Ramo"}),t.jsx("th",{className:"px-5 py-3 text-center",children:"Jovens"}),t.jsx("th",{className:"px-5 py-3 text-center",children:"Adultos"})]})}),t.jsxs("tbody",{className:"divide-y divide-gray-100 dark:divide-white/5",children:[e.directorate.sections.map(C),t.jsxs("tr",{children:[t.jsx("td",{className:"px-5 py-3 font-semibold text-gray-900 dark:text-white",children:"Dirigentes"}),t.jsx("td",{className:"px-5 py-3 text-gray-500 dark:text-gray-400",children:"Diretoria"}),t.jsx("td",{className:"px-5 py-3 text-center font-bold",children:"0"}),t.jsx("td",{className:"px-5 py-3 text-center font-bold",children:e.directorate.directors})]})]}),t.jsx("tfoot",{className:"border-t-2 border-gray-200 bg-gray-50 font-black text-gray-900 dark:border-white/10 dark:bg-white/5 dark:text-white",children:t.jsxs("tr",{children:[t.jsx("td",{className:"px-5 py-3",colSpan:2,children:"Total geral"}),t.jsx("td",{className:"px-5 py-3 text-center",children:o?.youth??0}),t.jsx("td",{className:"px-5 py-3 text-center",children:(o?.adults??0)+e.directorate.directors})]})})]})})]}),t.jsx(v,{title:"Registros com vencimento próximo",items:e.directorate.expiringMembers,dateField:"validUntil",emptyMessage:"Nenhum registro vence nos próximos quatro meses."})]}),a[11]=e.directorate,a[12]=o?.adults,a[13]=o?.youth,a[14]=d):d=a[14];let c;a[15]!==e.profiles.length?(c=e.profiles.length===0&&t.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white p-8 text-center dark:border-white/5 dark:bg-[#111128]",children:[t.jsx(L,{size:36,className:"mx-auto mb-3 text-gray-400"}),t.jsx("p",{className:"font-bold text-gray-900 dark:text-white",children:"Seu usuário ainda não possui um perfil de atuação."})]}),a[15]=e.profiles.length,a[16]=c):c=a[16];let m;return a[17]!==l||a[18]!==s||a[19]!==d||a[20]!==c?(m=t.jsxs("div",{className:"space-y-8 p-4 md:p-8",children:[i,l,s,d,c]}),a[17]=l,a[18]=s,a[19]=d,a[20]=c,a[21]=m):m=a[21],m};function S(a,e){return{youth:a.youth+e.youth,adults:a.adults+e.adults}}function C(a){return t.jsxs("tr",{children:[t.jsx("td",{className:"px-5 py-3 font-semibold text-gray-900 dark:text-white",children:a.name}),t.jsx("td",{className:"px-5 py-3 text-gray-500 dark:text-gray-400",children:a.branch}),t.jsx("td",{className:"px-5 py-3 text-center font-bold",children:a.youth}),t.jsx("td",{className:"px-5 py-3 text-center font-bold",children:a.adults})]},a.id)}export{B 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.