PageSourceSearch

https://sociallab.sa/chunk-D6u3bIUr.js

js sociallab.sa collected 2026-09-24 13:32:06 UTC 13,810 bytes, 1 lines download raw bytes

1import {u}from'./chunk-BSHKUDSF.js';import {P as Pe}from'./chunk-CUDPYCdX.js';import {E as En,D as De}from'./chunk-D3crpTkA.js';import {f}from'./chunk-CjNSgPDz.js';import {h as he}from'./chunk-C2EVnWPI.js';import'./chunk-CC_dzDIF.js';import {c as ce}from'./chunk-Cha4_V9g.js';import'./chunk-yuXVPJRt.js';import {c8 as Xr,H,bO as Gt,aE as lt$1,O,bQ as P,K as Kb,P as Pg,bt as Is,bu as Tg,bT as zc,i as ea,j as ai,T as Tt,k as Kv,V as Vg,l as b0,aL as co,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,cX as pu,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,cS as z_,cT as T1,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$1,a8 as cy,aa as Xs,bZ as Vy,b_ as G_,ae as fS,a9 as qT,ad as hd,aB as Qm,ab as my,ac as V_,ai as ay,bC as tS,ag as _C,b$ as By,al as hS,ah as ZT,aj as ky,aZ as Ey,a_ as g_,a$ as m_,aT as l_,aR as o_,aS as Pp,aU as Lp,bB as lb,bE as fb,fS as jy,ak as Dd,bh as nS,ba as _y,aD as Fy}from'./main-CTPND76J.js';import'./chunk-CAH8VGMK.js';var nt=()=>["Edit the template body, using the listed placeholders for the parts that vary.","The template has to be active for anything to send.","Check Sent Messages to confirm a message actually left."],at=()=>[10,20,50],ot=i=>["/admin/clients/client-profile",i];function rt(i,p){if(i&1){let e=o_();Xs(0,"div",18)(1,"strong"),V_(2),fS(3,"translate"),hd(),Xs(4,"p",19),V_(5),hd()(),Xs(6,"div",18)(7,"strong"),V_(8),fS(9,"translate"),hd(),Xs(10,"span",20),V_(11),fS(12,"translate"),hd()(),Xs(13,"p",21),V_(14),fS(15,"translate"),Xs(16,"code"),V_(17),hd(),V_(18," , "),Xs(19,"code"),V_(20),hd()(),Xs(21,"button",22),my("click",function(){Pp(e);let t=l_(2);return Lp(t.startEditTemplate())}),V_(22),fS(23,"translate"),hd();}if(i&2){let e=l_(2);_C(2),Dd("",hS(3,14,"Template Body"),":"),_C(3),ky(e.template.templateBody),_C(3),Dd("",hS(9,16,"Status"),":"),_C(2),_y("text-success",e.template.isActive)("text-danger",!e.template.isActive),_C(),Dd(" ",hS(12,18,e.template.isActive?"Active":"Inactive")," "),_C(3),Dd("",hS(15,20,"Available placeholders"),": "),_C(3),Fy("","{","\u0627\u0644\u0627\u0633\u0645","}"),_C(3),Fy("","{","\u0627\u0644\u062C\u0648\u0627\u0644","}"),_C(2),Dd(" ",hS(23,22,"Edit Template")," ");}}function lt(i,p){if(i&1){let e=o_();Xs(0,"mat-form-field",23)(1,"mat-label"),V_(2),fS(3,"translate"),hd(),Xs(4,"textarea",24),Vy("ngModelChange",function(t){Pp(e);let d=l_(2);return G_(d.editTemplateBody,t)||(d.editTemplateBody=t),Lp(t)}),hd(),lb(),Xs(5,"mat-hint"),V_(6),fS(7,"translate"),hd()(),Xs(8,"div",18)(9,"mat-slide-toggle",25),Vy("ngModelChange",function(t){Pp(e);let d=l_(2);return G_(d.editTemplateActive,t)||(d.editTemplateActive=t),Lp(t)}),V_(10),fS(11,"translate"),hd(),lb(),hd(),Xs(12,"div",26)(13,"button",22),my("click",function(){Pp(e);let t=l_(2);return Lp(t.saveTemplate())}),V_(14),fS(15,"translate"),hd(),Xs(16,"button",27),my("click",function(){Pp(e);let t=l_(2);return Lp(t.cancelEditTemplate())}),V_(17),fS(18,"translate"),hd()();}if(i&2){let e=l_(2);_C(2),ky(hS(3,11,"Template Body")),_C(2),By("ngModel",e.editTemplateBody),fb(),_C(2),jy("",hS(7,13,"Available placeholders"),": ","{","\u0627\u0644\u0627\u0633\u0645","}"," , ","{","\u0627\u0644\u062C\u0648\u0627\u0644","}"),_C(3),By("ngModel",e.editTemplateActive),fb(),_C(),Dd(" ",hS(11,15,"Active")," "),_C(4),Dd(" ",hS(15,17,"Save Template")," "),_C(3),Dd(" ",hS(18,19,"Cancel")," ");}}function st(i,p){if(i&1&&(Xs(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),V_(3),fS(4,"translate"),hd()(),Xs(5,"mat-card-content",17),qT(6,rt,24,24)(7,lt,19,21),hd()()),i&2){let e=l_();_C(3),ky(hS(4,2,"SMS Template")),_C(3),ZT(e.isEditingTemplate?7:6);}}function mt(i,p){if(i&1){let e=o_();Xs(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),V_(3),fS(4,"translate"),hd()(),Xs(5,"mat-card-content",17)(6,"mat-form-field",23)(7,"mat-label"),V_(8),fS(9,"translate"),hd(),Xs(10,"textarea",24),Vy("ngModelChange",function(t){Pp(e);let d=l_();return G_(d.editTemplateBody,t)||(d.editTemplateBody=t),Lp(t)}),hd(),lb(),Xs(11,"mat-hint"),V_(12),fS(13,"translate"),hd()(),Xs(14,"div",18)(15,"mat-slide-toggle",25),Vy("ngModelChange",function(t){Pp(e);let d=l_();return G_(d.editTemplateActive,t)||(d.editTemplateActive=t),Lp(t)}),V_(16),fS(17,"translate"),hd(),lb(),hd(),Xs(18,"div",26)(19,"button",22),my("click",function(){Pp(e);let t=l_();return Lp(t.saveTemplate())}),V_(20),fS(21,"translate"),hd(),Xs(22,"button",27),my("click",function(){Pp(e);let t=l_();return Lp(t.cancelEditTemplate())}),V_(23),fS(24,"translate"),hd()()()();}if(i&2){let e=l_();_C(3),ky(hS(4,12,"Create SMS Template")),_C(5),ky(hS(9,14,"Template Body")),_C(2),By("ngModel",e.editTemplateBody),fb(),_C(2),jy("",hS(13,16,"Available placeholders"),": ","{","\u0627\u0644\u0627\u0633\u0645","}"," , ","{","\u0627\u0644\u062C\u0648\u0627\u0644","}"),_C(3),By("ngModel",e.editTemplateActive),fb(),_C(),Dd(" ",hS(17,18,"Active")," "),_C(4),Dd(" ",hS(21,20,"Create")," "),_C(3),Dd(" ",hS(24,22,"Cancel")," ");}}function dt(i,p){if(i&1){let e=o_();Xs(0,"div",6)(1,"p",18),V_(2),fS(3,"translate"),hd(),Xs(4,"button",22),my("click",function(){Pp(e);let t=l_();return Lp(t.startCreateTemplate())}),Xs(5,"mat-icon",28),V_(6,"add"),hd(),V_(7),fS(8,"translate"),hd()();}i&2&&(_C(2),ky(hS(3,2,"No SMS template has been configured yet.")),_C(5),Dd("",hS(8,4,"Create SMS Template")," "));}function pt(i,p){if(i&1&&(Xs(0,"a",29),V_(1),hd()),i&2){let e=p.$implicit;ay("routerLink",nS(2,ot,e.clientId)),_C(),Dd(" ",e.businessName||e.clientId," ");}}function ct(i,p){if(i&1&&V_(0),i&2){let e=p.$implicit;ky(e.phoneNumber);}}function ut(i,p){if(i&1&&V_(0),i&2){let e=p.$implicit;ky(e.messageBody);}}function gt(i,p){if(i&1&&cy(0,"app-user-date",30),i&2){let e=p.$implicit;
1ay("datetime",e.sentOn)("inline",true)("showIcon",false);}}function Mt(i,p){if(i&1&&(Xs(0,"span"),V_(1),fS(2,"translate"),hd()),i&2){let e=p.$implicit;_y("text-success",e.isSent)("text-danger",!e.isSent),_C(),Dd(" ",hS(2,5,e.isSent?"Delivered":"Failed")," ");}}function St(i,p){if(i&1&&V_(0),i&2){let e=p.$implicit;ky(e.errorMessage);}}function _t(i,p){i&1&&(Xs(0,"p",14),V_(1),fS(2,"translate"),hd()),i&2&&(_C(),ky(hS(2,1,"No sent messages found.")));}var xi=(()=>{class i{constructor(e,m,t,d,f){this.smsService=e,this.errorService=m,this.toastr=t,this.translate=d,this.loadingService=f,this.selectedTabIndex=0,this.template=null,this.editTemplateBody="",this.editTemplateActive=true,this.isEditingTemplate=false,this.isCreatingTemplate=false,this.clientSettings=[],this.clientSettingsColumns=[{key:"clientId",label:"Client",priority:1},{key:"monthlyLimit",label:"Monthly Limit",priority:2},{key:"monthlyUsed",label:"Monthly Used",priority:2},{key:"totalSent",label:"Total Sent",priority:2},{key:"uniqueCustomersReached",label:"Unique Customers",priority:3},{key:"isActive",label:"Status",priority:1},{key:"actions",label:"Actions",priority:1,hideLabel:true,stickyEnd:true}],this.clientIdFilter="",this.sentMessages=[],this.sentMessagesColumns=[{key:"businessName",label:"Client Name",priority:1},{key:"phoneNumber",label:"Phone Number",priority:1},{key:"messageBody",label:"Message",priority:2},{key:"sentOn",label:"Sent On",priority:2},{key:"isSent",label:"Delivery Status",priority:1},{key:"errorMessage",label:"Error Message",priority:3}],this.sentPageIndex=0,this.sentPageSize=20,this.sentTotal=0,this.sentFilterClientId="",this.isLoading=false;}ngOnInit(){this.loadTemplate(),this.loadSentMessages();}loadTemplate(){this.smsService.getSharedSMSTemplate().subscribe({next:e=>{e.succeeded&&e.data?(this.template=e.data,this.editTemplateBody=this.template.templateBody,this.editTemplateActive=this.template.isActive,this.isCreatingTemplate=false):this.template=null;},error:()=>{this.template=null;}});}startEditTemplate(){this.isEditingTemplate=true,this.template&&(this.editTemplateBody=this.template.templateBody,this.editTemplateActive=this.template.isActive);}cancelEditTemplate(){this.isEditingTemplate=false,this.isCreatingTemplate=false;}startCreateTemplate(){this.isCreatingTemplate=true,this.editTemplateBody="\u064A\u062D\u0627\u0648\u0644 {\u0627\u0644\u0627\u0633\u0645} \u0627\u0644\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643 \u060C \u0644\u0644\u0631\u062F \u064A\u0645\u0643\u0646\u0643\u0645 \u0627\u0644\u062A\u0648\u0627\u0635\u0644 \u0639\u0644\u0649 \u0627\u0644\u0648\u062A\u0633 \u0627\u0628 \u0639\u0644\u0649 \u0627\u0644\u0631\u0642\u0645 {\u0627\u0644\u062C\u0648\u0627\u0644} \u0648\u0634\u0643\u0631\u0627",this.editTemplateActive=true;}saveTemplate(){this.smsService.updateSharedSMSTemplate(this.editTemplateBody).subscribe({next:e=>{e.succeeded?(this.toastr.success("Template saved successfully."),this.isEditingTemplate=false,this.isCreatingTemplate=false,this.loadTemplate()):this.errorService.setError(e,this.translate.instant("Failed to save template."));},error:e=>this.errorService.setError(e,this.translate.instant("Failed to save template."))});}loadClientSettings(){this.clientIdFilter&&this.smsService.getClientSharedSMSSettings(this.clientIdFilter).subscribe({next:e=>{e.succeeded&&e.data&&(this.clientSettings=Array.isArray(e.data)?e.data:[e.data]);},error:e=>this.errorService.setError(e,this.translate.instant("Failed to load SMS status."))});}saveClientSettings(e){this.smsService.updateClientSharedSMSSettings(String(e.clientId),e.monthlyLimit,e.isActive).subscribe({next:m=>{m.succeeded?(this.toastr.success("Settings saved successfully"),this.loadClientSettings()):this.errorService.setError(m,this.translate.instant("Failed to save settings."));},error:m=>this.errorService.setError(m,this.translate.instant("Failed to save settings."))});}loadSentMessages(){this.isLoading=true,this.loadingService.beginSuppress(),this.smsService.getSharedSMSSentMessages(this.sentFilterClientId||void 0,void 0,void 0,void 0,this.sentPageIndex+1,this.sentPageSize).pipe(Xr(()=>{this.isLoading=false,this.loadingService.endSuppress();})).subscribe({next:e=>{e.succeeded&&e.data&&(e.data.items?(this.sentMessages=e.data.items,this.sentTotal=e.data.totalCount??this.sentMessages.length):Array.isArray(e.data)?(this.sentMessages=e.data,this.sentTotal=this.sentMessages.length):(this.sentMessages=[],this.sentTotal=0));},error:e=>this.errorService.setError(e,this.translate.instant("No sent messages found."))});}onSentPageChange(e){this.sentPageIndex=e.pageIndex,this.sentPageSize=e.pageSize,this.loadSentMessages();}searchSentMessages(){this.sentPageIndex=0,this.loadSentMessages();}static{this.\u0275fac=function(m){return new(m||i)(H(u),H(Gt),H(lt$1),H(O),H(P))};}static{this.\u0275cmp=Kb({type:i,selectors:[["admin-sms-management"]],viewQuery:function(m,t){if(m&1&&Ey(he,5),m&2){let d;g_(d=m_())&&(t.sentPaginator=d.first);}},decls:28,vars:23,consts:[["helpKey","admin-sms-management","intro","The SMS template the platform sends, and a log of what actually went out.","warning","A placeholder spelled 
1wrong is sent literally to the customer rather than being replaced.",3,"steps"],[1,"row"],[1,"col-12"],["mat-align-tabs","start",3,"selectedIndexChange","selectedIndex"],[3,"label"],[1,"p-24"],[1,"text-center","m-t-24"],[3,"dataSource","columns","loading"],["rtColumnDef","businessName"],["rtColumnDef","phoneNumber"],["rtColumnDef","messageBody"],["rtColumnDef","sentOn"],["rtColumnDef","isSent"],["rtColumnDef","errorMessage"],[1,"m-t-16","text-center"],[3,"page","length","pageSizeOptions"],[1,"text-center","m-t-16"],[1,"p-16"],[1,"m-b-16"],[1,"m-t-8"],[1,"m-l-8"],[1,"m-b-16","text-muted"],["mat-flat-button","","color","primary",3,"click"],["appearance","outline",1,"w-100","m-b-16"],["matInput","","rows","5","dir","rtl",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],[1,"d-flex","gap-8"],["mat-stroked-button","",3,"click"],[1,"m-r-4"],["target","_blank",1,"link-primary","cursor-pointer",3,"routerLink"],[3,"datetime","inline","showIcon"]],template:function(m,t){m&1&&(cy(0,"app-page-help",0),Xs(1,"div",1)(2,"div",2)(3,"mat-tab-group",3),Vy("selectedIndexChange",function(f){return G_(t.selectedTabIndex,f)||(t.selectedTabIndex=f),f}),Xs(4,"mat-tab",4),fS(5,"translate"),Xs(6,"div",5),qT(7,st,8,4,"mat-card")(8,mt,25,24,"mat-card")(9,dt,9,6,"div",6),hd()(),Xs(10,"mat-tab",4),fS(11,"translate"),Xs(12,"div",5)(13,"app-responsive-table",7),Qm(14,pt,2,4,"ng-template",8)(15,ct,1,1,"ng-template",9)(16,ut,1,1,"ng-template",10)(17,gt,1,3,"ng-template",11)(18,Mt,3,7,"ng-template",12)(19,St,1,1,"ng-template",13),hd(),qT(20,_t,3,3,"p",14),Xs(21,"paginator-configurable",15),my("page",function(f){return t.onSentPageChange(f)}),hd()()(),Xs(22,"mat-tab",4),fS(23,"translate"),Xs(24,"div",5)(25,"p",16),V_(26),fS(27,"translate"),hd()()()()()()),m&2&&(ay("steps",tS(21,nt)),_C(3),By("selectedIndex",t.selectedTabIndex),_C(),ay("label",hS(5,13,"SMS Template")),_C(3),ZT(t.template?7:t.isCreatingTemplate?8:9),_C(3),ay("label",hS(11,15,"Sent Messages")),_C(3),ay("dataSource",t.sentMessages)("columns",t.sentMessagesColumns)("loading",t.isLoading),_C(7),ZT(t.sentMessages.length===0?20:-1),_C(),ay("length",t.sentTotal)("pageSizeOptions",tS(22,at)),_C(),ay("label",hS(23,17,"Client SMS Settings")),_C(4),ky(hS(27,19,"This service is not developed yet.")));},dependencies:[ce,Pg,Is,Tg,zc,ea,ai,Tt,Pe,En,De,f,he,Kv,Vg,b0,co,L0,Yx,dn,da,vr,yr,Vw,Pw,nk,td,tC,bC,pu,sv,NC,XC,_D,oD,lD,mD,sD,il,XD,rM,Fb,t1,A1,z_,T1,gS,Vs,zs,NS,ZS,EI,us,ms,HI,ZI,Dn,kE,Jv,go,qd,YE,OT,lA,mt$1],styles:[":[_nghost-%COMP%]{display:block}.gap-8[_ngcontent-%COMP%]{gap:8px}.text-success[_ngcontent-%COMP%]{color:var(--color-primary-dark)}.text-danger[_ngcontent-%COMP%]{color:var(--color-error-text)}"],changeDetection:1});}}return i})();export{xi as AdminSMSManagementComponent};

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.