1import{c as ee,d as te}from"./chunk-QYFZHL7M.js";import{k as Y}from"./chunk-XKOUEAHG.js";import"./chunk-ETY5IXQX.js";import"./chunk-ZHEFE2UZ.js";import"./chunk-J4GJRNLY.js";import"./chunk-5CJWJTUM.js";import"./chunk-5V6PSLXI.js";import{d as X,e as q}from"./chunk-B2XCL7UU.js";import"./chunk-HZYGGRXH.js";import{a as K,b as Q}from"./chunk-YITBGLX6.js";import"./chunk-7IAGPEX4.js";import{a as W}from"./chunk-T3ZZJLHQ.js";import{a as A}from"./chunk-IZMVU2JJ.js";import"./chunk-XKIKHBBG.js";import"./chunk-V5P7OZPL.js";import"./chunk-CNCZHSUM.js";import"./chunk-ZCNPKFUW.js";import{b as U,c as J}from"./chunk-T5T543VA.js";import{c as H,d as G,e as P}from"./chunk-OONZWPV3.js";import"./chunk-NCQ7RH5Z.js";import"./chunk-VV6IORQA.js";import"./chunk-DI6ZKH2Z.js";import"./chunk-4YRY4IP2.js";import{ba as I,fa as k}from"./chunk-X4NFSBXU.js";import{u as L}from"./chunk-UQ7WXNBN.js";import{$b as w,Cb as y,Db as _,Eb as s,P as O,Qb as o,Rb as c,Sb as v,Tb as S,Wa as l,Xa as N,Xc as M,Zb as R,Zc as Z,_b as C,bd as z,ca as h,f as j,hd as D,jb as f,jc as E,lc as T,ma as u,mb as d,na as g,oa as $,pa as F,rb as b,ua as B,wb as t,xb as n,yb as p}from"./chunk-IK3CVY2O.js";import"./chunk-WWX6BADO.js";function me(a,i){if(a&1){let e=y();t(0,"div",4)(1,"div",5),p(2,"div",6),t(3,"div")(4,"h1",7),o(5,"Nomination Details"),n(),t(6,"p",8),o(7,"Review and manage nomination"),n()()(),t(8,"p-button",9),_("click",function(){u(e);let m=s();return g(m.closeModal())}),n()()}a&2&&(l(8),d("text",!0)("rounded",!0))}function se(a,i){if(a&1&&(t(0,"span",44),o(1),n()),a&2){let e=s(3);l(),v("(",e.selectedNomination.country==null?null:e.selectedNomination.country.continent,")")}}function de(a,i){if(a&1&&(t(0,"div",25)(1,"div",26)(2,"div",42),p(3,"i",43),n(),t(4,"div")(5,"h3",29),o(6,"Location"),n(),t(7,"p",30),o(8,"Country & continent"),n()()(),t(9,"p",31),o(10),f(11,se,2,1,"span",44),n()()),a&2){let e=s(2);l(10),v(" ",(e.selectedNomination.country==null?null:e.selectedNomination.country.name)||e.selectedNomination.country_name," "),l(),b(e.selectedNomination.country!=null&&e.selectedNomination.country.continent?11:-1)}}function pe(a,i){if(a&1&&(t(0,"div",25)(1,"div",26)(2,"div",45),p(3,"i",46),n(),t(4,"div")(5,"h3",29),o(6,"Company"),n(),t(7,"p",30),o(8,"Organization name"),n()()(),t(9,"p",31),o(10),n()()),a&2){let e=s(2);l(10),c(e.selectedNomination.company_name)}}function ce(a,i){if(a&1&&(t(0,"div",10)(1,"div",11)(2,"div",12)(3,"div",13)(4,"h2",14),o(5),n(),t(6,"div",15)(7,"div",16),p(8,"i",17),t(9,"span",18),o(10),n()(),t(11,"div",16),p(12,"i",19),t(13,"span"),o(14),n()()()(),t(15,"div",20)(16,"span",21),p(17,"i",22),o(18),n(),t(19,"span",23),o(20),E(21,"date"),n()()()(),t(22,"div",24)(23,"div",25)(24,"div",26)(25,"div",27),p(26,"i",28),n(),t(27,"div")(28,"h3",29),o(29,"Category"),n(),t(30,"p",30),o(31,"Nomination category"),n()()(),t(32,"p",31),o(33),n()(),f(34,de,12,2,"div",25)(35,pe,11,1,"div",32),t(36,"div",25)(37,"div",26)(38,"div",33),p(39,"i",34),n(),t(40,"div")(41,"h3",29),o(42,"Submitted"),n(),t(43,"p",30),o(44,"Creation date"),n()()(),t(45,"p",31),o(46),E(47,"date"),n()()(),t(48,"div",35)(49,"div",36)(50,"div",5)(51,"div",37),p(52,"i",38),n(),t(53,"div")(54,"h3",29),o(55,"Achievements & Accomplishments"),n(),t(56,"p",30),o(57,"Detailed description of nominee's achievements"),n()()()(),t(58,"div",39)(59,"div",40)(60,"p",41),o(61),n()()()()()),a&2){let e=s();l(5),S(" ",e.selectedNomination.first_name," ",e.selectedNomination.last_name," "),l(5),c(e.selectedNomination.brand==null?null:e.selectedNomination.brand.name),l(4),c(e.selectedNomination.email),l(2),d("ngClass",e.selectedNomination.processed?"bg-green-100 text-green-800 border-green-200":"bg-amber-100 text-amber-800 border-amber-200"),l(),d("ngClass",e.selectedNomination.processed?"pi pi-check-circle":"pi pi-clock"),l(),v(" ",e.selectedNomination.processed?"Processed":"Pending Review"," "),l(2),v(" ",T(21,13,e.selectedNomination.created_at,"
1short")," "),l(13),c((e.selectedNomination.subcategory==null?null:e.selectedNomination.subcategory.name)||(e.selectedNomination.category==null?null:e.selectedNomination.category.name)||e.selectedNomination.category_name),l(),b(e.selectedNomination.country||e.selectedNomination.country_name?34:-1),l(),d("ngIf",e.selectedNomination.company_name),l(11),c(T(47,16,e.selectedNomination.created_at,"fullDate")),l(15),c(e.selectedNomination.achievements)}}function ue(a,i){if(a&1){let e=y();t(0,"p-button",53),_("click",function(){u(e);let m=s(2);return g(m.updateStatus(m.selectedNomination))}),n()}}function ge(a,i){if(a&1){let e=y();t(0,"div",47)(1,"div",48),p(2,"i",49),t(3,"span"),o(4),E(5,"date"),n()(),t(6,"div",50)(7,"p-button",51),_("click",function(){u(e);let m=s();return g(m.closeModal())}),n(),f(8,ue,1,0,"p-button",52),n()()}if(a&2){let e=s();l(4),v("Last updated: ",T(5,3,e.selectedNomination==null?null:e.selectedNomination.created_at,"short"),""),l(3),d("text",!0),l(),d("ngIf",!(e.selectedNomination!=null&&e.selectedNomination.processed))}}var V=class a{selectedNomination=null;updateEvent=new B;closeEvent=new B;updateStatus(i){this.updateEvent.emit(i),this.closeModal()}closeModal(){this.closeEvent.emit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-nominee-detail-modal"]],inputs:{selectedNomination:"selectedNomination"},outputs:{updateEvent:"updateEvent",closeEvent:"closeEvent"},standalone:!0,features:[C],decls:4,vars:7,consts:[["styleClass","w-[95vw] sm:w-[85vw] md:w-[65vw] lg:w-[55vw] max-w-4xl",3,"visible","modal","draggable","resizable","closable","dismissableMask"],["pTemplate","header"],["class","px-6 py-4 space-y-6",4,"ngIf"],["pTemplate","footer"],[1,"flex","justify-between","items-center","w-full","py-2"],[1,"flex","items-center","gap-3"],[1,"w-2","h-8","bg-blue-500","rounded-full"],[1,"text-2xl","font-bold","text-gray-900"],[1,"text-sm","text-gray-500","mt-1"],["icon","pi pi-times","severity","secondary",1,"hover:bg-gray-100","transition-colors","duration-200",3,"click","text","rounded"],[1,"px-6","py-4","space-y-6"],[1,"bg-gradient-to-r","from-blue-50","to-indigo-50","border","border-blue-200","rounded-xl","p-6"],[1,"flex","items-start","justify-between"],[1,"flex-1"],[1,"text-2xl","font-bold","text-gray-900","mb-2"],[1,"flex","items-center","gap-4","text-gray-600","mb-3"],[1,"flex","items-center","gap-2"],[1,"pi","pi-building","text-blue-500"],[1,"font-medium"],[1,"pi","pi-envelope","text-blue-500"],[1,"flex","flex-col","items-end","gap-2"],[1,"px-4","py-2","rounded-full","text-sm","font-semibold","border","flex","items-center","gap-2",3,"ngClass"],[3,"ngClass"],[1,"text-xs","text-gray-500"],[1,"grid","grid-cols-1","md:grid-cols-2","gap-6"],[1,"bg-white","border","border-gray-200","rounded-lg","p-5","hover:shadow-sm","transition-shadow","duration-200"],[1,"flex","items-center","gap-3","mb-3"],[1,"w-10","h-10","bg-purple-100","rounded-lg","flex","items-center","justify-center"],[1,"pi","pi-tag","text-purple-600"],[1,"font-semibold","text-gray-900"],[1,"text-sm","text-gray-500"],[1,"text-gray-800","font-medium"],["class","bg-white border border-gray-200 rounded-lg p-5 hover:shadow-sm transition-shadow duration-200",4,"ngIf"],[1,"w-10","h-10","bg-orange-100","rounded-lg","flex","items-center","justify-center"],[1,"pi","pi-calendar","text-orange-600"],[1,"bg-white","border","border-gray-200","rounded-lg","overflow-hidden"],[1,"bg-gray-50","px-6","py-4","border-b","border-gray-200"],[1,"w-10","h-10","bg-yellow-100","rounded-lg","flex","items-center","justify-center"],[1,"pi","pi-star","text-yellow-600"],[1,"p-6"],[1,"prose","prose-sm","max-w-none"],[1,"text-gray-800","leading-relaxed","whitespace-pre-line"],[1,"w-10","h-10","bg-green-100","rounded-lg","flex","items-center","justify-center"],[1,"pi","pi-map-marker","text-green-600"],[1,"text-gray-500","text-sm","ml-2"],[1,"w-10","h-10","bg-blue-100","rounded-lg","flex","items-center","justify-center"],[1,"pi","pi-briefcase","text-blue-600"],[1,"flex","flex-col","sm:flex-row","justify-between","items-center","gap-4","w-full","pt-4","border-t","border-gray-200"],[1,"flex","items-center","gap-2","text-sm","text-gray-500"],[1,"pi","pi-info-circle"],[1,"flex","gap-3"],["type","button","label","Close","icon","pi pi-times",1,"p-button-secondary",3,"click","text"],["type","button","label","Mark as Processed","icon","pi pi-check","class","p-button-success",3,"click",4,"ngIf"],["type","button","label","Mark as Processed","icon","pi pi-check",1,"p-button-success",3,"click"]],template:function(e,r){e&1&&(t(0,"p-dialog",0),f(1,me,9,2,"ng-template",1)(2,ce,62,19,"div",2)(3,ge,9,6,"ng-template",3),n()),e&2&&(d("visible",!0)("modal",!0)("draggable",!1)("resizable",!1)("closable",!1)("dismissableMask",!0),l(2),d("ngIf",r.selectedNomination))},dependencies:[D,M,Z,z,q,X,k,P,G],styles:[".nomination-footer[_ngcontent-%COMP%] .p-button-label{font-size:14px!important}"]})};var _e=()=>[],xe=()=>({"min-width":"50rem"}),fe=()=>[20];function ve(a,i){a&1&&(t(0,"tr")(1,"th",12),o(2,"Name"),n(),t(3,"th",12),o(4,"Email"),n(),t(5,"th",12),o(6,"Brand"),n(),t(7,"th",12),o(8,"Category"),n(),t(9,"th",12),o(10,"Country"),n(),t(11,"th",12),o(12,"Status"),n(),t(13,"th",12),o(14,"Actions"),n()())}function ye(a,i){if(a&1&&o(0),a&2){let e=s().$implicit;v(" ",e.company_name," ")}}function be(a,i){if(a&1&&o(0),a&2){let e=s().$implicit;S(" ",e.first_name," ",e.last_name," ")}}function Ne(a,i){if(a&1){let e=y();t(0,"tr")(1,"td",13),f(2,ye,1,1)(3,be,1,2),n(),t(4,"td",13),o(5),n(),t(6,"td",13),o(7),n(),t(8,"td",13),o(9),n(),t(10,"td",13),o(11),n(),t(12,"td",13)(13,"span",14),o(14),n()(),t(15,"td",13)(16,"div",15)(17,"button",16),_("click",function(){let m=u(e).$implicit,x=s();return g(x.viewNomination(m))}),n(),t(18,"button",17),_("click",function(){let m=u(e).$implicit,x=s();return g(x.sendEmail(m))}),n(),t(19,"button",18),_("click",function(){let m=u(e).$implicit,x=s();return g(x.updateStatus(m))}),n()()()()}if(a&2){let e=i.$implicit;l(2),b(e.brand!=null&&e.brand.name.toLowerCase().includes("businesses")?2:3),l(3),c(e.email),l(2),c((e.brand==null?null:e.brand.name)||"-"),l(2),c((e.subcategory==null?null:e.subcategory.name)||(e.category==null?null:e.category.name)||e.category_name||"-"),l(2),c((e.country==null?null:e.country.name)||e.country_name||"-"),l(2),d("ngClass",e.processed?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"),l(
1),v(" ",e.processed?"Processed":"Pending"," "),l(5),d("disabled",e.processed)}}function he(a,i){a&1&&(t(0,"tr")(1,"td",19)(2,"div",20),$(),t(3,"svg",21),p(4,"path",22),n(),F(),t(5,"p",23),o(6,"No nominations found"),n(),t(7,"p",24),o(8,"There are currently no nominations in the system."),n()()()())}function Se(a,i){if(a&1){let e=y();t(0,"app-nominee-detail-modal",25),_("closeEvent",function(){u(e);let m=s();return g(m.displayDialog=!1)})("updateEvent",function(m){u(e);let x=s();return g(x.updateStatus(m))}),n()}if(a&2){let e=s();d("selectedNomination",e.selectedNomination)}}var ne=class a{constructor(i,e,r,m){this.nominationService=i;this.messageService=e;this.router=r;this.brandsService=m}currentBrand=null;nominations=null;loading=!0;currentPage=0;displayDialog=!1;selectedNomination=null;destroy$=new j;ngOnInit(){this.brandsService.brand$.pipe(O(this.destroy$)).subscribe(i=>{i?(i!==this.currentBrand&&(this.currentPage=0),this.currentBrand=i,this.getNominations()):(this.nominations=null,this.loading=!1)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getNominations(){this.currentBrand&&(this.loading=!0,this.nominationService.getNominationsLog(this.currentPage,{brand_id:this.currentBrand}).subscribe({next:i=>{this.nominations=i,this.loading=!1},error:i=>{console.error("Error fetching nominations:",i),this.loading=!1,this.messageService.add({severity:"error",summary:"Error",detail:"Failed to load nominations. Please try again."})}}))}viewNomination(i){this.selectedNomination=i,this.displayDialog=!0}updateStatus(i){i.processed||(this.loading=!0,this.nominationService.updateNomination(i.id,{processed:!0}).subscribe({next:()=>{if(this.loading=!1,this.nominations&&this.nominations.items){let e=this.nominations.items.findIndex(r=>
1r.id===i.id);e!==-1&&(this.nominations.items[e].processed=!0)}this.selectedNomination&&this.selectedNomination.id===i.id&&(this.selectedNomination.processed=!0),this.messageService.add({severity:"success",summary:"Success",detail:"Nomination status updated successfully"})},error:e=>{console.error("Error updating nomination status:",e),this.loading=!1,this.messageService.add({severity:"error",summary:"Error",detail:"Failed to update nomination status. Please try again."})}}))}sendEmail(i){this.router.navigate(["/admin/send-email"],{queryParams:{email:i.email,first_name:i.first_name,last_name:i.last_name,company_name:i.company_name,category_id:i.category?.id,country_id:i.country?.id,subcategory_id:i.subcategory?.id,is_nomination:!0}})}paginate(i){this.currentPage=i.page??0,this.getNominations()}static \u0275fac=function(e){return new(e||a)(N(W),N(I),N(L),N(A))};static \u0275cmp=h({type:a,selectors:[["app-nominations"]],standalone:!0,features:[R([I]),C],decls:14,vars:11,consts:[[1,"h-screen","w-screen","overflow-y-auto"],[1,"sticky","top-0","z-10"],[1,"px-5","md:ml-64","lg:px-10"],[1,"mt-10","flex","flex-col","gap-5"],[1,"mt-5"],[3,"value","tableStyle","loading"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],[1,"flex","justify-center","mt-5"],[3,"onPageChange","rows","totalRecords","first","rowsPerPageOptions"],[3,"selectedNomination"],[1,"text-sm","text-gray-700","font-medium"],[1,"text-sm","text-gray-700"],[1,"px-2","py-1","rounded-full","text-xs","font-medium",3,"ngClass"],[1,"flex","gap-2"],["pButton","","type","button","icon","pi pi-eye","title","View nomination",1,"p-button-rounded","p-button-info","p-button-sm",3,"click"],["pButton","","type","button","icon","pi pi-envelope","title","Send email",1,"p-button-rounded","p-button-help","p-button-sm",3,"click"],["pButton","","type","button","icon","pi pi-check","title","Mark as processed",1,"p-button-rounded","p-button-success","p-button-sm",3,"click","disabled"],["colspan","7"],[1,"flex","flex-col","items-center","justify-center","gap-y-2","p-8"],["xmlns","http://www.w3.org/2000/svg","height","50px","viewBox","0 -960 960 960","width","50px",1,"fill-gray-500"],["d","M0-240v-63q0-43 44-70t116-27q13 0 25 .5t23 2.5q-14 21-21 44t-7 48v65H0Zm240 0v-65q0-32 17.5-58.5T307-410q32-20 76.5-30t96.5-10q53 0 97.5 10t76.5 30q32 20 49 46.5t17 58.5v65H240Zm540 0v-65q0-26-6.5-49T754-397q11-2 22.5-2.5t23.5-.5q72 0 116 26.5t44 70.5v63H780Zm-455-80h311q-10-20-55.5-35T480-370q-55 0-100.5 15T325-320ZM160-440q-33 0-56.5-23.5T80-520q0-34 23.5-57t56.5-23q34 0 57 23t23 57q0 33-23 56.5T160-440Zm640 0q-33 0-56.5-23.5T720-520q0-34 23.5-57t56.5-23q34 0 57 23t23 57q0 33-23 56.5T800-440Zm-320-40q-50 0-85-35t-35-85q0-51 35-85.5t85-34.5q51 0 85.5 34.5T600-600q0 50-34.5 85T480-480Zm0-80q17 0 28.5-11.5T520-600q0-17-11.5-28.5T480-640q-17 0-28.5 11.5T440-600q0 17 11.5 28.5T480-560Zm1 240Zm-1-280Z"],[1,"font-medium","text-gray-800"],[1,"text-sm","text-gray-600"],[3,"closeEvent","updateEvent","selectedNomination"]],template:function(e,r){e&1&&(t(0,"div",0)(1,"nav",1),p(2,"app-admin-nav"),n(),t(3,"div",2)(4,"div",3)(5,"div",4)(6,"p-table",5),f(7,ve,15,0,"ng-template",6)(8,Ne,20,8,"ng-template",7)(9,he,9,0,"ng-template",8),n()(),t(10,"div",9)(11,"p-paginator",10),_("onPageChange",function(x){return r.paginate(x)}),n()()()()(),f(12,Se,1,1,"app-nominee-detail-modal",11),p(13,"p-toast")),e&2&&(l(6),d("value",(r.nominations==null?null:r.nominations.items)||w(8,_e))("tableStyle",w(9,xe))("loading",r.loading),l(5),d("rows",(r.nominations==null?null:r.nominations.items_per_page)||20)("totalRecords",(r.nominations==null?null:r.nominations.total_items)||0)("first",r.currentPage*((r.nominations==null?null:r.nominations.items_per_page)||20))("rowsPerPageOptions",w(10,fe)),l(),b(r.displayDialog?12:-1))},dependencies:[D,M,Y,te,ee,k,P,H,q,Q,K,J,U,V]})};export{ne as NominationsComponent};
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.