"use strict";(self.webpackChunkdemo1=self.webpackChunkdemo1||[]).push([[621],{4080:(M,P,s)=>{s.d(P,{r:()=>k});var h=s(8358),v=s(5312),C=s(8728),b=s(9493),y=s(9928),u=s(4438),I=s(2324),D=s(9417),L=s(5416);let k=(()=>{class m{constructor(a,c,_,g,p){this.data=a,this.router=c,this.fb=_,this.aRoute=g,this.snackBar=p,this.debug=v.c.production,this.permissions={},this.user_type=0,this.user_key="",this.role_type=0,this.userData={},this.userid=parseInt(this.userData?.id),this.keyfield=-1,this.amount=null,this.pkgselected=-1,this.user_type=parseInt(this.userData?.role_type),this.user_key=this.userData?.role_key||"",this.role_type=parseInt(this.userData?.role_type),this.router.events.pipe((0,C.p)(o=>o instanceof h.Ui),(0,b.s)(1)).subscribe(o=>{if(typeof o.snapshot?.data?.permissions<"u"&&Array.isArray(o.snapshot?.data?.permissions)){let d=o.snapshot?.data?.permissions;for(let x of d)this.permissions[x.mod_short_key]={exec_w:x.exec_w,exec_r:x.exec_r,exec_x:x.exec_x}}})}getRouteData(){let a=new y.t(null);return this?.router?.config[1]?.data?.gvdata?.getData().subscribe(c=>{a.next(c)}),a}setRouteData(a){this?.router?.config[1]?.data?.gvdata?.setData(a)}debug_log(a){}ngOnInit(){this.data.frm_label.subscribe(a=>{this.tag_label=a}),this.data.status.subscribe(a=>{this.state=a})}nextButtonClickEvent(){}Edit(a){this.data.changelabel("Edit Details"),this.data.Data=a,this.data.changefrm(!0)}Delete(a){this.openSnackBar("Data is deleted successfully","Clear")}onSubmit(){this.debug_log("Thanks for submitting! Data: "+JSON.stringify(this.cdata)),this.debug_log(this.keyfield.toString()),-1==this.keyfield?this.data.saveService(JSON.stringify(this.cdata)).subscribe(a=>{this.data.changefrm(!1),this.openSnackBar("Data is added successfully","Clear"),this.data.changelabel("List Details")}):this.data.updateService(JSON.stringify(this.cdata),this.keyfield).subscribe(a=>{this.data.changefrm(!1),this.data.Data=null,this.data.changelabel("List Details")})}openSnackBar(a,c){this.snackBar.open(a,c,{duration:2e3})}current_datetime(){let a=new Date,c=""+a.getFullYear(),_=""+(a.getMonth()+1),g=""+a.getDate(),p=""+a.getHours(),o=""+a.getMinutes(),d=""+a.getSeconds();return _=1==_.length?"0"+_:_,g=1==g.length?g="0"+g:g,p=1==p.length?p="0"+p:p,o=1==o.length?o="0"+o:o,d=1==d.length?d="0"+d:d,c+"-"+_+"-"+g+" "+p+":"+o+":"+d}onDestroy(){this.data.frm_label.unsubscribe()}static{this.\u0275fac=function(c){return new(c||m)(u.KVO(I.d),u.KVO(h.Ix),u.KVO(D.ok),u.KVO(h.nX),u.KVO(L.UG))}}static{this.\u0275prov=u.jDH({token:m,factory:m.\u0275fac})}}return m})()},2796:(M,P,s)=>{s.d(P,{ed:()=>w});var h=s(4438),v=s(177);class a{constructor(){this.change=new h.bkB,this.instances={},this.DEFAULT_ID="DEFAULT_PAGINATION_ID"}defaultId(){return this.DEFAULT_ID}register(t){return null==t.id&&(t.id=this.DEFAULT_ID),this.instances[t.id]?this.updateInstance(t):(this.instances[t.id]=t,!0)}updateInstance(t){let e=!1;for(let i in this.instances[t.id])t[i]!==this.instances[t.id][i]&&(this.instances[t.id][i]=t[i],e=!0);return e}getCurrentPage(t){return this.instances[t]?this.instances[t].currentPage:1}setCurrentPage(t,e){if(this.instances[t]){let i=this.instances[t];e<=Math.ceil(i.totalItems/i.itemsPerPage)&&1<=e&&(this.instances[t].currentPage=e,this.change.emit(t))}}setTotalItems(t,e){this.instances[t]&&0<=e&&(this.instances[t].totalItems=e,this.change.emit(t))}setItemsPerPage(t,e){this.instances[t]&&(this.instances[t].itemsPerPage=e,this.change.emit(t))}getInstance(t=this.DEFAULT_ID){return this.instances[t]?this.clone(this.instances[t]):{}}clone(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}}let w=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=h.$C({type:n}),n.\u0275inj=h.G2t({providers:[a],imports:[[v.MD]]}),n})()}}]);