%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/www2]/app/
Upload File :
Create Path :
Current File : /home/vacivi36/www2]/app/947.7c069494c49b6413.js

"use strict";(self.webpackChunkmaterial=self.webpackChunkmaterial||[]).push([[947],{9947:(I,f,r)=>{r.r(f),r.d(f,{CampaignModule:()=>q});var p=r(9808),C=r(6696),l=r(8279),v=r(6087),d=r(4847),c=r(3075),g=r(8966),t=r(5e3),Z=r(7261),_=r(4530),u=r(3737),x=r(7423),T=r(4834),y=r(5899);function b(e,i){1&e&&t._UZ(0,"mat-progress-bar",16)}let h=(()=>{class e{constructor(a,n,o,s,m){this.formBuilder=a,this._snackBar=n,this.campaignService=o,this.dialog=s,this.data=m,this.loading=!1,this.savedChange=!1,this.campaign=this.data.campaign}ngOnInit(){this.initForm(),this.populateForm(this.campaign)}initForm(){this.form=this.formBuilder.group({code:[null,[c.kI.required]],name:[null,[c.kI.required]],notes:[null]})}save(a){if(this.form.valid){this.loading=!0;let n=this.form.value;this.campaign?this.campaignService.update(this.campaign.id,n).then(o=>{this.campaign=o,this.savedChange=!0,this.openSnackBar("Salvo com sucesso!","Fechar","success"),a&&this.closeDialog()}).catch(o=>{this.openSnackBar(o.error.message,"Fechar","danger")}).finally(()=>{this.loading=!1}):this.campaignService.create(n).then(o=>{this.campaign=o,this.savedChange=!0,this.openSnackBar("Salvo com sucesso!","Fechar","success"),a&&this.closeDialog()}).catch(o=>{this.openSnackBar(o.error.message,"Fechar","danger")}).finally(()=>{this.loading=!1})}}populateForm(a){this.form.patchValue(a)}canSave(){return this.form.valid&&!this.loading}closeDialog(){this.savedChange?this.dialog.close(this.campaign):this.dialog.close()}openSnackBar(a,n,o){this._snackBar.open(a,n,{horizontalPosition:"right",verticalPosition:"bottom",duration:4e3,panelClass:"snackBar-"+o})}}return e.\u0275fac=function(a){return new(a||e)(t.Y36(c.qu),t.Y36(Z.ux),t.Y36(_.U),t.Y36(g.so),t.Y36(g.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-campaign-form-dialog"]],decls:29,vars:4,consts:[[3,"formGroup"],["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane","cdkDragHandle","",1,"d-flex","align-items-center","justify-content-between","cursor-pointer","p-2","mt-2","mx-2"],[1,"mdi","mdi-close","mb-2",3,"click"],["style","height: 3px;","color","accent","mode","indeterminate",4,"ngIf"],[1,"mat-typography","p-4","background-color-form"],[1,"row","mb-3","d-flex","align-items-center"],[1,"col-md-3"],[1,"form-label"],[1,"required"],["type","text","formControlName","code",1,"form-control"],[1,"col-md-9"],["type","text","formControlName","name",1,"form-control"],[1,"col-md-12","mt-3"],["formControlName","notes","rows","4",1,"form-control"],["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane","cdkDragHandle","","align","end",1,"cursor-pointer","p-2","mt-1","mx-2","mb-1"],["mat-button","","color","accent",3,"disabled","click"],["color","accent","mode","indeterminate",2,"height","3px"]],template:function(a,n){1&a&&(t.TgZ(0,"form",0)(1,"div",1)(2,"h6"),t._uU(3),t.qZA(),t.TgZ(4,"i",2),t.NdJ("click",function(){return n.closeDialog()}),t.qZA()(),t._UZ(5,"mat-divider"),t.YNc(6,b,1,0,"mat-progress-bar",3),t.TgZ(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),t._uU(11,"C\xf3digo"),t.qZA(),t.TgZ(12,"span",8),t._uU(13,"*"),t.qZA(),t._UZ(14,"input",9),t.qZA(),t.TgZ(15,"div",10)(16,"label",7),t._uU(17,"Nome"),t.qZA(),t.TgZ(18,"span",8),t._uU(19,"*"),t.qZA(),t._UZ(20,"input",11),t.qZA(),t.TgZ(21,"div",12)(22,"label",7),t._uU(23,"Observa\xe7\xf5es"),t.qZA(),t._UZ(24,"textarea",13),t.qZA()()(),t._UZ(25,"mat-divider"),t.TgZ(26,"div",14)(27,"button",15),t.NdJ("click",function(){return n.save(!0)}),t._uU(28,"Salvar e Fechar"),t.qZA()()()),2&a&&(t.Q6J("formGroup",n.form),t.xp6(3),t.Oqu(n.campaign?"Editar Campanha #"+n.campaign.id:"Adicionar Campanha"),t.xp6(3),t.Q6J("ngIf",n.loading),t.xp6(21),t.Q6J("disabled",!n.canSave()))},dependencies:[p.O5,u.Zt,u.Bh,x.lW,T.d,y.pW,c._Y,c.Fj,c.JJ,c.JL,c.sg,c.u],styles:[".required[_ngcontent-%COMP%]{color:#ea0505;margin-left:5px}.small-toggle[_ngcontent-%COMP%]{transform:scale(.75);margin:0}.small-toggle[_ngcontent-%COMP%]   .mat-slide-toggle-thumb[_ngcontent-%COMP%]{width:12px;height:12px}.small-toggle[_ngcontent-%COMP%]   .mat-slide-toggle-bar[_ngcontent-%COMP%]{height:14px}"]}),e})();var S=r(5664),D=r(6030),U=r(7531),k=r(7238);function A(e,i){1&e&&t._UZ(0,"mat-progress-bar",23)}function F(e,i){1&e&&(t.TgZ(0,"th",24),t._uU(1," C\xf3digo"),t.qZA())}function N(e,i){if(1&e&&(t.TgZ(0,"td",25),t._uU(1),t.qZA()),2&e){const a=i.$implicit;t.xp6(1),t.hij(" ",a.code,"")}}function w(e,i){1&e&&(t.TgZ(0,"th",24),t._uU(1," Nome"),t.qZA())}function B(e,i){if(1&e&&(t.TgZ(0,"td",25),t._uU(1),t.qZA()),2&e){const a=i.$implicit;t.xp6(1),t.hij(" ",a.name,"")}}function Y(e,i){1&e&&(t.TgZ(0,"th",24),t._uU(1," Observa\xe7\xf5es"),t.qZA())}function L(e,i){if(1&e&&(t.TgZ(0,"td",25),t._uU(1),t.qZA()),2&e){const a=i.$implicit;t.xp6(1),t.hij(" ",a.notes,"")}}function M(e,i){1&e&&t._UZ(0,"th",26)}function O(e,i){if(1&e){const a=t.EpF();t.TgZ(0,"td",25)(1,"div",27)(2,"button",28),t.NdJ("click",function(){const s=t.CHM(a).$implicit,m=t.oxw();return t.KtG(m.openDialog(s))}),t._UZ(3,"i",29),t.qZA(),t.TgZ(4,"button",30),t.NdJ("click",function(){const s=t.CHM(a).$implicit,m=t.oxw();return t.KtG(m.delete(s.id,s.name))}),t._UZ(5,"i",31),t.qZA()()()}}function J(e,i){1&e&&t._UZ(0,"tr",32)}function P(e,i){1&e&&t._UZ(0,"tr",33)}function E(e,i){if(1&e&&(t.TgZ(0,"tr",34)(1,"td",35)(2,"p",36),t._uU(3,"Nenhum registro encontrado."),t.qZA()()()),2&e){const a=t.oxw();t.xp6(1),t.uIk("colspan",a.displayedColumns.length)}}const Q=function(){return[25,50,100]},R=[{path:"",component:(()=>{class e{constructor(a,n,o,s,m){this._liveAnnouncer=a,this.dialog=n,this.confirmService=o,this._snackBar=s,this.campaignService=m,this.loading=!1,this.campaigns=[],this.displayedColumns=["code","name","notes","options"],this.dataSource=new l.by}ngOnInit(){this.downloadCampaigns()}ngAfterViewInit(){this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator}applyFilter(a){this.dataSource.filter=a.target.value.trim().toLowerCase()}sortChange(a){this._liveAnnouncer.announce(a.direction?`Sorted ${a.direction}ending`:"Sorting cleared")}openDialog(a){this.dialog.open(h,{width:"800px",maxHeight:"100vh",panelClass:"dialog",autoFocus:!1,data:{campaign:a}}).afterClosed().subscribe(o=>{o&&this.downloadCampaigns()})}downloadCampaigns(){this.loading=!0,this.campaignService.list().then(a=>{this.dataSource.data=a,this.campaigns=a}).catch(a=>{this.openSnackBar("Erro ao listar campanhas","Fechar","danger")}).finally(()=>{this.loading=!1})}delete(a,n){this.confirmService.openConfirmDialog("Excluir","Tem certeza que deseja excluir a campanha "+n+" ?","Cancelar","Excluir").afterClosed().subscribe(o=>{o&&(this.loading=!0,this.campaignService.delete(a).then(()=>{this.downloadCampaigns(),this.openSnackBar("Exclu\xedda com sucesso!","Fechar","success")}).catch(s=>{this.openSnackBar(s.error.message,"Fechar","danger")}).finally(()=>{this.loading=!1}))})}openSnackBar(a,n,o){this._snackBar.open(a,n,{horizontalPosition:"right",verticalPosition:"bottom",duration:3e3,panelClass:"snackBar-"+o})}redirectToWhatsapp(a){const o=`https://api.whatsapp.com/send/?phone=${a.replace(/\D/g,"")}`;window.open(o,"_blank")}formatarCellPhone(a){return a.replace(/(\d{2})(\d{5})(\d{4})/,"($1) $2-$3")}}return e.\u0275fac=function(a){return new(a||e)(t.Y36(S.Kd),t.Y36(g.uw),t.Y36(D.x),t.Y36(Z.ux),t.Y36(_.U))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-campaign-list"]],viewQuery:function(a,n){if(1&a&&(t.Gf(v.NW,5),t.Gf(d.YE,5)),2&a){let o;t.iGM(o=t.CRH())&&(n.paginator=o.first),t.iGM(o=t.CRH())&&(n.sort=o.first)}},decls:32,vars:7,consts:[[1,"d-flex","align-items-center","justify-content-between","p-2"],["mat-raised-button","","color","accent",1,"style-button-add",3,"click"],[1,"mt-3"],["style","height: 3px;","color","accent","mode","indeterminate",4,"ngIf"],[1,"header-table"],[1,"d-flex","align-items-center","justify-content-between"],[1,"search_input_group","search-table","w-25","mt-4","mb-4"],[1,"mdi","mdi-magnify"],["matInput","","placeholder","Pesquisar",1,"search_input",3,"input"],["input",""],[1,"table-responsive"],["mat-table","","matSort","",3,"dataSource","matSortChange"],["matColumnDef","code"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name"],["matColumnDef","notes"],["matColumnDef","options"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],[1,"mat-paginator",3,"pageSizeOptions"],["color","accent","mode","indeterminate",2,"height","3px"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],[1,"mat-icon-no-color"],["matTooltip","Editar",1,"icon-options",3,"click"],[1,"mdi","mdi-pencil-outline"],["matTooltip","Excluir",1,"icon-options-delete",3,"click"],[1,"mdi","mdi-trash-can-outline"],["mat-header-row",""],["mat-row",""],[1,"mat-row"],[1,"mat-cell"],[1,"d-flex","align-items-center","justify-content-center","mt-3"]],template:function(a,n){1&a&&(t.TgZ(0,"div",0)(1,"h3"),t._uU(2,"Campanhas"),t.qZA(),t.TgZ(3,"button",1),t.NdJ("click",function(){return n.openDialog()}),t._uU(4,"Adicionar Campanha"),t.qZA()(),t._UZ(5,"mat-divider",2),t.YNc(6,A,1,0,"mat-progress-bar",3),t.TgZ(7,"div",4)(8,"div",5)(9,"div",6),t._UZ(10,"i",7),t._uU(11,"\xa0 "),t.TgZ(12,"input",8,9),t.NdJ("input",function(s){return n.applyFilter(s)}),t.qZA()()(),t.TgZ(14,"div",10)(15,"table",11),t.NdJ("matSortChange",function(s){return n.sortChange(s)}),t.ynx(16,12),t.YNc(17,F,2,0,"th",13),t.YNc(18,N,2,1,"td",14),t.BQk(),t.ynx(19,15),t.YNc(20,w,2,0,"th",13),t.YNc(21,B,2,1,"td",14),t.BQk(),t.ynx(22,16),t.YNc(23,Y,2,0,"th",13),t.YNc(24,L,2,1,"td",14),t.BQk(),t.ynx(25,17),t.YNc(26,M,1,0,"th",18),t.YNc(27,O,6,0,"td",14),t.BQk(),t.YNc(28,J,1,0,"tr",19),t.YNc(29,P,1,0,"tr",20),t.YNc(30,E,4,1,"tr",21),t.qZA()(),t._UZ(31,"mat-paginator",22),t.qZA()),2&a&&(t.xp6(6),t.Q6J("ngIf",n.loading),t.xp6(9),t.Q6J("dataSource",n.dataSource),t.xp6(13),t.Q6J("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.xp6(1),t.Q6J("matRowDefColumns",n.displayedColumns),t.xp6(2),t.Q6J("pageSizeOptions",t.DdM(6,Q)))},dependencies:[p.O5,x.lW,l.BZ,l.fO,l.as,l.w1,l.Dz,l.nj,l.ge,l.ev,l.XQ,l.Gk,l.Ee,U.Nt,T.d,v.NW,y.pW,d.YE,d.nU,k.gM],styles:['table[_ngcontent-%COMP%]{width:100%}h3[_ngcontent-%COMP%]{font-size:23px}.status-icon[_ngcontent-%COMP%]{font-size:16px;display:flex;align-items:center;color:#0d8a0d}.status-icon-error[_ngcontent-%COMP%]{font-size:16px;display:flex;align-items:center;color:#d00808}.icon-whatsapp[_ngcontent-%COMP%]{color:#25d366;cursor:pointer;margin-left:5px}.mdi-whatsapp[_ngcontent-%COMP%]:before{content:"\\f05a3";font-size:16px}  .mat-table .mat-row:nth-child(odd){background-color:#f8f8f8}  .mat-table .mat-row:nth-child(even){background-color:#fff}']}),e})()},{path:"new",component:h},{path:":id/edit",component:h}];let z=(()=>{class e{}return e.\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[C.Bz.forChild(R),C.Bz]}),e})();var H=r(4540),j=r(79);let q=(()=>{class e{}return e.\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[p.ez,z,u._t,H.m,c.UX,j.Tx]}),e})()}}]);

Zerion Mini Shell 1.0