import{c as I}from"./chunk-3QM4VCPR.js";import{b as Q,c as Y,f as q}from"./chunk-XLWMYK7F.js";import{G as Z,O as ee,Q as te,n as X}from"./chunk-KPL7BGNQ.js";import{$b as $,Aa as C,B as c,Ba as u,Cc as J,Ec as K,Ka as a,La as s,Rb as O,Sb as k,X as r,Yb as F,Zb as D,_b as R,ac as B,ba as T,bb as S,cb as _,cc as H,gc as z,hc as A,ia as g,ja as f,jc as N,ka as P,ma as h,na as x,nc as j,oa as M,oc as L,pa as o,pc as U,qa as n,ra as m,sc as G,tb as w,ub as y,uc as V,x as b}from"./chunk-RBLFZ2PJ.js";import{a as W}from"./chunk-LNEQX42T.js";import{k as l}from"./chunk-24IZEI4V.js";var v=class i{constructor(){this.api=c(Y);this.endpoint="api/ElementoGestion/Gestion/Impresora/screens/";let t=c(q);this.endpoint=this.endpoint+t.currentSettings[t.COD_EMPRESA]+"/",this.endpoint=this.endpoint+t.currentSettings[t.COD_RESTAURANTE]+"/"}getScreens(){return l(this,null,function*(){return yield this.api.getFromServer(this.endpoint)})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}};function oe(i,t){if(i&1&&(o(0,"ion-item",14)(1,"ion-grid")(2,"ion-row")(3,"ion-col",15),a(4),n(),o(5,"ion-col",9),a(6),S(7,"number"),n(),o(8,"ion-col",7),a(9),n(),o(10,"ion-col",9),a(11),n(),o(12,"ion-col",12),a(13),n()()()()),i&2){let e=u().$implicit;M("product",e),r(4),s(e.Descripcion),r(2),s(_(7,6,e.Cantidad)),r(3),s(e.CamareroMarchado),r(2),s(e.Mesa),r(2),s(e.Hora)}}function re(i,t){if(i&1&&g(0,oe,14,8,"ion-item",14),i&2){let e=t.$implicit;f(e.Marcado===1&&e.Servido===0?0:-1)}}function ce(i,t){if(i&1&&(o(0,"ion-list",6)(1,"ion-list-header")(2,"ion-grid")(3,"ion-row",0)(4,"ion-col")(5,"h3"),a(6),n()()(),o(7,"ion-row")(8,"ion-col",7),m(9,"ion-icon",8),n(),o(10,"ion-col",9),a(11),S(12,"translate"),n(),o(13,"ion-col",7),m(14,"ion-icon",10),n(),o(15,"ion-col",9),m(16,"ion-icon",11),n(),o(17,"ion-col",12),m(18,"ion-icon",13),n()()()(),h(19,re,1,1,null,null,P),n()),i&2){let e=u(),d=e.$implicit,p=e.$index,E=u();r(6),s(E.screens[p]==null?null:E.screens[p].nombre),r(5),s(_(12,2,"QUANTITY")),r(8),x(d)}}function ae(i,t){if(i&1&&g(0,ce,21,4,"ion-list",6),i&2){let e=t.$implicit,d=t.$index,p=u();f(p.checkScreen(e,d)?0:-1)}}var ie=class i{constructor(){this.products=c(I);this.promisesHandler=c(Q);this.screensService=c(v);this.productsService=c(I);this.modalCtrl=c(U);this.loadingCtrl=c(G);this.screens=[];W({clipboard:X,person:Z,time:ee,volumeHigh:te})}ngOnInit(){return l(this,null,function*(){yield this.productsService.getSelectedProduct().subscribe(t=>{this.selectedProducts=t}),yield this.getScreens()})}getScreens(){return l(this,null,function*(){yield this.screensService.getScreens().then(t=>{t.forEach(e=>{this.screens[e.codigo]=e})})})}checkScreen(t,e){return t!==void 0&&t.length>0&&this.screens!==void 0}serve(){return l(this,null,function*(){yield this.loadingCtrl.create({}).then(t=>l(this,null,function*(){yield t.present(),this.productsService.processProducts(this.selectedProducts,this.productsService.SERVIR).then(()=>l(this,null,function*(){yield t.dismiss()}))}))})}dismiss(){this.modalCtrl.dismiss()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=T({type:i,selectors:[["app-serve-products"]],decls:15,vars:3,consts:[[1,"ion-text-center"],["slot","end",3,"click"],["name","close"],[1,"ion-padding"],["expand","block","fill","outline","size","large","color","success","icon-left","",3,"click"],["name","volume-high"],[1,"prodCenter"],["size","4",1,"ion-text-center"],["name","clipboard"],["size","1",1,"ion-text-center"],["name","person"],["name","open"],["size","2",1,"ion-text-center"],["name","time"],["appSelectProduct","",3,"product"],["size","4"]],template:function(e,d){e&1&&(o(0,"ion-header")(1,"ion-toolbar")(2,"ion-buttons")(3,"ion-title",0),a(4),S(5,"translate"),n(),o(6,"ion-button",1),C("click",function(){return d.dismiss()}),m(7,"ion-icon",2),n()()()(),o(8,"ion-content",3),h(9,ae,1,1,null,null,P),n(),o(11,"ion-footer")(12,"ion-toolbar",0)(13,"ion-button",4),C("click",function(){return d.serve()}),m(14,"ion-icon",5),n()()()),e&2&&(r(4),s(_(5,1,"SERVE_PRODUCTS")),r(5),x(d.screensProducts))},dependencies:[R,H,V,j,k,O,F,$,A,z,D,N,L,B,y,K,w,J],styles:["ion-grid[_ngcontent-%COMP%]{width:100%;padding:0}ion-grid[_ngcontent-%COMP%]   ion-row[_ngcontent-%COMP%]{width:100%}ion-grid[_ngcontent-%COMP%]   ion-row[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{height:2em;line-height:2em;background-color:var(--ion-color-warning);border-bottom:2px solid rgba(0,0,0,.2);margin-bottom:0;color:#000;font-size:1.2em}ion-item[_ngcontent-%COMP%]{--ion-safe-area-right: 0}"]})}};export{v as a,ie as b};
