1import{a as x}from"./chunk-WSFU6SFG.js";import"./chunk-PJU3RY6S.js";import{a as E}from"./chunk-7Y4FQRRS.js";import{a as P}from"./chunk-I7XIRC2S.js";import{D as k,g as v,k as w,t as y,u as _,v as F}from"./chunk-T3OC74ZZ.js";import"./chunk-NAOEBZYB.js";import"./chunk-K2BAHOWP.js";import"./chunk-4QTHKBSW.js";import{w as A}from"./chunk-EQ6PZGEX.js";import{Eb as h,Nb as i,Ob as a,Pb as g,Yb as s,gb as c,jc as o,lb as p,oc as f,pc as b,qc as S,sb as u,sc as C}from"./chunk-QZFOZYL5.js";import{a as m}from"./chunk-SZAW6ZBW.js";var M=()=>[5,10,25,50],D=class d{constructor(e,r){this.apiService=e;this.permissionService=r}columns=[];data=[];totalRecords=0;isLoading=!1;rowActions=[];filterOptions={};pageSize=10;currentPage=1;selectedStatusFilter="";selectedCareerFilter="";ngOnInit(){this.setupColumns(),this.setupActions(),this.loadData()}setupColumns(){this.columns=[{key:"sno",label:"S.No",type:"number",width:"60px"},{key:"applicationNumber",label:"Application No",type:"text",width:"150px"},{key:"userName",label:"Applicant Name",type:"text",width:"180px"},{key:"userEmail",label:"Email",type:"text",width:"200px"},{key:"userPhone",label:"Phone",type:"text",width:"120px"},{key:"status",label:"Status",type:"status",width:"150px",statusConfig:{draft:{label:"Draft",color:"#fff",backgroundColor:"#6c757d"},submitted:{label:"Submitted",color:"#fff",backgroundColor:"#0d6efd"},under_review:{label:"Under Review",color:"#fff",backgroundColor:"#B26A00"},shortlisted:{label:"Shortlisted",color:"#fff",backgroundColor:"#17a2b8"},rejected:{label:"Rejected",color:"#fff",backgroundColor:"#dc3545"},selected:{label:"Selected",color:"#fff",backgroundColor:"#1B5E20"}}},{key:"createdAt",label:"Applied Date",type:"date",width:"120px"}]}PERM_PREFIX="career-applications";can(e){return this.permissionService.hasPermission(`${this.PERM_PREFIX}.${e}`)}setupActions(){this.rowActions=[],this.can("view")&&this.rowActions.push({icon:"eye",tooltip:"View Details",color:"#0A3C7D",onClick:e=>this.viewApplication(e)}),this.can("update")&&this.rowActions.push({icon:"edit",tooltip:"Update Status",color:"#0A3C7D",onClick:e=>this.updateStatus(e)})}loadData(e=1,r=10){this.isLoading=!0,this.currentPage=e;let t={};this.selectedStatusFilter&&(t.status=this.selectedStatusFilter),this.selectedCareerFilter&&(t.careerId=this.selectedCareerFilter),this.apiService.getCareerApplications(e,r,t).subscribe({next:n=>{n?.data?(this.data=n.data.map((l,R)=>m({sno:(e-1)*r+R+1},l)),this.totalRecords=n.total||n.data.length):(this.data=[],this.totalRecords=0),this.isLoading=!1},error:n=>{console.error("Error loading applications:",n),this.isLoading=!1}})}viewApplication(e){console.log("View application:",e)}updateStatus(e){console.log("Update status:",e)}onPageChange(e){this.loadData(e.pageIndex+1,e.pageSize)}onStatusFilterChange(){this.loadData(1,this.pageSize)}clearFilters(){this.selectedStatusFilter="",this.selectedCareerFilter="",this.loadData(1,this.pageSize)}static \u0275fac=function(r){return new(r||d)(p(E),p(P))};static \u0275cmp=u({type:d,selectors:[["app-career-applications"]],decls:32,vars:18,consts:[[1,"container-fluid","py-4"],[1,"card","shadow","border-0","rounded-4"],[1,"card-header","d-flex","align-items-center","justify-content-between","py-3","px-4",2,"background-color","#13296C","color","#fff"],[1,"mb-0","fw-bold"],[1,"card-body","p-4"],[1,"row","mb-3"],[1,"col-md-4"],[1,"form-label","fw-semibold","mb-2"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value",""],["value","draft"],["value","submitted"],["value","under_review"],["value","shortlisted"],["value","rejected"],["value","selected"],[1,"col-md-2"],[1,"btn","btn-outline-danger","w-100",3,"click"],[1,"ri-close-line","me-1"],[3,"pageChange","displayedColumns","dataSource","totalRecords","pageSize","pageSizeOptions","isLoading","showSearch","showFilter","showAddButton","tableTitle","filterOptions","selectable","rowActions","stickyHeader","stickyFooter","serverSidePagination"]],template:function(r,t){r&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"h5",3),o(4,"Career Applications"),a()(),i(5,"div",4)(6,"div",5)(7,"div",6)(8,"label",7),o(9,"Filter by Status"),a(),i(10,"select",8),S("ngModelChange",function(l){return b(t.selectedStatusFilter,l)||(t.selectedStatusFilter=l),l}),s("change",function(){return t.onStatusFilterChange()}),i(11,"option",9),o(12,"All Status"),a(),i(13,"option",10),o(14,"Draft"),a(),i(15,"option",11),o(16,"Submitted"),a(),i(17,"option",12),o(18,"Under Review"),a(),i(19,"option",13),o(20,"Shortlisted"),a(),i(21,"option",14),o(22,"Rejected"),a(),i(23,"option",15),o(24,"Selected"),a()()(),i(25,"div",16)(26,"label",7),o(27,"\xA0"),a(),i(28,"button",17),s("click",function(){return t.clearFilters()}),g(29,"i",18),o(30," Clear "),a()()(),i(31,"app-common-table",19),s("pageChange",function(l){return t.onPageChange(l)}),a()()()()),r&2&&(c(10),f("ngModel",t.selectedStatusFilter),c(21),h("displayedColumns",t.columns)("dataSource",t.data)("totalRecords",t.totalRecords)("pageSize",t.pageSize)("pageSizeOptions",C(17,M))("isLoading",t.isLoading)("showSearch",!0)("showFilter",!1)("showAddButton",!1)("tableTitle","Applications List")("filterOptions",t.f
1ilterOptions)("selectable",!1)("rowActions",t.rowActions)("stickyHeader",!0)("stickyFooter",!0)("serverSidePagination",!0))},dependencies:[A,k,_,F,y,v,w,x],encapsulation:2})};export{D as CareerApplicationsComponent};
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.