import{a as E}from"./chunk-IJK7ICES.js";import{f as g,i as r,x as b}from"./chunk-CGR7IOZB.js";import{a as C}from"./chunk-6753ERK4.js";import"./chunk-YN2DAHZU.js";import{Ba as s,Ca as a,Ja as u,Jb as _,Ta as v,ab as f,ba as d,ca as l,ha as p,qa as m,vb as h}from"./chunk-7SK34GC7.js";import"./chunk-JKOY2XUY.js";var w=()=>["ccode","refercode","parentcode","password","status","wallet"],T=(()=>{class n{constructor(e,t){this.apiService=e,this.router=t,this.list=[],this.loading=!1,this.actions=[{label:"Edit",action:"edit",color:"warning",key:"id"},{label:"Delete",action:"delete",color:"danger",key:"id"},{label:"Create Order",action:"other",color:"success",key:"id"}],this.filter=new g({table:new r("tbl_user"),key:new r("name"),value:new r("")})}ngOnInit(){this.getStats()}getStats(){this.loading=!0,this.apiService.customers().subscribe({next:e=>{this.list=e.data,this.loading=!1},error:e=>{console.error(e)}})}handleButtonClick(e){console.log(e)}edit(e){console.log("edit valie:"+e)}del(e){console.log("delete valie:"+e)}other(e){console.log("other valie:"+e),this.router.navigate(["store/order/create",e.id])}static{this.\u0275fac=function(t){return new(t||n)(l(C),l(_))}}static{this.\u0275cmp=p({type:n,selectors:[["app-list"]],decls:5,vars:4,consts:[[1,""],[1,"d-flex","justify-content-between"],[3,"editEvent","otherEvent","deleteEvent","data","exclude","actions"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"h3"),v(3,"Customers list"),a()(),s(4,"app-table",2),u("editEvent",function(i){return o.edit(i)})("otherEvent",function(i){return o.other(i)})("deleteEvent",function(i){return o.del(i)}),a()()),t&2&&(d(4),m("data",o.list)("exclude",f(3,w))("actions",o.actions))},dependencies:[E,h,b],encapsulation:2})}}return n})();export{T as ListComponent};
