"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2775],{56773:(P,d,i)=>{i.d(d,{V:()=>o});var r=i(54438),f=i(36375);let o=(()=>{var c;class g{constructor(){this.reloadPage=!0}ngOnInit(){}handleRefresh(_){setTimeout(()=>{this.reloadPage&&location.reload(),_.target.complete()},1e3)}}return(c=g).\u0275fac=function(_){return new(_||c)},c.\u0275cmp=r.VBU({type:c,selectors:[["app-page-refresher"]],inputs:{reloadPage:"reloadPage"},decls:3,vars:0,consts:[["slot","fixed",2,"margin-top","70px",3,"ionRefresh"]],template:function(_,h){1&_&&(r.j41(0,"div")(1,"ion-refresher",0),r.bIt("ionRefresh",function(m){return h.handleRefresh(m)}),r.nrm(2,"ion-refresher-content"),r.k0s()())},dependencies:[f.To,f.Ki]}),g})()},2775:(P,d,i)=>{i.r(d),i.d(d,{NotificationPage:()=>R});var r=i(60177),f=i(89417),o=i(36375),c=i(45312),g=i(27803),t=i(54438),_=i(20891),h=i(75205),p=i(4417),m=i(56773);const E=(a,l)=>({"notification-read":a,"notification-unread":l});function v(a,l){if(1&a){const e=t.RV6();t.j41(0,"ion-card",8),t.bIt("click",function(){const s=t.eBV(e).$implicit,u=t.XpG(2);return t.Njj(u.markAsRead(s))}),t.j41(1,"ion-grid")(2,"ion-row")(3,"ion-col",9)(4,"ion-avatar",10),t.nrm(5,"img",11),t.k0s()(),t.j41(6,"ion-col",12)(7,"ion-label"),t.EFF(8),t.k0s(),t.nrm(9,"br")(10,"ion-icon",13),t.EFF(11,"\xa0 "),t.j41(12,"span",14),t.EFF(13),t.k0s()()()()()}if(2&a){const e=l.$implicit;t.xc7("background-color",e.notification_is_read?"white":"rgba(184, 184, 210, 0.4)"),t.Mz_("id","notification-",e.notification_id,""),t.Y8G("ngClass",t.l_i(8,E,1===e.notification_is_read,0===e.notification_is_read)),t.R7$(5),t.Y8G("src","assets/images/"+e.icon,t.B4B),t.R7$(3),t.JRh(e.title),t.R7$(5),t.JRh(e.time)}}function O(a,l){if(1&a){const e=t.RV6();t.j41(0,"div",1)(1,"ion-content",2),t.nrm(2,"app-page-refresher"),t.j41(3,"ion-header")(4,"ion-toolbar",3)(5,"ion-buttons",4)(6,"ion-button",5),t.bIt("click",function(){t.eBV(e);const s=t.XpG();return t.Njj(s.goBack())}),t.nrm(7,"ion-icon",6),t.k0s()(),t.j41(8,"ion-title"),t.EFF(9,"Notifications"),t.k0s()()(),t.DNE(10,v,14,11,"ion-card",7),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(),t.Y8G("fullscreen",!0),t.R7$(9),t.Y8G("ngForOf",e.notifications)}}let R=(()=>{var a;class l{constructor(n,s,u){this.apiRequest=n,this.router=s,this.toasterService=u,this.notifications=[],this.showSkeleton=!0,this.hasRecords=!1,this.forMobile=c.c.forMobile,this.limit=5,this.offset=0,this.totalItems=10}ngOnInit(){}ionViewWillEnter(){this.currentUser=JSON.parse(sessionStorage.getItem("user")||"{}"),this.roleName=sessionStorage.getItem("roleName")||"{}",this.loadNotifications()}loadNotifications(){this.apiRequest.get(`mst_notification/get_role_notification/${this.currentUser.role_id}/${this.limit}/${this.offset}`).subscribe(n=>{n.data.totalItems>0?(this.notifications=n.data.list,this.hasRecords=!0):(this.notifications=[],this.hasRecords=!1),this.showSkeleton=!1})}markAsRead(n){1!==n.notification_is_read&&(n.notification_is_read=1,this.apiRequest.post("mst_notification/add_edit_record",{notification_id:n.notification_id,notification_is_read:1}).subscribe(s=>{s.status?console.log("Notification marked as read"):console.log("Error marking notification as read")}))}goBack(){window.history.back()}}return(a=l).\u0275fac=function(n){return new(n||a)(t.rXU(_.x),t.rXU(h.Ix),t.rXU(p.W))},a.\u0275cmp=t.VBU({type:a,selectors:[["app-notification"]],standalone:!0,features:[t.aNF],decls:1,vars:1,consts:[["class","mobile","style","height:100%",4,"ngIf"],[1,"mobile",2,"height","100%"],[3,"fullscreen"],["color","primary"],["slot","start"],["color","light",3,"click"],["name","chevron-back-outline"],["class","card-radius card-shadow",3,"background-color","id","ngClass","click",4,"ngFor","ngForOf"],[1,"card-radius","card-shadow",3,"click","id","ngClass"],["size","3"],[1,"avatar","flex"],[1,"avatar-img",3,"src"],["size","9"],["name","time-outline",1,"dashboard-label"],[1,"dashboard-label"]],template:function(n,s){1&n&&t.DNE(0,O,11,2,"div",0),2&n&&t.Y8G("ngIf",s.forMobile)},dependencies:[o.bv,o.mC,o.Jm,o.QW,o.b_,o.hU,o.W9,o.lO,o.eU,o.iq,o.he,o.ln,o.BC,o.ai,r.MD,r.YU,r.Sq,r.bT,f.YN,g.G,m.V],styles:["ion-row[_ngcontent-%COMP%]{padding:5px 10px}.img-card[_ngcontent-%COMP%]{border-radius:12px;box-shadow:0 0 -1px 0 var(--ion-color-light)}ion-img[_ngcontent-%COMP%]{height:120px}.avatar[_ngcontent-%COMP%]{background-color:#ffebf0;height:60px;width:60px;border-radius:15px}.avatar-img[_ngcontent-%COMP%]{width:30px;object-fit:contain}.icon[_ngcontent-%COMP%]{font-size:26px;margin:11px;color:#f39335}.wallet-icon[_ngcontent-%COMP%]{font-size:26px;margin:11px}ion-segment-button[_ngcontent-%COMP%]{--indicator-color: var(--ion-color-primary) }ion-segment-button.md[_ngcontent-%COMP%]{--color: #000;--color-checked:var(--ion-color-primary);--indicator-height: 2px}.text-color[_ngcontent-%COMP%]{color:#858585}"]}),l})()}}]);