1import{c as U,m as Ve,t as o,r as s,a as l,j as e}from"./index-EDpPT5Rr.js";import{P as He,a as Je}from"./PortalPage-D914YfKG.js";import{C as we,I as _e,i as Ge}from"./InstitutionalVisuals-D49IX5it.js";import{B as ze}from"./badge-BaBdCDoZ.js";import{B as n}from"./button-DVgpAuPA.js";import{C as We}from"./checkbox-BRT5T2L8.js";import{S as Xe,I as w,p as Se,D as le,a as de,b as xe,c as pe,g as Ye}from"./DashboardLayout-aDWHwE81.js";import{L as Ze}from"./label-LyjaPYgw.js";import{T as ke}from"./textarea--uOQJa_K.js";import{u as et}from"./useAuth-DM3cRT1e.js";import{P as Ie}from"./plus-C4abld4K.js";import{A as tt}from"./accessibility-BZqt5LM7.js";import{C as at}from"./clock-3-CtoyaQ6q.js";import{C as Me,L as st}from"./list-tree-br7l2hXu.js";import{D as nt}from"./download-CCGdaNwk.js";import{T as rt}from"./trash-2-Cokl_UuG.js";import"./compass-DVa-IKLz.js";import"./shield-check-B8xKLMsz.js";import"./map-BT16Bc6L.js";import"./Combination-0SnIBMFZ.js";import"./route-BVQDn-tX.js";import"./badge-check-BT_PSB6j.js";import"./index-DcrJeVzX.js";import"./check-C8Mgguj3.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ot=U("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const it=U("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 12 * @license lucide-react v0.453.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const ct=U("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 17 * @license lucide-react v0.453.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const lt=U("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),ue=x=>x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),Pe=x=>Math.max(.9,Math.min(1.3,Number(x.toFixed(2))));function Ot(){const{user:x}=et(),{preferences:dt,updatePreferences:xt}=Ve(),z=o.useUtils(),u=x?.role==="admin",S=o.content.list.useQuery(void 0,{enabled:!!x}),Q=o.content.categories.useQuery(void 0,{enabled:!!x}),Ae=o.cohorts.list.useQuery(void 0,{enabled:u}),me=o.profile.learner.useQuery(void 0,{enabled:!!x}),[r,K]=s.useState(null),[Ee,b]=s.useState(!1),[c,q]=s.useState(null),[Te,V]=s.useState(!1),[H,Re]=s.useState(""),[y,ge]=s.useState("all"),[k,Oe]=s.useState("all"),[I,De]=s.useState("all"),[h,Fe]=s.useState("curriculum"),[Be,p]=s.useState(1),[M,be]=s.useState(!1),[C,J]=s.useState(!1),[f,ye]=s.useState(1),[P,he]=s.useState(""),[A,_]=s.useState(""),[E,T]=s.useState(""),[R,G]=s.useState(""),[W,X]=s.useState(""),[Ce,Y]=s.useState(""),[Z,ee]=s.useState(""),[fe,te]=s.useState("30"),[ae,se]=s.useState([]),O=s.useRef(null),i=o.content.open.useQuery({contentId:r??0},{enabled:!!r,retry:!1}),D=o.content.attachments.useQuery({contentId:r??0},{enabled:!!r&&!!i.data}),d=o.content.open.useQuery({contentId:c??0},{enabled:!!c}),ne=o.content.assignments.useQuery({contentId:c??0},{enabled:!!c}),L=s.useMemo(()=>[...(S.data??[]).filter(a=>(y==="all"||String(a.categoryId)===y)&&(k==="all"||a.curriculumLevel===k)&&(I==="all"||a.status===I)&&`${a.title} ${a.summary||""} ${a.categoryName} ${a.externalResourceLabel||""}`.toLowerCase().includes(H.toLowerCase()))].sort((a,g)=>
21h==="title"?a.title.localeCompare(g.title,"pt-BR"):h==="duration"?a.estimatedMinutes-g.estimatedMinutes:h==="recent"?new Date(g.updatedAt).getTime()-new Date(a.updatedAt).getTime():0),[S.data,y,k,I,H,h]),F=9,j=Math.max(1,Math.ceil(L.length/F)),v=Math.min(Be,j),re=(v-1)*F,$e=L.slice(re,re+F),m=S.data??[],N=r?m.findIndex(t=>t.id===r):-1,B=N>0?m[N-1]:null,$=N>=0&&N<m.length-1?m[N+1]:null,Le=o.content.createCategory.useMutation({onSuccess:()=>{he(""),V(!1),z.content.categories.invalidate(),l.success("Categoria criada.")},onError:t=>l.error(t.message)}),je=o.content.create.useMutation({onSuccess:()=>{b(!1),z.content.list.invalidate(),l.success("Conteúdo publicado e atribuÃdo à s turmas indicadas.")},onError:t=>l.error(t.message)}),ve=o.content.update.useMutation({onSuccess:()=>{b(!1),q(null),z.content.list.invalidate(),l.success("Conteúdo e permissões atualizados.")},onError:t=>l.error(t.message)}),oe=o.content.prepareAttachmentUpload.useMutation(),ie=o.content.confirmAttachment.useMutation(),Ue=o.content.removeAttachment.useMutation({onSuccess:()=>{D.refetch(),l.success("Referência do anexo removida.")},onError:t=>l.error(t.message)}),ce=t=>{K(t),be(!1),J(!1)},Qe=t=>se(a=>a.includes(t)?a.filter(g=>g!==t):[...a,t]),Ne=()=>{q(null),_(""),T(""),G(""),X(""),Y(""),ee(""),te("30"),se([])};s.useEffect(()=>{d.data&&c&&(_(d.data.title),T(d.data.slug),G(String(d.data.categoryId)),X(d.data.summary||""),Y(d.data.body||""),ee(d.data.visualIcon||""),te(String(d.data.estimatedMinutes)))},[d.data,c]),s.useEffect(()=>{ne.data&&c&&se(ne.data.map(t=>t.cohortId))},[ne.data,c]),s.useEffect(()=>{const t=Number(window.sessionStorage.getItem("cfi-open-content-id"));t>0&&(K(t),window.sessionStorage.removeItem("cfi-open-content-id"))},[]),s.useEffect(()=>{const t=r&&i.data?.externalResourceUrl?{contentId:r,url:i.data.externalResourceUrl,label:i.data.externalResourceLabel||"Abrir recurso correspondente no e-book"}:null;return window.dispatchEvent(new CustomEvent("cfi-module-ebook-context",{detail:t})),()=>{window.dispatchEvent(new CustomEvent("cfi-module-ebook-context",{detail:null}))}},[r,i.data?.externalResourceUrl,i.data?.externalResourceLabel]);const Ke=async t=>{if(r){if(t.size>50*1024*1024){l.error("O limite para anexos oficiais é de 50 MB.");return}try{const a=await oe.mutateAsync({contentId:r,fileName:t.name,mimeType:t.type||"application/octet-stream",byteSize:t.size});if(!(await fetch(a.uploadUrl,{method:"PUT",headers:{"Content-Type":t.type||"application/octet-stream"},body:t})).ok)throw new Error("Não foi possÃvel publicar o arquivo no armazenamento institucional.");await ie.mutateAsync({contentId:r,fileName:a.safeFileName,storageKey:a.key,mimeType:t.type||"application/octet-stream",byteSize:t.size}),D.refetch(),l.success("Anexo oficial publicado.")}catch(a){l.error(a instanceof Error?a.message:"Falha ao publicar o anexo.")}finally{O.current&&(O.current.value="")}}},qe=()=>{const t={categoryId:Number(R),title:A,slug:E,summary:W||void 0,body:Ce||void 0,visualIcon:Z||void 0,format:"module",status:"published",estimatedMinutes:Number(fe),cohortIds:ae};c?ve.mutate({...t,contentId:c}):je.mutate(t)};return e.jsxs(He,{"data-loc":"client/src/pages/ContentLibrary.tsx:39",children:[e.jsx("a",{"data-loc":"client/src/pages/ContentLibrary.tsx:39",href:"#acervo-principal",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-forest focus:px-4 focus:py-2 focus:text-cream",children:"Ir para os módulos autorizados"}),e.jsx(Je,{"data-loc":"client/src/pages/ContentLibrary.tsx:39",eyebrow:"Jornada didática controlada",title:"Conteúdos CFI-COVANT",description:u?"Organize o acervo, as trilhas de leitura e as atribuições por turma sem alterar os controles institucionais.":"Navegue por módulos autorizados, acompanhe a leitura institucional e use recursos de foco e briefing.",action:u?e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:39",className:"flex gap-2",children:[e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:39",variant:"outline",onClick:()=>V(!0),children:"Nova categoria"}),e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:39",onClick:()=>{Ne(),b(!0)},children:[e.jsx(Ie,{"data-loc":"client/src/pages/ContentLibrary.tsx:39",className:"mr-2 size-4"}),"Novo conteúdo"]})]}):e.jsxs(ze,{"data-loc":"client/src/pages/ContentLibrary.tsx:39",className:"w-fit bg-forest text-cream hover:bg-forest",children:[me.data?.progress.percentage??0,"% de leitura institucional"]})}),e.jsxs("section",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"paper-card mt-6 rounded-2xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"eyebrow",children:"Trilha de aprendizagem"}),e.jsx("h2",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"mt-1 font-serif text-2xl font-bold text-forest",children:"Aprender por módulos e partes"}),e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"mt-2 max-w-2xl text-sm leading-6 text-moss",children:"As categorias funcionam como partes didáticas. O conteúdo permanece visÃvel apenas quando a turma e o perfil estão autorizados no servidor."})]}),e.jsxs("label",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"relative block w-full xl:w-80",children:[e.jsx(Xe,{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"pointer-events-none absolute left-3 top-3 size-4 text-moss"}),e.jsx(w,{"data-loc":"client/src/pages/ContentLibrary.tsx:40","aria-label":"Buscar nos módulos autorizados",className:"pl-9",value:H,onChange:t=>{Re(t.target.value),p(1)},placeholder:"Buscar módulo, capÃtulo ou e-book"})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"mt-5 flex gap-2 overflow-x-auto pb-1",role:"tablist","aria-label":"Partes da trilha didática",children:[e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:40",size:"sm",variant:y==="all"?"default":"outline",onClick:()=>{ge("all"),p(1)},children:["Todos (",m.length,")"]}),Q.data?.filter(t=>m.some(a=>a.categoryId===t.id)).map(t=>e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:40",size:"sm",variant:y===String(t.id)?"default":"outline",onClick:()=>{ge(String(t.id)),p(1)},children:t.name},t.id))]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",className:"catalog-advanced-filters",role:"group","aria-label":"Filtros avançados do acervo",children:[e.jsxs("label",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:[e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:"NÃvel didático"}),e.jsxs("select",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:k,onChange:t=>{Oe(t.target.value),p(1)},children:[e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"all",children:"Todos os nÃveis"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"module",children:"Módulos"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"chapter",children:"CapÃtulos"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"subdivision",children:"Subdivisões"})]})]}),e.jsxs("label",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:[e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:"Publicação"}),e.jsxs("select",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:I,onChange:t=>{De(t.target.value),p(1)},children:[e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"all",children:"Todos os estados"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"published",children:"Publicados"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"draft",children:"Rascunhos"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"archived",children:"Arquivados"})]})]}),e.jsxs("label",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:[e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",children:"Ordenar por"}),e.jsxs("select",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:h,onChange:t=>{Fe(t.target.value),p(1)},children:[e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"curriculum",children:"Sequência curricular"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"title",children:"TÃtulo"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"duration",children:"Duração"}),e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:40",value:"recent",children:"Atualização recente"})]})]})]})]}),e.jsxs("main",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",
21id:"acervo-principal",className:"mt-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"text-sm text-moss",children:[L.length," registro(s) autorizado(s) · Página ",v," de ",j,"."]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"inline-flex items-center gap-2 rounded-full border border-sand bg-white/50 px-3 py-1.5 text-xs text-moss",children:[e.jsx(tt,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"size-3.5 text-gold"}),"Leitura com foco, contraste e tamanho de texto"]})]}),e.jsx("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"curriculum-registry-grid",children:S.isLoading?e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"text-sm text-moss",children:"Carregando conteúdo autorizadoâ¦"}):L.length?$e.map((t,a)=>e.jsxs("article",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"paper-card flex min-h-0 flex-col overflow-hidden rounded-2xl","aria-labelledby":`modulo-${t.id}-titulo`,children:[e.jsx(we,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",categoryName:t.categoryName,iconKey:t.visualIcon,compact:!0}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"flex flex-1 flex-col p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"flex items-start justify-between gap-3",children:[e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"grid size-10 shrink-0 place-items-center rounded-lg bg-forest text-cream",children:e.jsx(_e,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",iconKey:t.visualIcon,className:"size-5"})}),e.jsx(ze,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",variant:t.status==="published"?"secondary":"outline",children:t.status==="published"?"Publicado":t.status})]}),e.jsxs("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mt-5 text-xs font-semibold uppercase tracking-[.13em] text-gold",children:["Parte ",t.categoryName]}),e.jsxs("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mt-2 font-mono text-[10px] uppercase tracking-[.12em] text-moss",children:[t.curriculumLevel==="module"?"Módulo":t.curriculumLevel==="chapter"?"CapÃtulo":"Subdivisão"," ",String(re+a+1).padStart(2,"0")]}),e.jsx("h2",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",id:`modulo-${t.id}-titulo`,className:"mt-1 font-serif text-2xl font-bold leading-tight text-forest",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mt-3 line-clamp-3 text-sm leading-6 text-moss",children:t.summary||"Descrição ainda não cadastrada."}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mt-auto flex flex-wrap items-center justify-between gap-3 pt-5",children:[e.jsxs("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"flex items-center gap-1 text-xs text-moss",children:[e.jsx(at,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"size-3.5"}),t.estimatedMinutes," min"]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"flex gap-2",children:[e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",size:"sm",variant:"outline",onClick:()=>ce(t.id),children:"Ler módulo"}),u&&e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",size:"sm",onClick:()=>{q(t.id),b(!0)},children:"Editar"})]})]})]})]},t.id)):e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"paper-card col-span-full rounded-2xl p-10 text-center",children:[e.jsx(ot,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mx-auto size-7 text-gold"}),e.jsx("h2",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mt-3 font-serif text-2xl font-bold text-forest",children:"Nenhum módulo nesta visualização"}),e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mx-auto mt-2 max-w-md text-sm leading-6 text-moss",children:"Ajuste os filtros ou solicite ao Administrador a atribuição do conteúdo à turma correspondente."})]})}),L.length>F?e.jsxs("nav",{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"catalog-pagination","aria-label":"Paginação do acervo",children:[e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",variant:"outline",onClick:()=>p(t=>Math.max(1,t-1)),disabled:v===1,children:[e.jsx(Me,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"mr-1 size-4"}),"Anterior"]}),e.jsxs("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:41","aria-live":"polite",children:["Página ",v," de ",j]}),e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",variant:"outline",onClick:()=>p(t=>Math.min(j,t+1)),disabled:v===j,children:["Próxima",e.jsx(Se,{"data-loc":"client/src/pages/ContentLibrary.tsx:41",className:"ml-1 size-4"})]})]}):null]}),e.jsx(le,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",open:!!r,onOpenChange:t=>{t||(K(null),J(!1))},children:e.jsxs(de,{"data-loc":"client/src/pages/ContentLibrary.tsx:42","data-cfi-module-reader":"true",className:C?"max-w-6xl":"max-w-4xl",children:[e.jsx(xe,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",children:e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex flex-wrap items-start justify-between gap-3 pr-8",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"eyebrow",children:M?"Modo briefing":"Leitura didática"}),e.jsx(pe,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mt-1 font-serif text-2xl text-forest",children:i.data?.title||"Carregando módulo"})]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex flex-wrap gap-2",children:[e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"sm",variant:M?"default":"outline",onClick:()=>be(t=>!t),children:M?"Leitura completa":"Modo briefing"}),e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"icon",variant:"outline","aria-label":"Diminuir tamanho do texto",disabled:f<=.9,onClick:()=>ye(t=>Pe(t-.1)),children:e.jsx(lt,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-4"})}),e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"sm",variant:"outline","aria-label":"Tamanho atual do texto",children:[Math.round(f*100),"%"]}),e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"icon",variant:"outline","aria-label":"Aumentar tamanho do texto",disabled:f>=1.3,onClick:()=>ye(t=>Pe(t+.1)),children:e.jsx(Ie,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-4"})}),e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"icon",variant:C?"default":"outline","aria-label":C?"Sair do modo foco":"Ativar modo foco",onClick:()=>J(t=>!t),children:C?e.jsx(ct,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-4"}):e.jsx(it,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-4"})})]})]})}),i.isLoading?e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"text-sm text-moss",children:"Validando permissão e carregandoâ¦"}):i.error?e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"text-sm text-destructive",children:i.error.message}):e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"max-h-[68vh] space-y-6 overflow-y-auto pr-1",children:[!C&&e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex flex-wrap items-center gap-2 border-y border-sand py-3 text-xs text-moss",children:[e.jsx(st,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-3.5 text-gold"}),e.jsxs("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",children:["Parte: ",i.data?.categoryName||"Acervo CFI-COVANT"]}),e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:42","aria-hidden":"true",children:"·"}),e.jsxs("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",children:["Estimativa: ",i.data?.estimatedMinutes??0," min"]}),e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:42","aria-hidden":"true",children:"·"}),e.jsxs("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",children:["Progresso: ",me.data?.progress.percentage??0,"%"]})]}),M?e.jsxs("section",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"rounded-xl border border-gold/35 bg-gold/5 p-5",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"eyebrow",children:"Resumo de ação"}),e.jsx("h3",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mt-1 font-serif text-xl font-bold text-forest",children:"Preparação para briefing"}),e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mt-3 whitespace-pre-wrap text-ink",style:{fontSize:`${f}rem`,lineHeight:1.8},children:i.data?.summary||"Este módulo não possui resumo cadastrado. Utilize a leitura completa para consultar o conteúdo institucional."})]}):e.jsx("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"whitespace-pre-wrap text-ink",style:{fontSize:`${f}rem`,lineHeight:1.8},children:i.data?.body||"O conteúdo ainda não possui corpo textual cadastrado."}),e.jsxs("section",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"border-t border-sand pt-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"eyebrow",children:"Documentos institucionais"}),e.jsx("h3",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mt-1 font-serif text-xl font-bold text-forest",children:"Anexos oficiais"})]}),u&&e.jsxs(e.Fragment,{children:[e.jsx("input",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",ref:O,type:"file",className:"hidden",accept:".pdf,.docx,.xlsx,.csv,.jpg,.jpeg,.png,.webp",onChange:t=>{const a=t.target.files?.[0];a&&Ke(a)}}),e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"sm",onClick:()=>O.current?.click(),disabled:oe.isPending||ie.isPending,children:[e.jsx(Ye,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mr-2 size-4"}),oe.isPending||ie.isPending?"Enviandoâ¦":"Adicionar anexo"]})]})]}),e.jsx("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mt-4 space-y-2",children:D.data?.length?D.data.map(t=>e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex items-center justify-between gap-3 rounded-lg border border-sand bg-white/50 p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"min-w-0",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"truncate text-sm font-medium text-forest",children:t.fileName}),e.jsxs("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"text-xs text-moss",children:[Math.max(1,Math.ceil(t.byteSize/1024))," KB"]}
21)]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex gap-1",children:[e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"icon",variant:"ghost","aria-label":`Baixar ${t.fileName}`,onClick:async()=>{const a=await z.content.attachmentDownload.fetch({contentId:r??0,attachmentId:t.id});window.open(a.url,"_blank","noopener,noreferrer")},children:e.jsx(nt,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-4"})}),u&&e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",size:"icon",variant:"ghost","aria-label":`Remover ${t.fileName}`,onClick:()=>Ue.mutate({contentId:r??0,attachmentId:t.id}),children:e.jsx(rt,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"size-4 text-destructive"})})]})]},t.id)):e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"text-sm text-moss",children:"Nenhum anexo oficial foi vinculado a este módulo."})})]}),e.jsxs("nav",{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"flex flex-col gap-3 border-t border-sand pt-5 sm:flex-row sm:justify-between","aria-label":"Navegação entre módulos",children:[e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",variant:"outline",disabled:!B,onClick:()=>B&&ce(B.id),children:[e.jsx(Me,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"mr-2 size-4"}),B?"Módulo anterior":"InÃcio da trilha"]}),e.jsxs(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",variant:"outline",disabled:!$,onClick:()=>$&&ce($.id),children:[$?"Próximo módulo":"Fim da trilha",e.jsx(Se,{"data-loc":"client/src/pages/ContentLibrary.tsx:42",className:"ml-2 size-4"})]})]})]})]})}),e.jsx(le,{"data-loc":"client/src/pages/ContentLibrary.tsx:43",open:Te,onOpenChange:V,children:e.jsxs(de,{"data-loc":"client/src/pages/ContentLibrary.tsx:43",children:[e.jsx(xe,{"data-loc":"client/src/pages/ContentLibrary.tsx:43",children:e.jsx(pe,{"data-loc":"client/src/pages/ContentLibrary.tsx:43",className:"font-serif text-2xl text-forest",children:"Nova categoria"})}),e.jsx(w,{"data-loc":"client/src/pages/ContentLibrary.tsx:43",value:P,onChange:t=>he(t.target.value),placeholder:"Ex.: Operações Especiais"}),e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:43",disabled:!P||Le.isPending,onClick:()=>Le.mutate({name:P,slug:ue(P)}),children:"Criar categoria"})]})}),e.jsx(le,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",open:Ee,onOpenChange:t=>{t||(b(!1),Ne())},children:e.jsxs(de,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"max-w-3xl",children:[e.jsx(xe,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",children:e.jsx(pe,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"font-serif text-2xl text-forest",children:c?"Editar conteúdo e permissões":"Novo conteúdo controlado"})}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"grid gap-4 md:grid-cols-2",children:[e.jsx(w,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:A,onChange:t=>{_(t.target.value),E||T(ue(t.target.value))},placeholder:"TÃtulo do módulo"}),e.jsx(w,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:E,onChange:t=>T(ue(t.target.value)),placeholder:"identificador-do-modulo"}),e.jsxs("select",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"h-10 rounded-md border border-sand bg-white px-3 text-sm",value:R,onChange:t=>G(t.target.value),children:[e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:"",children:"Selecione a categoria"}),Q.data?.map(t=>e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:t.id,children:t.name},t.id))]}),e.jsx(w,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",type:"number",min:5,max:480,value:fe,onChange:t=>te(t.target.value),placeholder:"Duração em minutos"})]}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",children:[e.jsx(Ze,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",children:"Ãcone institucional de apoio"}),e.jsxs("select",{"data-loc":"client/src/pages/ContentLibrary.tsx:44","aria-label":"Ãcone institucional de apoio",className:"mt-2 h-10 w-full rounded-md border border-sand bg-white px-3 text-sm",value:Z,onChange:t=>ee(t.target.value),children:[e.jsx("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:"",children:"Usar Ãcone padrão da categoria"}),Ge.map(t=>e.jsxs("option",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:t.key,children:[t.label," â ",t.description]},t.key))]}),e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"mt-2 text-xs text-moss",children:"O Ãcone complementa, mas não substitui, tÃtulo, descrição ou instrução textual."})]}),e.jsxs("section",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"overflow-hidden rounded-xl border border-sand bg-sand/20","aria-label":"Pré-visualização da capa curricular",children:[e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"flex items-center justify-between px-4 pt-4",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"folio-label",children:"Pré-visualização em tempo real"}),e.jsx("span",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"text-xs text-moss",children:"Não publicada"})]}),e.jsx(we,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",compact:!0,categoryName:Q.data?.find(t=>String(t.id)===R)?.name,iconKey:Z,className:"mt-3"}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"p-4",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"font-serif text-xl font-bold text-forest",children:A||"TÃtulo do módulo"}),e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"mt-1 text-xs text-moss",children:W||"Resumo institucional que será exibido no acervo."})]})]}),e.jsx(ke,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",value:W,onChange:t=>X(t.target.value),placeholder:"Resumo para acervo e modo briefing"}),e.jsx(ke,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"min-h-40",value:Ce,onChange:t=>Y(t.target.value),placeholder:"Conteúdo didático"}),e.jsxs("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",children:[e.jsx("p",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"mb-2 text-xs font-semibold",children:"Turmas autorizadas"}),e.jsx("div",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"grid max-h-36 gap-2 overflow-y-auto sm:grid-cols-2",children:Ae.data?.map(t=>e.jsxs("label",{"data-loc":"client/src/pages/ContentLibrary.tsx:44",className:"flex items-center gap-2 rounded-lg border border-sand p-2 text-sm",children:[e.jsx(We,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",checked:ae.includes(t.id),onCheckedChange:()=>Qe(t.id)}),t.name]},t.id))})]}),e.jsx(n,{"data-loc":"client/src/pages/ContentLibrary.tsx:44",disabled:!A||!E||!R||!ae.length||je.isPending||ve.isPending,onClick:qe,children:c?"Salvar conteúdo e permissões":"Publicar e atribuir à s turmas"})]})})]})}export{Ot 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.