PageSourceSearch

https://iitrpr.ac.in/assets/FacultyProfileManager-Cel_5laV.js

js iitrpr.ac.in collected 2026-09-24 09:37:05 UTC 28,504 bytes, 1 lines download raw bytes

1import{c as ie,r as d,D as Pe,Q as De,j as e,W as Se,F as Ae,Z as R,Y as se,X as ke,M as Ie,E as Ee,U as F}from"./index-cP4L_Hak.js";import{c as _e}from"./Compression-DprBITlU.js";import{v as Le,s as qe,d as M}from"./Validation-CKCV8MIW.js";import{P as ae,U as ne}from"./FacultyManager-j09N-8mj.js";import{C as Oe}from"./ConfirmDialog-DHcYISOj.js";import{f as b,g as $,d as re}from"./departmentUtils-DHRBpYva.js";import{B as U}from"./building--z5ZNweY.js";import{P as T,T as le}from"./trash-2-CsycC9LX.js";import{M as Re}from"./mail-BpWnUC9h.js";import{P as Me}from"./phone-Dyk5gq3Y.js";import{B}from"./book-open-CJrpmGqU.js";import{S as oe}from"./save-DkcP6ied.js";import"./InputSanitizer-BOVWea6G.js";const $e=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],J=ie("award",$e);const Ue=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Te=ie("circle-x",Ue),st=()=>{const de=d.useContext(Pe),{fetchDepartments:V,allDepartments:j,addFaculty:ce,fetchFaculties:me,allFaculties:v,updateFaculty:pe,deleteFaculty:ue}=de,{user:i}=De(),u=i?.role?.toLowerCase().includes("superadmin"),[o,xe]=d.useState([]),[he,ge]=d.useState([]),[be,z]=d.useState(!1),[w,K]=d.useState(!1),[P,G]=d.useState(""),[D,S]=d.useState(i?.role?.toLowerCase().includes("superadmin")?"all":i?.department?.toLowerCase()),[H,W]=d.useState(!1),[A,k]=d.useState({open:!1,id:null,name:""}),[n,x]=d.useState({id:null,name:"",designation:"",role:"Faculty",department:"",departmentCode:"",email:"",phone:"",profileImage:"",specialization:"",profile_link:"",publications:[],research:[],patents:[],office_address:"",imagePath:""}),[X,I]=d.useState(""),[N,y]=d.useState({publications:{editingIndex:null,value:""},research:{editingIndex:null,value:""},patents:{editingIndex:null,value:""}}),[f,E]=d.useState({publications:"",research:"",patents:""});d.useEffect(()=>{if(!j||j.length===0){V();return}const t=j.map(s=>({code:s.department_code,name:s.department_name}));xe(t)},[j,V]),d.useEffect(()=>{me()},[]),d.useEffect(()=>{if(v&&v.length>0&&o.length>0){const t=v.map(s=>{const a=b(o,s.departmentCode||s.department),l=a?.code||s.departmentCode||s.department||"",r=a?.name||s.department||"";return{...s,departmentCode:l,department:r}});ge(t)}},[v,o]),d.useEffect(()=>{if(!u&&o.length>0&&!n.department){const t=b(o,i?.department);t&&x(s=>({...s,department:t.name,departmentCode:t.code}))}},[o,i,u]),d.useEffect(()=>{!u&&i?.department&&S($(o,i.department))},[o,u,i?.department]);const h=t=>{const{name:s,value:a}=t.target;if(s==="departmentCode"){console.log("deptcode",o),console.log("dept value is",a);const l=o.find(r=>r.code?.toLowerCase()===a?.toLowerCase());console.log("selected dept is",l),x(r=>({...r,department:l?.name||"",departmentCode:a}))}else x(l=>({...l,[s]:a}))},fe=t=>{const s=t.target.files[0];if(s){x(l=>({...l,imagePath:s}));const a=new FileReader;a.onloadend=()=>{I(a.result),x(l=>({...l,profileImage:a.result}))},a.readAsDataURL(s)}},je=(t,s)=>{E(a=>({...a,[t]:s}))},Q=t=>{console.log("🔵 handleAddItem called for field:",t),console.log("🔵 newItemValues:",f),console.log("🔵 newItemValues[field]:",f[t]);const s=f[t]?.trim();if(console.log("🔵 Trimmed value:",s),!s){console.log("❌ No value to add");return}console.log("🔵 currentFaculty BEFORE update:",n),console.log(`🔵 currentFaculty.${t} BEFORE:`,n[t]),x(a=>{const l=Array.isArray(a[t])?a[t]:[],r=[...l,s];console.log("✅ Inside setState:"),console.log("  - prev[field]:",a[t]),console.log("  - currentArray:",l),console.log("  - newArray:",r);const c={...a,[t]:r};return console.log("  - Returning new state:",c),c}),E(a=>(console.log("🔵 Clearing input for",t),{...a,[t]:""}))},ve=(t,s,a)=>{y(l=>({...l,[t]:{editingIndex:s,value:a}}))},we=(t,s)=>{y(a=>({...a,[t]:{...a[t],value:s}}))},Y=(t,s)=>{const a=N[t].value.trim();a&&x(l=>({...l,[t]:l[t].map((r,c)=>c===s?a:r)})),_(t)},_=t=>{y(s=>({...s,[t]:{editingIndex:null,value:""}}))},Ne=(t,s)=>{x(a=>({...a,[t]:a[t].filter((l,r)=>r!==s)}))},Z=(t,s,a,l)=>{t.key==="Enter"?(t.preventDefault(),l()):t.key==="Escape"&&(t.preventDefault(),_(s))},ee=async t=>{t.preventDefault();const s=["name","designation","role","departmentCode","email"];for(const p of s){const O=p==="departmentCode"?n.departmentCode:n[p];if(!O||typeof O=="string"&&O.trim()===""){F("error",`Please fill the required field: ${p==="departmentCode"?"department":p}`);return}}console.log("Current Faculty State:",n),console.log("Publications:",n.publications),console.log("Research:",n.research),console.log("patents:",n.patents);const{isValid:a,errors:l}=Le(n,["name","email","phone"]);if(!a){Object.values(l).forEach(p=>F("error",p));return}let r,c,g,q;try{r=qe(n,{name:{type:"text",required:!0},designation:{type:"text",required:!0},role:{type:"text",required:!0},departmentCode:{type:"text",required:!0},email:{type:"text",required:!0},phone:{type:"text",allowEmpty:!0},specialization:{type:"text",allowEmpty:!0},profile_link:{type:"url",allowEmpty:!0},office_address:{type:"text",allowEmpty:!0}}),c=M(n.publications,"Publication"),g=M(n.research,"Research area"),q=M(n.patents,"Patent")}catch(p){F("error",p.message||"Please correct the invalid faculty input.");return}const m=new FormData;if(m.append("name",r.name),m.append("designation",r.designation),m.append("role",r.role),m.append("department",r.departmentCode),m.append("email",r.email),m.append("phone",r.phone||""),m.append("specialization",r.specialization||""),m.append("profile_link",r.profile_link||""),m.append("office_address",r.office_address||""),m.append("publications",JSON.stringify(c)),m.append("research",JSON.stringify(g)),m.append("patents",JSON.stringify(q)),console.log("Stringified Publications:",JSON.stringify(c)),console.log("Stringified Re
1search:",JSON.stringify(g)),console.log("Stringified patents:",JSON.stringify(q)),w&&m.append("id",n.id),n.imagePath&&n.imagePath instanceof File){const p=await _e(n.imagePath);m.append("image",p,n.imagePath.name)}console.log("=== FormData Contents ===");for(let p of m.entries())console.log(p[0]+":",p[1]);W(!0);try{w?await pe(n.id,m):await ce(m),C()}catch(p){console.error("Save Faculty Error:",p),F("error",p.response?.data?.message||"Failed to save faculty profile.")}finally{W(!1)}},ye=t=>{const s=b(o,t.departmentCode||t.department),a={...t,publications:Array.isArray(t.publications)?t.publications:[],research:Array.isArray(t.research)?t.research:[],patents:Array.isArray(t.patents)?t.patents:[],departmentCode:s?.code||t.departmentCode||t.department||"",department:s?.name||t.department||""};x({...a,id:t.id}),I(t.image?.download_url||t.profileImage||""),K(!0),z(!0)},Ce=(t,s)=>{k({open:!0,id:t,name:s})},Fe=()=>{ue(A.id),k({open:!1,id:null,name:""})},ze=()=>{k({open:!1,id:null,name:""})},C=()=>{if(x({id:null,name:"",designation:"",role:"Faculty",department:"",departmentCode:"",email:"",phone:"",profileImage:"",specialization:"",profile_link:"",publications:[],research:[],patents:[],office_address:"",imagePath:""}),I(""),z(!1),K(!1),y({publications:{editingIndex:null,value:""},research:{editingIndex:null,value:""},patents:{editingIndex:null,value:""}}),E({publications:"",research:"",patents:""}),!u){const t=b(o,i?.department);x((s=>({...s,departmentCode:t?.code||i?.department?.trim()||"",department:t?.name||i?.department?.trim()||""})))}},te=he.filter(t=>{const s=t.name.toLowerCase().includes(P.toLowerCase())||t.email.toLowerCase().includes(P.toLowerCase()),a=D==="all"||re(o,t.departmentCode,D),l=u||re(o,t.departmentCode,i?.department);return s&&a&&l}),L=(t,s=[],a)=>{const l=Array.isArray(s)?s:[];return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex gap-2 p-1 bg-slate-50 border border-slate-200 rounded-2xl group focus-within:ring-2 focus-within:ring-blue-500 transition-all",children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 text-blue-600 bg-white rounded-xl shadow-sm",children:a}),e.jsx("input",{type:"text",className:"flex-1 bg-transparent border-none outline-none text-sm px-2 py-2",placeholder:`Add new ${t}...`,value:f[t]||"",onChange:r=>je(t,r.target.value),onKeyDown:r=>Z(r,t,null,()=>Q(t))}),e.jsx("button",{className:"p-2 text-blue-600 hover:bg-white hover:shadow-sm rounded-xl transition disabled:opacity-30 disabled:hover:shadow-none",type:"button",onClick:()=>Q(t),disabled:!f[t]||!f[t].trim(),children:e.jsx(T,{size:20})})]}),e.jsx("div",{className:"space-y-2",children:l.map((r,c)=>e.jsx("div",{className:`flex items-center gap-2 p-3 bg-white border rounded-xl transition-all ${N[t]?.editingIndex===c?"border-blue-500 shadow-md ring-1 ring-blue-500":"border-slate-100 hover:border-slate-200 shadow-sm"}`,children:N[t]?.editingIndex===c?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"text",className:"flex-1 bg-slate-50 border-none outline-none text-sm px-3 py-1 rounded-lg",value:N[t]?.value||"",onChange:g=>we(t,g.target.value),onKeyDown:g=>Z(g,t,c,()=>Y(t,c)),autoFocus:!0}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:"p-1.5 text-green-600 hover:bg-green-50 rounded-lg transition",onClick:()=>Y(t,c),children:e.jsx(oe,{size:16})}),e.jsx("button",{type:"button",className:"p-1.5 text-slate-400 hover:bg-slate-50 rounded-lg transition",onClick:()=>_(t),children:e.jsx(Te,{size:16})})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"flex-1 text-sm text-slate-700 font-medium leading-relaxed",children:r}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",className:"p-1.5 text-blue-600 hover:bg-blue-50 rounded-lg transition",onClick:()=>ve(t,c,r),children:e.jsx(ae,{size:16})}),e.jsx("button",{type:"button",className:"p-1.5 text-red-600 hover:bg-red-50 rounded-lg transition",onClick:()=>Ne(t,c),children:e.jsx(le,{size:16})})]})]})},c))})]})};return e.jsxs("div",{className:"min-h-screen bg-slate-50 pb-12",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h1",{className:"text-4xl font-extrabold text-slate-900 tracking-tight sm:text-5xl mb-4",children:"Faculty Profile Manager"}),e.jsx("p",{className:"text-xl text-slate-500 max-w-2xl mx-auto",children:"Manage faculty profiles and information across departments"})]}),e.jsx("div",{className:"bg-white rounded-3xl shadow-sm border border-slate-200 p-6 mb-8 transform hover:shadow-md transition duration-300",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 items-center",children:[e.jsxs("div",{className:"md:col-span-12 lg:col-span-5 relative group",children:[e.jsx(Se,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 transition-colors group-focus-within:text-blue-500",size:20}),e.jsx("input",{type:"text",className:"w-full pl-12 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm",placeholder:"Search by name or email...",value:P,onChange:t=>G(t.target.value)})]}),e.jsxs("div",{className:"md:col-span-6 lg:col-span-4 relative group",children:[e.jsx(U,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 transition-colors group-focus-within:text-blue-500",size:20}),e.jsx("select",{className:`w-full pl-12 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition appearance-none shadow-sm ${u?"curs
1or-pointer":"cursor-not-allowed opacity-75"}`,value:D,onChange:t=>S(t.target.value),disabled:!u,children:u?e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"all",children:"All Departments"}),o.map(t=>e.jsx("option",{value:t.code,children:t.name},t.code))]}):e.jsx("option",{value:$(o,i?.department),children:b(o,i?.department)?.name||i?.department})})]}),e.jsx("div",{className:"md:col-span-6 lg:col-span-3",children:e.jsxs("button",{className:"w-full py-3.5 bg-slate-900 text-white font-bold rounded-2xl hover:bg-slate-800 transform hover:-translate-y-1 shadow-lg shadow-slate-200 transition-all flex items-center justify-center gap-2",onClick:()=>{C(),z(!0)},children:[e.jsx(T,{size:20}),"Add Faculty"]})})]})}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:te.map(t=>{const s=b(o,t.departmentCode||t.department),a=s?s.name:t.department;return e.jsx("div",{className:"group h-full",children:e.jsxs("div",{className:"bg-white h-full rounded-[2rem] border border-slate-200 shadow-sm hover:shadow-xl hover:border-blue-100 transition-all duration-300 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-8 pb-4 flex flex-col items-center flex-1",children:[e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 bg-blue-100 rounded-full scale-110 opacity-0 group-hover:opacity-100 transition-all duration-500 -z-1"}),e.jsx("img",{src:t.image?.download_url||`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&size=200`,alt:t.name,className:"w-32 h-32 rounded-full object-cover border-4 border-white shadow-xl transform transition-transform duration-500 group-hover:scale-105"})]}),e.jsx("h3",{className:"text-xl font-bold text-slate-800 text-center mb-1 group-hover:text-blue-600 transition-colors",children:t.name}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-4",children:[e.jsx("span",{className:"px-3 py-1 bg-blue-50 text-blue-700 text-[10px] font-bold rounded-full uppercase tracking-wider",children:t.designation}),t.role!=="Faculty"&&e.jsx("span",{className:"px-3 py-1 bg-red-50 text-red-700 text-[10px] font-bold rounded-full uppercase tracking-wider",children:t.role})]}),e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 text-sm mb-6 bg-slate-50 px-4 py-2 rounded-2xl",children:[e.jsx(U,{size:14,className:"text-blue-500"}),e.jsx("span",{className:"font-medium truncate max-w-[150px]",children:a})]}),e.jsxs("div",{className:"w-full space-y-3 mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-2xl hover:bg-white hover:shadow-sm border border-transparent hover:border-blue-100 transition",children:[e.jsx(Re,{size:16,className:"text-blue-500"}),e.jsx("a",{href:`mailto:${t.email}`,className:"text-sm font-medium text-slate-600 hover:text-blue-600 truncate",children:t.email})]}),t.phone&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-2xl hover:bg-white hover:shadow-sm border border-transparent hover:border-blue-100 transition text-sm font-medium text-slate-600",children:[e.jsx(Me,{size:16,className:"text-slate-400"}),e.jsx("span",{children:t.phone})]}),t.specialization&&e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-slate-50 rounded-2xl hover:bg-white hover:shadow-sm border border-transparent hover:border-blue-100 transition",children:[e.jsx(Ae,{size:16,className:"text-slate-400 mt-0.5"}),e.jsx("span",{className:"text-xs text-slate-500 italic leading-relaxed line-clamp-2",children:t.specialization})]})]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:[t.publications.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 bg-indigo-50 text-indigo-700 rounded-full text-[10px] font-bold",children:[e.jsx(B,{size:12})," ",t.publications.length," Pubs"]}),t.research.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 bg-emerald-50 text-emerald-700 rounded-full text-[10px] font-bold",children:[e.jsx(R,{size:12})," ",t.research.length," Areas"]}),t.patents.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 bg-amber-50 text-amber-700 rounded-full text-[10px] font-bold",children:[e.jsx(J,{size:12})," ",t.patents.length," Patents"]})]})]}),e.jsxs("div",{className:"p-4 bg-slate-50 flex gap-3 border-t border-slate-100",children:[e.jsxs("button",{className:"flex-1 py-3 bg-white text-slate-700 font-bold rounded-2xl border border-slate-200 hover:bg-blue-600 hover:text-white hover:border-blue-600 shadow-sm transition-all flex items-center justify-center gap-2",onClick:()=>ye(t),children:[e.jsx(ae,{size:16})," Edit"]}),e.jsxs("button",{className:"flex-1 py-3 bg-white text-red-600 font-bold rounded-2xl border border-slate-200 hover:bg-red-600 hover:text-white hover:border-red-600 shadow-sm transition-all flex items-center justify-center gap-2",onClick:()=>
1Ce(t.id,t.name),children:[e.jsx(le,{size:16})," Delete"]})]})]})},t.id)})}),te.length===0&&e.jsx("div",{className:"text-center py-20",children:e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-200 p-12 max-w-lg mx-auto transform hover:scale-[1.02] transition duration-500",children:[e.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(se,{size:48,className:"text-slate-300"})}),e.jsx("h3",{className:"text-2xl font-bold text-slate-800 mb-3",children:"No profiles found"}),e.jsx("p",{className:"text-slate-500 mb-8",children:"We couldn't find any faculty members matching your criteria."}),e.jsx("button",{className:"px-8 py-3 bg-blue-600 text-white font-bold rounded-2xl shadow-lg shadow-blue-200 hover:bg-blue-700 transition",onClick:()=>{G(""),S("all")},children:"Clear all filters"})]})}),e.jsx(Oe,{isOpen:A.open,message:`Are you sure you want to delete the faculty profile of "${A.name}"? This action cannot be undone.`,onConfirm:Fe,onCancel:ze})]}),be&&e.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center p-4 bg-slate-900/60 backdrop-blur-sm overflow-y-auto",children:e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-2xl w-full max-w-5xl my-8 overflow-hidden transform transition-all animate-in fade-in zoom-in duration-300 flex flex-col max-h-[90vh]",children:[e.jsxs("div",{className:"bg-slate-900 p-8 text-white flex justify-between items-center shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center border border-white/20",children:e.jsx(se,{size:24})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold",children:w?"Edit Faculty Profile":"Add New Faculty"}),e.jsx("p",{className:"text-slate-400 text-sm",children:"Please fill in the information below"})]})]}),e.jsx("button",{className:"p-3 bg-white/10 hover:bg-white/20 rounded-2xl transition-colors border border-white/10",onClick:C,children:e.jsx(ke,{size:24})})]}),e.jsx("form",{onSubmit:ee,className:"flex-1 overflow-y-auto p-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-12",children:[e.jsxs("div",{className:"lg:col-span-4 space-y-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest pl-1",children:"Profile Photo"}),e.jsx("div",{className:"aspect-square rounded-[3rem] bg-slate-50 border-4 border-dashed border-slate-200 flex flex-col items-center justify-center relative overflow-hidden group cursor-pointer hover:border-blue-400 transition-all",onClick:()=>document.querySelector('input[type="file"]').click(),children:X?e.jsxs("div",{className:"absolute inset-0 group",children:[e.jsx("img",{src:X,alt:"Preview",className:"w-full h-full object-cover transition duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(ne,{className:"text-white",size:32})})]}):e.jsxs("div",{className:"text-center p-8 space-y-4",children:[e.jsx("div",{className:"w-16 h-16 bg-white rounded-3xl shadow-sm flex items-center justify-center mx-auto text-blue-500 transform group-hover:-translate-y-1 transition duration-300 font-bold border border-slate-100",children:e.jsx(ne,{size:32})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-slate-700",children:"Upload Photo"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-1",children:"PNG, JPG up to 5MB"})]})]})}),e.jsx("input",{type:"file",accept:"image/*",onChange:fe,style:{display:"none"}})]}),e.jsxs("div",{className:"space-y-6 bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[e.jsxs("h6",{className:"text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(Ie,{size:16,className:"text-blue-500"}),"Contact Information"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Email Address *"}),e.jsx("input",{type:"email",className:"w-full px-5 py-3 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition shadow-sm font-medium text-sm",name:"email",value:n.email,onChange:h,required:!0,placeholder:"[email protected]"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Phone Number"}),e.jsx("input",{type:"tel",className:"w-full px-5 py-3 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition shadow-sm font-medium text-sm",name:"phone",value:n.phone,onChange:h,placeholder:"+91-000-000-0000"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Personal Profile (URL)"}),e.jsx("input",{type:"text",className:"w-full px-5 py-3 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition shadow-sm font-medium text-sm",name:"profile_link",value:n.profile_link,onChange:h,placeholder:"https://faculty.profile.com"})]})]})]})]}),e.jsxs("div",{className:"lg:col-span-8 space-y-10",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h6",{className:"text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(U,{size:16,className:"text-blue-500"}),"Academic Position"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Full Name *"}),e.jsx("input",{type:"text",className:"w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm font-bold",name:"name",value:n.name,onChange:h,required:!0,placeholder:"Dr. John Doe"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Designation *"}),e.jsxs("select",{className:`w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm font-medium text-sm appearance-none ${u?"curs
1or-pointer":"cursor-not-allowed opacity-75"}`,name:"designation",value:n.designation,onChange:h,required:!0,children:[e.jsx("option",{value:"",children:"Select Designation"}),e.jsx("option",{value:"Professor",children:"Professor"}),e.jsx("option",{value:"Associate Professor",children:"Associate Professor"}),e.jsx("option",{value:"Assistant Professor",children:"Assistant Professor"}),e.jsx("option",{value:"Associate Faculty",children:"Associate Faculty"}),e.jsx("option",{value:"Adjunct Faculty",children:"Adjunct Faculty"}),e.jsx("option",{value:"Inspire Faculty",children:"Inspire Faculty"}),e.jsx("option",{value:"Fellow Faculty",children:"Fellow Faculty"}),e.jsx("option",{value:"Former Faculty",children:"Former Faculty"}),e.jsx("option",{value:"Lecturer",children:"Lecturer"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:["Department ",!u&&e.jsx("span",{className:"text-red-500",children:"(Not Editable)"})," *"]}),e.jsx("select",{className:`w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm font-medium text-sm appearance-none ${u?"cursor-pointer":"cursor-not-allowed opacity-75"}`,name:"departmentCode",value:n.departmentCode,onChange:h,required:!0,disabled:!u,children:u?e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"",children:"Select Department"}),o.map(t=>e.jsx("option",{value:t.code,children:t.name},t.code))]}):e.jsx("option",{value:$(o,i?.department),children:b(o,i?.department)?.name||i?.department})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Administrative Role *"}),e.jsxs("select",{className:"w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm font-medium text-sm appearance-none cursor-pointer",name:"role",value:n.role,onChange:h,required:!0,children:[e.jsx("option",{value:"Faculty",children:"Faculty"}),e.jsx("option",{value:"HOD",children:"HOD"}),e.jsx("option",{value:"Dean",children:"Dean"}),e.jsx("option",{value:"Associate_Dean",children:"Associate Dean"}),e.jsx("option",{value:"Coordinator",children:"Coordinator"})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h6",{className:"text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(Ee,{size:16,className:"text-blue-500"}),"Extra Details"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Office Address"}),e.jsx("input",{type:"text",className:"w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm font-medium text-sm",name:"office_address",value:n.office_address,onChange:h,placeholder:"Room 226, Main Campus"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase ml-1",children:"Specialization"}),e.jsx("input",{className:"w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition shadow-sm font-medium text-sm",name:"specialization",value:n.specialization,onChange:h,placeholder:"e.g., Computer Vision, AI"})]})]})]}),e.jsxs("div",{className:"space-y-10",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h6",{className:"text-sm font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(B,{size:18,className:"text-indigo-500"})," Publications"]}),L("publications",n.publications,e.jsx(B,{size:16}))]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h6",{className:"text-sm font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(R,{size:18,className:"text-emerald-500"})," Research Areas"]}),L("research",n.research,e.jsx(R,{size:16}))]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h6",{className:"text-sm font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(J,{size:18,className:"text-amber-500"})," Patents"]}),L("patents",n.patents,e.jsx(J,{size:16}))]})]})]})]})}),e.jsxs("div",{className:"p-8 bg-slate-50 border-t border-slate-100 flex justify-end gap-4 shrink-0",children:[e.jsx("button",{type:"button",className:"px-8 py-3.5 bg-white text-slate-600 font-bold rounded-2xl border border-slate-200 hover:bg-slate-100 transition shadow-sm",onClick:C,children:"Cancel"}),e.jsx("button",{type:"submit",className:"px-8 py-3.5 bg-gradient-to-r from-blue-700 to-indigo-800 text-white font-bold rounded-2xl shadow-xl shadow-blue-200 hover:scale-[1.02] active:scale-[0.98] transition-all disabled:opacity-50",onClick:ee,disabled:H,children:H?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Saving..."]}):w?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(oe,{size:18})," Update Profile"]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(T,{size:18})," Create Profile"]})})]})]})})]})};export{st 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.