1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as b}from"./vendor-react-zNM0AU50.js";import{r as y,K as L,U as $,s as H,ar as K,i as X,A as I,aa as J,n as Q,ah as V,a7 as m,X as P,Y as W,a8 as Z}from"./vendor-ui-CW5bJ11U.js";import{y as R,k as v,u as B,z as ee,l as w,q as A,x as k,m as S,w as te,D as se,G as ae,E as le}from"./vendor-firebase-Da9KY1q_.js";import{d as p,s as ne}from"./index-D1K3lVhu.js";import"./vendor-charts-08G1rM8P.js";const M="seodoon-church",f=`churches/${M}/academyPrograms`,N=`churches/${M}/academyEnrollments`,C={async getAll(){try{const s=A(w(p,f),k("sortOrder","asc"));return(await S(s)).docs.map(c=>({id:c.id,...c.data()}))}catch(s){return console.error("ìì¹´ë°ë¯¸ ê°ì¢ ì¡°í ì¤í¨:",s),[]}},async create(s){return(await ee(w(p,f),{...s,createdAt:new Date,updatedAt:new Date})).id},async update(s,r){const c=v(p,f,s);await B(c,{...r,updatedAt:new Date})},async remove(s){await R(v(p,f,s))}},T={async getAll(){try{const s=A(w(p,N),k("createdAt","desc"));return(await S(s)).docs.map(c=>{var i,x;const d=c.data();return{id:c.id,...d,createdAt:((x=(i=d.createdAt)==null?void 0:i.toDate)==null?void 0:x.call(i))||d.createdAt}})}catch(s){return console.error("ìê°ì ì² ì¡°í ì¤í¨:",s),[]}},async getByProgram(s){try{const r=A(w(p,N),te("programId","==",s),k("createdAt","desc"));return(await S(r)).docs.map(d=>{var x,h;const i=d.data();return{id:d.id,...i,createdAt:((h=(x=i.createdAt)==null?void 0:x.toDate)==null?void 0:h.call(x))||i.createdAt}})}catch(r){return console.error("ê°ì¢ë³ ìê°ì ì² ì¡°í ì¤í¨:",r),[]}},async updateStatus(s,r){const c=v(p,N,s);await B(c,{status:r})},async remove(s){await R(v(p,N,s))}},E={sunday:"주ì¼ìì¹´ë°ë¯¸",thursday:"목ìì ì",special:"í¹ë³ê°ì¢"},D={upcoming:"ì´ììì ",recruiting:"모ì§ì¤",active:"ì´ìì¤",closed:"ì¢
ê°"},re={pending:"ë기",confirmed:"íì¸",cancelled:"ì·¨ì"};function _(s){switch(s){case"upcoming":return"bg-slate-100 text-slate-600";case"recruiting":return"bg-blue-100 text-blue-700";case"active":return"bg-green-100 text-green-700";case"closed":return"bg-gray-100 text-gray-500"}}function ge(){const[s,r]=b.useState("dashboard"),[c,d]=b.useState([]),[i,x]=b.useState([]),[h,l]=b.useState(!0),t=b.useCallback(async()=>{l(!0);const[o,j]=await Promise.all([C.getAll(),T.getAll()]);d(o),x(j),l(!1)},[]);b.useEffect(()=>{t()},[t]);const n=[{id:"dashboard",label:"ëìë³´ë",icon:L},{id:"programs",label:"ê°ì¢ ê´ë¦¬",icon:y},{id:"enrollments",label:"ìê°ì ì² ê´ë¦¬",icon:$}];return e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"rounded-xl p-6 bg-white border border-gray-200 mb-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-blue-50 rounded-lg flex items-center justify-center",children:e.jsx(y,{className:"w-5 h-5 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-[18px] font-bold text-gray-900",children:"ìëìì¹´ë°ë¯¸ ê´ë¦¬"}),e.jsx("p",{className:"text-[12px] text-gray-500 mt-0.5",children:"ê°ì¢ì ìê°ì ì²ì ê´ë¦¬í©ëë¤"})]})]}),e.jsxs("div",{className:"bg-slate-50 border border-gray-200 rounded-lg px-4 py-2 text-center",children:[e.jsxs("div",{className:"text-[11px] text-gray-500 flex items-center gap-1",children:[e.jsx(y,{className:"w-3 h-3"}),"ì ì²´ ê°ì¢"]}),e.jsxs("div",{className:"text-[22px] font-bold leading-tight text-gray-900 tabular-nums",children:[c.length,e.jsx("span",{className:"text-[13px] font-normal ml-0.5",children:"ê°"})]})]})]})}),e.jsx("div",{className:"flex gap-1 border-b border-gray-200 mb-4",children:n.map(o=>e.jsxs("button",{onClick:()=>r(o.id),className:`flex items-center gap-1.5 px-4 py-2.5 text-[13px] font-medium border-b-2 -mb-[1px] transition-colors ${s===o.id?"border-[#2C5F8A] text-[#2C5F8A]":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[e.jsx(o.icon,{className:"w-4 h-4"}),o.label]},o.id))}),h?e.jsx("div",{className:"text-center py-16 text-gray-400 text-[13px]",children:"ë¡ë© ì¤..."}):e.jsxs(e.Fragment,{children:[s==="dashboard"&&e.jsx(ce,{programs:c,enrollments:i}),s==="programs"&&e.jsx(de,{programs:c,onReload:t}),s==="enrollments"&&e.jsx(ie,{programs:c,enrollments:i,onReload:t})]})]})}function ce({programs:s,enrollments:r}){const c=s.filter(l=>l.status==="active"||l.status==="recruiting"),d=r.filter(l=>l.status==="confirmed").length,i=r.filter(l=>l.status==="pending").length,x=[{label:"ì ì²´ ê°ì¢",value:s.length,unit:"ê°",color:"#2C5F8A",bg:"#EBF2F8",icon:y},{label:"ì§íì¤ ê°ì¢",value:c.length,unit:"ê°",color:"#16a34a",bg
1:"#f0fdf4",icon:H},{label:"ì´ ì ì²",value:r.length,unit:"ê±´",color:"#2563eb",bg:"#eff6ff",icon:$},{label:"íì ",value:d,unit:"ê±´",color:"#2563eb",bg:"#eff6ff",icon:K},{label:"ë기",value:i,unit:"ê±´",color:"#d97706",bg:"#fffbeb",icon:X}],h=s.map(l=>{const t=r.filter(n=>n.programId===l.id);return{...l,total:t.length,confirmed:t.filter(n=>n.status==="confirmed").length,pending:t.filter(n=>n.status==="pending").length,cancelled:t.filter(n=>n.status==="cancelled").length}});return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"grid grid-cols-5 gap-3",children:x.map((l,t)=>e.jsxs("div",{className:"rounded-xl p-4 border",style:{backgroundColor:l.bg,borderColor:`${l.color}20`},children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[11px] font-medium",style:{color:l.color},children:l.label}),e.jsx(l.icon,{className:"w-4 h-4",style:{color:l.color,opacity:.5}})]}),e.jsxs("div",{className:"text-[24px] font-bold leading-tight",style:{color:l.color},children:[l.value,e.jsx("span",{className:"text-[12px] font-normal ml-0.5",children:l.unit})]})]},t))}),i>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3 flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),e.jsxs("span",{className:"text-[13px] text-amber-700",children:["íì¸ ë기 ì¤ì¸ ìê°ì ì²ì´ ",e.jsxs("strong",{children:[i,"ê±´"]})," ììµëë¤."]})]}),e.jsxs("div",{className:"bg-white rounded-xl border p-4",children:[e.jsxs("h3",{className:"text-[14px] font-bold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4 text-[#2C5F8A]"}),"ê°ì¢ë³ ì ì² íí©"]}),h.length===0?e.jsx("div",{className:"text-center py-8 text-gray-400 text-[13px]",children:"ë±ë¡ë ê°ì¢ê° ììµëë¤"}):e.jsx("div",{className:"space-y-2.5",children:h.map(l=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors",children:[e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[11px] font-medium flex-shrink-0 ${l.category==="sunday"?"bg-blue-100 text-blue-700":(l.category==="thursday","bg-slate-100 text-slate-700")}`,children:E[l.category]}),e.jsx("span",{className:"text-[13px] font-medium text-gray-900 flex-1 truncate",children:l.name}),e.jsx("span",{className:`text-[12px] px-2 py-0.5 rounded ${_(l.status)}`,children:D[l.status]}),e.jsxs("div",{className:"flex items-center gap-3 ml-2 text-[12px]",children:[e.jsxs("span",{className:"text-gray-500",children:["ì ì² ",e.jsx("strong",{className:"text-gray-800",children:l.total})]}),e.jsxs("span",{className:"text-green-600",children:["íì ",e.jsx("strong",{children:l.confirmed})]}),e.jsxs("span",{className:"text-amber-600",children:["ë기 ",e.jsx("strong",{children:l.pending})]}),l.cancelled>0&&e.jsxs("span",{className:"text-red-500",children:["ì·¨ì ",e.jsx("strong",{children:l.cancelled})]})]})]},l.id))})]})]})}function de({programs:s,onReload:r}){const[c,d]=b.useState(null),[i,x]=b.useState(!1),h=async t=>{if(confirm(`"${t.name}" ê°ì¢ë¥¼ ìì íìê² ìµëê¹?`))try{await C.remove(t.id),m.success("ìì ëììµëë¤"),r()}catch{m.error("ìì ì¤í¨")}},l=async()=>{d(null),x(!1),await r()};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white rounded-xl border p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-[13px] text-gray-500",children:["ì ì²´ ",e.jsx("strong",{className:"text-gray-800",children:s.length}),"ê° ê°ì¢"]}),e.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1.5 px-4 py-2 bg-[#2C5F8A] text-white rounded-lg text-[13px] font-medium hover:bg-[#1E4060] shadow-sm transition-colors",children:[e.jsx(J,{className:"w-4 h-4"}),"ê°ì¢ ì¶ê°"]})]})}),s.length===0?e.jsxs("div",{className:"bg-white rounded-xl border text-center py-16 text-gray-400 text-[13px]",children:[e.jsx(y,{className:"w-10 h-10 mx-auto mb-3 text-gray-300"}),"ë±ë¡ë ê°ì¢ê° ììµëë¤"]}):e.jsx("div",{className:"bg-white rounded-xl border overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 bg-gray-50/80",children:[e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[200px]",children:"ê°ì¢ëª
"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 min-w-[100px]",children:"ì¹´í
ê³ ë¦¬"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[120px]",children:"ê°ì¬"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[160px]",children:"ê°ììê°"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[100px]",children:"ì¥ì"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 min-w-[80px]",children:"ìê°ë£"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 min-w-[70px]",children:"ìí"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 w-[140px]",children:"ì¡ì
"})]})}),e.jsx("tbody",{children:s.map((t,n)=>e.jsxs("tr",{className:`border-b border-gray-100 hover:bg-blue-50/30 transition-colors ${n%2===1?"bg-gray-50/30":""}`,children:[e.jsxs("td",{className:"px-4 py-3.5",children:[e.jsx("div",{className:"text-[13px] font-semibold text-gray-900",children:t.name}),t.tagline&&e.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:t.tagline})]}),e.jsx("td",{className:"px-4 py-3.5 text-center",children:e.jsx("span",{className:`inline-block px-2 py-1 rounded-md text-[11px] font-semibold ${t.category==="sunday"?"bg-blue-100 text-blue-700":(t.category==="thursday","bg-slate-100 text-slate-700")}`,children:E[t.category]||t.category})}),e.jsxs("td",{className:"px-4 py-3.5",children:[e.jsx("div",{className:"text-[13px] text-gray-800",children:t.instructor}),t.instructorTitle&&!t.instructor.includes(t.instructorTitle)&&e.jsx("div",{className:"text-[11px] text-gray-400",children:t.instructorTitle})]}),e.jsx("td",{className:"px-4 py-3.5 text-[12px] text-gray-600 whitespace-pre-line leading-relaxed",children:t.scheduleText||"-"}),e.jsx("td",{className:"px-4 py-3.5 text-[12px] text-gray-600",children:t.location||"-"}),e.jsx("td",{className:"px-4 py-3.5 text-center text-[13px] font-medium text-gray-700",children:t.fee||"-"}),e.jsx("td",{className:"px-4 py-3.5 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("span",{className:`inline-block px-2 py-1 rounded-md text-[11px] font-semibold ${_(t.status)}`,children:D[t.status]}),t.recruitmentClosed&&e.jsx("span",{className:"inline-block px-2 py-0.5 rounded-md text-[10px] font-semibold bg-red-100 text-red-600",children:"모ì§ë§ê°"})]})}),e.jsx("td",{className:"px-4 py-3.5 text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx("button",{onClick:()=>d(t),className:"px-3 py-1.5 bg-[#2C5F8A] text-white rounded-md text-[11px] font-medium hover:bg-[#1E4060] transition-colors",children:"ìì "}),e.jsx("button",{onClick:()=>h(t),className:"px-3 py-1.5 bg-red-500 text-white rounded-md text-[11px] font-medium hover:bg-red-600 transition-colors",children:"ìì "})]})})]},t.id))})]})})}),c&&e.jsx(F,{program:c,onClose:()=>d(null),onSave:l}),i&&e.jsx(F,{program:null,onClose:()=>x(!1),onSave:l})]})}function F({program:s,onClose:r,onSave:c}
1){const d=!!s,[i,x]=b.useState(!1),[h,l]=b.useState(!1),[t,n]=b.useState({name:(s==null?void 0:s.name)||"",description:(s==null?void 0:s.description)||"",instructor:(s==null?void 0:s.instructor)||"",instructorTitle:(s==null?void 0:s.instructorTitle)||"목ì¬",scheduleText:(s==null?void 0:s.scheduleText)||"",location:(s==null?void 0:s.location)||"",fee:(s==null?void 0:s.fee)||"",target:(s==null?void 0:s.target)||"êµì¸ ë구ë",category:(s==null?void 0:s.category)||"sunday",status:(s==null?void 0:s.status)||"active",recruitmentClosed:(s==null?void 0:s.recruitmentClosed)||!1,sortOrder:(s==null?void 0:s.sortOrder)||1,tagline:(s==null?void 0:s.tagline)||"",note:(s==null?void 0:s.note)||"",enrollment:(s==null?void 0:s.enrollment)||"ì¬ë¬´ì¤ ì ì²",imageUrl:(s==null?void 0:s.imageUrl)||""}),o=async a=>{var U;const g=(U=a.target.files)==null?void 0:U[0];if(g){if(g.size>5*1024*1024){m.error("5MB ì´íë§ ê°ë¥í©ëë¤");return}try{l(!0);const q=Date.now(),Y=g.name.split(".").pop()||"jpg",O=se(ne,`academy/courses/${q}.${Y}`);await ae(O,g,{contentType:g.type});const z=await le(O);n(G=>({...G,imageUrl:z})),m.success("ì´ë¯¸ì§ê° ì ë¡ëëììµëë¤")}catch{m.error("ì ë¡ëì ì¤í¨íìµëë¤")}finally{l(!1)}}},j=async()=>{var a;if(!t.name.trim()){m.error("ê°ì¢ëª ì ì ë ¥íì¸ì");return}if(!t.instructor.trim()){m.error("ê°ì¬ë¥¼ ì ë ¥íì¸ì");return}if(!((a=t.scheduleText)!=null&&a.trim())){m.error("ê°ììê°ì ì ë ¥íì¸ì");return}x(!0);try{d&&s?(await C.update(s.id,t),m.success("ìì ëììµëë¤")):(await C.create(t),m.success("ì¶ê°ëììµëë¤")),c()}catch{m.error("ì ì¥ ì¤í¨")}finally{x(!1)}},u="w-full border rounded-lg px-3 py-2 text-[13px] focus:border-[#2C5F8A] focus:ring-1 focus:ring-[#2C5F8A]/20 outline-none";return e.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-xl w-full max-w-lg max-h-[90vh] overflow-y-auto shadow-xl",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b bg-slate-50",children:[e.jsxs("h2",{className:"text-[15px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-blue-600"}),d?"ê°ì¢ ìì ":"ì ê°ì¢ ì¶ê°"]}),e.jsx("button",{onClick:r,className:"p-1 text-gray-400 hover:text-gray-600",children:e.jsx(P,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-5 space-y-3.5",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:["ê°ì¢ëª ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{value:t.name,onChange:a=>n({...t,name:a.target.value}),className:u,placeholder:"ì: 1ì¸ê¸° 문íë¡ ë³´ë ë°ì¸ìì (8주)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ëí ì´ë¯¸ì§"}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.imageUrl?e.jsxs("div",{className:"relative group",children:[e.jsx("img",{src:t.imageUrl,alt:"ê°ì¢ ëí ì´ë¯¸ì§",className:"w-24 h-16 rounded-lg object-cover border"}),e.jsx("button",{type:"button",onClick:()=>n(a=>({...a,imageUrl:""})),className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(P,{className:"w-3 h-3"})})]}):e.jsx("div",{className:"w-24 h-16 rounded-lg border-2 border-dashed border-gray-300 flex items-center justify-center bg-gray-50",children:e.jsx(W,{className:"w-5 h-5 text-gray-300"})}),e.jsxs("label",{className:"flex items-center gap-1.5 px-3 py-2 bg-gray-100 border border-gray-200 rounded-lg hover:bg-gray-200 cursor-pointer text-[12px] font-medium text-gray-600 transition-colors",children:[e.jsx(Z,{className:"w-3.5 h-3.5"}),h?"ì ë¡ë ì¤...":"ì´ë¯¸ì§ ì í",e.jsx("input",{type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:h})]})]}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"ííì´ì§ ê°ì¢ ì¹´ëì íìë©ëë¤ (5MB ì´í)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ì¹´í ê³ ë¦¬"}),e.jsx("select",{value:t.category,onChange:a=>n({...t,category:a.target.value}),className:u,children:Object.entries(E).map(([a,g])=>e.jsx("option",{value:a,children:g},a))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ìí"}),e.jsx("select",{value:t.status,onChange:a=>n({...t,status:a.target.value}),className:u,children:Object.entries(D).map(([a,g])=>e.jsx("option",{value:a,children:g},a))})]})]}),e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer px-3 py-2.5 rounded-lg border hover:bg-red-50/50 transition-colors",style:{borderColor:t.recruitmentClosed?"#ef4444":"#e5e7eb"},children:[e.jsx("input",{type:"checkbox",checked:t.recruitmentClosed,onChange:a=>n({...t,recruitmentClosed:a.target.checked}),className:"w-4 h-4 accent-red-500 rounded cursor-pointer"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[13px] font-semibold text-gray-700",children:"모ì§ë§ê°"}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5",children:"ì²´í¬íë©´ ìê°ì ì²ì´ ì°¨ë¨ëê³ '모ì§ë§ê°' ë°°ì§ê° íìë©ëë¤"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:["ê°ì¬ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{value:t.instructor,onChange:a=>n({...t,instructor:a.target.value}),className:u,placeholder:"ì´ëê·¼ 목ì¬"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ì§í¨"}),e.jsx("input",{value:t.instructorTitle,onChange:a=>n({...t,instructorTitle:a.target.value}),className:u,placeholder:"목ì¬"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:["ê°ììê° ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:t.scheduleText,onChange:a=>n({...t,scheduleText:a.target.value}),className:u,rows:3,placeholder:`ì: 2매주 ì£¼ì¼ ì¤í 3ì 3ê°ê°: 3ì 15ì¼(주ì¼)`}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5",children:"ííì´ì§ ìê°ìë´ì ê·¸ëë¡ íìë©ëë¤"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ì¥ì"}),e.jsx("textarea",{value:t.location,onChange:a=>n({...t,location:a.target.value}),className:u,rows:2,placeholder:"ê³ ë±ë¶ì¤"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ìê°ë£"}),e.jsx("input",{value:t.fee,onChange:a=>n({...t,fee:a.target.value}),className:u,placeholder:"1ë§ì"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ëì"}
3),e.jsx("input",{value:t.target,onChange:a=>n({...t,target:a.target.value}),className:u,placeholder:"êµì¸ ë구ë"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ì ì²ë°©ë²"}),e.jsx("input",{value:t.enrollment,onChange:a=>n({...t,enrollment:a.target.value}),className:u,placeholder:"ì¬ë¬´ì¤ ì ì²"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"íì¤ìê°"}),e.jsx("input",{value:t.tagline,onChange:a=>n({...t,tagline:a.target.value}),className:u,placeholder:"ë°ì¸ì ì¸ê³ë¥¼ ë§ëë¤"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ì¤ëª
"}),e.jsx("textarea",{value:t.description,onChange:a=>n({...t,description:a.target.value}),className:u,rows:2,placeholder:"ê°ì¢ ìì¸ ì¤ëª
"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ë¹ê³ "}),e.jsx("textarea",{value:t.note,onChange:a=>n({...t,note:a.target.value}),className:u,rows:2,placeholder:"기í ìë´ì¬í"})]}),e.jsxs("div",{className:"w-24",children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"ì ë ¬ìì"}),e.jsx("input",{type:"number",value:t.sortOrder,onChange:a=>n({...t,sortOrder:Number(a.target.value)}),className:u,min:1})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-5 border-t bg-gray-50 rounded-b-xl",children:[e.jsx("button",{onClick:r,className:"px-4 py-2 text-[13px] text-gray-600 border rounded-lg hover:bg-gray-100",children:"ì·¨ì"}),e.jsx("button",{onClick:j,disabled:i,className:"px-5 py-2 text-[13px] font-medium text-white bg-[#2C5F8A] rounded-lg hover:bg-[#1E4060] disabled:opacity-50 shadow-sm",children:i?"ì ì¥ ì¤...":d?"ìì ì ì¥":"ì¶ê°"})]})]})})}function ie({programs:s,enrollments:r,onReload:c}){const[d,i]=b.useState("all"),x=d==="all"?r:r.filter(t=>t.programId===d),h=async(t,n)=>{try{await T.updateStatus(t.id,n),m.success("ìíê° ë³ê²½ëììµëë¤"),c()}catch{m.error("ìí ë³ê²½ ì¤í¨")}},l=async t=>{if(confirm(`${t.name}ëì ì ì²ì ìì íìê² ìµëê¹?`))try{await T.remove(t.id),m.success("ìì ëììµëë¤"),c()}catch{m.error("ìì ì¤í¨")}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white rounded-xl border p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("label",{className:"text-[12px] font-semibold text-gray-600",children:"ê°ì¢ íí°:"}),e.jsxs("select",{value:d,onChange:t=>i(t.target.value),className:"border rounded-lg px-3 py-2 text-[13px] focus:border-[#2C5F8A] outline-none",children:[e.jsxs("option",{value:"all",children:["ì ì²´ (",r.length,"ê±´)"]}),s.map(t=>{const n=r.filter(o=>o.programId===t.id).length;return e.jsxs("option",{value:t.id,children:[t.name," (",n,"ê±´)"]},t.id)})]})]}),e.jsxs("div",{className:"text-[13px] text-gray-500",children:["ì¡°í ê²°ê³¼: ",e.jsx("strong",{className:"text-gray-800",children:x.length}),"ê±´"]})]})}),x.length===0?e.jsxs("div",{className:"bg-white rounded-xl border text-center py-16 text-gray-400 text-[13px]",children:[e.jsx(I,{className:"w-10 h-10 mx-auto mb-3 text-gray-300"}),"ìê°ì ì² ë´ìì´ ììµëë¤"]}):e.jsx("div",{className:"bg-white rounded-xl border overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 bg-gray-50/80",children:[e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:"ê°ì¢"}),e.jsxs("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:[e.jsx(Q,{className:"w-3 h-3 inline mr-1"}),"ì´ë¦"]}),e.jsxs("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:[e.jsx(V,{className:"w-3 h-3 inline mr-1"}),"ì°ë½ì²"]}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600",children:"êµì¸"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:"ë©ëª¨"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600",children:"ìí"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600",children:"ì ì²ì¼"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 w-[80px]",children:"ì¡ì
"})]})}),e.jsx("tbody",{children:x.map((t,n)=>e.jsxs("tr",{className:`border-b border-gray-100 hover:bg-blue-50/30 transition-colors ${n%2===1?"bg-gray-50/30":""}`,children:[e.jsx("td",{className:"px-4 py-3 text-[13px] text-gray-700 max-w-[180px] truncate",children:t.programName}),e.jsx("td",{className:"px-4 py-3 text-[13px] font-semibold text-gray-900",children:t.name}),e.jsx("td",{className:"px-4 py-3 text-[13px] text-gray-600",children:t.phone}),e.jsx("td",{className:"px-4 py-3 text-center",children:t.isMember?e.jsx("span",{className:"inline-block px-2 py-0.5 bg-green-100 text-green-700 rounded-md text-[11px] font-medium",children:"êµì¸"}):e.jsx("span",{className:"inline-block px-2 py-0.5 bg-gray-100 text-gray-500 rounded-md text-[11px] font-medium",children:"ì¸ë¶"})}),e.jsx("td",{className:"px-4 py-3 text-[12px] text-gray-500 max-w-[150px] truncate",children:t.note||"-"}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("select",{value:t.status,onChange:o=>h(t,o.target.value),className:`text-[12px] border rounded-md px-2 py-1 font-medium ${t.status==="confirmed"?"text-green-700 bg-green-50 border-green-200":t.status==="cancelled"?"text-red-700 bg-red-50 border-red-200":"text-amber-700 bg-amber-50 border-amber-200"}`,children:Object.entries(re).map(([o,j])=>e.jsx("option",{value:o,children:j},o))})}),e.jsx("td",{className:"px-4 py-3 text-center text-gray-400 text-[12px]",children:t.createdAt?new Date(t.createdAt).toLocaleDateString("ko-KR"):"-"}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{onClick:()=>l(t),className:"px-3 py-1.5 bg-red-500 text-white rounded-md text-[11px] font-medium hover:bg-red-600 transition-colors",children:"ìì "})})]},t.id))})]})})})]})}export{ge as AcademyManagementPage};
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.