1import"./chunk-3DOB3D4Y.js";import{a as U}from"./chunk-Y75ERHTN.js";import"./chunk-O3ZGOWCX.js";import{$ as c,B,Cb as G,E as N,Ob as Y,Pa as O,Pb as z,R as P,Rb as V,Sa as j,i as k,rb as R,t as A}from"./chunk-DSWQWX5U.js";import"./chunk-C3ELASKV.js";import{p as x}from"./chunk-S3PEHNLM.js";import"./chunk-K5JSOS4B.js";import"./chunk-PPMQE2JW.js";import{$ as u,Bb as m,Cb as h,Db as f,Fa as L,J as $,L as M,N as T,Pb as b,Qa as l,S as _,a as o,aa as w,ab as F,ca as g,fb as I,l as D,ma as r,rd as E,s as C,sc as d,x as y,xc as a,y as S,yc as n}from"./chunk-4LX4HPCZ.js";var v=()=>[],oe=(()=>{class s extends z{constructor(){super(...arguments),this.router=r(k),this.messageService=r(R),this.toastrService=r(A),this.translateService=r(B),this.eMessagingService=r(U),this.filterConfigs=[{key:c.INPUT,name:"e-messaging.subject",control:{name:"subject",value:null}},{key:c.NGX_DATE_RANGE,name:"e-messaging.creation-date",dateControls:{maxDate:new Date,errorMessage:"validation.date",startDate:{name:"createdAfter",value:null,placeholder:"filter.placeholder.from"},endDate:{name:"createdBefore",value:null,placeholder:"filter.placeholder.to"}}},{key:c.NGX_DATE_RANGE,name:"e-messaging.modification-date",dateControls:{maxDate:new Date,errorMessage:"validation.date",startDate:{name:"updatedAfter",value:null,placeholder:"filter.placeholder.from"},endDate:{name:"updatedBefore",value:null,placeholder:"filter.placeholder.to"}}}],this.destroy$=new D}ngOnInit(){this.getDrafts(),this.initTable()}onFilter(e){this.filter$.next(o({},this.convertToTaDates(e))),this.pagination$.next({page:0,size:this.pagination$.value.size})}convertToTaDates(e){return P(e,{hasHours:!0,hasMinutes:!0,hasSeconds:!0},"YYYY-MM-DD","-")}getDrafts(){this.dataSource$=S([this.filter$,this.pagination$]).pipe(g(()=>this.isLoading$.next(!0)),T(50),u(([e,i])=>this.getDraftList({filter:o({draft:!0},e),page:o({},i)})))}getDraftList(e){return this.eMessagingService.getDraftList(e).pipe(g(i=>this.totalItems$.next(i?.count??0)),y(i=>i.data||[]),M(()=>C([])),_(()=>this.isLoading$.next(!1)))}initTable(){this.columns$.next([{key:"subject",label:"e-messaging.subject",tooltip:({subject:e})=>e.length>28?e:"",render:({subject:e})=>e.length>28?`${e.substring(0,28)}...`:e},{key:"createdAt",label:"e-messaging.creation-date"},{key:"updatedAt",label:"e-messaging.modification-date"}]),this.actions$.next([{key:"edit",taIcon:"ta-icon ic-edit",tooltip:"btn.edit",clicked:({el:{id:e}})=>this.router.navigate(["e-messaging","drafts",e])},{key:"delete",taIcon:"ta-icon ic-delete",tooltip:"btn.delete",clicked:({el:{id:e}})=>this.deleteDraft(e)}])}deleteDraft(e){this.messageService.showConfirmDialog("e-messaging.drafts.confirm-deleting").pipe($(i=>i),u(()=>this.eMessagingService.deleteDraft(e)),w(this.destroy$)).subscribe(()=>{this.pagination$.next(o({},this.pagination$.value)),this.toastrService.success(this.translateService.instant("e-messaging.drafts.deleted"))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.unsubscribe()}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=L(s)))(t||s)}})()}static{this.\u0275cmp=F({type:s,selectors:[["ssp-e-drafts-list"]],features:[I],decls:12,vars:30,consts:[[1,"mb-4"],[3,"isFilterShowed"],[3,"submit$","formConfigs","filterFormValue","isShowSearchManageAction"],[1,"w-100"],[3,"pageChange","showSearchResultTitle","dataSource","showIndex","showPagination","showTableColumn","pageIndex","totalItems","columns","actions","routeConstructorName","isLoading"]],template:function(i,t){i&1&&(h(0,"div",0)(1,"ta-filters-wrapper",1)(2,"ta-lib-filter",2),b("submit$",function(p){return t.onFilter(p)}),f()()(),h(3,"mat-card")(4,"div",3)(5,"ta-lib-table",4),a(6,"async"),a(7,"async"),a(8,"async"),a(9,"async"),a(10,"async"),a(11,"async"),b("pageChange",function(p){return t.pageChange(p)}),f()()()),i&2&&(l(),m("isFilterShowed",!0),l(),m("formConfigs",t.filterConfigs)("filterFormValue",t.filter$.getValue())("isShowSearchManageAction",!1),l(3),m("showSearchResultTitle",!0)("dataSource",n(6,15,t.dataSource$)||d(27,v))("showIndex",!0)("showPagination",!0)("showTableColumn",!0)("pageIndex",n(
17,17,t.pageIndex$)||0)("totalItems",n(8,19,t.totalItems$)||0)("columns",n(9,21,t.columns$)||d(28,v))("actions",n(10,23,t.actions$)||d(29,v))("routeConstructorName","ETax_Drafts")("isLoading",n(11,25,t.isLoading$)||!1))},dependencies:[G,Y,V,x,j,O,N,E],styles:["[_nghost-%COMP%] .mat-mdc-table tr th.mat-mdc-header-cell, [_nghost-%COMP%] .mat-mdc-table tr td.mat-mdc-cell{min-width:11rem}[_nghost-%COMP%] .mat-mdc-table tr th.mat-mdc-header-cell.mat-column-subject, [_nghost-%COMP%] .mat-mdc-table tr td.mat-mdc-cell.mat-column-subject{min-width:16rem}"]})}}return s})();export{oe as EDraftsListComponent};
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.