File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/5290.bc3e7d80986e92e6.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5290],{35290:(gt,P,d)=>{d.r(P),d.d(P,{OrderPageModule:()=>_t});var g=d(56610),o=d(77897),m=d(22882),h=d(36075),p=d(73308),t=d(2978),b=d(69942);function I(n,c){if(1&n&&(t.j41(0,"ion-item")(1,"ion-label")(2,"h2"),t.EFF(3),t.k0s()(),t.j41(4,"ion-label",7)(5,"p"),t.EFF(6),t.k0s()()()),2&n){const e=c.$implicit;t.R7$(3),t.JRh(e.priceDiscount),t.R7$(3),t.JRh(e.name)}}function y(n,c){if(1&n&&(t.j41(0,"ion-list")(1,"ion-list-header",5),t.EFF(2," Listado de descuentos en el pedido "),t.k0s(),t.DNE(3,I,7,2,"ion-item",6),t.k0s()),2&n){const e=t.XpG();t.R7$(3),t.Y8G("ngForOf",e.listDiscount)}}function A(n,c){if(1&n&&(t.j41(0,"ion-item")(1,"ion-label")(2,"h2"),t.EFF(3),t.k0s()(),t.j41(4,"ion-label",7)(5,"p"),t.EFF(6),t.k0s()()()),2&n){const e=c.$implicit;t.R7$(3),t.JRh(e.discount),t.R7$(3),t.JRh(e.name)}}function C(n,c){if(1&n&&(t.j41(0,"ion-list")(1,"ion-list-header",5),t.EFF(2," Listado de productos con descuento "),t.k0s(),t.DNE(3,A,7,2,"ion-item",6),t.k0s()),2&n){const e=t.XpG();t.R7$(3),t.Y8G("ngForOf",e.listProductDiscount)}}let S=(()=>{class n{constructor(e,i,r,s){this.corporateIdentityService=e,this.navCtrl=i,this.navParams=r,this.modalCtrl=s,this.listDiscount=[],this.listProductDiscount=[],this.orderDetail=r.get("orderDetail"),this.typeDiscount=r.get("typeDiscount"),this.currency=this.corporateIdentityService.getCurrency()}ngOnInit(){this.detalDiscountOrder(this.orderDetail)}cancel(){this.modalCtrl.dismiss()}detalDiscountOrder(e){for(let i=0;i<e.discount_order_user.length;i++)if("discountOrder"==this.typeDiscount&&1!=e.discount_order_user[i].discount.discount_type_id){if(10!=e.discount_order_user[i].discount.discount_type_id){let r=0;r=e.discount_order_user[i].discount.price_discount?e.discount_order_user[i].discount.price_discount:(e.subtotal+e.cost_delivery)*e.discount_order_user[i].discount.percentage_discount/100,this.listDiscount.push({name:e.discount_order_user[i].discount.name,priceDiscount:r})}if(10==e.discount_order_user[i].discount.discount_type_id&&e.discount_order_user[i].discount.apply_value){let r=0;for(let a=0;a<e.discount_product_users.length;a++)r+=e.discount_order_user[i].discount.price_discount?e.discount_product_users[a].quantity*e.discount_order_user[i].discount.price_discount:e.discount_product_users[a].price_bruto*e.discount_product_users[a].quantity*e.discount_order_user[i].discount.percentage_discount/100;this.listDiscount.push({name:e.discount_order_user[i].discount.name,priceDiscount:r})}}else if("discountDelivery"==this.typeDiscount&&1==e.discount_order_user[i].discount.discount_type_id||"discountDelivery"==this.typeDiscount&&10==e.discount_order_user[i].discount.discount_type_id&&!e.discount_order_user[i].discount.apply_value){let r=0;r=e.discount_order_user[i].discount.price_discount?e.discount_order_user[i].discount.price_discount:(e.cost_delivery+e.discount_delivery)*e.discount_order_user[i].discount.percentage_discount/100,this.listDiscount.push({name:e.discount_order_user[i].discount.name,priceDiscount:r})}for(let i=0;i<e.products.length;i++){let r={name:"",discount:0};e.products[i].flash_price?(r.name=e.products[i].products.name,r.discount=(e.products[i].price_bruto-e.products[i].flash_price)*e.products[i].quantity):e.products[i].percentage_discount&&(r.name=e.products[i].products.name,r.discount=e.products[i].price_bruto*e.products[i].percentage_discount/100*e.products[i].quantity),r.discount&&this.listProductDiscount.push(r)}}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(b.r),t.rXU(o.q9),t.rXU(o.y8),t.rXU(o.W3))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["page-discount-detail"]],decls:12,vars:8,consts:[[1,"ion-no-border"],[1,"ion-text-center"],["slot","end"],["strong","","color","light",3,"click"],[4,"ngIf"],[1,"fontsize8"],[4,"ngFor","ngForOf"],["slot","end",1,"ion-text-end"]],template:function(i,r){1&i&&(t.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title",1),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"ion-buttons",2)(6,"ion-button",3),t.bIt("click",function(){return r.cancel()}),t.EFF(7),t.nI1(8,"translate"),t.k0s()()()(),t.j41(9,"ion-content"),t.DNE(10,y,4,1,"ion-list",4),t.DNE(11,C,4,1,"ion-list",4),t.k0s()),2&i&&(t.R7$(3),t.JRh(t.bMT(4,4,"TITLE_LIST_ORDER_DISCOUNT")),t.R7$(4),t.JRh(t.bMT(8,6,"all.close")),t.R7$(3),t.Y8G("ngIf",r.listDiscount.length),t.R7$(1),t.Y8G("ngIf",r.listProductDiscount.length))},dependencies:[g.Sq,g.bT,o.Jm,o.QW,o.W9,o.eU,o.uz,o.he,o.nf,o.AF,o.BC,o.ai,m.D9],styles:[".buttonOk[_ngcontent-%COMP%]{border-radius:5px}.modal-discount-detail[_ngcontent-%COMP%]{padding:150px 50px;background:rgba(0,0,0,.5)}.modal-discount-detail[_ngcontent-%COMP%] .modal-wrapper[_ngcontent-%COMP%]{border-radius:5px}.fontsize8[_ngcontent-%COMP%]{font-size:8px!important}"]})}return n})();var E=d(57291),D=d(18674),v=d(54171),f=d(37222);let x=(()=>{class n{constructor(e,i,r,s,a,l,_,T,R){this.translateService=e,this.alertCtrl=i,this.loadingCtrl=r,this.storage=s,this.orderProvider=a,this.toastCtrl=l,this.utilsService=_,this.navParams=T,this.modalCtrl=R,this.translateService.get(["TITLE_ALERT_CONFIRM_ORDER","TEXT_ALERT_RAKING","RATING_SUCCESS","TEXT1_APPRATE","TEXT2_APPRATE","TEXT3_APPRATE","TEXT4_APPRATE","TEXT5_APPRATE","TEXT6_APPRATE","TEXT7_APPRATE","TEXT8_APPRATE","TEXT9_APPRATE"]).subscribe(u=>{this.messageText={titleAlert:u.TITLE_ALERT_CONFIRM_ORDER,textAlert:u.TEXT_ALERT_RAKING,sendRating:u.RATING_SUCCESS,text1AppRate:u.TEXT1_APPRATE,text2AppRate:u.TEXT2_APPRATE,text3AppRate:u.TEXT3_APPRATE,text4AppRate:u.TEXT4_APPRATE,text5AppRate:u.TEXT5_APPRATE,text6AppRate:u.TEXT6_APPRATE,text7AppRate:u.TEXT7_APPRATE,text8AppRate:u.TEXT8_APPRATE,text9AppRate:u.TEXT9_APPRATE}}),this.order_id=this.navParams.get("order_id")}ngOnInit(){}logRatingChange(e){this.rating=e}ionViewDidLoad(){}cancel(){this.modalCtrl.dismiss()}sendRating(e){var i=this;return(0,p.A)(function*(){i.rating?i.storage.get("token").then(function(){var r=(0,p.A)(function*(s){s&&(i.utilsService.presentLoading(i.translateService.instant("all.loading")),(yield i.orderProvider.ratingOrder(i.rating,e,i.order_id,s.access_token)).subscribe(a=>{i.utilsService.dismissLoading(),"success"==a.status&&(i.utilsService.presentToast(3e3,"sucess","top",i.messageText.sendRating),i.cancel(),setTimeout(()=>{5==i.rating&&i.storage.get("parametersMain").then(l=>{})},500))},a=>{console.log("error generateOrder",a),i.utilsService.dismissLoading()}))});return function(s){return r.apply(this,arguments)}}()):yield(yield i.alertCtrl.create({header:i.messageText.titleAlert,subHeader:i.messageText.textAlert,buttons:["OK"]})).present()})()}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(m.c$),t.rXU(o.hG),t.rXU(o.Xi),t.rXU(E.n),t.rXU(D.Q),t.rXU(o.K_),t.rXU(v.T),t.rXU(o.y8),t.rXU(o.W3))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["page-order-rating"]],decls:26,vars:13,consts:[[1,"ion-no-border"],[1,"ion-padding"],["lines","none"],[1,"ion-text-center"],[1,"fontSize13"],["src","../../assets/img/rating-shopping.png",1,"imageRating"],["lines","none",1,"ion-text-center"],["type","text","name","commentaryRating",1,"ion-text-center",3,"placeholder","ngModel","ngModelChange"],["activeIcon","star","defaultIcon","star-outline","activeColor","#3cd5d2","defaultColor","#3cd5d2","readonly","false",3,"ratingChanged"],["color","primary","shape","round","expand","block","fill","solid",1,"ion-margin-top",3,"click"]],template:function(i,r){1&i&&(t.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title"),t.EFF(3),t.nI1(4,"translate"),t.k0s()()(),t.j41(5,"ion-content",1)(6,"ion-card")(7,"ion-item",2)(8,"ion-label",3)(9,"p",4),t.EFF(10),t.nI1(11,"translate"),t.k0s()()(),t.j41(12,"div",3),t.nrm(13,"img",5),t.k0s(),t.j41(14,"ion-item",2)(15,"ion-grid")(16,"ion-row")(17,"ion-col")(18,"ion-item",6)(19,"ion-textarea",7),t.bIt("ngModelChange",function(a){return r.commentaryRating=a}),t.nI1(20,"translate"),t.k0s()()()()()(),t.j41(21,"div",3)(22,"ionic5-star-rating",8),t.bIt("ratingChanged",function(a){return r.logRatingChange(a)}),t.k0s()(),t.j41(23,"ion-button",9),t.bIt("click",function(){return r.sendRating(r.commentaryRating)}),t.EFF(24),t.nI1(25,"translate"),t.k0s()()()),2&i&&(t.R7$(3),t.JRh(t.bMT(4,5,"ORDER_RATING_TITLE")),t.R7$(7),t.JRh(t.bMT(11,7,"ORDER_RATING_TITLE2")),t.R7$(9),t.FS9("placeholder",t.bMT(20,9,"PLACEHOLDER_TEXTAREA_RATING")),t.Y8G("ngModel",r.commentaryRating),t.R7$(5),t.SpI(" ",t.bMT(25,11,"BUTTON_SEND")," "))},dependencies:[o.Jm,o.b_,o.hU,o.W9,o.lO,o.eU,o.uz,o.he,o.ln,o.nc,o.BC,o.ai,o.Gw,f.BC,f.vS,m.D9],styles:[".ionic5-star-rating[_ngcontent-c0][_ngcontent-%COMP%] .button[_ngcontent-c0][_ngcontent-%COMP%]{width:54px!important}.imageRating[_ngcontent-%COMP%]{width:50%;margin:auto}.fontSize13[_ngcontent-%COMP%]{font-size:13px!important}"]})}return n})();var k=d(23867),F=d(7125),X=d(88909),$=d(70047),G=d(23793),j=d(97411);function M(n,c){if(1&n){const e=t.RV6();t.j41(0,"ion-buttons",16)(1,"ion-icon",17),t.bIt("click",function(){t.eBV(e);const r=t.XpG();return t.Njj(r.openActionSheet(r.orderDetail.id))}),t.k0s()()}}function N(n,c){1&n&&(t.j41(0,"ion-col",24),t.nrm(1,"img",33),t.k0s())}function U(n,c){1&n&&t.nrm(0,"img",34)}function Y(n,c){1&n&&t.nrm(0,"img",35)}function L(n,c){1&n&&t.nrm(0,"img",36)}function J(n,c){1&n&&t.nrm(0,"img",37)}function W(n,c){1&n&&t.nrm(0,"img",38)}function w(n,c){1&n&&t.nrm(0,"img",39)}function z(n,c){1&n&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(1),t.JRh(t.bMT(2,1,"STATE_ORDER_1")))}function B(n,c){1&n&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(1),t.JRh(t.bMT(2,1,"STATE_ORDER_2")))}function V(n,c){1&n&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(1),t.JRh(t.bMT(2,1,"STATE_ORDER_3")))}function H(n,c){1&n&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(1),t.JRh(t.bMT(2,1,"STATE_ORDER_4")))}function Q(n,c){1&n&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(1),t.JRh(t.bMT(2,1,"STATE_ORDER_5")))}function K(n,c){1&n&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(1),t.JRh(t.bMT(2,1,"STATE_ORDER_6")))}function Z(n,c){if(1&n){const e=t.RV6();t.j41(0,"ion-row")(1,"ion-col",3)(2,"ion-button",41),t.bIt("click",function(){t.eBV(e);const r=t.XpG(3);return t.Njj(r.orderQualify(r.orderDetail.id))}),t.nrm(3,"ion-icon",42),t.EFF(4),t.nI1(5,"translate"),t.k0s()()()}2&n&&(t.R7$(4),t.JRh(t.bMT(5,1,"ORDER_QUALIFY")))}function q(n,c){if(1&n&&(t.j41(0,"ion-card",19)(1,"ion-card-content")(2,"ion-grid",3)(3,"ion-row",20),t.DNE(4,N,2,0,"ion-col",21),t.j41(5,"ion-col",22),t.nrm(6,"img",23),t.k0s(),t.j41(7,"ion-col",24),t.DNE(8,U,1,0,"img",25),t.DNE(9,Y,1,0,"img",26),t.k0s(),t.j41(10,"ion-col",22),t.nrm(11,"img",23),t.k0s(),t.j41(12,"ion-col",24),t.DNE(13,L,1,0,"img",27),t.DNE(14,J,1,0,"img",28),t.k0s(),t.j41(15,"ion-col",22),t.nrm(16,"img",23),t.k0s(),t.j41(17,"ion-col",24),t.DNE(18,W,1,0,"img",29),t.DNE(19,w,1,0,"img",30),t.k0s()()(),t.DNE(20,z,3,3,"p",31),t.DNE(21,B,3,3,"p",31),t.DNE(22,V,3,3,"p",31),t.DNE(23,H,3,3,"p",31),t.DNE(24,Q,3,3,"p",31),t.DNE(25,K,3,3,"p",31),t.k0s(),t.DNE(26,Z,6,3,"ion-row",32),t.k0s()),2&n){const e=t.XpG(2);t.R7$(4),t.Y8G("ngIf",e.orderDetail.order_state.id<=6),t.R7$(4),t.Y8G("ngIf",e.orderDetail.order_state.id<2),t.R7$(1),t.Y8G("ngIf",e.orderDetail.order_state.id>=2),t.R7$(4),t.Y8G("ngIf",e.orderDetail.order_state.id<3),t.R7$(1),t.Y8G("ngIf",e.orderDetail.order_state.id>=3),t.R7$(4),t.Y8G("ngIf",e.orderDetail.order_state.id<4),t.R7$(1),t.Y8G("ngIf",e.orderDetail.order_state.id>=4),t.R7$(1),t.Y8G("ngIf",1==e.orderDetail.order_state.id),t.R7$(1),t.Y8G("ngIf",2==e.orderDetail.order_state.id),t.R7$(1),t.Y8G("ngIf",3==e.orderDetail.order_state.id),t.R7$(1),t.Y8G("ngIf",4==e.orderDetail.order_state.id),t.R7$(1),t.Y8G("ngIf",5==e.orderDetail.order_state.id),t.R7$(1),t.Y8G("ngIf",6==e.orderDetail.order_state.id),t.R7$(1),t.Y8G("ngIf",5==e.orderDetail.order_state.id)}}function tt(n,c){if(1&n&&(t.j41(0,"ion-list"),t.DNE(1,q,27,14,"ion-card",18),t.k0s()),2&n){const e=t.XpG();t.R7$(1),t.Y8G("ngIf",e.orderDetail)}}function et(n,c){if(1&n){const e=t.RV6();t.j41(0,"ion-item",43)(1,"ion-button",46),t.nrm(2,"ion-icon",47),t.j41(3,"a",48)(4,"ion-label",49),t.EFF(5),t.nI1(6,"translate"),t.k0s()()(),t.j41(7,"ion-button",50),t.bIt("click",function(){t.eBV(e);const r=t.XpG(3);return t.Njj(r.openWhatsapp(r.orderDetail.delivery_man.phone,r.orderDetail.code))}),t.nrm(8,"ion-icon",51),t.EFF(9),t.nI1(10,"translate"),t.k0s()()}if(2&n){const e=t.XpG(3);t.R7$(3),t.Mz_("href","tel:'",e.orderDetail.delivery_man.phone,"'",t.B4B),t.R7$(2),t.JRh(t.bMT(6,3,"ORDERS_CALL")),t.R7$(4),t.SpI(" ",t.bMT(10,5,"ORDERS_CHAT")," ")}}function it(n,c){if(1&n&&(t.j41(0,"ion-card")(1,"ion-item",43)(2,"ion-avatar",1),t.nrm(3,"img",44),t.k0s(),t.j41(4,"ion-label")(5,"h2"),t.EFF(6),t.k0s(),t.j41(7,"p"),t.EFF(8),t.k0s()()(),t.DNE(9,et,11,7,"ion-item",45),t.k0s()),2&n){const e=t.XpG(2);t.R7$(3),t.FCK("src","",e.cityProvider._urlGallery,"deliveryman/",e.orderDetail.delivery_man.user_info.photo,"",t.B4B),t.R7$(3),t.Lme("",e.orderDetail.delivery_man.first_name," ",e.orderDetail.delivery_man.last_name,""),t.R7$(2),t.SpI("Placa: ",e.orderDetail.delivery_man.user_info.plate,""),t.R7$(1),t.Y8G("ngIf",e.orderDetail.order_state.id<=5)}}function nt(n,c){if(1&n&&(t.j41(0,"ion-list"),t.DNE(1,it,10,6,"ion-card",32),t.k0s()),2&n){const e=t.XpG();t.R7$(1),t.Y8G("ngIf",e.orderDetail.delivery_man)}}function rt(n,c){if(1&n&&(t.j41(0,"div"),t.nrm(1,"app-product-list",52),t.k0s()),2&n){const e=t.XpG(2);t.R7$(1),t.Y8G("listProducts",e.listProducts)("origin","orderDetail")}}function ot(n,c){if(1&n&&(t.j41(0,"ion-list"),t.DNE(1,rt,2,2,"div",32),t.k0s()),2&n){const e=t.XpG();t.R7$(1),t.Y8G("ngIf",e.orderDetail)}}function st(n,c){if(1&n){const e=t.RV6();t.j41(0,"app-total-summary",53),t.bIt("infoDiscount",function(r){t.eBV(e);const s=t.XpG();return t.Njj(s.infoDiscount(r))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("origin","orderDetail")("subtotal",e.orderDetail.subtotal)("serviceChargeEnabled",e.orderDetail.service_charge>0)("serviceCharge",e.orderDetail.service_charge)("priceDomicile",e.orderDetail.cost_delivery)("discount",e.orderDetail.discount_price)("discountDelivery",e.orderDetail.discount_delivery)("total",e.orderDetail.total_price)}}const at=[{path:"",component:(()=>{class n{constructor(e,i,r,s,a,l,_,T,R,u,ut,pt){this.modalCtrl=e,this.orderProvider=i,this.translateService=r,this.storage=s,this.alertCtrl=a,this.cityProvider=l,this.pusherProvider=_,this.utilsService=T,this.route=R,this.routerOutlet=u,this.actionSheetController=ut,this.navCtrl=pt,this.orderSegment="",this.listProducts=[],this.orderSegment="statusOrder",this.translateService.get(["TEXT1_WHATSAPP_ORDER","TEXT2_WHATSAPP_ORDER"]).subscribe(O=>{this.messageText={textWhatsapp1:O.TEXT1_WHATSAPP_ORDER,textWhatsapp2:O.TEXT2_WHATSAPP_ORDER}})}ngOnInit(){this.origin=this.route.snapshot.paramMap.get("origin"),this.order_id=this.route.snapshot.paramMap.get("order_id"),this.pusherProvider.connectOrderState()}ionViewWillEnter(){this.detailOrder(),setTimeout(()=>{this.orderChannel=this.pusherProvider.getOrderChannel(),this.orderChannel.bind("order-state-"+this.order_id,e=>{this.orderDetail.id==e.orderId&&this.detailOrder()})},2)}ionViewWillLeave(){this.pusherProvider.disconnectOrderState()}detailOrder(){var e=this;this.orderDetail=null,this.listProducts=[],"confirmOrder"==this.origin&&this.orderProvider.getPendingOrders(),this.storage.get("token").then(function(){var i=(0,p.A)(function*(r){r&&(e.utilsService.presentLoading(e.translateService.instant("all.loading")),(yield e.orderProvider.pendingOrderDetail(e.order_id,r.access_token)).subscribe(s=>{e.utilsService.dismissLoading(),"success"==s.status&&(e.orderDetail=s.order,e.orderDetail.products.forEach((a,l)=>{let _=a.products;_.available=e.orderDetail.products[l].available,_.priceAfterDiscount=0,_.price=e.orderDetail.products[l].price,e.orderDetail.products[l].percentage_discount&&(_.priceAfterDiscount=e.orderDetail.products[l].price_bruto-e.orderDetail.products[l].price_bruto*e.orderDetail.products[l].percentage_discount/100,_.price=e.orderDetail.products[l].price_bruto),_.priceAfterFlash=0,e.orderDetail.products[l].flash_price&&(_.priceAfterFlash=e.orderDetail.products[l].flash_price,_.price=e.orderDetail.products[l].price_bruto),_.priceAfterSpecialPriceTag=0,e.orderDetail.products[l].special_price&&(_.priceAfterSpecialPriceTag=e.orderDetail.products[l].special_price,_.price=e.orderDetail.products[l].price_bruto),_.order_product_attributes=a.order_product_attributes&&a.order_product_attributes.length?a.order_product_attributes:[],_.quantity=e.orderDetail.products[l].quantity,_.comments=e.orderDetail.products[l].comments,e.listProducts.push(_)}))},s=>{console.log("error generateOrder",s),e.utilsService.dismissLoading()}))});return function(r){return i.apply(this,arguments)}}())}orderQualify(e){var i=this;return(0,p.A)(function*(){yield(yield i.modalCtrl.create({component:x,swipeToClose:!0,presentingElement:i.routerOutlet.nativeEl,componentProps:{order_id:e}})).present()})()}openWhatsapp(e,i){e&&i&&k.P.open({url:"https://api.whatsapp.com/send?phone=57"+e+"&text="+this.messageText.textWhatsapp1+i+this.messageText.textWhatsapp2})}doRefresh(e,i){i<=5?(this.detailOrder(),setTimeout(()=>{e.target.complete()},1e3)):e.target.complete()}infoDiscount(e){var i=this;return(0,p.A)(function*(){yield(yield i.modalCtrl.create({component:S,swipeToClose:!0,presentingElement:i.routerOutlet.nativeEl,componentProps:{orderDetail:i.orderDetail,typeDiscount:e}})).present()})()}changedSubcategory(e){e.detail.value&&(this.orderSegment=e.detail.value)}openActionSheet(e){var i=this;return(0,p.A)(function*(){yield(yield i.actionSheetController.create({header:"Opciones",cssClass:"my-custom-class",buttons:[{text:"Cancelar Pedido",role:"destructive",icon:"ban-outline",handler:()=>{i.storage.get("token").then(function(){var s=(0,p.A)(function*(a){a&&(i.utilsService.presentLoading(i.translateService.instant("all.loading")),(yield i.orderProvider.cancelOrder(i.order_id,a.access_token)).subscribe(l=>{i.utilsService.dismissLoading(),console.log("resp: ",l),l.r?i.navCtrl.back():i.utilsService.presentToast(5e3,"warning","top",l.m)},l=>{i.utilsService.dismissLoading(),console.log(l)}))});return function(a){return s.apply(this,arguments)}}())}},{text:"Cerrar",icon:"close",role:"cancel",handler:()=>{console.log("Cancel clicked")}}]})).present()})()}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(o.W3),t.rXU(D.Q),t.rXU(m.c$),t.rXU(E.n),t.rXU(o.hG),t.rXU(F.h),t.rXU(X.r),t.rXU(v.T),t.rXU(h.nX),t.rXU(o.Rg),t.rXU(o.GD),t.rXU(o.q9))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["page-order"]],decls:29,vars:19,consts:[[1,"ion-no-border"],["slot","start"],["defaultHref","/app/tabs/settings/user-orders"],[1,"ion-text-center"],["slot","end",4,"ngIf"],[1,"ion-padding"],["slot","fixed",3,"ionRefresh"],["pullingIcon","chevron-down-outline","refreshingSpinner","ios"],[3,"value","ionChange"],["value","statusOrder"],["value","informationDelivery"],["value","listProduct"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"p-h-8"],[3,"origin","subtotal","serviceChargeEnabled","serviceCharge","priceDomicile","discount","discountDelivery","total","infoDiscount",4,"ngIf"],["slot","end"],["slot","icon-only","name","ellipsis-vertical-outline",3,"click"],["margin-top","",4,"ngIf"],["margin-top",""],["margin-left",""],["size","2",4,"ngIf"],["size","1"],["src","../../assets/img/status/right-double-arrow.png","alt","",1,"separador"],["size","2"],["src","../../assets/img/status/found-inactive.png",4,"ngIf"],["src","../../assets/img/status/found-active.png",4,"ngIf"],["src","../../assets/img/status/pick-inactive.png",4,"ngIf"],["src","../../assets/img/status/pick-active.png",4,"ngIf"],["src","../../assets/img/status/delivery-inactive.png",4,"ngIf"],["src","../../assets/img/status/delivery-active.png",4,"ngIf"],["class","ion-text-center textStatusOrder",4,"ngIf"],[4,"ngIf"],["src","../../assets/img/status/search-active.png"],["src","../../assets/img/status/found-inactive.png"],["src","../../assets/img/status/found-active.png"],["src","../../assets/img/status/pick-inactive.png"],["src","../../assets/img/status/pick-active.png"],["src","../../assets/img/status/delivery-inactive.png"],["src","../../assets/img/status/delivery-active.png"],[1,"ion-text-center","textStatusOrder"],["size","small","fill","clear",3,"click"],["name","star","slot","start"],["lines","none"],["valid-url-image","",3,"src"],["lines","none",4,"ngIf"],["fill","clear","slot","start","color","secondary"],["name","call-outline","slot","start"],[1,"decorationNone",3,"href"],["color","secondary"],["fill","clear","slot","end","color","secondary",3,"click"],["name","logo-whatsapp","slot","start"],[3,"listProducts","origin"],[3,"origin","subtotal","serviceChargeEnabled","serviceCharge","priceDomicile","discount","discountDelivery","total","infoDiscount"]],template:function(i,r){1&i&&(t.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-buttons",1),t.nrm(3,"ion-back-button",2),t.k0s(),t.j41(4,"ion-title",3),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.DNE(7,M,2,0,"ion-buttons",4),t.k0s()(),t.j41(8,"ion-content",5)(9,"ion-refresher",6),t.bIt("ionRefresh",function(a){return r.doRefresh(a,r.orderDetail.order_state.id)}),t.nrm(10,"ion-refresher-content",7),t.k0s(),t.j41(11,"div")(12,"ion-segment",8),t.bIt("ionChange",function(a){return r.changedSubcategory(a)}),t.j41(13,"ion-segment-button",9),t.EFF(14),t.nI1(15,"translate"),t.k0s(),t.j41(16,"ion-segment-button",10),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.j41(19,"ion-segment-button",11),t.EFF(20),t.nI1(21,"translate"),t.k0s()()(),t.j41(22,"div",12),t.DNE(23,tt,2,1,"ion-list",13),t.DNE(24,nt,2,1,"ion-list",13),t.DNE(25,ot,2,1,"ion-list",13),t.k0s()(),t.j41(26,"ion-footer")(27,"ion-toolbar",14),t.DNE(28,st,1,8,"app-total-summary",15),t.k0s()()),2&i&&(t.R7$(5),t.JRh(t.bMT(6,11,"ORDER_TITLE")),t.R7$(2),t.Y8G("ngIf",r.orderDetail&&1==r.orderDetail.order_state.id),t.R7$(5),t.Y8G("value",r.orderSegment),t.R7$(2),t.SpI(" ",t.bMT(15,13,"ORDER_STATUS_TITLE")," "),t.R7$(3),t.SpI(" ",t.bMT(18,15,"ORDER_INFORMATION_DELIVERY_TITLE")," "),t.R7$(3),t.SpI(" ",t.bMT(21,17,"ORDER_LIST_PRODUCT_TITLE")," "),t.R7$(2),t.Y8G("ngSwitch",r.orderSegment),t.R7$(1),t.Y8G("ngSwitchCase","statusOrder"),t.R7$(1),t.Y8G("ngSwitchCase","informationDelivery"),t.R7$(1),t.Y8G("ngSwitchCase","listProduct"),t.R7$(3),t.Y8G("ngIf",r.orderDetail))},dependencies:[g.bT,g.ux,g.e1,o.mC,o.el,o.Jm,o.QW,o.b_,o.I9,o.hU,o.W9,o.M0,o.lO,o.eU,o.iq,o.uz,o.he,o.nf,o.To,o.Ki,o.ln,o.Gp,o.eP,o.BC,o.ai,o.Je,o.tY,$.t,G.M,j.a,m.D9],styles:[".decorationNone[_ngcontent-%COMP%]{text-decoration:none}.separador[_ngcontent-%COMP%]{width:15px;height:15px;margin-top:10px}.textStatusOrder[_ngcontent-%COMP%]{font-size:11px;color:var(--color-title)}.avatarProfile[_ngcontent-%COMP%]{display:block!important}.imageDelivery[_ngcontent-%COMP%]{position:absolute;left:130px}.imageProductNotAvailable[_ngcontent-%COMP%]{position:absolute!important;width:30%!important;height:60%!important;top:15px!important;left:0!important}.priceNotAvailable[_ngcontent-%COMP%]{text-decoration:line-through!important}.imageProductDiscount[_ngcontent-%COMP%]{position:absolute!important;width:30px!important;height:auto!important;top:20px!important;left:50px!important}.priceDecorationThrough[_ngcontent-%COMP%]{text-decoration:line-through!important}.priceDiscount[_ngcontent-%COMP%]{font-weight:600;font-size:1.6rem;color:var(--ion-color-secondary)}.spanPriceDiscount[_ngcontent-%COMP%]{display:-webkit-box!important}.marginRight7[_ngcontent-%COMP%]{margin-right:7px!important}.scroll-content[_ngcontent-%COMP%]{margin-bottom:155px!important}.iconInfoDiscount[_ngcontent-%COMP%]{margin-left:10px;position:absolute;font-size:25px;top:0}.p-h-8[_ngcontent-%COMP%]{padding:0 8px}"]})}return n})()}];let ct=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n});static#i=this.\u0275inj=t.G2t({imports:[h.iI.forChild(at),h.iI]})}return n})();var lt=d(55553),dt=d(13721);let _t=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n});static#i=this.\u0275inj=t.G2t({imports:[g.MD,o.bv,m.h.forChild(),ct,lt.h,dt.h,f.YN]})}return n})()}}]);