import{c as b}from"./chunk-EE2P3Q2R.js";import{b as q,c as J,f as K}from"./chunk-MT5VNIHV.js";import{G as te,O as ie,Q as ne,n as ee}from"./chunk-KPL7BGNQ.js";import{$ as w,$a as f,Ac as W,B as c,Cc as X,Ia as a,Ja as s,Pb as F,Qb as D,U as r,Wb as R,Xb as $,Yb as B,Zb as H,_b as z,ab as g,ac as A,ec as N,fc as j,ga as h,ha as x,hc as L,ia as C,ka as P,la as I,lc as U,ma as y,mc as G,na as n,nc as V,oa as i,pa as m,qc as Q,rb as O,sb as k,sc as Y,x as M,ya as E,za as _}from"./chunk-DRW4ORQZ.js";import{a as Z}from"./chunk-LNEQX42T.js";import{k as l}from"./chunk-24IZEI4V.js";var p=class p{constructor(){this.api=c(J);this.endpoint="api/ElementoGestion/Gestion/Impresora/screens/";let t=c(K);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)})}};p.\u0275fac=function(e){return new(e||p)},p.\u0275prov=M({token:p,factory:p.\u0275fac,providedIn:"root"});var v=p;function ce(o,t){if(o&1&&(n(0,"ion-item",14)(1,"ion-grid")(2,"ion-row")(3,"ion-col",15),a(4),i(),n(5,"ion-col",9),a(6),f(7,"number"),i(),n(8,"ion-col",7),a(9),i(),n(10,"ion-col",9),a(11),i(),n(12,"ion-col",12),a(13),i()()()()),o&2){let e=_().$implicit;y("product",e),r(4),s(e.Descripcion),r(2),s(g(7,6,e.Cantidad)),r(3),s(e.CamareroMarchado),r(2),s(e.Mesa),r(2),s(e.Hora)}}function ae(o,t){if(o&1&&h(0,ce,14,8,"ion-item",14),o&2){let e=t.$implicit;x(e.Marcado===1&&e.Servido===0?0:-1)}}function se(o,t){if(o&1&&(n(0,"ion-list",6)(1,"ion-list-header")(2,"ion-grid")(3,"ion-row",0)(4,"ion-col")(5,"h3"),a(6),i()()(),n(7,"ion-row")(8,"ion-col",7),m(9,"ion-icon",8),i(),n(10,"ion-col",9),a(11),f(12,"translate"),i(),n(13,"ion-col",7),m(14,"ion-icon",10),i(),n(15,"ion-col",9),m(16,"ion-icon",11),i(),n(17,"ion-col",12),m(18,"ion-icon",13),i()()()(),P(19,ae,1,1,null,null,C),i()),o&2){let e=_(),d=e.$implicit,u=e.$index,T=_();r(6),s(T.screens[u]==null?null:T.screens[u].nombre),r(5),s(g(12,2,"QUANTITY")),r(8),I(d)}}function le(o,t){if(o&1&&h(0,se,21,4,"ion-list",6),o&2){let e=t.$implicit,d=t.$index,u=_();x(u.checkScreen(e,d)?0:-1)}}var S=class S{constructor(){this.products=c(b);this.promisesHandler=c(q);this.screensService=c(v);this.productsService=c(b);this.modalCtrl=c(V);this.loadingCtrl=c(Q);this.screens=[];Z({clipboard:ee,person:te,time:ie,volumeHigh:ne})}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()}};S.\u0275fac=function(e){return new(e||S)},S.\u0275cmp=w({type:S,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&&(n(0,"ion-header")(1,"ion-toolbar")(2,"ion-buttons")(3,"ion-title",0),a(4),f(5,"translate"),i(),n(6,"ion-button",1),E("click",function(){return d.dismiss()}),m(7,"ion-icon",2),i()()()(),n(8,"ion-content",3),P(9,le,1,1,null,null,C),i(),n(11,"ion-footer")(12,"ion-toolbar",0)(13,"ion-button",4),E("click",function(){return d.serve()}),m(14,"ion-icon",5),i()()()),e&2&&(r(4),s(g(5,1,"SERVE_PRODUCTS")),r(5),I(d.screensProducts))},dependencies:[B,A,Y,U,D,F,R,H,j,N,$,L,G,z,k,X,O,W],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}"]});var oe=S;export{v as a,oe as b};
