1import {S}from'./chunk-BnTvkfq-.js';import {c as ce}from'./chunk-Cha4_V9g.js';import'./chunk-yuXVPJRt.js';import {H,bQ as P,bO as Gt,aE as lt,K as Kb,T as Tt,cr as pe,d5 as Pe,k as Kv,P as Pg,bt as Is,dg as jc,bu as Tg,bT as zc,V as Vg,l as b0,L as L0,Y as Yx,m as dn,b2 as da,by as vr,bz as yr,n as Vw,bA as Pw,o as nk,t as td,p as tC,q as bC,s as sv,N as NC,X as XC,_ as _D,aO as oD,aP as lD,b0 as mD,aX as sD,r as il,u as XD,v as rM,F as Fb,w as t1,y as A1,z as gS,B as Vs,C as zs,J as NS,Z as ZS,M as EI,Q as us,R as ms,S as HI,U as ZI,$ as Dn,a0 as kE,a1 as Jv,a2 as go,a3 as qd,a4 as YE,a5 as OT,a6 as lA,a7 as mt,a8 as cy,aa as Xs,ac as V_,ae as fS,ad as hd,bZ as Vy,b_ as G_,bB as lb,aB as Qm,ai as ay,bC as tS,ag as _C,aj as ky,al as hS,b$ as By,bE as fb,aR as o_,ab as my,aS as Pp,aT as l_,aU as Lp,ak as Dd}from'./main-CTPND76J.js';import'./chunk-CAH8VGMK.js';var Oe=()=>["Turn reminders on, then set the low-balance threshold.","Set how many days before expiry the expiry reminder is sent.","Reminders are delivered by the scheduled background jobs, so confirm those are running in this environment."],ke=()=>["Admin_AdjustPoints"];function He(d,je){if(d&1){let i=o_();Xs(0,"button",11),my("click",function(){Pp(i);let t=l_();return Lp(t.save())}),Xs(1,"mat-icon"),V_(2,"save"),hd(),V_(3),fS(4,"translate"),hd();}d&2&&(_C(3),Dd(" ",hS(4,1,"Save Settings")," "));}var Li=(()=>{class d{constructor(i,p,t,c){this.pointsAdminService=i,this.loadingService=p,this.errorService=t,this.toastr=c,this.settings={lowBalanceThreshold:0,expiryReminderDays:"14,7,1",cooldownHours:24,minimumAllowedBalance:0};}ngOnInit(){this.loadSettings();}loadSettings(){this.loadingService.loadingOn(),this.pointsAdminService.getReminderSettings().subscribe({next:i=>{this.loadingService.loadingOff(),i.succeeded&&i.data&&(this.settings=i.data);},error:i=>{this.loadingService.loadingOff(),this.errorService.setError(i,"Failed to load");}});}save(){this.loadingService.loadingOn(),this.pointsAdminService.updateReminderSettings(this.settings).subscribe({next:i=>{this.loadingService.loadingOff(),i.succeeded?this.toastr.success("Updated Successfully"):this.errorService.setError(i,"Failed to Update");},error:i=>{this.loadingService.loadingOff(),this.errorService.setError(i,"Failed to Update");}});}static{this.\u0275fac=function(p){return new(p||d)(H(S),H(P),H(Gt),H(lt))};}static{this.\u0275cmp=Kb({type:d,selectors:[["app-admin-reminder-settings"]],decls:44,vars:35,consts:[["helpKey","admin-points-reminders","title","Points reminders","intro","When clients are warned that they are running out of points, or that points are about to expire.",3,"steps"],[1,"cardWithShadow","theme-card"],[1,"m-b-0"],[1,"cardWithShadow"],[1,"p-24"],[1,"row"],[1,"col-md-6"],["appearance","outline",1,"w-100","m-b-16"],["matInput","","type","number","step","any",3,"ngModelChange","ngModel"],["matInput","","placeholder","14,7,1",3,"ngModelChange","ngModel"],["mat-flat-button","","color","primary","class","m-t-16",3,"click",4,"ngxPermissionsOnly"],["mat-flat-button","","color","primary",1,"m-t-16",3,"click"]],template:function(p,t){p&1&&(cy(0,"app-page-help",0),Xs(1,"mat-card",1)(2,"mat-card-header")(3,"mat-card-title",2)(4,"h3"),V_(5),fS(6,"translate"),hd()()()(),Xs(7,"mat-card",3)(8,"mat-card-content",4)(9,"div",5)(10,"div",6)(11,"mat-form-field",7)(12,"mat-label"),V_(13),fS(14,"translate"),hd(),Xs(15,"input",8),Vy("ngModelChange",function(a){return G_(t.settings.lowBalanceThreshold,a)||(t.settings.lowBalanceThreshold=a),a}),hd(),lb(),Xs(16,"mat-hint"),V_(17),fS(18,"translate"),hd()(),Xs(19,"mat-form-field",7)(20,"mat-label"),V_(21),fS(22,"translate"),hd(),Xs(23,"input",9),Vy("ngModelChange",function(a){return G_(t.settings.expiryReminderDays,a)||(t.settings.expiryReminderDays=a),a}),hd(),lb(),Xs(24,"mat-hint"),V_(25),fS(26,"translate"),hd()(),Xs(27,"mat-form-field",7)(28,"mat-label"),V_(29),fS(30,"translate"),hd(),Xs(31,"input",8),Vy("ngModelChange",function(a){return G_(t.settings.cooldownHours,a)||(t.settings.cooldownHours=a),a}),hd(),lb(),Xs(32,"mat-hint"),V_(33),fS(34,"translate"),hd()(),Xs(35,"mat-form-field",7)(36,"mat-label"),V_(37),fS(38,"translate"),hd(),Xs(39,"input",8),Vy("ngModelChange",function(a){return G_(t.settings.minimumAllowedBalance,a)||(t.settings.minimumAllowedBalance=a),a}),hd(),lb(),Xs(40,"mat-hint"),V_(41),fS(42,"translate"),hd()(),Qm(43,He,5,3,"button",10),hd()()()()),p&2&&(ay("steps",tS(33,Oe)),_C(5),ky(hS(6,15,"Points Reminder Settings")),_C(8),ky(hS(14,17,"Low Balance Threshold")),_C(2),By("ngModel",t.settings.lowBalanceThreshold),fb(),_C(2),ky(hS(18,19,"Alert when balance falls below this value")),_C(4),ky(hS(22,21,"Expiry Reminder Days")),_C(2),By("ngModel",t.settings.expiryReminderDays),fb(),_C(2),ky(hS(26,23,"Comma-separated days before expiry")),_C(4),ky(hS(30,25,"Cooldown Hours")),_C(2),By("ngModel",t.settings.cooldownHours),fb(),_C(2),ky(hS(34,27,"Minimum hours between alerts")),_C(4),ky(hS(38,29,"Minimum Allowed Balance")),_C(2),By("ngModel",t.settings.minimumAllowedBalance),fb(),_C(2),ky(hS(42,31,"Block o
1perations below this balance")),_C(2),ay("ngxPermissionsOnly",tS(34,ke)));},dependencies:[Tt,ce,pe,Pe,Kv,Pg,Is,jc,Tg,zc,Vg,b0,L0,Yx,dn,da,vr,yr,Vw,Pw,nk,td,tC,bC,sv,NC,XC,_D,oD,lD,mD,sD,il,XD,rM,Fb,t1,A1,gS,Vs,zs,NS,ZS,EI,us,ms,HI,ZI,Dn,kE,Jv,go,qd,YE,OT,lA,mt],encapsulation:2,changeDetection:1});}}return d})();export{Li as AdminReminderSettingsComponent};
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.