1import{c as d,j as e,A as se,y as ae,t as m}from"./vendor-ui-DoG2tnCj.js";import{u as Se,G as Fe,d as Te,a0 as Ee,a1 as Me,c as $e,z as Ie,af as te,ag as M,B as i,ah as $,j as g,au as Le,C as I,b as re,I as x,m as Ue,D as L,f as U,g as ie,h as le,i as ne,a9 as He,X as H,V as Ve,a2 as V,av as Be}from"./index-D5rH5Kj8.js";import{f as qe}from"./dateUtils-Cw7GAwTr.js";import{C as j,a as B,b as q,d as C,c as ce}from"./card-DGsoyv2Y.js";import{T as Ge,a as We,b as k,c as z}from"./tabs-DZGkHi1Z.js";import{L as p}from"./label-D8bvz-07.js";import{T as G}from"./textarea-CaSTxjt6.js";import{c as Ye}from"./FilePdf.es-misUfEZQ.js";import{s as W}from"./FileText.es-b5Q3If4r.js";import{c as Qe}from"./FileZip.es-D03lKnJx.js";import{m as Xe}from"./ListChecks.es-CEdig07i.js";import{e as oe,l as Ze}from"./UploadSimple.es-DC6pbLmm.js";import{n as P}from"./Plus.es-C3ACvdL1.js";import{h as de}from"./ShieldCheck.es-DDAVxLM-.js";import{c as me}from"./ShieldWarning.es-DdrD8-Yj.js";import{m as xe}from"./SpinnerGap.es-DH2f9dlw.js";import{n as _}from"./Trash.es-D7_55eLp.js";import{c as Je}from"./TrendUp.es-CcFg52dh.js";import{n as Y}from"./User.es-C6uhw3Mp.js";import{M as Ke}from"./MfaSetupCard-BWYyEYMt.js";import{A as es}from"./ArticleEditor-ChgtX_0A.js";import"./vendor-supabase-BwKJ0EQr.js";import"./index-DwL3Vu-4.js";import"./Copy.es-CPe1z17P.js";import"./DeviceMobile.es-yesm6Sqp.js";import"./Key.es-Cwk5v1AW.js";import"./QrCode.es-yZQ83ryu.js";import"./input-otp-OqIOG1zY.js";import"./sanitize-BYKsS9js.js";import"./FileArrowDown.es-DBBxKYVh.js";import"./ListBullets.es-DSJX7q6D.js";import"./Tag.es-CO6ht6CM.js";function Ss(){const{i18n:he}=Se(),O=he.language==="ga",{user:u,loading:R,signOut:D}=Fe(),b=Te(),{officers:pe,loading:ue,refresh:fe}=Ee(),{reports:ge,refresh:je}=Me(void 0,{status:"all"}),{events:be}=$e(),{news:Ne,refresh:Q}=Ie({status:"all"}),t=pe.find(s=>s.user_id===u?.id),X=ge.filter(s=>s.officer_id===t?.id),Z=Ne.filter(s=>s.author_id===t?.id||!s.author_id),ve=be.filter(s=>s.type==="cn"),[o,N]=d.useState(null),[ye,v]=d.useState(!1),[S,F]=d.useState(null),[we,y]=d.useState(!1),[c,f]=d.useState({email:"",bio:"",pronouns:"",photo_url:""}),[J,K]=d.useState(!1),[T,ee]=d.useState(!1);d.useEffect(()=>{t&&f({email:t.email||"",bio:t.bio||"",pronouns:t.pronouns||"",photo_url:t.photo_url||""})},[t]);const Ce=async s=>{const a=s.target.files?.[0];if(a)try{ee(!0);const n=await Ve.uploadImage(a,"officers");f(l=>({...l,photo_url:n})),m.success("Photo uploaded successfully")}catch(n){console.error("Photo upload error:",n),m.error("Failed to upload photo",{description:n.message})}finally{ee(!1)}},Ae=async()=>{if(t){K(!0);try{await V.update(t.id,{email:c.email.trim()||null,bio:c.bio.trim()||null,pronouns:c.pronouns.trim()||null,photo_url:c.photo_url||t.photo_url}),m.success("Profile and pronouns updated successfully!"),fe()}catch(s){console.error("Failed to update officer profile:",s),m.error("Failed to update profile",{description:s.message})}finally{K(!1)}}},[w,ke]=d.useState(null),[r,h]=d.useState({agenda:[],timetable:[]}),[ze,A]=d.useState(!1);d.useEffect(()=>{!R&&!u&&b("/login")},[u,R,b]);const Pe=async()=>{if(!(!o||!t))try{if(o.id)await V.updateReport(o.id,o),m.success("Report updated successfully");else{const{id:s,...a}=o;await V.createReport({...a,officer_id:t.id}),m.success("Report posted successfully")}v(!1),je()}catch(s){m.error("Failed to save report",{description:s.message})}},_e=s=>{ke(s),h(s.cn_details?.[0]||{agenda:[],timetable:[]}),A(!0)},Oe=async()=>{if(w)try{await Be.updateDetails(w.id,r),m.success("CN details updated"),A(!1)}catch(s){m.error("Failed to update CN details",{description:s.message})}},Re=async s=>{try{S?.id?await H.update(S.id,s):await H.create({...s,author_id:t?.id||null,author_name:t?.name||null}),y(!1),F(null),Q()}catch(a){throw m.error("Failed to save article",{description:a.message}),a}},De=async s=>{if(confirm("Are you sure you want to delete this article?"))try{await H.delete(s),m.success("Article deleted"),Q()}catch(a){m.error("Failed to delete article",{description:a.message})}};return R||ue?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(te,{className:"animate-spin",size:24}),e.jsx("p",{className:"text-lg font-medium",children:"Loading dashboard..."})]})}):u&&!u.isVerified&&u.role!=="Admin"?e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(M,{}),e.jsx("main",{className:"flex-1 container mx-auto px-6 py-24 max-w-lg text-center flex items-center justify-center",children:e.jsxs(j,{className:"glass border-2 border-amber-500/30 p-8 space-y-6 shadow-2xl text-center w-full",children:[e.jsx("div",{className:"w-16 h-16 rounded-3xl bg-amber-500/10 border border-amber-500/30 flex items-center justify-center mx-auto text-amber-500 shadow-inner",children:e.jsx(me,{size:36,weight:"duotone"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Authority Verification Required"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Access to the Officer Dashboard requires manual authority verification by an AMLà administrator."})]}),e.jsxs("div",{className:"flex gap-3 justify-center pt-2",children:[e.jsx(i,{variant:"outline",onClick:()=>b("/"),children:"Return Home"}),e.jsx(i,{variant:"ghost",onClick:()=>D(),className:"text-muted-foreground",children:"Sign Out"})]})]})}),e.jsx($,{})]}):t?e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(M,{}),e.jsxs("main",{className:"flex-1 container mx-auto px-6 py-24 max-w-6xl",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6 mb-12",children:[e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:t.photo_url||`https://api.dicebear.com/7.x/initials/svg?seed=${t.name}`,alt:t.name,className:"w-20 h-20 rounded-2xl object-cover border-2 border-accent/20 shadow-xl"}),e.jsx("div",{className:"absolute -bottom-2 -right-2 bg-accent text-white p-1.5 rounded-lg shadow-lg",children:e.jsx(te,{size:16})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("h1",{className:"text-3xl font-bold tracking-tight",children:["Fáilte, ",t.name]}),u?.isMicrosoftAuth?e.jsxs(g,{variant:"outline",className:"bg-sky-500/10 text-sky-400 border-sky-500/30 gap-1.5 py-1 px-2.5 text-xs",children:[e.jsx(de,{size:14,weight:"fill",className:"text-sky-400"}),"Microsoft 365 MFA"]}):u?.hasEnrolled2FA?e.jsxs(g,{variant:"outline",className:"bg-emerald-500/10 text-emerald-400 border-emerald-500/30 gap-1.5 py-1 px-2.5 text-xs",children:[e.jsx(de,{size:14,weight:"fill",className:"text-emerald-400"}),"2FA Active"]}):e.jsxs(g,{variant:"outline",className:"bg-amber-500/10 text-amber-400 border-amber-500/30 gap-1.5 py-1 px-2.5 text-xs",children:[e.jsx(me,{size:14,className:"text-amber-400"}),"2FA Recommended"]})]}),e.jsx("p",{className:"text-accent font-medium uppercase tracking-widest text-sm mt-1",children:t.role})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs(i,{variant:"outline",className:"gap-2",onClick:()=>b("/admin"),children:[e.jsx(Je,{size:18})," Admin View"]}
1),e.jsxs(i,{variant:"ghost",className:"gap-2 text-destructive",onClick:()=>D(),children:[e.jsx(Le,{size:18})," Logout"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-8",children:[e.jsx("div",{className:"lg:col-span-1 space-y-6",children:e.jsxs(j,{className:"glass border-2",children:[e.jsx(B,{className:"pb-2",children:e.jsx(q,{className:"text-sm uppercase tracking-widest opacity-60",children:"How to use"})}),e.jsxs(C,{className:"space-y-4 text-sm leading-relaxed",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"1. Approved Reports:"})," Officer reports relate to your work since the last report was approved at Comhairle Náisiúnta. Official reports are published from CN proceedings, so officers do not need to manually submit reports through the site per se."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"2. CN Events:"})," Manage agendas and timetables for Comhairle Náisiúnta events."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"3. Documents:"})," Upload PDFs for members to download before meetings."]}),e.jsx("div",{className:"pt-4 border-t",children:e.jsx("p",{className:"italic opacity-70",children:"Need help? Contact the IT team at [email protected]"})})]})]})}),e.jsx("div",{className:"lg:col-span-3",children:e.jsxs(Ge,{defaultValue:"reports",className:"w-full",children:[e.jsxs(We,{className:"grid w-full grid-cols-4 max-w-xl mb-8",children:[e.jsxs(k,{value:"reports",className:"gap-2",children:[e.jsx(W,{size:18})," Reports"]}),e.jsxs(k,{value:"articles",className:"gap-2",children:[e.jsx(I,{size:18})," Publications"]}),e.jsxs(k,{value:"cn",className:"gap-2",children:[e.jsx(re,{size:18})," CN Events"]}),e.jsxs(k,{value:"profile",className:"gap-2",children:[e.jsx(Y,{size:18})," Profile"]})]}),e.jsxs(z,{value:"reports",className:"space-y-6",children:[e.jsxs("div",{className:"p-4 rounded-xl glass border border-accent/20 bg-accent/5 mb-6",children:[e.jsxs("h3",{className:"font-bold text-accent mb-1 flex items-center gap-2",children:[e.jsx(W,{size:20}),"Comhairle Náisiúnta Approved Reports"]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Officer reports relate directly to the period since your last report was approved at Comhairle Náisiúnta. Officers are not required to submit reports directly through this website per se, as official reports are processed and published from approved CN meeting minutes and proceedings."})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Approved Accountability Reports"}),e.jsxs(i,{onClick:()=>{N({id:"",officer_id:t.id,title:"",content:"",report_date:new Date().toISOString().split("T")[0],status:"approved",period_description:"Covers activity since last report approved at Comhairle Náisiúnta"}),v(!0)},variant:"outline",className:"gap-2",children:[e.jsx(P,{size:18})," Add / Sync Report Record"]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4",children:e.jsx(se,{children:X.length>0?X.map(s=>e.jsx(ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.95},children:e.jsx(j,{className:"glass border hover:border-accent/40 transition-all",children:e.jsxs(C,{className:"p-4 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-bold",children:s.title}),e.jsx("span",{className:"text-[10px] font-semibold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20 px-2 py-0.5 rounded-full",children:"Approved at CN"}),e.jsx("span",{className:"text-xs font-normal text-muted-foreground bg-muted px-2 py-0.5 rounded",children:s.report_date})]}),e.jsx("p",{className:"text-xs text-emerald-600 dark:text-emerald-400 font-medium mb-1",children:"Relates to period since last approved report"}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1 italic",children:s.content})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(i,{size:"sm",variant:"ghost",onClick:()=>{N(s),v(!0)},children:e.jsx(oe,{size:18})}),e.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",children:e.jsx(_,{size:18})})]})]})})},s.id)):e.jsxs("div",{className:"text-center py-12 bg-muted/30 rounded-2xl border-2 border-dashed",children:[e.jsx(W,{className:"mx-auto mb-2 opacity-20",size:48}),e.jsx("p",{className:"text-muted-foreground",children:"No approved reports logged yet."})]})})})]}),e.jsxs(z,{value:"articles",className:"space-y-6",children:[e.jsxs("div",{className:"p-4 rounded-xl glass border border-accent/20 bg-accent/5 mb-6",children:[e.jsxs("h3",{className:"font-bold text-accent mb-1 flex items-center gap-2",children:[e.jsx(I,{size:20}),"My Articles, Statements & Publications"]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Draft, publish, and manage press statements, opinion pieces, research submissions, and union updates attributed to your officer profile."})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Published & Drafted Articles"}),e.jsxs(i,{onClick:()=>{F(null),y(!0)},className:"gap-2 bg-accent text-accent-foreground font-bold rounded-xl shadow-md",children:[e.jsx(P,{size:18,weight:"bold"}
1)," Write New Article"]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4",children:e.jsx(se,{children:Z.length>0?Z.map(s=>e.jsx(ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.95},children:e.jsx(j,{className:"glass border-2 hover:border-accent/40 transition-all overflow-hidden",children:e.jsxs(C,{className:"p-4 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(g,{className:s.status==="draft"?"bg-amber-500/15 text-amber-600 border-amber-500/30":"bg-emerald-500/15 text-emerald-600 border-emerald-500/30",children:s.status==="draft"?"Draft":"Published"}),e.jsx(g,{variant:"outline",className:"text-xs",children:s.category}),s.file_url&&(s.file_url.toLowerCase().endsWith(".zip")?e.jsxs(g,{className:"bg-amber-500/15 text-amber-600 border-amber-500/30 text-[10px] gap-1",children:[e.jsx(Qe,{size:12,weight:"fill"})," ZIP"]}):e.jsxs(g,{className:"bg-rose-500/15 text-rose-500 border-rose-500/30 text-[10px] gap-1",children:[e.jsx(Ye,{size:12,weight:"fill"})," PDF"]})),e.jsx("span",{className:"text-xs text-muted-foreground",children:s.date})]}),e.jsx("h3",{className:"font-bold text-base text-foreground",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:s.excerpt})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(i,{size:"sm",variant:"outline",onClick:()=>{F(s),y(!0)},className:"rounded-lg gap-1.5",children:[e.jsx(oe,{size:16})," Edit"]}),e.jsx(i,{size:"sm",variant:"ghost",onClick:()=>De(s.id),className:"text-destructive hover:text-destructive hover:bg-destructive/10 rounded-lg",children:e.jsx(_,{size:16})})]})]})})},s.id)):e.jsxs("div",{className:"text-center py-12 bg-muted/30 rounded-2xl border-2 border-dashed",children:[e.jsx(I,{className:"mx-auto mb-2 opacity-20",size:48}),e.jsx("p",{className:"text-muted-foreground",children:"No articles or publications written yet."})]})})})]}),e.jsxs(z,{value:"cn",className:"space-y-6",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Comhairle Náisiúnta Management"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:ve.map(s=>e.jsxs(j,{className:"glass border-2 hover:border-accent/40 transition-all",children:[e.jsxs(B,{children:[e.jsx(q,{className:"text-lg",children:O&&s.title_ga?s.title_ga:s.title}),e.jsxs(ce,{className:"flex items-center gap-2",children:[e.jsx(re,{size:14})," ",qe(s.date,s.end_date,{isGa:O})]})]}),e.jsx(C,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(i,{onClick:()=>_e(s),className:"flex-1 bg-accent/10 text-accent hover:bg-accent hover:text-white border-accent/20",children:"Manage Agenda"}),e.jsx(i,{onClick:()=>b(`/events/cn/${s.id}`),variant:"outline",children:"View Page"})]})})]},s.id))})]}),e.jsxs(z,{value:"profile",className:"space-y-6",children:[e.jsxs(j,{className:"glass border-2",children:[e.jsxs(B,{children:[e.jsx(q,{className:"text-xl",children:"Edit Your Officer Profile"}),e.jsx(ce,{children:"Customize your public information, self-specified pronouns, and bio displayed across the Officer Cloud and Accountability Reports."})]}),e.jsxs(C,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{children:"Full Name"}),e.jsx(x,{value:t.name,disabled:!0,className:"bg-muted/50"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{children:"Elected Role"}),e.jsx(x,{value:t.role,disabled:!0,className:"bg-muted/50"})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-accent/5 border border-accent/25 space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(p,{htmlFor:"officer-pronouns",className:"font-semibold text-sm flex items-center gap-1.5",children:[e.jsx("span",{children:"Pronouns / Forainmneacha"}),e.jsx(g,{variant:"outline",className:"text-[10px] border-accent/30 text-accent font-medium",children:"Self-Specified"})]}),c.pronouns&&e.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["Preview: ",e.jsxs("strong",{className:"text-foreground",children:["(",c.pronouns,")"]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Specify how colleagues, student members, and media should refer to you. Displayed next to your name across AMLà directories and reports."})]}),e.jsx(x,{id:"officer-pronouns",placeholder:"e.g. they/them, she/her, he/him, she/they, he/they...",value:c.pronouns,onChange:s=>
1f(a=>({...a,pronouns:s.target.value})),className:"bg-background font-medium"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pt-1",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground mr-1",children:"Quick Select:"}),["they/them","she/her","he/him","she/they","he/they","any pronouns"].map(s=>e.jsx("button",{type:"button",onClick:()=>f(a=>({...a,pronouns:s})),className:`text-xs px-2.5 py-1 rounded-lg border transition-all ${c.pronouns===s?"bg-accent text-accent-foreground border-accent font-bold shadow-sm":"bg-background hover:bg-muted text-muted-foreground border-border"}`,children:s},s)),c.pronouns&&e.jsx("button",{type:"button",onClick:()=>f(s=>({...s,pronouns:""})),className:"text-[11px] text-destructive hover:underline ml-1",children:"Clear"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"officer-email",children:"Official Officer Email"}),e.jsx(x,{id:"officer-email",type:"email",value:c.email,onChange:s=>f(a=>({...a,email:s.target.value})),placeholder:"[email protected]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{children:"Officer Portrait / Headshot"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-xl overflow-hidden border-2 border-border bg-muted shrink-0",children:c.photo_url?e.jsx("img",{src:c.photo_url,alt:"",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:e.jsx(Y,{size:24})})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(x,{value:c.photo_url,onChange:s=>f(a=>({...a,photo_url:s.target.value})),placeholder:"Image URL or upload",className:"text-xs"}),e.jsxs("label",{className:"cursor-pointer inline-block",children:[e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:Ce,disabled:T}),e.jsx(i,{type:"button",variant:"outline",size:"sm",asChild:!0,disabled:T,className:"text-xs h-7",children:e.jsxs("span",{children:[T?e.jsx(xe,{size:14,className:"animate-spin mr-1"}):e.jsx(Ze,{size:14,className:"mr-1"}),"Upload New Photo"]})})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"officer-bio",children:"Public Bio & Mandate Priorities"}),e.jsx(G,{id:"officer-bio",value:c.bio,onChange:s=>f(a=>({...a,bio:s.target.value})),rows:4,placeholder:"Tell students about your work, union priorities, and committee responsibilities..."})]}),e.jsx(i,{onClick:Ae,disabled:J,className:"w-full bg-accent hover:bg-accent/90 text-accent-foreground font-bold shadow-md h-11",children:J?e.jsxs(e.Fragment,{children:[e.jsx(xe,{size:18,className:"animate-spin mr-2"}),"Updating Officer Profile..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{size:18,className:"mr-2",weight:"bold"}),"Save Profile & Pronouns"]})})]})]}),e.jsx(Ke,{})]})]})})]})]}),e.jsx(L,{open:ye,onOpenChange:v,children:e.jsxs(U,{className:"glass max-w-2xl",children:[e.jsxs(ie,{children:[e.jsx(le,{children:o?.id?"Edit Report":"Post New Accountability Report"}),e.jsx(ne,{children:"Paste the contents of your officer report below. It will be immediately visible on the site."})]}),o&&e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{children:"Title"}),e.jsx(x,{placeholder:"e.g. Monthly Report - Feb 2026",value:o.title,onChange:s=>N({...o,title:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{children:"Report Date"}),e.jsx(x,{type:"date",value:o.report_date,onChange:s=>N({...o,report_date:s.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{children:"Report Content"}),e.jsx(G,{placeholder:"Paste your report here...",className:"min-h-[300px]",value:o.content,onChange:s=>N({...o,content:s.target.value})})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(i,{variant:"ghost",onClick:()=>v(!1),children:"Cancel"}),e.jsx(i,{onClick:Pe,className:"bg-accent",children:"Save & Post Report"})]})]})]})}),e.jsx(L,{open:ze,onOpenChange:A,children:e.jsxs(U,{className:"glass max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ie,{children:[e.jsxs(le,{children:["Management: ",O&&w?.title_ga?w?.title_ga:w?.title]}),e.jsx(ne,{children:"Update the native Agenda and Timetable for this Comhairle Náisiúnta."})]}),e.jsxs("div",{className:"space-y-8 py-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"font-bold flex items-center gap-2",children:[e.jsx(He,{})," Timetable"]}),e.jsxs("div",{className:"space-y-2",children:[r.timetable?.map((s,a)=>e.jsxs("div",{className:"flex gap-2 items-center bg-muted/30 p-2 rounded-lg",children:[e.jsx(x,{className:"w-24",placeholder:"Start",value:s.start,onCh
1ange:n=>{const l=[...r.timetable||[]];l[a].start=n.target.value,h({...r,timetable:l})}}),e.jsx(x,{className:"w-24",placeholder:"End",value:s.end,onChange:n=>{const l=[...r.timetable||[]];l[a].end=n.target.value,h({...r,timetable:l})}}),e.jsx(x,{className:"flex-1",placeholder:"Activity",value:s.activity,onChange:n=>{const l=[...r.timetable||[]];l[a].activity=n.target.value,h({...r,timetable:l})}}),e.jsx(i,{size:"icon",variant:"ghost",onClick:()=>{const n=(r.timetable||[]).filter((l,E)=>E!==a);h({...r,timetable:n})},children:e.jsx(_,{})})]},a)),e.jsxs(i,{variant:"outline",size:"sm",className:"w-full",onClick:()=>{h({...r,timetable:[...r.timetable||[],{start:"",end:"",activity:""}]})},children:[e.jsx(P,{className:"mr-2"})," Add Activity"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"font-bold flex items-center gap-2",children:[e.jsx(Xe,{})," Agenda Items"]}),e.jsxs("div",{className:"space-y-4",children:[r.agenda?.map((s,a)=>e.jsxs(j,{className:"p-4 bg-muted/20",children:[e.jsxs("div",{className:"flex gap-4 mb-2",children:[e.jsx(x,{className:"w-24",placeholder:"Time",value:s.time,onChange:n=>{const l=[...r.agenda||[]];l[a].time=n.target.value,h({...r,agenda:l})}}),e.jsx(x,{className:"flex-1",placeholder:"Title",value:s.title,onChange:n=>{const l=[...r.agenda||[]];l[a].title=n.target.value,h({...r,agenda:l})}}),e.jsx(i,{size:"icon",variant:"ghost",onClick:()=>{const n=(r.agenda||[]).filter((l,E)=>E!==a);h({...r,agenda:n})},children:e.jsx(_,{})})]}),e.jsx(G,{placeholder:"Description",rows:2,value:s.description,onChange:n=>{const l=[...r.agenda||[]];l[a].description=n.target.value,h({...r,agenda:l})}})]},a)),e.jsxs(i,{variant:"outline",size:"sm",className:"w-full",onClick:()=>{h({...r,agenda:[...r.agenda||[],{time:"",title:"",description:""}]})},children:[e.jsx(P,{className:"mr-2"})," Add Agenda Item"]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-6 border-t font-bold",children:[e.jsx(i,{variant:"ghost",onClick:()=>A(!1),children:"Cancel"}),e.jsx(i,{onClick:Oe,className:"bg-accent",children:"Save Changes"})]})]})]})}),e.jsx(L,{open:we,onOpenChange:y,children:e.jsx(U,{className:"glass max-w-5xl w-[95vw] max-h-[92vh] overflow-y-auto p-6 md:p-8",children:e.jsx(es,{article:S,onSave:Re,onCancel:()=>y(!1),defaultAuthorId:t?.id})})}),e.jsx($,{})]}):e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(M,{}),e.jsxs("main",{className:"flex-1 container mx-auto px-6 py-24 max-w-2xl text-center",children:[e.jsxs("div",{className:"bg-destructive/10 text-destructive p-8 rounded-2xl border-2 border-destructive/20 mb-8",children:[e.jsx(Y,{className:"mx-auto mb-4",size:48}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Officer Profile Not Found"}),e.jsx("p",{className:"opacity-80",children:"You are logged in but not currently linked to an Officer profile. Please contact an Administrator to set up your account."})]}),e.jsx(i,{onClick:()=>D(),children:"Logout"})]}),e.jsx($,{})]})}export{Ss as OfficerDashboard};
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.